summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-07-29 21:30:39 +0100
committerColin Guthrie <colin@mageia.org>2014-07-29 21:30:39 +0100
commit6bd358282ae7b63b3bf5f75da6c922e638fefbcd (patch)
treef4c0e9fec544a3525f829d96d7e315db03137093
parentc4d7b611eec5b228afed19e53ba9573fc3ac85e1 (diff)
downloadmgatools-6bd358282ae7b63b3bf5f75da6c922e638fefbcd.tar
mgatools-6bd358282ae7b63b3bf5f75da6c922e638fefbcd.tar.gz
mgatools-6bd358282ae7b63b3bf5f75da6c922e638fefbcd.tar.bz2
mgatools-6bd358282ae7b63b3bf5f75da6c922e638fefbcd.tar.xz
mgatools-6bd358282ae7b63b3bf5f75da6c922e638fefbcd.zip
Move the --dry-run handling into the functions file.
-rw-r--r--functions7
-rwxr-xr-xmga-hdlists5
-rwxr-xr-xmga-hdlists-backports5
-rwxr-xr-xmga-hdlists-cauldron5
-rwxr-xr-xmga-hdlists-updates5
-rwxr-xr-xmga-move-pkg5
6 files changed, 7 insertions, 25 deletions
diff --git a/functions b/functions
index 992157f..26fc6db 100644
--- a/functions
+++ b/functions
@@ -16,6 +16,13 @@ mirror_rsync_options="--dry-run -v --delete -alH"
[ -f /etc/mgatools.conf ] && . /etc/mgatools.conf
+# Generic support for --dry-run as first argument
+if [ "$1" = "--dry-run" ]; then
+ dryrun=echo
+ mirror_rsync_options="--dry-run -v --delete -alH"
+ shift
+fi
+
function isingroup()
{
grp="$1"
diff --git a/mga-hdlists b/mga-hdlists
index 37dc31d..da09a2e 100755
--- a/mga-hdlists
+++ b/mga-hdlists
@@ -9,11 +9,6 @@ else
. /usr/share/mgatools/functions
fi
-if [ "$1" = "--dry-run" ]; then
- dryrun=echo
- shift
-fi
-
if [ $# != 3 ]; then
echo "Usage: $0 [--dry-run] <release> <section> <subsection>" >&2
exit 1
diff --git a/mga-hdlists-backports b/mga-hdlists-backports
index 9137aa0..767c331 100755
--- a/mga-hdlists-backports
+++ b/mga-hdlists-backports
@@ -9,11 +9,6 @@ else
. /usr/share/mgatools/functions
fi
-if [ "$1" = "--dry-run" ]; then
- dryrun=echo
- shift
-fi
-
if [ $# != 2 ]; then
echo "Usage: $0 [--dry-run] <release> <section>" >&2
exit 1
diff --git a/mga-hdlists-cauldron b/mga-hdlists-cauldron
index ca85344..dfa4ca4 100755
--- a/mga-hdlists-cauldron
+++ b/mga-hdlists-cauldron
@@ -9,11 +9,6 @@ else
. /usr/share/mgatools/functions
fi
-if [ "$1" = "--dry-run" ]; then
- dryrun=echo
- shift
-fi
-
if [ $# != 2 ]; then
echo "Usage: $0 [--dry-run] <section>" >&2
exit 1
diff --git a/mga-hdlists-updates b/mga-hdlists-updates
index ee2f71f..9d12a45 100755
--- a/mga-hdlists-updates
+++ b/mga-hdlists-updates
@@ -9,11 +9,6 @@ else
. /usr/share/mgatools/functions
fi
-if [ "$1" = "--dry-run" ]; then
- dryrun=echo
- shift
-fi
-
if [ $# != 2 ]; then
echo "Usage: $0 [--dry-run] <release> <section>" >&2
exit 1
diff --git a/mga-move-pkg b/mga-move-pkg
index b757ba9..beaf99e 100755
--- a/mga-move-pkg
+++ b/mga-move-pkg
@@ -9,11 +9,6 @@ else
. /usr/share/mgatools/functions
fi
-if [ "$1" = "--dry-run" ]; then
- dryrun=echo
- shift
-fi
-
sync=
if [ "$1" = "--sync" ]; then
sync=yes