diff options
Diffstat (limited to 'files/scripts/create-filelist')
-rwxr-xr-x | files/scripts/create-filelist | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/files/scripts/create-filelist b/files/scripts/create-filelist index adf8104c6..eeba9d089 100755 --- a/files/scripts/create-filelist +++ b/files/scripts/create-filelist @@ -63,7 +63,7 @@ def parseopts(): p.add_argument('-C', '--checksum-file', action='append', dest='checksum_files', help='Include checksums of all instances of the specified file.') p.add_argument('-s', '--skip', action='store_true', - help='Skip the --filelist file in the top directory') + help='Skip the file lists in the top directory') p.add_argument('-S', '--skip-file', action='append', dest='skip_files', help='Skip the specified file in the top directory.') @@ -87,6 +87,8 @@ def parseopts(): if opts.skip: if not opts.timelist.name == '<stdout>': opts.skip_files += [opts.timelist.name] + if not opts.filelist.name == '<stdout>': + opts.skip_files += [opts.filelist.name] return opts @@ -114,14 +116,15 @@ def main(): # opts.timelist.write('{0}\t{1}\t{2}\n'.format(modtime, ftype, entry.path[2:])) print('{0}\t{1}\t{2}\t{3}'.format(modtime, ftype, size, entry.path[2:]), file=opts.timelist) - if not checksums: - sys.exit(0) - print('\n[Checksums SHA1]', file=opts.timelist) + # It's OK if the checksum section is empty, but we should include it anyway + # as the client expects it. for f in sorted(checksums): print('{0}\t{1}'.format(sha1(f), f), file=opts.timelist) + print('\n[End]', file=opts.timelist) + if __name__ == '__main__': main() |