From f874a3af8b0f3d32b26dcfa4a8b57b4220e3851f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 5 Feb 2011 14:07:31 -0300 Subject: LibreRelease adapted to work on CreateWorkDir. Using rsync now. --- librerelease | 54 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'librerelease') diff --git a/librerelease b/librerelease index 4662ced..b47237b 100755 --- a/librerelease +++ b/librerelease @@ -23,70 +23,78 @@ source /etc/libretools.conf - custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf [[ -e $custom_config ]] && source $custom_config -batchfile=/tmp/librerelease_batchfile.$$ # End Config usage() { - echo "Usage: $0 " + echo "Usage: $0 [ ... ]" echo "" - echo "Libre release will upload the package and source built by the PKGBUILD on the" + echo "LibreRelease will upload the package built by the PKGBUILD on the" echo "current directory to the specified repo." } -repo=${1} +repos=$@ -if [ ${#repo} -eq 0 ]; then +if [ ${#repos} -eq 0 ]; then usage exit 1; fi -function to_sftp() { - echo "$@" >> $batchfile -} - [[ ! -e ./PKGBUILD ]] && { echo "PKGBUILD not found" exit 1 } +# Source the needed files source PKGBUILD source /etc/makepkg.conf - [[ -e ~/.makepkg.conf ]] && source ~/.makepkg.conf # Default package location PKGDEST=${PKGDEST:-.} SRCPKGDEST=${SRCPKGDEST:-.} -# Init the batchfile -to_sftp "progress" - +# Copies the packages to the specified repos inside staging for _arch in ${arch[@]}; do for pkg in ${pkgname[@]}; do + pkgfile="$PKGDEST/$pkg-$pkgver-$pkgrel-$_arch$PKGEXT" - if [ -e "$pkgfile" ]; then - to_sftp "put $pkgfile ${LIBREDESTDIR}/$repo/" + + if [ -e "${pkgfile}" ]; then + + for _repo in ${repos[@]}; do + + cp "${pkgfile}" "${WORKDIR}/staging/${_repo}/" || { + echo "Can't put ${pkgfile} on [staging]" + exit 1 + } + + done + fi done done -# Use pkgbase for the finding the sources tar +# Use pkgbase for finding the sources tar [[ -z ${pkgbase} ]] && pkgbase=${pkgname} -# Upload the build scripts -makepkg -f --source -to_sftp "put $SRCPKGDEST/$pkgbase-$pkgver-$pkgrel$SRCEXT ${LIBRESRCDIR}/$repo" - -sftp -b ${batchfile} ${PARABOLAHOST} +echo ":: Uploading packages..." +rsync --recursive \ + --copy-links \ + --partial \ + --prune-empty-dirs \ + --human-readable \ + --progress \ + -e "ssh " \ + ${WORKDIR}/staging \ + ${PARABOLAHOST}:/home/parabolavnx/${LIBREDESTDIR} || exit 1 cat <