diff options
-rwxr-xr-x | librerelease | 1 | ||||
-rwxr-xr-x | librestage | 33 |
2 files changed, 23 insertions, 11 deletions
diff --git a/librerelease b/librerelease index 7bf5003..f592b9e 100755 --- a/librerelease +++ b/librerelease @@ -28,6 +28,7 @@ custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf echo ":: Uploading packages..." rsync --recursive \ --copy-links \ + --hard-links \ --partial \ --prune-empty-dirs \ --human-readable \ @@ -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 |