diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-03-21 20:18:44 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-03-21 20:18:44 -0300 |
commit | f98753091219274bc92cf8a90b7786e288d8219f (patch) | |
tree | 7f72f30a2aaf304fa7b21daf06a8e001bf4efdb7 /librestage | |
parent | 9c4f19b5e3f590002c19758cded5cb6ed691a8fd (diff) | |
parent | de28a019385b3a4465ffeadf39e51f0411771edf (diff) |
Merge branch 'master' of ssh://vparabola/srv/git/projects/libretoolsv20110321
Diffstat (limited to 'librestage')
-rwxr-xr-x | librestage | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -66,23 +66,34 @@ SRCPKGDEST=${SRCPKGDEST:-.} # Copies the packages to the specified repos inside staging for _arch in ${arch[@]}; do for pkg in ${pkgname[@]}; do + pkgfile="$pkg-$pkgver-$pkgrel-$_arch$PKGEXT" + pkgpath="$PKGDEST/$pkgfile" - pkgfile="$PKGDEST/$pkg-$pkgver-$pkgrel-$_arch$PKGEXT" + if [ -e "${pkgpath}" ]; then + echo found ${pkgfile} - if [ -e "${pkgfile}" ]; then - echo found ${pkgfile} + canonical="" for _repo in ${repos[@]}; do - cp "${pkgfile}" "${WORKDIR}/staging/${_repo}/" || { - echo "Can't put ${pkgfile} on [staging]" - exit 1 - } && { - echo "${pkg} staged on [${_repo}]" - } + [[ -z "$canonical" ]] && { + canonical="${WORKDIR}/staging/${_repo}/${pkgfile}" + cp "${pkgpath}" "${WORKDIR}/staging/${_repo}/" || { + echo "Can't put ${pkgfile} on [staging]" + exit 1 + } && { + echo "${pkg} staged on [${_repo}]" + } + } || { + ln "${canonical}" "${WORKDIR}/staging/${_repo}/${pkgfile}" || { + echo "Can't put ${pkgfile} on [staging]" + exit 1 + } && { + echo "${pkg} staged on [${_repo}]" + } + } done - fi done done -exit 0
\ No newline at end of file +exit 0 |