~xubuntu-dev/ubuntu-cdimage/xubuntu-base

« back to all changes in this revision

Viewing changes to bin/checksum-remove

  • Committer: Adam Conrad
  • Date: 2015-08-06 08:04:06 UTC
  • Revision ID: adconrad@0c3.net-20150806080406-altjtz2xv5tubg80
Tidy up ALL_PROJECTS a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
sys.path.insert(0, os.path.join(sys.path[0], os.pardir, "lib"))
25
25
from cdimage.checksums import ChecksumFileSet
26
 
from cdimage.config import config
 
26
from cdimage.config import Config
27
27
 
28
28
 
29
29
def main():
30
 
    parser = OptionParser("%prog [options] DIR FILE")
 
30
    parser = OptionParser("%prog [options] DIR FILE [...]")
31
31
    parser.add_option(
32
32
        "--no-sign", dest="sign", default=True, action="store_false",
33
33
        help="don't re-sign checksums files")
35
35
    if len(args) < 2:
36
36
        parser.error("need directory and filename")
37
37
 
38
 
    directory, filename = args[:2]
 
38
    directory = args[0]
 
39
    config = Config()
39
40
    with ChecksumFileSet(config, directory, sign=options.sign) as files:
40
 
        files.remove(filename)
 
41
        for filename in args[1:]:
 
42
            files.remove(filename)
41
43
 
42
44
 
43
45
if __name__ == "__main__":