diff options
author | Bruno Haible <bruno@clisp.org> | 2022-08-06 23:01:36 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-08-06 23:01:36 +0200 |
commit | 9812027a9afa87b12eb3b7e3c28600e6eff7ca98 (patch) | |
tree | 07de1ae335d1d14ae8607d28a0d31ba036793cb5 /pygnulib | |
parent | 860df12df83dd27ae2b83e0ed6b485c4ffbb640e (diff) | |
download | gnulib-9812027a9afa87b12eb3b7e3c28600e6eff7ca98.tar.gz |
gnulib-tool.py: Finish implementing options --vc-files, --no-vc-files.
* gnulib-tool.py (main): Accept options --vc-files, --no-vc-files.
* pygnulib/GLImport.py (GLImport.__init__): Correct parsing of
gl_VC_FILES directive.
(GLImport.gnulib_cache): Don't treat the value False like None.
(GLImport.execute): Skip the .gitignore file manipulations if vc_files
is False.
Diffstat (limited to 'pygnulib')
-rw-r--r-- | pygnulib/GLConfig.py | 2 | ||||
-rw-r--r-- | pygnulib/GLImport.py | 62 |
2 files changed, 32 insertions, 32 deletions
diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py index 5f30a80797..216f2e05fa 100644 --- a/pygnulib/GLConfig.py +++ b/pygnulib/GLConfig.py @@ -276,7 +276,7 @@ class GLConfig(object): elif key in ['libtool', 'lgpl', 'conddeps', 'symbolic', 'lsymbolic', 'libtests', 'dryrun']: return False - if key == 'vc_files': + elif key == 'vc_files': return None elif key == 'errors': return True diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 9de4b3b93c..b06fc5b603 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -141,9 +141,6 @@ class GLImport(object): if 'gl_CONDITIONAL_DEPENDENCIES' in data: self.cache.setCondDeps(True) data = data.replace('gl_CONDITIONAL_DEPENDENCIES', '') - if 'gl_VC_FILES' in data: - self.cache.setVCFiles(True) - data = data.replace('gl_VC_FILES', '') if 'gl_WITH_TESTS' in data: self.cache.enableInclTestCategory(TESTS['tests']) data = data.replace('gl_WITH_TESTS', '') @@ -202,6 +199,8 @@ class GLImport(object): self.cache.setPoDomain(cleaner(tempdict['gl_PO_DOMAIN'])) if tempdict['gl_WITNESS_C_MACRO']: self.cache.setWitnessCMacro(cleaner(tempdict['gl_WITNESS_C_MACRO'])) + if tempdict['gl_VC_FILES']: + self.cache.setVCFiles(cleaner(tempdict['gl_VC_FILES'])) # Get cached filelist from gnulib-comp.m4. destdir, m4base = self.config.getDestDir(), self.config.getM4Base() @@ -542,7 +541,7 @@ class GLImport(object): emit += 'gl_MACRO_PREFIX([%s])\n' % macro_prefix emit += 'gl_PO_DOMAIN([%s])\n' % podomain emit += 'gl_WITNESS_C_MACRO([%s])\n' % witness_c_macro - if vc_files: + if vc_files != None: emit += 'gl_VC_FILES([%s])\n' % vc_files return constants.nlconvert(emit) @@ -1334,33 +1333,34 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix if isfile(tmpfile): os.remove(tmpfile) - # Update the .cvsignore and .gitignore files. - ignorelist = list() - filetable['added'] = sorted(set(filetable['added'])) - filetable['removed'] = sorted(set(filetable['added'])) - for file in filetable['added']: - directory, basename = os.path.split(file) - ignorelist += [tuple([directory, '|A|', basename])] - for file in filetable['removed']: - directory, basename = os.path.split(file) - ignorelist += [tuple([directory, '|R|', basename])] - last_dir = '' - last_dirs_added = list() - last_dirs_removed = list() - for row in ignorelist: - next_dir = row[0] - operand = row[1] - filename = row[2] - if next_dir != last_dir: - self._done_dir_(last_dir, last_dirs_added, last_dirs_removed) - last_dir = next_dir - last_dirs_added = list() - last_dirs_removed = list() - if operand == '|A|': - last_dirs_added += [filename] - elif operand == '|R|': - last_dirs_removed += [filename] - self._done_dir_(last_dir, last_dirs_added, last_dirs_removed) + if vc_files != False: + # Update the .cvsignore and .gitignore files. + ignorelist = list() + filetable['added'] = sorted(set(filetable['added'])) + filetable['removed'] = sorted(set(filetable['added'])) + for file in filetable['added']: + directory, basename = os.path.split(file) + ignorelist += [tuple([directory, '|A|', basename])] + for file in filetable['removed']: + directory, basename = os.path.split(file) + ignorelist += [tuple([directory, '|R|', basename])] + last_dir = '' + last_dirs_added = list() + last_dirs_removed = list() + for row in ignorelist: + next_dir = row[0] + operand = row[1] + filename = row[2] + if next_dir != last_dir: + self._done_dir_(last_dir, last_dirs_added, last_dirs_removed) + last_dir = next_dir + last_dirs_added = list() + last_dirs_removed = list() + if operand == '|A|': + last_dirs_added += [filename] + elif operand == '|R|': + last_dirs_removed += [filename] + self._done_dir_(last_dir, last_dirs_added, last_dirs_removed) exit() # Finish the work. |