From a323ff09d756dd06a559586467c84dbe78069060 Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sat, 22 Sep 2012 18:47:21 -0300 Subject: Deprecate clean-pacman in favor of smart chcleanup Chcleanup compares the currently installed packages with a clean system list of packages + the package dependencies and removes the leftovers. Treepkg runs it as pre-build hook, so FULLBUILDCMD finds only the needed dependencies. --- libretools.conf | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'libretools.conf') diff --git a/libretools.conf b/libretools.conf index 514c37d..40f92dc 100644 --- a/libretools.conf +++ b/libretools.conf @@ -30,9 +30,6 @@ CACHEDIR=`grep "^#\?CacheDir" /etc/pacman.conf | cut -d'=' -f2` ## 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 # Don't change unless you know what you're doing and you won't screw # anything ;) @@ -52,6 +49,20 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git FULLBUILDCMD="sudo libremakepkg -cuN" # Cross compiling fullkpg # FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot'" +# Build from within the chroot (or host system) +# FULLBUILDCMD="makepkg -sL --noconfirm" + +# Run a command before releasing a package (ie. SSH connection, SSH tunnel, etc.) +HOOKPRERELEASE="ssh -fN parabola" + +# Run a command before running FULLBUILDCMD, usually to cleanup uneeded packages +# Note! chcleanup *is not* chroot aware, if you run it as it is it will cleanup +# your system +# HOOKPREBUILD="chcleanup" + +# Locally release the package or any other action after running FULLBUILDCMD +# succesfully +# HOOKLOCALRELEASE="" ## Toru # Section for toru's vars -- cgit v1.2.3-54-g00ecf From 04af64022ed0a0bf618e23c0ed7512c168d479c7 Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sat, 3 Nov 2012 13:29:38 -0300 Subject: Traverse REPOS backwards This ensures packages in stable repos are added last to the path cache --- libretools.conf | 6 ++++-- toru-path | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'libretools.conf') diff --git a/libretools.conf b/libretools.conf index 40f92dc..88ba515 100644 --- a/libretools.conf +++ b/libretools.conf @@ -7,10 +7,12 @@ DIFFTOOL=vimdiff # The dir where you work on WORKDIR=/home/$USER/packages # The repos you'll be packaging for +# # Tip: As early repos take precedence on $REPOS loops, you can use this as # inverted order of precedence. Put testing repos first so fullpkg find new -# PKGBUILDs first, for instance. -REPOS=('core' 'extra' 'community' 'libre' 'libre-testing' 'social' 'sugar') +# PKGBUILDs first, for instance. Toru-path uses reverse order to enforce repo +# precedence on the path cache (the last path added replaces the rest) +REPOS=('core' 'libre' 'extra' 'community' 'libre-testing' 'social' 'sugar') # The architectures ARCHES=('i686' 'x86_64' 'mips64el' 'any') diff --git a/toru-path b/toru-path index 7f1d599..957f49b 100755 --- a/toru-path +++ b/toru-path @@ -3,6 +3,7 @@ source $(dirname $(command -v $0))/toru-utils TORUPATH=${T:-${TORUPATH}} +VERBOSE=${V:-false} if [ ! -w "$TORUPATH" ]; then error "Toru's path isn't writable. Please check $TORUPATH" @@ -18,7 +19,11 @@ fi # TODO pass other paths via flags # ABSROOT has trailing slash -fullrepos=($(for _repo in ${REPOS[@]}; do echo "${ABSROOT}${_repo}"; done)) +fullrepos=() +for (( i = ${#REPOS[@]}-1 ; i >= 0 ; i-- )); do + ${VERBOSE} && msg "Processing [%s]" ${REPOS[$i]} + fullrepos+=("${ABSROOT}${REPOS[$i]}") +done pkgbuilds=($(get_pkgbuilds ${fullrepos[@]})) msg "Updating path cache" @@ -33,6 +38,7 @@ for _pkgbuild in ${pkgbuilds[@]}; do fullpath=$(dirname ${_pkgbuild}) for _pkg in ${pkgbase} ${pkgname[@]} ${provides[@]}; do + $VERBOSE && msg2 "${_pkg} -> ${fullpath}" tcamgr put ${PATHFILE} ${_pkg/[<>=]*} ${fullpath} done -- cgit v1.2.3-54-g00ecf From 362ec9e880e784ec9bc2858c635b0279e52af82d Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Mon, 5 Nov 2012 16:02:07 -0300 Subject: Be even smarter Only use one pacman call by getting repo.db files from the local cache. Adds a new libretools.conf array for getting extra packages (other than the base system): CHROOTEXTRAPKGS. --- chcleanup | 37 +++++++++++++++++-------------------- libretools.conf | 2 ++ 2 files changed, 19 insertions(+), 20 deletions(-) (limited to 'libretools.conf') diff --git a/chcleanup b/chcleanup index b5f631c..e732b8c 100755 --- a/chcleanup +++ b/chcleanup @@ -9,16 +9,17 @@ set -e -[ ! -f /etc/libretools.d/cleansystem ] && exit 1 -[ ! -d "${DB:-/var/lib/libretools/clean}"/sync ] && exit 1 - source $(dirname $0)/libremessages source /etc/makepkg.conf source ${HOME}/.makepkg.conf 2>/dev/null|| true msg "Cleaning chroot..." -cleanup_log=/tmp/libretools-cleanup.log + +TMPDIR="$(mktemp -d /tmp/$(basename $0)-XXXXX)" +cleanup_log="${TMPDIR}"/libretools-cleanup.log + +cp -a /var/lib/pacman/sync "${TMPDIR}/" touch ${cleanup_log} # If we're running makepkg @@ -27,24 +28,20 @@ if [ -f PKGBUILD ]; then check=(${depends[@]} ${makedepends[@]} ${checkdepends[@]}) - if [ ${#check[@]} -ne 0 ]; then - -# Update the cleansystem database - sudo pacman -b "${BD:-/var/lib/libretools/clean}" -Sy -# Get the full list of packages needed by dependencies - sudo pacman -b "${BD:-/var/lib/libretools/clean}" \ - -Sp \ - --print-format "%n" \ - ${check[@]} \ - >${cleanup_log} - fi fi -# Diff installed packages against a clean chroot and needed packages, -# then remove leftovers +# Get the full list of packages needed by dependencies, including the base system +sudo pacman -b "${TMPDIR}" \ + -Sp \ + --print-format "%n" \ + base base-devel sudo \ + ${CHROOTEXTRAPKG[@]} \ + ${check[@]} \ + >${cleanup_log} + +# Diff installed packages against a clean chroot then remove leftovers packages=($(comm -23 <(pacman -Qq | sort) \ - <(cat /etc/libretools.d/cleansystem ${cleanup_log} | sort -u) - )) + <(sort -u ${cleanup_log}))) [ ${#packages[@]} -eq 0 ] && exit 0 @@ -54,6 +51,6 @@ msg2 "Removing %d packages" ${#packages[@]} sudo pacman --noconfirm -Rn ${packages[@]} # Cleanup -rm -f ${cleanup_log} +rm -fr ${TMPDIR} exit $? diff --git a/libretools.conf b/libretools.conf index 88ba515..8032397 100644 --- a/libretools.conf +++ b/libretools.conf @@ -19,6 +19,8 @@ ARCHES=('i686' 'x86_64' 'mips64el' 'any') ## The directory where the chroots are stored CHROOTDIR=/home/chroot +# Extra packages to have installed on the chroot (besides base base-devel and sudo) +CHROOTEXTRAPKG=(distcc ccache tsocks tokyocabinet) ## The working chroot ## A chroot is useful to build packages isolated from the current system and avoid -- cgit v1.2.3-54-g00ecf From 84442a551d28dc504b3b38e1dcfc99dd56c52dea Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Nov 2012 11:10:11 -0500 Subject: mv libretools.conf src/ --- libretools.conf | 122 ---------------------------------------------------- src/libretools.conf | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 122 deletions(-) delete mode 100644 libretools.conf create mode 100644 src/libretools.conf (limited to 'libretools.conf') diff --git a/libretools.conf b/libretools.conf deleted file mode 100644 index 8032397..0000000 --- a/libretools.conf +++ /dev/null @@ -1,122 +0,0 @@ -## Blacklist URL -BLACKLIST=http://repo.parabolagnulinux.org/docs/blacklist.txt - -# Diff tool (vimdiff, gvimdiff, meld, etc) -DIFFTOOL=vimdiff - -# The dir where you work on -WORKDIR=/home/$USER/packages -# The repos you'll be packaging for -# -# Tip: As early repos take precedence on $REPOS loops, you can use this as -# inverted order of precedence. Put testing repos first so fullpkg find new -# PKGBUILDs first, for instance. Toru-path uses reverse order to enforce repo -# precedence on the path cache (the last path added replaces the rest) -REPOS=('core' 'libre' 'extra' 'community' 'libre-testing' 'social' 'sugar') - -# The architectures -ARCHES=('i686' 'x86_64' 'mips64el' 'any') - -## The directory where the chroots are stored -CHROOTDIR=/home/chroot -# Extra packages to have installed on the chroot (besides base base-devel and sudo) -CHROOTEXTRAPKG=(distcc ccache tsocks tokyocabinet) - -## The working chroot -## A chroot is useful to build packages isolated from the current system and avoid -## unwanted (as in not in dependencies) automatic library linking -# CHROOT=$SUDO_USER -# CHROOT=root - -## Obtains CacheDir from pacman.conf -CACHEDIR=`grep "^#\?CacheDir" /etc/pacman.conf | cut -d'=' -f2` - -## Parabola hostname (should be the same used on ssh_config -PARABOLAHOST=parabola - -## Server destination of libre packages -# Don't change unless you know what you're doing and you won't screw -# anything ;) -LIBREDESTDIR=/srv/http/repo/public - -## ABSLibre -ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git - -## Commit Command -## Should be git or hg -## Uncomment only one of those -#COMMITCMD=git -#COMMITCMD=hg - -## Uncomment one of those or make one of your choice -# Normal fullpkg -FULLBUILDCMD="sudo libremakepkg -cuN" -# Cross compiling fullkpg -# FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot'" -# Build from within the chroot (or host system) -# FULLBUILDCMD="makepkg -sL --noconfirm" - -# Run a command before releasing a package (ie. SSH connection, SSH tunnel, etc.) -HOOKPRERELEASE="ssh -fN parabola" - -# Run a command before running FULLBUILDCMD, usually to cleanup uneeded packages -# Note! chcleanup *is not* chroot aware, if you run it as it is it will cleanup -# your system -# HOOKPREBUILD="chcleanup" - -# Locally release the package or any other action after running FULLBUILDCMD -# succesfully -# HOOKLOCALRELEASE="" - -## Toru -# Section for toru's vars -TORUPATH=/var/lib/libretools/toru - -## Package signing -# Leave commented to disable signing -#SIGEXT=".sig" -#SIGID="0xYOURID" - -# Checks if vars aren't empty - -for VAR in CHROOTDIR CHROOT CACHEDIR PARABOLAHOST LIBREDESTDIR \ - BLACKLIST WORKDIR REPOS ARCHES ABSLIBREGIT \ - COMMITCMD DIFFTOOL FULLBUILDCMD; do - - ret=0 - [[ -z ${!VAR} ]] && { - echo "Configure $VAR var in /etc/libretools.conf" - ret=1 - } - [ $ret -ne 0 ] && exit 1 -done - -source /usr/bin/libremessages - -## These are architecture specific files. -## Uncomment them if you installed libretools-mips64el -# source /etc/libretools.d/mips64el.conf - -## Recommended SSH Config follows -# SSH host, it's better if you have it configured on ~/.ssh/config -# with ControlMaster auto (and a shell opened somewhere else) -# -# Example: -# Host * -# Protocol 2 -# ControlMaster auto -# ControlPath /tmp/ssh-%r@%h:%p -# -## Repo server -# Host parabola -# Port 22 -# HostName repo.parabolagnulinux.org -# User parabolavnx -# IdentityFile ~/.ssh/id_rsa -# -## Git server -# Host vparabola -# Port 1863 -# HostName parabolagnulinux.org -# User parabola -# IdentityFile ~/.ssh/id_rsa diff --git a/src/libretools.conf b/src/libretools.conf new file mode 100644 index 0000000..8032397 --- /dev/null +++ b/src/libretools.conf @@ -0,0 +1,122 @@ +## Blacklist URL +BLACKLIST=http://repo.parabolagnulinux.org/docs/blacklist.txt + +# Diff tool (vimdiff, gvimdiff, meld, etc) +DIFFTOOL=vimdiff + +# The dir where you work on +WORKDIR=/home/$USER/packages +# The repos you'll be packaging for +# +# Tip: As early repos take precedence on $REPOS loops, you can use this as +# inverted order of precedence. Put testing repos first so fullpkg find new +# PKGBUILDs first, for instance. Toru-path uses reverse order to enforce repo +# precedence on the path cache (the last path added replaces the rest) +REPOS=('core' 'libre' 'extra' 'community' 'libre-testing' 'social' 'sugar') + +# The architectures +ARCHES=('i686' 'x86_64' 'mips64el' 'any') + +## The directory where the chroots are stored +CHROOTDIR=/home/chroot +# Extra packages to have installed on the chroot (besides base base-devel and sudo) +CHROOTEXTRAPKG=(distcc ccache tsocks tokyocabinet) + +## The working chroot +## A chroot is useful to build packages isolated from the current system and avoid +## unwanted (as in not in dependencies) automatic library linking +# CHROOT=$SUDO_USER +# CHROOT=root + +## Obtains CacheDir from pacman.conf +CACHEDIR=`grep "^#\?CacheDir" /etc/pacman.conf | cut -d'=' -f2` + +## Parabola hostname (should be the same used on ssh_config +PARABOLAHOST=parabola + +## Server destination of libre packages +# Don't change unless you know what you're doing and you won't screw +# anything ;) +LIBREDESTDIR=/srv/http/repo/public + +## ABSLibre +ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git + +## Commit Command +## Should be git or hg +## Uncomment only one of those +#COMMITCMD=git +#COMMITCMD=hg + +## Uncomment one of those or make one of your choice +# Normal fullpkg +FULLBUILDCMD="sudo libremakepkg -cuN" +# Cross compiling fullkpg +# FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot'" +# Build from within the chroot (or host system) +# FULLBUILDCMD="makepkg -sL --noconfirm" + +# Run a command before releasing a package (ie. SSH connection, SSH tunnel, etc.) +HOOKPRERELEASE="ssh -fN parabola" + +# Run a command before running FULLBUILDCMD, usually to cleanup uneeded packages +# Note! chcleanup *is not* chroot aware, if you run it as it is it will cleanup +# your system +# HOOKPREBUILD="chcleanup" + +# Locally release the package or any other action after running FULLBUILDCMD +# succesfully +# HOOKLOCALRELEASE="" + +## Toru +# Section for toru's vars +TORUPATH=/var/lib/libretools/toru + +## Package signing +# Leave commented to disable signing +#SIGEXT=".sig" +#SIGID="0xYOURID" + +# Checks if vars aren't empty + +for VAR in CHROOTDIR CHROOT CACHEDIR PARABOLAHOST LIBREDESTDIR \ + BLACKLIST WORKDIR REPOS ARCHES ABSLIBREGIT \ + COMMITCMD DIFFTOOL FULLBUILDCMD; do + + ret=0 + [[ -z ${!VAR} ]] && { + echo "Configure $VAR var in /etc/libretools.conf" + ret=1 + } + [ $ret -ne 0 ] && exit 1 +done + +source /usr/bin/libremessages + +## These are architecture specific files. +## Uncomment them if you installed libretools-mips64el +# source /etc/libretools.d/mips64el.conf + +## Recommended SSH Config follows +# SSH host, it's better if you have it configured on ~/.ssh/config +# with ControlMaster auto (and a shell opened somewhere else) +# +# Example: +# Host * +# Protocol 2 +# ControlMaster auto +# ControlPath /tmp/ssh-%r@%h:%p +# +## Repo server +# Host parabola +# Port 22 +# HostName repo.parabolagnulinux.org +# User parabolavnx +# IdentityFile ~/.ssh/id_rsa +# +## Git server +# Host vparabola +# Port 1863 +# HostName parabolagnulinux.org +# User parabola +# IdentityFile ~/.ssh/id_rsa -- cgit v1.2.3-54-g00ecf