summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlibremessages6
-rw-r--r--libretools.conf6
-rwxr-xr-xtoru-info28
-rwxr-xr-xtoru-path29
-rwxr-xr-xtoru-utils2
-rwxr-xr-xtoru-where10
-rwxr-xr-xtreepkg17
-rwxr-xr-xupdate-cleansystem9
8 files changed, 80 insertions, 27 deletions
diff --git a/libremessages b/libremessages
index 5d817dd..68badb8 100755
--- a/libremessages
+++ b/libremessages
@@ -86,6 +86,12 @@ stat_done() {
printf "${BOLD}done${ALL_OFF}\n" >&2
}
+# Set the terminal title
+# TODO test on several terms - it works on screen/tmux
+term_title() {
+ printf "\033k%s\033\\" "$@"
+}
+
# usage : in_array( $needle, $haystack )
in_array() {
[[ $2 ]] || return 1 # Not found
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-info b/toru-info
new file mode 100755
index 0000000..523f682
--- /dev/null
+++ b/toru-info
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Prints info about a given pkgname
+source /etc/libretools.conf
+
+for _pkg in $@; do
+ _pkgbuild="$(toru-where $_pkg)"
+
+ if [ -f "$_pkgbuild/PKGBUILD" ]; then
+ source "$_pkgbuild/PKGBUILD" 2>/dev/null || {
+ warning "Errors on %s" $_pkg
+ continue
+ }
+
+ deps="${depends[@]} ${makedepends[@]} ${checkdepends[@]}"
+ repo="$(basename $(dirname "$_pkgbuild"))"
+
+ unset build package depends makedepends checkdepends optdepends source md5sums
+
+ msg "%s/%s %s-%s" $repo $_pkg $pkgver $pkgrel
+ msg2 "$pkgdesc"
+ msg2 "$url"
+ msg2 "Depends: ${deps}"
+ else
+ warning "%s doesn't exist" $_pkg
+ fi
+
+ unset pkgname pkgver pkgrel pkgdesc url
+done
diff --git a/toru-path b/toru-path
index 9bfc3ff..957f49b 100755
--- a/toru-path
+++ b/toru-path
@@ -2,22 +2,35 @@
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"
exit 1
fi
LASTSYNCFILE=${TORUPATH}/lastsync.paths
+PATHFILE=${TORUPATH}/paths.tch
+
+if [ ! -e "${PATHFILE}" ]; then
+ tcamgr create "${PATHFILE}"
+fi
# TODO pass other paths via flags
-pkgbuilds=($(get_pkgbuilds ${ABSROOT}))
-paths=()
+# ABSROOT has trailing slash
+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"
msg2 "${#pkgbuilds[@]} PKGBUILDs to update"
for _pkgbuild in ${pkgbuilds[@]}; do
- $DEBUG && plain "$_pkgbuild"
- source ${_pkgbuild} || {
+# plain "$_pkgbuild"
+ source ${_pkgbuild} >/dev/null 2>&1 || {
error "${_pkgbuild} contains errors, skipping"
continue
}
@@ -25,15 +38,11 @@ for _pkgbuild in ${pkgbuilds[@]}; do
fullpath=$(dirname ${_pkgbuild})
for _pkg in ${pkgbase} ${pkgname[@]} ${provides[@]}; do
- paths+=(${_pkg/[<>=]*}:${fullpath})
+ $VERBOSE && msg2 "${_pkg} -> ${fullpath}"
+ tcamgr put ${PATHFILE} ${_pkg/[<>=]*} ${fullpath}
done
unset pkgbase pkgname provides
done
-
-# TODO remove old paths
-# by joining new paths to old paths and exclude the joining points from the
-# cache (sort of a sql join)
-echo ${paths[@]} | tr ' ' "\n" | sort >> ${TORUPATH}/paths
lastsync ${LASTSYNCFILE}
diff --git a/toru-utils b/toru-utils
index c0918ae..316e6b8 100755
--- a/toru-utils
+++ b/toru-utils
@@ -1,6 +1,4 @@
#!/bin/bash
-#!/bin/bash
-
source /etc/abs.conf
source /etc/libretools.conf
diff --git a/toru-where b/toru-where
index 02a7a88..e9ab29d 100755
--- a/toru-where
+++ b/toru-where
@@ -1,11 +1,7 @@
#!/bin/bash
# Locates a PKGBUILD dir on toru's path cache
+source /etc/libretools.conf
-source $(dirname $(command -v $0))/toru-utils
+PATHFILE=${TORUPATH}/paths.tch
-# Look in all cached but pick the last one
-grep "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \
- tail -n1 2>/dev/null|\
- cut -d: -f2 2>/dev/null
-
-exit $?
+tcamgr get ${PATHFILE} $1 2>/dev/null || echo ""
diff --git a/treepkg b/treepkg
index a22df71..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
}
@@ -134,10 +137,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
@@ -199,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
@@ -225,4 +233,5 @@ fi
fi
+term_title "done"
exit $?
diff --git a/update-cleansystem b/update-cleansystem
index 7c652ab..6bec742 100755
--- a/update-cleansystem
+++ b/update-cleansystem
@@ -3,6 +3,7 @@
# Creates a fake Parabola root and writes to cleansystem all
# packages installable from base and base-devel plus extras.
+set -e
# Copyright 2012 Nicolás Reynolds, Luke Shumaker
# ---------- GNU General Public License 3 ----------
@@ -59,5 +60,9 @@ pacman -b "${db_dir}" --config /etc/pacman.conf -Sy 2>/dev/null
pacman -b "${db_dir}" \
--config /etc/pacman.conf \
-Sp --print-format "%n" \
- base base-devel sudo "$@" | sort > "$cleansystem"
-pacman -Sy --needed --noconfirm base base-devel sudo "$@"
+ base base-devel sudo $@ | sort > "$cleansystem"
+
+# Ensures everything's installed
+pacman -Sy --needed --noconfirm base base-devel sudo $@
+
+exit $?