diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-01-08 15:17:16 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-01-08 15:17:16 -0300 |
commit | 341400146cbde0dbf05eaa8aec531f5286fd91fb (patch) | |
tree | aef2a4b704731ee405345bc8e22dbcdad2056cb5 /db-repo-add | |
parent | a749983e8f2becf7c5427b0e5c449d457afbe385 (diff) | |
parent | a8b219b325cd642a781a64d8e08a0e66d25c1b44 (diff) |
Merge branch 'master' of https://projects.archlinux.org/git/dbscripts
Conflicts:
db-remove
Diffstat (limited to 'db-repo-add')
-rwxr-xr-x | db-repo-add | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/db-repo-add b/db-repo-add index 53cfc84..b83fb77 100755 --- a/db-repo-add +++ b/db-repo-add @@ -3,14 +3,14 @@ . "$(dirname $0)/db-functions" . "$(dirname $0)/config" -if [ $# -ne 3 ]; then - msg "usage: $(basename $0) <pkgfile> <repo> <arch>" +if [ $# -lt 3 ]; then + msg "usage: $(basename $0) <repo> <arch> <pkgfile> ..." exit 1 fi -pkgfile="$1" -repo="$2" -arch="$3" +repo="$1" +arch="$2" +pkgfiles=(${@:3}) ftppath="$FTP_BASE/$repo/os" @@ -28,12 +28,14 @@ for tarch in ${tarches[@]}; do repo_lock $repo $tarch || exit 1 done -msg "Adding $pkgfile to [$repo]..." - for tarch in ${tarches[@]}; do - if [ ! -f "${pkgfile}" ]; then - die "Package file ${pkgfile} not found" - fi - arch_repo_add "${repo}" "${tarch}" ${pkgfile} + for pkgfile in ${pkgfiles[@]}; do + if [[ ! -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}" ]]; then + die "Package file ${pkgfile##*/} not found in ${FTP_BASE}/${repo}/os/${arch}/" + else + msg "Adding $pkgfile to [$repo]..." + fi + done + arch_repo_add "${repo}" "${tarch}" ${pkgfiles[@]} repo_unlock $repo $tarch done |