From 10547b604665db1eebc7325ae181c2d3b5f300ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 10 Mar 2011 16:01:52 -0300 Subject: LibreStage just copies once and hardlinks the rest if the package is going to be released into two repos. --- librestage | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'librestage') diff --git a/librestage b/librestage index 933a7e7..70aaa4a 100755 --- a/librestage +++ b/librestage @@ -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 -- cgit v1.2.2