[Rpm-metadata] genpkgmetadata.py

zpavlas at osuosl.org zpavlas at osuosl.org
Tue Aug 27 13:21:03 UTC 2013


 genpkgmetadata.py |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit bf6267491c25071024e8b36020bf343760a5d419
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Tue Aug 27 15:05:44 2013 +0200

    chdir("/") if $PWD does not exist. BZ 1001629

diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index 4528bf2..212b075 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -24,6 +24,7 @@ import sys
 import re
 from optparse import OptionParser,SUPPRESS_HELP
 import time
+import errno
 
 import createrepo
 from createrepo import MDError
@@ -241,6 +242,12 @@ class MDCallBack(object):
 
 def main(args):
     """createrepo from cli main flow"""
+    try:
+        os.getcwd()
+    except OSError, e:
+        if e.errno != errno.ENOENT: raise
+        print ('No getcwd() access in current directory, moving to /')
+        os.chdir("/")
     start_st = time.time()
     conf = createrepo.MetaDataConfig()
     conf = parse_args(args, conf)


More information about the Rpm-metadata mailing list