summaryrefslogtreecommitdiff
path: root/librestage
diff options
context:
space:
mode:
Diffstat (limited to 'librestage')
-rwxr-xr-xlibrestage33
1 files changed, 22 insertions, 11 deletions
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