Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow selecting of individual refs to build

  • Loading branch information...
commit 928888fe535b89c70eb1b2b7ad3feb1df09b9d09 1 parent d1c7e54
@jreese jreese authored
Showing with 14 additions and 7 deletions.
  1. +14 −7 docbook-manual-repo.py
View
21 docbook-manual-repo.py
@@ -15,17 +15,19 @@
# Regular expressions of refs to ignore
ignorelist = map(re.compile, [
'HEAD',
+ '->',
'-1\.0\.[\w\d]+',
'-1\.1\.[\w\d]+'
])
# Script options
-options = "hfda"
-long_options = [ "help", "force", "delete", "all", "pdf", "html", "release" ]
+options = "hr:fda"
+long_options = [ "help", "ref=", "force", "delete", "all", "pdf", "html", "release" ]
def usage():
print '''Usage: docbook-manual-repo /path/to/mantisbt/repo /path/to/install [<lang> ...]
Options: -h | --help Print this usage message
+ -r | --ref Select what refs to build
-f | --force Ignore timestamps and force building
-d | --delete Delete install directories before building
--html Build HTML manual
@@ -53,6 +55,7 @@ def main():
usage()
sys.exit(2)
+ refs = None
force = False
pass_opts = ""
@@ -61,6 +64,9 @@ def main():
usage()
sys.exit(0)
+ elif opt in ("-r", "--ref"):
+ refs = val.split(",")
+
elif opt in ("-f", "--force"):
force = True
@@ -95,12 +101,13 @@ def main():
os.system('git fetch')
os.system('git remote prune origin')
- # List refs from remote branches and tags
- branches = os.popen('git branch -r').read().split()
- tags = os.popen('git tag -l').read().split()
+ if refs is None:
+ # List refs from remote branches and tags
+ branches = os.popen('git branch -r').read().split()
+ tags = os.popen('git tag -l').read().split()
- # Filter refs using ignore()
- refs = [ref for ref in branches + tags if not ignore(ref)]
+ # Filter refs using ignore()
+ refs = [ref for ref in branches + tags if not ignore(ref)]
# Regex to strip 'origin/' from ref names
refnameregex = re.compile('(?:[a-zA-Z0-9-.]+/)?(.*)')
Please sign in to comment.
Something went wrong with that request. Please try again.