summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-03-10 16:01:52 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-03-10 16:01:52 -0300
commit10547b604665db1eebc7325ae181c2d3b5f300ec (patch)
treea4ec5b3b23e977cffa153cb4d3be8decc971a0e2
parentb48ab815479c1301bbd696978c1dd537a03c68d3 (diff)
LibreStage just copies once and hardlinks the rest if the package is going to be released into two repos.
-rwxr-xr-xlibrerelease1
-rwxr-xr-xlibrestage33
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 \
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