summaryrefslogtreecommitdiffstats
path: root/files/scripts/create-filelist
diff options
context:
space:
mode:
authorKevin Fenzi <kevin@scrye.com>2016-07-15 20:05:53 +0000
committerKevin Fenzi <kevin@scrye.com>2016-07-15 20:05:53 +0000
commit03a8923c04487675cee2baae4862fa5a3f8a5b0d (patch)
treeceb7fc6acd9fafee408273a9c3cb775eaa0d5406 /files/scripts/create-filelist
parent6685841b7c150ba9e3371294a9e40a2ba18afce1 (diff)
downloadansible-03a8923c04487675cee2baae4862fa5a3f8a5b0d.tar.gz
ansible-03a8923c04487675cee2baae4862fa5a3f8a5b0d.tar.xz
ansible-03a8923c04487675cee2baae4862fa5a3f8a5b0d.zip
Update create-filelist and wrapper from upstream quick mirror.
Merge all the various copies of the wrapper into one copy. Setup arguments as needed for each call.
Diffstat (limited to 'files/scripts/create-filelist')
-rwxr-xr-xfiles/scripts/create-filelist11
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()