packages: check-unused-files.py - from package dir require not specname

glen glen at pld-linux.org
Thu Aug 19 13:34:36 CEST 2010


Author: glen                         Date: Thu Aug 19 11:34:36 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- from package dir require not specname

---- Files affected:
packages:
   check-unused-files.py (1.11 -> 1.12) 

---- Diffs:

================================================================
Index: packages/check-unused-files.py
diff -u packages/check-unused-files.py:1.11 packages/check-unused-files.py:1.12
--- packages/check-unused-files.py:1.11	Thu Aug 19 13:31:10 2010
+++ packages/check-unused-files.py	Thu Aug 19 13:34:31 2010
@@ -5,11 +5,11 @@
 import os
 import fnmatch
 
-if len(sys.argv) != 2:
-    print >> sys.stderr, "Usage: %s <spec>" % sys.argv[0]
-    sys.exit(1)
-
-spec = sys.argv[1]
+if len(sys.argv) == 2:
+    spec = sys.argv[1]
+else:
+    # try autodetecting
+    spec = "%s.spec" % os.path.basename(os.getcwd())
 
 if not os.path.isfile(spec):
     print >> sys.stderr, "%s: %s doesn't exist!" % (sys.argv[0], spec)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/check-unused-files.py?r1=1.11&r2=1.12&f=u



More information about the pld-cvs-commit mailing list