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]"
|
usage = "Usage: %prog [-p prefix] <initscript> [args]"
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.set_usage(usage)
|
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()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
# Need a script name
|
# Need a script name
|
||||||
@ -142,7 +143,7 @@ for key in env2.keys():
|
|||||||
prefix=None
|
prefix=None
|
||||||
if options.prefix:
|
if options.prefix:
|
||||||
prefix = options.prefix
|
prefix = options.prefix
|
||||||
else:
|
elif not options.noprefix:
|
||||||
prefix = os.path.commonprefix(pathnames).rstrip('/')
|
prefix = os.path.commonprefix(pathnames).rstrip('/')
|
||||||
if prefix == '':
|
if prefix == '':
|
||||||
prefix = None
|
prefix = None
|
||||||
|
Loading…
Reference in New Issue
Block a user