repoman: fix KeyError from digestgen with symlink
authorZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 16:08:19 +0000 (09:08 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 16:08:19 +0000 (09:08 -0700)
bin/repoman

index e0cdf6ed44f974398f8a306bf074834a82987ab2..2180f641a6bc393be3aa1c6248d42dd7bd11d781 100755 (executable)
@@ -648,6 +648,13 @@ 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 = os.path.join(repodir, *startdir.split(os.sep)[-2-repolevel+3:])
+
 def caterror(mycat):
        err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")