diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-02-05 14:07:31 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-02-05 14:07:31 -0300 |
commit | f874a3af8b0f3d32b26dcfa4a8b57b4220e3851f (patch) | |
tree | 47c8e5cc47af60e88f3ed7f2bbcb93da843f02b7 /librerelease | |
parent | 79d785a7a72e224ff867fbd90b1c2687595bc0bb (diff) |
LibreRelease adapted to work on CreateWorkDir. Using rsync now.v20110207
Diffstat (limited to 'librerelease')
-rwxr-xr-x | librerelease | 54 |
1 files changed, 31 insertions, 23 deletions
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 <repo> " + echo "Usage: $0 <repo> [<repo2> ... ]" 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 <<EOM From: you To: packages@list.parabolagnulinux.org -Subject: [$pkgbase] $pkgver-$pkgrel released on [$repo] +Subject: [$pkgbase] $pkgver-$pkgrel staged on [${repos[@]}] :) EOM |