diff options
author | Marcelo Leitner <mrl@mandriva.com> | 2007-03-23 12:58:22 +0000 |
---|---|---|
committer | Marcelo Leitner <mrl@mandriva.com> | 2007-03-23 12:58:22 +0000 |
commit | e9c6a00090a14131c46e52414906c3d6dc3a15f6 (patch) | |
tree | 3caa82193f09a87ce200e2e157de5d900082e13c /approve.sh | |
parent | 1b17b18e8e153e9fdd264b447b785c7892c37a18 (diff) | |
download | iurt-e9c6a00090a14131c46e52414906c3d6dc3a15f6.tar iurt-e9c6a00090a14131c46e52414906c3d6dc3a15f6.tar.gz iurt-e9c6a00090a14131c46e52414906c3d6dc3a15f6.tar.bz2 iurt-e9c6a00090a14131c46e52414906c3d6dc3a15f6.tar.xz iurt-e9c6a00090a14131c46e52414906c3d6dc3a15f6.zip |
- Implemented later and updates commands:
later command moves packages to a queue that will be merged into cooker after
2007.1
updates command moves packages to 2007.1 updates tree.
Diffstat (limited to 'approve.sh')
-rwxr-xr-x | approve.sh | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -1,9 +1,12 @@ #!/bin/bash -e +# Do not use trailing slashes here SRCBASEDIR=/home/mandrake/uploads/queue DESTBASEDIR=/home/mandrake/uploads/approved REJECTEDDIR=/home/mandrake/uploads/rejected +LATERBASEDIR=/home/mandrake/uploads/later DISTRO=cooker +UPDATEDISTRO="2007.1" function list() { echo "The following packages are currently queued:" >&2 @@ -37,9 +40,13 @@ function list_approved() { done } +# $1 = id = package id +# $2 = dest = destination queue +# $3 = media = forced distro/media, like "2007.1/updates/release/" function move() { id="$1" dest="$2" + media="$3" queuename=$(basename $dest) echo "Searching for packages with id $id..." @@ -50,11 +57,15 @@ function move() { echo -e "\t$pkg" | sed "s@$SRCBASEDIR/$DISTRO/@@;s/${id}_@[0-9]\+://;s/${id}_//" done - echo "- Moving packages to $queuename..." + echo -n "- Moving packages to $queuename... " for srcpath in $packages; do destpath=$(echo "$srcpath" | sed "s@$SRCBASEDIR@$dest@") + if [ -n "$media" ]; then + destpath=$(echo "$destpath" | sed "s@\($dest\)/\(\([^/]\+/\)\{3\}\)@\1/$media@") + fi mv "$srcpath" "$destpath" done + echo "done." } # @@ -65,6 +76,8 @@ if [ -z "$1" ]; then echo -e "Usage: $(basename $0) --inspect [id]\n to inspect packages changelog" echo "Usage: $(basename $0) --list-approved" echo "Usage: $(basename $0) --approve <id> [id...]" + echo "Usage: $(basename $0) --updates <id> [id...]" + echo "Usage: $(basename $0) --later <id> [id...]" echo "Usage: $(basename $0) --reject <id> [id...]" echo " Where id = 20070315170513.oden.kenobi.7558, for example" exit 1 @@ -82,6 +95,16 @@ elif [ "$1" == "--approve" ]; then move "$2" "$DESTBASEDIR" shift done +elif [ "$1" == "--updates" ]; then + while [ -n "$2" ]; do + move "$2" "$DESTBASEDIR" "$UPDATEDISTRO/updates/release/" + shift + done +elif [ "$1" == "--later" ]; then + while [ -n "$2" ]; do + move "$2" "$LATERBASEDIR" + shift + done elif [ "$1" == "--reject" ]; then while [ -n "$2" ]; do move "$2" "$REJECTEDDIR" |