summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-07-28 22:12:19 +0100
committerColin Guthrie <colin@mageia.org>2014-07-28 22:12:19 +0100
commit970918c53f74801902f2b29a78d738489d783016 (patch)
treeaded3495da1adc0d3d0af2ff12a0ae1ecd964f57 /functions
parentfebcebab2903f03fe41cdcf50900defdb874d7a5 (diff)
downloadmgatools-970918c53f74801902f2b29a78d738489d783016.tar
mgatools-970918c53f74801902f2b29a78d738489d783016.tar.gz
mgatools-970918c53f74801902f2b29a78d738489d783016.tar.bz2
mgatools-970918c53f74801902f2b29a78d738489d783016.tar.xz
mgatools-970918c53f74801902f2b29a78d738489d783016.zip
function: Fix shell script style
Diffstat (limited to 'functions')
-rw-r--r--functions27
1 files changed, 9 insertions, 18 deletions
diff --git a/functions b/functions
index 4201145..8ecd968 100644
--- a/functions
+++ b/functions
@@ -1,15 +1,12 @@
-#!/bin/sh
+# to be sourced
. /etc/mgatools.conf
function isingroup()
{
grp="$1"
- for group in `groups`
- do if [ "$grp" = "$group" ]
- then
- return 0
- fi
+ for group in `groups`; do
+ [ "$grp" = "$group" ] && return 0
done
return 1
}
@@ -18,12 +15,8 @@ function inlist()
{
k="$1"
list="$2"
- for e in $list
- do
- if [ a"$k" = a"$e" ]
- then
- return 0
- fi
+ for e in $list; do
+ [ "$k" = "$e" ] && return 0
done
return 1
}
@@ -39,11 +32,10 @@ function update_hdlist()
function update_common_MD5SUM()
{
distrorelease="$1"
- for arch in $arches
- do
- pushd "$distribdir/$distrorelease/$arch/media/media_info"
- /usr/bin/md5sum hdlist_* synthesis.* > MD5SUM
- popd
+ for arch in $arches; do
+ pushd "$distribdir/$distrorelease/$arch/media/media_info"
+ /usr/bin/md5sum hdlist_* synthesis.* > MD5SUM
+ popd
done
}
@@ -52,4 +44,3 @@ function mirror_repository()
distrorelease="$1"
/usr/bin/rsync $mirror_rsync_options "$distribdir/$distrorelease/" "$finaldistribdir/$distrorelease/"
}
-