parser.add_argument('-i', '--import',
dest='mode_import',
default=None,
- nargs='+')
+ nargs='*')
# add-import
parser.add_argument('-a', '--add-import',
dest='mode_add_import',
dest='mode_xmaintainer',
default=None,
nargs='*')
+ # no-changelog
+ parser.add_argument('--no-changelog',
+ dest='changelog',
+ default=None,
+ action='store_false')
# destdir
parser.add_argument('-d', '--destdir',
dest='destdir',
dest='inctests',
default=None,
action='store_true')
+ # makefile
+ parser.add_argument("--makefile-name",
+ dest="makefile",
+ default=None,
+ type=str)
# obsolete
parser.add_argument('--with-obsolete',
dest='obsolete',
dest='libname',
default=None,
nargs=1)
+ # libtool
+ parser.add_argument("--libtool",
+ dest=libtool,
+ default=False,
+ action="store_true")
# sourcebase
parser.add_argument('-sb', '--source-base',
dest='sourcebase',
elif index == 6:
testflags += [constants.TESTS['all-tests']]
lgpl = cmdargs.lgpl
+ libtool = cmdargs.libtool
+ makefile = cmdargs.makefile
if lgpl == None:
lgpl = True
avoids = cmdargs.avoids
if __name__ == '__main__':
try: # Try to execute
main()
+ except:
+ raise
except BaseException as error:
errmode = 0 # gnulib-style errors
errno = error.errno
file.write(snippet)
stdin = codecs.open(path, 'rb', 'UTF-8')
snippet = sp.check_output(args, stdin=stdin, shell=False)
- snippet = snippet.decode(ENCS['shell'])
+ snippet = snippet.decode("UTF-8")
os.remove(path)
if disable_libtool:
snippet = snippet.replace('$gl_cond_libtool', 'false')
try: # Try to move file
if os.path.exists(basepath):
os.remove(basepath)
- shutil.move(tmpfile, rewritten)
+ shutil.copy(tmpfile, rewritten)
except Exception as error:
raise(GLError(17, original))
else: # if self.config['dryrun']
stdin = codecs.open(lookedup, 'rb', 'UTF-8')
try: # Try to transform file
data = sp.check_output(args, stdin=stdin, shell=False)
- data = data.decode(ENCS['shell'])
+ data = data.decode("UTF-8")
except Exception as error:
raise(GLError(16, lookedup))
with codecs.open(tmpfile, 'wb', 'UTF-8') as file:
counter = int() # Create counter
result = string() # Create string
args = ['git', 'log']
- result = sp.check_output(args).decode(ENCS['shell'])
+ result = sp.check_output(args).decode("UTF-8")
# Get date as "Fri Mar 21 07:16:51 2008 -0600" from string
pattern = re.compile('Date:[\t ]*(.*?)$', re.S | re.M)
result = pattern.findall(result)[0]
# Use GNU date to compute the time in GMT
args = ['date', '-d', result, '-u', '+%Y-%m-%d %H:%M:%S']
proc = sp.check_output(args)
- result = string(proc, ENCS['shell'])
+ result = string(proc, "UTF-8")
result = result.rstrip(os.linesep)
return(result)
if isdir(DIRS['git']):
version_gen = joinpath(DIRS['build-aux'], 'git-version-gen')
args = [version_gen, DIRS['root']]
- result = sp.check_output(args).decode(ENCS['shell'])
+ result = sp.check_output(args).decode("UTF-8")
result = result.strip()
if result == 'UNKNOWN':
result = string()
# Read modules from gnulib root directory.
os.chdir(constants.DIRS['root'])
find = sp.Popen(find_args, stdout=sp.PIPE)
- result += find.stdout.read().decode(ENCS['shell'])
+ result += find.stdout.read().decode("UTF-8")
# Read modules from local directory.
if localdir and isdir(joinpath(localdir, 'modules')):
os.chdir(localdir)
find = sp.Popen(find_args, stdout=sp.PIPE)
- result += find.stdout.read().decode(ENCS['shell'])
+ result += find.stdout.read().decode("UTF-8")
sed_args += ['-e', r's,\.diff$,,']
# Save the list of the modules to file.
# Filter the list of the modules.
stdin = codecs.open(path, 'rb', 'UTF-8')
sed = sp.Popen(sed_args, stdin=stdin, stdout=sp.PIPE)
- result = sed.stdout.read().decode(ENCS['shell'])
+ result = sed.stdout.read().decode("UTF-8")
stdin.close(); os.remove(path)
listing = [line for line in result.split('\n') if line.strip()]
listing = sorted(set(listing))
vc_witness = joinpath(DIRS['root'], '.git', 'refs', 'heads', 'master')
mdate_sh = joinpath(DIRS['root'], 'build-aux', 'mdate-sh')
args = ['sh', mdate_sh, vc_witness]
- cvsdate = sp.check_output(args).decode(ENCS['shell']).strip()
+ cvsdate = sp.check_output(args).decode("UTF-8").strip()
for key in repdict:
if len(key) > 3:
cvsdate = cvsdate.replace(key, repdict[key])