From 3bf5718c1f04a622d457ad0568ba8ba165bdbb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sun, 13 Feb 2011 22:47:08 -0600 Subject: * Updated parabola host recommendation. * Fixed librerelease to play with db-update in repo. --- librerelease | 2 +- libretools.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/librerelease b/librerelease index ad083a3..707ebca 100755 --- a/librerelease +++ b/librerelease @@ -34,7 +34,7 @@ rsync --recursive \ --progress \ -e "ssh " \ ${WORKDIR}/staging \ - ${PARABOLAHOST}:${LIBREDESTDIR} || exit 1 + ${PARABOLAHOST}:${LIBREDESTDIR}/stagging || exit 1 echo ":: Removing packages from local [staging]" find ${WORKDIR}/staging/ -iname "*.pkg.tar.*" -delete diff --git a/libretools.conf b/libretools.conf index ce61f30..d8850bd 100644 --- a/libretools.conf +++ b/libretools.conf @@ -45,7 +45,7 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git/ # # Host parabola # Port 22 -# HostName parabolagnulinux.org +# HostName repo.parabolagnulinux.org # User parabolavnx # IdentityFile ~/.ssh/id_rsa -- cgit v1.2.3 From 700e3da385b35228d43a64501850a6ebad83293c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sun, 13 Feb 2011 23:19:41 -0600 Subject: Fixed typo --- librerelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librerelease b/librerelease index 707ebca..6762a68 100755 --- a/librerelease +++ b/librerelease @@ -34,7 +34,7 @@ rsync --recursive \ --progress \ -e "ssh " \ ${WORKDIR}/staging \ - ${PARABOLAHOST}:${LIBREDESTDIR}/stagging || exit 1 + ${PARABOLAHOST}:${LIBREDESTDIR}/staging || exit 1 echo ":: Removing packages from local [staging]" find ${WORKDIR}/staging/ -iname "*.pkg.tar.*" -delete -- cgit v1.2.3 From 650b2065bd9197e3ecc1a9a14165e638322b178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Mon, 14 Feb 2011 00:07:45 -0600 Subject: Another try --- librerelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librerelease b/librerelease index 6762a68..7bf5003 100755 --- a/librerelease +++ b/librerelease @@ -34,7 +34,7 @@ rsync --recursive \ --progress \ -e "ssh " \ ${WORKDIR}/staging \ - ${PARABOLAHOST}:${LIBREDESTDIR}/staging || exit 1 + ${PARABOLAHOST}:${LIBREDESTDIR}/ || exit 1 echo ":: Removing packages from local [staging]" find ${WORKDIR}/staging/ -iname "*.pkg.tar.*" -delete -- cgit v1.2.3 From b48ab815479c1301bbd696978c1dd537a03c68d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 14 Feb 2011 15:37:06 -0300 Subject: Share pacman cache --- libremakepkg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libremakepkg b/libremakepkg index 2055002..a41326f 100755 --- a/libremakepkg +++ b/libremakepkg @@ -28,6 +28,8 @@ source /etc/libretools.conf echo "Updating the main chroot" mkarchroot -u -c ${CACHEDIR} -- ${CHROOTDIR}/${CHROOT} +mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHCOPY}/var/cache/pacman/pkg || exit 1 + echo "Creating the package" makechrootpkg -c -r ${CHROOTDIR} -l ${CHCOPY} -- $@ -- cgit v1.2.3 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. --- librerelease | 1 + librestage | 33 ++++++++++++++++++++++----------- 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 -- cgit v1.2.3 From 0f3c3b4fcaac15db0df82679fd81518bee4e2ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 10 Mar 2011 16:02:50 -0300 Subject: LibreMakepkg doesn't clean the chroot copy if any arg is supplied --- libremakepkg | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libremakepkg b/libremakepkg index a41326f..cf3f13f 100755 --- a/libremakepkg +++ b/libremakepkg @@ -25,12 +25,17 @@ fi source /etc/libretools.conf -echo "Updating the main chroot" -mkarchroot -u -c ${CACHEDIR} -- ${CHROOTDIR}/${CHROOT} +[[ -z $1 ]] && { + CLEAN="-c" -mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHCOPY}/var/cache/pacman/pkg || exit 1 + echo "Updating the main chroot" + mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHROOT}/var/cache/pacman/pkg || exit 1 + mkarchroot -u -- ${CHROOTDIR}/${CHROOT} + + mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHCOPY}/var/cache/pacman/pkg || exit 1 +} echo "Creating the package" -makechrootpkg -c -r ${CHROOTDIR} -l ${CHCOPY} -- $@ +makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${CHCOPY} -- $@ exit 0 -- cgit v1.2.3 From dc5b8c08f6eb61139ef859e192856a0ea3a2c279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 10 Mar 2011 16:04:03 -0300 Subject: LibreChRoot enters a build chroot --- librechroot | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/librechroot b/librechroot index 63bf9b4..99adcc0 100755 --- a/librechroot +++ b/librechroot @@ -1,4 +1,7 @@ #!/bin/bash +# LibreChRoot +# Enters a chroot + # Copyright 2010 Nicolás Reynolds # ---------- GNU General Public License 3 ---------- @@ -18,37 +21,38 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -[[ -z "${1}" ]] && { - echo "This scripts enters into the build chroot." - echo "Usage: $0 " - echo "Example: \`$0 root\` enters the 'root' chroot" +[[ "$UID" != "0" ]] && { + echo "This script must be run as root." exit 1 } -[[ $UID -ne 0 ]] && { - echo "This script must be run as root" - exit 2 -} - source /etc/libretools.conf -custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf -[[ -e $custom_config ]] && source $custom_config +custom_config=${XDG_CONFIG_HOME}/libretools/libretools.conf +[[ -e ${custom_config} ]] && source ${custom_config} -[[ ! -d $CHROOTDIR/$1/ ]] && { - echo "There's no $CHROOTDIR/$1" - exit 3 +# Enter the chroot copy by default +root=${1:-$CHCOPY} +CACHEDIR=${CACHEDIR:-/var/cache/pacman/pkg} + +[[ ! -d ${CHROOTDIR}/${root} ]] && { + echo "${CHROOTDIR}/$root is not a dir." + exit 1 } -mount -t proc proc $CHROOTDIR/$1/proc/ -mount -t sysfs sys $CHROOTDIR/$1/sys/ -mount -o bind /dev $CHROOTDIR/$1/dev/ +mount -t proc proc ${CHROOTDIR}/${root}/proc/ +mount -t sysfs sys ${CHROOTDIR}/${root}/sys/ +mount -o bind /dev ${CHROOTDIR}/${root}/dev/ + +# Share pacman cache +mount -o bind ${CACHEDIR} ${CHROOTDIR}/${root}/var/cache/pacman/pkg -cp -L /etc/resolv.conf $CHROOTDIR/$1/etc/resolv.conf >/dev/null 2>&1 +cp -L /etc/resolv.conf ${CHROOTDIR}/${root}/etc/resolv.conf -chroot $CHROOTDIR/$1 /bin/bash +chroot ${CHROOTDIR}/${root} /bin/bash -umount $CHROOTDIR/$1/proc/ -umount $CHROOTDIR/$1/sys/ -umount $CHROOTDIR/$1/dev/ +umount ${CHROOTDIR}/${root}/proc/ +umount ${CHROOTDIR}/${root}/sys/ +umount ${CHROOTDIR}/${root}/dev/ +umount ${CHROOTDIR}/${root}/var/cache/pacman/pkg exit 0 -- cgit v1.2.3 From ac5d8f7455cd1466737271c1ee9b4ae216339f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 10 Mar 2011 16:20:52 -0300 Subject: ABSLibreCommit commits a package to abslibre.git --- abslibre-commit | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 abslibre-commit diff --git a/abslibre-commit b/abslibre-commit new file mode 100755 index 0000000..8922cc0 --- /dev/null +++ b/abslibre-commit @@ -0,0 +1,35 @@ +#!/bin/bash +# ABSLibreCommit +# Commits a PKGBUILD to ABSLibre.git + +# Copyright 2010 Nicolás Reynolds + +# ---------- GNU General Public License 3 ---------- + +# This file is part of Parabola. + +# Parabola is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# Parabola is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with Parabola. If not, see . + +for _pkg in ${@}; do + [[ ! -e ${_pkg}/PKGBUILD ]] && continue + + unset pkgbase pkgname + source ${_pkg}/PKGBUILD + + git stage ${_pkg}/* + + git commit -m "${pkgbase:-$pkgname}-${pkgver}-${pkgrel}" +done + +exit 0 -- cgit v1.2.3 From de28a019385b3a4465ffeadf39e51f0411771edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 10 Mar 2011 16:55:01 -0300 Subject: LibreRelease run a command before syncing --- librerelease | 2 ++ libretools.conf | 3 +++ 2 files changed, 5 insertions(+) diff --git a/librerelease b/librerelease index f592b9e..900cad3 100755 --- a/librerelease +++ b/librerelease @@ -25,6 +25,8 @@ source /etc/libretools.conf custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf [[ -e $custom_config ]] && source $custom_config +[[ ! -z ${HOOKPRERELEASE} ]] && bash -c "${HOOKPRERELEASE}" + echo ":: Uploading packages..." rsync --recursive \ --copy-links \ diff --git a/libretools.conf b/libretools.conf index d8850bd..a3fd4b8 100644 --- a/libretools.conf +++ b/libretools.conf @@ -26,6 +26,9 @@ PATCHDIR=${WORKDIR}/abslibre/patches ## Parabola hostname (should be the same used on ssh_config PARABOLAHOST=parabola +## Run a command before releasing a package (ie. SSH connection, SSH tunnel, etc.) +HOOKPRERELEASE="ssh -fN parabola" + ## Server destination of libre packages LIBREDESTDIR=/home/parabolavnx/parabolagnulinux.org/free LIBRESRCDIR=/home/parabolavnx/parabolagnulinux.org/repo/pkgbuilds -- cgit v1.2.3