createmodule.py: Add --noprefix option
This commit is contained in:
parent
8ab02627e6
commit
43aac49861
@ -26,7 +26,8 @@ from subprocess import *
|
||||
usage = "Usage: %prog [-p prefix] <initscript> [args]"
|
||||
parser = OptionParser()
|
||||
parser.set_usage(usage)
|
||||
parser.add_option('-p', '--prefix', dest='prefix', help='Specify path prefix')
|
||||
parser.add_option('-p', '--prefix', action='store', type='string', dest='prefix', help='Specify path prefix')
|
||||
parser.add_option('--noprefix', action='store_true', dest='noprefix', default=False, help='Do not generate a prefix')
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
# Need a script name
|
||||
@ -139,10 +140,10 @@ for key in env2.keys():
|
||||
pathnames.append(setenv[key])
|
||||
|
||||
# Determine a prefix
|
||||
prefix = None
|
||||
prefix=None
|
||||
if options.prefix:
|
||||
prefix = options.prefix
|
||||
else:
|
||||
elif not options.noprefix:
|
||||
prefix = os.path.commonprefix(pathnames).rstrip('/')
|
||||
if prefix == '':
|
||||
prefix = None
|
||||
|
Loading…
Reference in New Issue
Block a user