51 lines
1.6 KiB
Diff
51 lines
1.6 KiB
Diff
diff -up rpmlint-1.5/rpmlint.no-sys-argv-overload rpmlint-1.5/rpmlint
|
|
--- rpmlint-1.5/rpmlint.no-sys-argv-overload 2013-11-11 10:27:05.579909238 -0500
|
|
+++ rpmlint-1.5/rpmlint 2013-11-11 10:28:13.827740569 -0500
|
|
@@ -235,7 +235,7 @@ def runChecks(pkg):
|
|
#
|
|
#############################################################################
|
|
|
|
-sys.argv[0] = os.path.basename(sys.argv[0])
|
|
+argv0 = os.path.basename(sys.argv[0])
|
|
|
|
# parse options
|
|
try:
|
|
@@ -256,8 +256,8 @@ try:
|
|
'rawout=',
|
|
])
|
|
except getopt.GetoptError, e:
|
|
- Pkg.warn("%s: %s" % (sys.argv[0], e))
|
|
- usage(sys.argv[0])
|
|
+ Pkg.warn("%s: %s" % (argv0, e))
|
|
+ usage(argv0)
|
|
sys.exit(1)
|
|
|
|
# process options
|
|
@@ -276,7 +276,7 @@ configs = glob.glob('/etc/rpmlint/*confi
|
|
configs.sort()
|
|
|
|
# Was rpmlint invoked as a prefixed variant?
|
|
-m = re.match(r"(?P<prefix>[\w-]+)-rpmlint(\.py)?", sys.argv[0])
|
|
+m = re.match(r"(?P<prefix>[\w-]+)-rpmlint(\.py)?", argv0)
|
|
if m:
|
|
# Okay, we're a prefixed variant. Look for the variant config.
|
|
# If we find it, use it. If not, fallback to the default.
|
|
@@ -310,7 +310,7 @@ for o in opt:
|
|
# split by comma for deprecated backwards compatibility with < 1.2
|
|
info_error.update(o[1].split(','))
|
|
elif o[0] in ('-h', '--help'):
|
|
- usage(sys.argv[0])
|
|
+ usage(argv0)
|
|
sys.exit(0)
|
|
elif o[0] in ('-C', '--checkdir'):
|
|
Config.addCheckDir(o[1])
|
|
@@ -367,7 +367,7 @@ if info_error:
|
|
|
|
# if no argument print usage
|
|
if not args:
|
|
- usage(sys.argv[0])
|
|
+ usage(argv0)
|
|
sys.exit(1)
|
|
|
|
if __name__ == '__main__':
|