diff options
Diffstat (limited to 'modules/buildsystem')
-rwxr-xr-x | modules/buildsystem/templates/maintdb/maintdb.bin | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/modules/buildsystem/templates/maintdb/maintdb.bin b/modules/buildsystem/templates/maintdb/maintdb.bin index eb18ffef..9fef3c64 100755 --- a/modules/buildsystem/templates/maintdb/maintdb.bin +++ b/modules/buildsystem/templates/maintdb/maintdb.bin @@ -5,11 +5,11 @@ MAINTDBDIR="<%= scope.lookupvar('buildsystem::var::maintdb::dbdir') %>" function checkname() { if [ -z "$1" ] || - echo "$1" | grep -q '[/*{}%]' || - echo "$1" | fgrep -q '..' + echo "$1" | grep -q '[/*{}%]' || + echo "$1" | fgrep -q '..' then - echo "Error: invalid package name." >&2 - exit 1 + echo "Error: invalid package name." >&2 + exit 1 fi } @@ -17,14 +17,14 @@ function maintnew() { if [ a"$user" != "aroot" ] then - echo "Error: new is only allowed to root." >&2 - exit 1 + echo "Error: new is only allowed to root." >&2 + exit 1 fi checkname "$1" maintfile="$MAINTDBDIR/$1" if [ -f "$maintfile" ] then - exit 0 + exit 0 fi echo "$2" > "$maintfile" } @@ -36,33 +36,33 @@ function maintset() newmaint="$2" if ! [ -f "$maintfile" ] then - echo "Error: package $1 does not exist in maintdb." >&2 - exit 1 + echo "Error: package $1 does not exist in maintdb." >&2 + exit 1 fi curmaint=$(cat "$maintfile") if [ a"$newmaint" = "anobody" ] then - if [ a"$curmaint" = a"$user" ] - then - echo "$newmaint" > "$maintfile" - exit 0 - else - echo "Error: cannot set maintainer for $1." >&2 - exit 1 - fi + if [ a"$curmaint" = a"$user" ] + then + echo "$newmaint" > "$maintfile" + exit 0 + else + echo "Error: cannot set maintainer for $1." >&2 + exit 1 + fi elif [ a"$newmaint" = a"$user" ] then - if [ a"$curmaint" = "anobody" ] - then - echo "$newmaint" > "$maintfile" - exit 0 - else - echo "Error: cannot set maintainer for $1." >&2 - exit 1 - fi + if [ a"$curmaint" = "anobody" ] + then + echo "$newmaint" > "$maintfile" + exit 0 + else + echo "Error: cannot set maintainer for $1." >&2 + exit 1 + fi else - echo "Error: cannot set someone else as maintainer." >&2 - exit 1 + echo "Error: cannot set someone else as maintainer." >&2 + exit 1 fi } @@ -71,7 +71,7 @@ function maintgetall() cd "$MAINTDBDIR" for file in * do - echo "$file $(cat $file)" + echo "$file $(cat $file)" done exit 0 } @@ -80,16 +80,16 @@ function maintget() { if [ -z "$1" ] then - maintgetall + maintgetall fi checkname "$1" maintfile="$MAINTDBDIR/$1" if [ -f "$maintfile" ] then - cat "$maintfile" + cat "$maintfile" else - echo "Error: package $1 does not exist in maintdb." >&2 - exit 1 + echo "Error: package $1 does not exist in maintdb." >&2 + exit 1 fi } @@ -109,4 +109,3 @@ else echo "Error: unknow command." >&2 exit 2 fi - |