repoman: use the repodir variable more
authorZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 18:34:19 +0000 (11:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 18:34:19 +0000 (11:34 -0700)
bin/repoman

index 2180f641a6bc393be3aa1c6248d42dd7bd11d781..318979766f3296d7b2b41ad2d49ab9f85ce6c565 100755 (executable)
@@ -587,8 +587,8 @@ portdb = trees[root]['porttree'].dbapi
 
 # Constrain dependency resolution to the master(s)
 # that are specified in layout.conf.
-portdir_overlay = os.path.realpath(portdir_overlay)
-repo_info = portdb._repo_info[portdir_overlay]
+repodir = os.path.realpath(portdir_overlay)
+repo_info = portdb._repo_info[repodir]
 portdb.porttrees = list(repo_info.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
@@ -598,7 +598,7 @@ portdir = portdb.porttrees[0]
 # thin-manifests is designed to prevent.
 sign_manifests = "sign" in repoman_settings.features and \
        repoman_settings.repositories.get_repo_for_location(
-       portdir_overlay).sign_manifest
+       repodir).sign_manifest
 
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.
@@ -642,17 +642,12 @@ if options.mode == 'commit' and repolevel not in [1,2,3]:
        print(red("***"))
        err("Unable to identify level we're commiting from for %s" % '/'.join(reposplit))
 
-startdir = normalize_path(mydir)
-repodir = startdir
-for x in range(0, repolevel - 1):
-       repodir = os.path.dirname(repodir)
-repodir = os.path.realpath(repodir)
-
 # Make startdir relative to the cannonical repodir, so that we can pass
 # it to digestgen and it won't have to be cannonicalized again.
 if repolevel == 1:
        startdir = repodir
 else:
+       startdir = normalize_path(mydir)
        startdir = os.path.join(repodir, *startdir.split(os.sep)[-2-repolevel+3:])
 
 def caterror(mycat):