From a164826eef907c27c60936c01c72ff96005af9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 3 Nov 2012 17:23:11 -0300 Subject: Inform the upload size --- librerelease | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/librerelease b/librerelease index c4d97c1..efb698e 100755 --- a/librerelease +++ b/librerelease @@ -118,7 +118,7 @@ else exit 1 fi -# Make the permissions of the packages 644 otherwize the user will get access +# Make the permissions of the packages 644 otherwise the user will get access # denied error when they try to download (rsync --no-perms doesn't seem to # work). find ${WORKDIR}/staging -type f -exec chmod 644 {} \; @@ -127,6 +127,7 @@ find ${WORKDIR}/staging -type d -exec chmod 755 {} \; # Get the synced files SYNCED_FILES=($(find ${WORKDIR}/staging -type f)) +msg "%s to upload" $(du -h -d 0 ${WORKDIR}/staging | tr "\t" " " | cut -d" " -f1) msg "Uploading packages..." rsync --recursive \ ${dryrun} \ -- cgit v1.2.3 From d9efdb903fcd4d3242918910e7d6c00d2e17975d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 5 Nov 2012 15:38:49 -0300 Subject: Updated treepkg docs --- doc/treepkg.markdown | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/treepkg.markdown b/doc/treepkg.markdown index 2808599..7f7ece1 100644 --- a/doc/treepkg.markdown +++ b/doc/treepkg.markdown @@ -13,9 +13,9 @@ some design issues that made fullpkg miss some packages sometimes. ## Requirements `treepkg` needs the help of `toru-path` for "indexing" an ABS tree. `toru-path` -stores a plain text database of "pkgname:path" pairs, where pkgname is replaced -by the "pkgbase", "pkgname", and "provides" fields of a PKGBUILD, followed by -the path of the current PKGBUILD. +stores a tokyocabinet database of "pkgname" => "path" pairs, where pkgname is +replaced by the "pkgbase", "pkgname", and "provides" fields of a PKGBUILD, +followed by the path of the current PKGBUILD. This information is then used by `treepkg` to know where to find the PKGBUILD of a package. The fullpkg family needed to guess this by traversing the full @@ -24,9 +24,9 @@ pkgbase. So, to use `treepkg` you need to run `toru-path` after the ABS tree update. -> Currently `toru-path` doesn't remove duplicated or updated pairs, but it -> picks the last ones and only processes new PKGBUILDs. This means `toru-path` -> works correctly but it's database will grow up slowly. +> Split PKGBUILDs make it difficult to extract metadata if it's stored inside +> package() functions. This will happen with the provides field and `treepkg` +> won't find that linux-libre-headers provides linux-headers, for instance. ## How does it work @@ -105,6 +105,9 @@ current one. Thus this will become the build path: ghostscript (0) - fontconfig (buried) \ cups (1) - fontconfig (2) +> Note: currently, `treepkg` doesn't perform recursive burying, so if you hit +> a really long build tree with some circular dependencies you may find +> packages buried several times and queued to build before their actuals deps. ## Tips @@ -114,13 +117,14 @@ to pass this arguments when running it manually, they're used internally to automatically construct the build path. But if a build failed, `treepkg` will cancel itself immediately informing you -where the leftovers files where left. If you pass this path to `treepkg` as the +where the leftovers files were left. If you pass this path to `treepkg` as the first argument, it will resume the build, skipping to the last package being packaged. You can take the opportunity given by this to modify the build path or the -PKGBUILDs, without having to re-run `treepkg` twice. For instance you can -remove a package from the build order, or move it manually, or update the -PKGBUILD that made `treepkg` fail in the first place. +PKGBUILDs, without having to run `treepkg` twice. For instance you can remove +a package from the build order, or move it manually, or update the PKGBUILD +that made `treepkg` fail in the first place. You can force a skipped package +(after building it manually) by using `touch built_ok` on the PKGBUILD dir. You don't probably want to mess with the second argument though. -- cgit v1.2.3 From 362ec9e880e784ec9bc2858c635b0279e52af82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= 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(-) 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 From 61ca876072f8e7a5a6ab90974db895c57434ae9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 5 Nov 2012 16:13:14 -0300 Subject: Added DRYRUN mode and use libretools.conf --- chcleanup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chcleanup b/chcleanup index e732b8c..26c1a27 100755 --- a/chcleanup +++ b/chcleanup @@ -9,13 +9,12 @@ set -e -source $(dirname $0)/libremessages source /etc/makepkg.conf +source /etc/libretools.conf source ${HOME}/.makepkg.conf 2>/dev/null|| true msg "Cleaning chroot..." - TMPDIR="$(mktemp -d /tmp/$(basename $0)-XXXXX)" cleanup_log="${TMPDIR}"/libretools-cleanup.log @@ -48,9 +47,10 @@ packages=($(comm -23 <(pacman -Qq | sort) \ msg2 "Removing %d packages" ${#packages[@]} # Only remove leftovers, -Rcs removes too much -sudo pacman --noconfirm -Rn ${packages[@]} +${DRYRUN} || sudo pacman --noconfirm -Rn ${packages[@]} +${DRYRUN} && echo ${packages[@]} # Cleanup -rm -fr ${TMPDIR} +${DRYRUN} || rm -fr ${TMPDIR} exit $? -- cgit v1.2.3 From 83dd1498e580510023b63611bb25feedd3699b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 5 Nov 2012 16:30:55 -0300 Subject: Make librechroot use chcleanup --- librechroot | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/librechroot b/librechroot index 9e292f5..b4766e6 100755 --- a/librechroot +++ b/librechroot @@ -44,39 +44,9 @@ function usage { } function clean_chroot { # Clean packages with pacman - msg "Cleaning chroot: ${CHROOTDIR}/${CHROOTNAME}" - cp "/etc/libretools.d/cleansystem" "${CHROOTDIR}/${CHROOTNAME}/cleansystem" - (cat < "${CHROOTDIR}/${CHROOTNAME}/clean" - - chmod +x "${CHROOTDIR}/${CHROOTNAME}/clean" - mkarchroot -r "/clean" "${CHROOTDIR}/${CHROOTNAME}" + cp -a "$(dirname $0)/chcleanup" "${CHROOTDIR}/${CHROOTNAME}/clean" - rm "${CHROOTDIR}/${CHROOTNAME}/clean" - rm "${CHROOTDIR}/${CHROOTNAME}/cleansystem" + mkarchroot -r "/clean" } function clean_repo { -- cgit v1.2.3