From 64e7456af141330ae33d51dc74a1ab331cfc3b2d Mon Sep 17 00:00:00 2001
From: Luke Shumaker <LukeShu@sbcglobal.net>
Date: Mon, 30 Sep 2013 17:05:44 -0400
Subject: librerelease: add -u flag for upload-only; don't run db-update

---
 src/abslibre-tools/librerelease | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index cdc5536..adfb935 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -39,6 +39,7 @@
 . $(librelib conf.sh)
 
 dryrun=""
+upload_only=false
 readonly rsync_flags=(
 	--no-group
 	--no-perms
@@ -129,8 +130,10 @@ usage() {
 	       to parabola server.'
 	echo
 	print "Options:"
-	flag '-c'            'Clean packages on $WORKDIR/staging'
-	flag '-l'            "Only list packages but not upload them"
+	flag '-c'            'Clean; delete packages in $WORKDIR/staging'
+	flag '-l'            "List; list packages but not upload them"
+	flag '-u'            "Upload-only; do not run db-update on the server"
+
 	flag '-n'            "Dry-run; don't actually do anything"
 	flag '-h'            "Show this message"
 }
@@ -143,10 +146,11 @@ main() {
 
 	# Parse options
 	local mode="release_packages"
-	while getopts 'clnh' arg; do
+	while getopts 'clunh' arg; do
 		case $arg in
 			c) mode=clean ;;
 			l) mode=pretty_print_packages ;;
+			u) upload_only=true ;;
 			n) dryrun="--dry-run" ;;
 			h) mode=usage ;;
 			*) usage >/dev/stderr; return 1 ;;
@@ -236,6 +240,10 @@ release_packages() {
 
 	clean_files "$file_list"
 
+	if $upload_only; then
+		return 0
+	fi
+
 	msg "Running db-update on repos"
 	ssh ${REPODEST%%:*} "$(printf 'STAGING=%q dbscripts/db-update' "${REPODEST#*:}")"
 
-- 
cgit v1.2.3-2-g168b