From ee40153178ec333278cc4aa422c5b237af6d858d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 7 Jun 2012 14:32:28 -0300 Subject: Get the last path, not the first one (fixes not found on repo change) --- treepkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index d21377d..8dab83a 100755 --- a/treepkg +++ b/treepkg @@ -85,7 +85,8 @@ bury() { # Look in all caches but pick the first one # TODO move to a toru flag (-p?) where_is() { - grep -m1 "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \ + grep "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \ + tail -n1 2>/dev/null|\ cut -d: -f2 2>/dev/null } -- cgit v1.2.3-2-g168b From fe138085ad889447942f03b969f1a3abb862cb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 15 Aug 2012 15:25:59 -0300 Subject: Toru-where is an utility to find PKGBUILD dirs on toru's path cache Use with toru-path --- treepkg | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index 8dab83a..fcb9d29 100755 --- a/treepkg +++ b/treepkg @@ -81,17 +81,8 @@ bury() { } || return 1 } -# Finds a PKGBUILD on toru's path cache -# Look in all caches but pick the first one -# TODO move to a toru flag (-p?) -where_is() { - grep "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \ - tail -n1 2>/dev/null|\ - cut -d: -f2 2>/dev/null -} - # Guess the repo from the pkgbase path -# $1 path, pwd or where_is +# $1 path, pwd or toru-where guess_repo() { basename "$(dirname "${1}")" } @@ -176,7 +167,7 @@ if ! ${BUILDNOW}; then egrep -q ";${_dep};" "${BUILDORDER}" && bury "${_dep}" ${NEXTDEPTH} # Ask toru where's a PKGBUILD - depdir="$(where_is ${_dep})" + depdir="$(toru-where ${_dep})" if [ -z "${depdir}" -o ! -d "${depdir}" ]; then # We specify the pkgname because we can't source the dep PKGBUILD -- cgit v1.2.3-2-g168b From b3b52d5c4a3cbcdeb505b099230107b830290e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 15 Aug 2012 15:28:35 -0300 Subject: TODO was implemented already --- treepkg | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index fcb9d29..00ec0e0 100755 --- a/treepkg +++ b/treepkg @@ -157,13 +157,10 @@ if ! ${BUILDNOW}; then # NOTE: getting depends from package() is a PITA for _dep in ${deps[@]}; do -# Ignore if already in build order -# TODO move deps deeper in the tree if +# Move deps deeper in the tree if # pkgbase - dep1 # \ dep2 - dep1 # dep1 should be depth + 1 -# probably sed -i buildorder and increase dep's dep depth :D -# remember to change dir name from xxx_pkgbase to xxx+1_pkgbase egrep -q ";${_dep};" "${BUILDORDER}" && bury "${_dep}" ${NEXTDEPTH} # Ask toru where's a PKGBUILD -- cgit v1.2.3-2-g168b From f49a63724e56c11c5ee89561f573fff1b1d56506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 22 Sep 2012 00:20:15 -0300 Subject: Skip already built packages --- treepkg | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'treepkg') diff --git a/treepkg b/treepkg index 00ec0e0..8a243e4 100755 --- a/treepkg +++ b/treepkg @@ -194,6 +194,8 @@ if [ ${DEPTH} -eq 0 ]; then for _pkg in $(ls -r "${BUILDDIR}"); do # Ignore if there's no PKGBUILD if [ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]; then continue; fi +# Skip if already built (faster than calling is_build again) + if [ -f built_ok ]; then continue; fi ${VERBOSE} && msg "Building ${_pkg/_/ }" || true @@ -204,6 +206,8 @@ if [ ${DEPTH} -eq 0 ]; then ${FULLBUILDCMD} # Run local release hook with $1 = $repo ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) + + touch built_ok popd >/dev/null done -- cgit v1.2.3-2-g168b From 7c02d4480f87936ba1351299072704a3744ede1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 22 Sep 2012 05:07:54 -0300 Subject: Use PACMAN on FULLBUILDCMD --- treepkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index 8a243e4..5a8eae2 100755 --- a/treepkg +++ b/treepkg @@ -203,7 +203,8 @@ if [ ${DEPTH} -eq 0 ]; then pushd "${BUILDDIR}/${_pkg}" >/dev/null sudo pacman -Syu --noconfirm - ${FULLBUILDCMD} +# Pass the PACMAN env var to makepkg + PACMAN=$(dirname $0)/clean-pacman ${FULLBUILDCMD} # Run local release hook with $1 = $repo ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) -- cgit v1.2.3-2-g168b From 379cb6eb270b0b26ddddb9170c6dcd0f756d1de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 22 Sep 2012 05:08:26 -0300 Subject: Fix skip on built_ok --- treepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index 5a8eae2..8ba2add 100755 --- a/treepkg +++ b/treepkg @@ -195,7 +195,7 @@ if [ ${DEPTH} -eq 0 ]; then # Ignore if there's no PKGBUILD if [ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]; then continue; fi # Skip if already built (faster than calling is_build again) - if [ -f built_ok ]; then continue; fi + if [ -f "${BUILDDIR}/${_pkg}/built_ok" ]; then continue; fi ${VERBOSE} && msg "Building ${_pkg/_/ }" || true -- cgit v1.2.3-2-g168b From a323ff09d756dd06a559586467c84dbe78069060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= 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. --- treepkg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index 8ba2add..a22df71 100755 --- a/treepkg +++ b/treepkg @@ -203,8 +203,9 @@ if [ ${DEPTH} -eq 0 ]; then pushd "${BUILDDIR}/${_pkg}" >/dev/null sudo pacman -Syu --noconfirm -# Pass the PACMAN env var to makepkg - PACMAN=$(dirname $0)/clean-pacman ${FULLBUILDCMD} + ${HOOKPREBUILD} + + ${FULLBUILDCMD} # Run local release hook with $1 = $repo ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) -- cgit v1.2.3-2-g168b From 5863c70d969c4654e0ea99f7b68876bc4aa5770b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 29 Oct 2012 16:34:57 -0300 Subject: Run is_built against pkgnames When pkgbase isn't a valid pkgname, treepkg ended up deciding to build this non-existant package, regardless of packages already built. This commit fixes that by checking is_built against pkgnames instead. --- treepkg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'treepkg') diff --git a/treepkg b/treepkg index a22df71..fb7eed1 100755 --- a/treepkg +++ b/treepkg @@ -134,10 +134,12 @@ if ! ${BUILDNOW}; then touch "${BUILDORDER}" # If this package is already built quit silently - if is_built "${pkgbase}" "${fullver}"; then - add_order "ignore" - exit 0 - fi + for _pkg in ${pkgname[@]}; do + if is_built "${_pkg}" "${fullver}"; then + add_order "ignore" + exit 0 + fi + done # Ignore if already in build order egrep -q ";${pkgbase};" "${BUILDORDER}" && exit 0 -- cgit v1.2.3-2-g168b From 121e9ebb3caa4f6259960fb66c6ede0bbc875666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 3 Nov 2012 13:23:05 -0300 Subject: Set terminal title with libremessages' term_title() Useful for showing progress --- treepkg | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'treepkg') diff --git a/treepkg b/treepkg index fb7eed1..8c4cc8e 100755 --- a/treepkg +++ b/treepkg @@ -18,12 +18,15 @@ source /etc/libretools.conf source $XDG_CONFIG_HOME/libretools/libretools.conf >/dev/null 2>&1|| true +term_title "$(basename $0)" + # Get system variables source /etc/makepkg.conf source $HOME/makepkg.conf >/dev/null 2>&1|| true # End inmediately but print an useful message trap_exit() { + term_title "error!" error "($(basename $0)) $@ (leftovers on ${BUILDDIR})" exit 1 } @@ -201,6 +204,9 @@ if [ ${DEPTH} -eq 0 ]; then ${VERBOSE} && msg "Building ${_pkg/_/ }" || true +# Remove leading zeros and space if any + term_title "$(echo ${_pkg/_/ } | sed "s/^0\+ \?//")" + # Run build command pushd "${BUILDDIR}/${_pkg}" >/dev/null sudo pacman -Syu --noconfirm @@ -227,4 +233,5 @@ fi fi +term_title "done" exit $? -- cgit v1.2.3-2-g168b