diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-11-19 10:57:35 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-11-19 10:57:35 -0800 |
commit | d1da346694b1e86b6373fd99b890ab92f2752c41 (patch) | |
tree | da8bf1e3f721848a7a4eb2f392acd5da3448f3cc | |
parent | f9b67bd8385b344b9a29a46bf2f3c7e2def020c4 (diff) | |
download | portage-d1da346694b1e86b6373fd99b890ab92f2752c41.tar.gz portage-d1da346694b1e86b6373fd99b890ab92f2752c41.tar.bz2 portage-d1da346694b1e86b6373fd99b890ab92f2752c41.zip |
Fix emerge --sync PORTDIR creation.
-rw-r--r-- | pym/_emerge/actions.py | 8 | ||||
-rw-r--r-- | pym/_emerge/main.py | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 03f7d3130..0247fd3f0 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1898,6 +1898,12 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): emergelog(xterm_titles, " === sync") portdb = trees[settings["ROOT"]]["porttree"].dbapi myportdir = portdb.porttree_root + if not myportdir: + myportdir = settings.get('PORTDIR', '') + if myportdir and myportdir.strip(): + myportdir = os.path.realpath(myportdir) + else: + myportdir = None out = portage.output.EOutput() global_config_path = GLOBAL_CONFIG_PATH if settings['EPREFIX']: @@ -1915,7 +1921,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): st = None if st is None: print(">>>",myportdir,"not found, creating it.") - os.makedirs(myportdir,0o755) + portage.util.ensure_dirs(myportdir, mode=0o755) st = os.stat(myportdir) usersync_uid = None diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index fa8ddefc2..ec56e9d3d 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1511,8 +1511,7 @@ def emerge_main(): 'prune', 'unmerge') or not \ (fetchonly or \ (buildpkgonly and secpass >= 1) or \ - myaction in ("metadata", "regen") or \ - (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK))) + myaction in ("metadata", "regen", "sync")) if portage.secpass < 1 or \ need_superuser: if need_superuser: |