summaryrefslogtreecommitdiff
path: root/pbs-package-merge
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-01-29 14:33:14 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-01-29 14:33:14 -0500
commit9e7024c2798f429bcb76c5bb7a2131e1d2ae3ff4 (patch)
tree27a753c2894282b512fa39dd26c53958310cfd23 /pbs-package-merge
parent694a9d979213280ad503a53c64eb195c5277b63e (diff)
Initial versions of pbs-package-* commands
Diffstat (limited to 'pbs-package-merge')
-rwxr-xr-xpbs-package-merge39
1 files changed, 39 insertions, 0 deletions
diff --git a/pbs-package-merge b/pbs-package-merge
new file mode 100755
index 0000000..b30c26d
--- /dev/null
+++ b/pbs-package-merge
@@ -0,0 +1,39 @@
+#!/bin/bash -euE
+
+. $(which libremessages)
+
+cmd=${0##*/}
+usage() {
+ echo "Usage: $cmd [OPTIONS]"
+ echo 'Fetches and merges changes from an upstream package'
+ echo ''
+ echo 'The repository and refspec that are merged are controlled by the'
+ echo 'file `pbstrack`.'
+ echo ''
+ echo 'Options:'
+ echo ' -h Show this message'
+}
+
+main() {
+ while getopts 'h' arg; do
+ case $arg in
+ h) usage; return 0;;
+ *) usage; return 1;;
+ esac
+ done
+ shift $(($OPTIND - 1))
+ if [[ $# > 0 ]]; then
+ usage
+ return 1
+ fi
+
+ if [[ ! -f .git ]]; then
+ error "Must be in a package directory"
+ fi
+ if [[ ! -r pbstrack ]]; then
+ error "No pbstrack file found, don't know where to pull from"
+ fi
+ git pull $(cat pbstrack)
+}
+
+main "$@"