diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-10-15 17:38:49 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-10-15 17:38:49 +0000 |
commit | d2ea67f981bc09190f67276a942824ae7ed8c507 (patch) | |
tree | 588b57c150f6f90e899ec171c49db1821bbb0ec4 /rdiff-backup/dist/makedist | |
parent | ce02549615dd23bca25dbb71b6c187f6e1f31351 (diff) | |
download | rdiff-backup-d2ea67f981bc09190f67276a942824ae7ed8c507.tar.gz |
makedist can now build FAQ separately (--faq-only)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@227 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/dist/makedist')
-rwxr-xr-x | rdiff-backup/dist/makedist | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist index afe64c6..bf68184 100755 --- a/rdiff-backup/dist/makedist +++ b/rdiff-backup/dist/makedist @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, re, shutil, time, sys +import os, re, shutil, time, sys, getopt SourceDir = "src" DistDir = "dist" @@ -119,19 +119,36 @@ def MakeSpecFile(): VersionedCopy(spec_template, specfile) return specfile +def parse_cmdline(arglist): + """Returns action""" + global Version + def error(): + print "Syntax: makedist [--faq-only] [version_number]" + sys.exit(1) + + optlist, args = getopt.getopt(arglist, "", ["faq-only"]) + if len(args) != 1: error() + else: Version = args[0] + + for opt, arg in optlist: + if opt == "--faq-only": return "FAQ" + else: assert 0, "Bad argument" + return "All" + def Main(): - print "Making FAQ" - MakeFAQ() - print "Processing version " + Version - tarfile = MakeTar() - print "Made tar file " + tarfile - specfile = MakeSpecFile() - print "Made specfile ", specfile + action = parse_cmdline(sys.argv[1:]) + if action == "FAQ": + print "Making FAQ" + MakeFAQ() + else: + assert action == "All" + print "Processing version " + Version + tarfile = MakeTar() + print "Made tar file " + tarfile + specfile = MakeSpecFile() + print "Made specfile ", specfile + if __name__ == "__main__" and not globals().has_key('__no_execute__'): - if len(sys.argv) != 2: - print "Syntax: makedist [version_number]" - sys.exit(1) - Version = sys.argv[1] Main() |