summaryrefslogtreecommitdiff
path: root/pbs-package-new
diff options
context:
space:
mode:
Diffstat (limited to 'pbs-package-new')
-rwxr-xr-xpbs-package-new38
1 files changed, 38 insertions, 0 deletions
diff --git a/pbs-package-new b/pbs-package-new
new file mode 100755
index 0000000..2787a07
--- /dev/null
+++ b/pbs-package-new
@@ -0,0 +1,38 @@
+#!/bin/bash -euE
+
+. $(which libremessages)
+
+cmd=${0##*/}
+usage() {
+ echo "Usage: $cmd [OPTIONS] REPO/PACKAGE"
+ 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
+
+ local dest=$1
+ local package="${dest##*/}"
+
+ git submodule add ./ "${dest}"
+ cd "${dest}"
+ git checkout --orphan "packages/${package}"
+}
+
+main "$@"