[Rpm-metadata] [PATCH] abort if $PWD does not exist. BZ 1001629

Zdenek Pavlas zpavlas at redhat.com
Tue Oct 8 11:51:11 UTC 2013


People use "createrepo ." often enough to make "chdir /" a bad idea.
---
 genpkgmetadata.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index 634406d..3ddaae6 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -249,8 +249,8 @@ def main(args):
         os.getcwd()
     except OSError, e:
         if e.errno != errno.ENOENT: raise
-        print ('No getcwd() access in current directory, moving to /')
-        os.chdir("/")
+        print ('No getcwd() access in current directory.')
+        sys.exit(1)
     start_st = time.time()
     conf = createrepo.MetaDataConfig()
     conf = parse_args(args, conf)
-- 
1.7.11.7



More information about the Rpm-metadata mailing list