summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-08-22 13:36:04 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-08-22 13:36:04 -0300
commit2dd17dbe005b9d87a1d629e8fb029ae10f493790 (patch)
tree83fcf1b2d1e7b9fe97cb4955bce7d1dac848deb4
parentb8d0640c2d882e514a583e372bb26280a60aa604 (diff)
parentb3b52d5c4a3cbcdeb505b099230107b830290e8e (diff)
Merge branch 'master' into newroot
Conflicts: treepkg
-rwxr-xr-xlibrerelease13
-rwxr-xr-xtoru-path5
-rwxr-xr-xtoru-utils5
-rwxr-xr-xtoru-where11
-rwxr-xr-xtreepkg18
5 files changed, 29 insertions, 23 deletions
diff --git a/librerelease b/librerelease
index c113572..c4d97c1 100755
--- a/librerelease
+++ b/librerelease
@@ -66,8 +66,6 @@ function sign_packages {
if ! gpg --quiet --verify "${package}${SIGEXT}" >/dev/null 2>&1; then
error "Failed! Resigning..."
rm -f "${package}${SIGEXT}"
- else
- continue
fi
fi
@@ -91,7 +89,7 @@ function clean_non_packages {
# Clean everything if not on dry-run mode
function clean {
[ -z ${dryrun} ] && \
- find ${WORKDIR}/staging/ -type f -delete
+ rm -f $@
}
if [ -w / ]; then
@@ -116,7 +114,7 @@ clean_non_packages
if [ ! -z "${SIGID}" ]; then
sign_packages
else
- error "Package signing is *required*"
+ error "Package signing is *required*, please set SIGID on your libretools.conf"
exit 1
fi
@@ -126,6 +124,9 @@ fi
find ${WORKDIR}/staging -type f -exec chmod 644 {} \;
find ${WORKDIR}/staging -type d -exec chmod 755 {} \;
+# Get the synced files
+SYNCED_FILES=($(find ${WORKDIR}/staging -type f))
+
msg "Uploading packages..."
rsync --recursive \
${dryrun} \
@@ -144,8 +145,8 @@ rsync --recursive \
exit 1
}
-msg "Removing packages from local [staging]"
-clean
+msg "Removing ${#SYNCED_FILES[@]} files from local [staging]"
+clean ${SYNCED_FILES[@]}
msg "Running db-update on repos"
ssh ${PARABOLAHOST} dbscripts/db-update
diff --git a/toru-path b/toru-path
index 5065a30..9bfc3ff 100755
--- a/toru-path
+++ b/toru-path
@@ -2,6 +2,11 @@
source $(dirname $(command -v $0))/toru-utils
+if [ ! -w "$TORUPATH" ]; then
+ error "Toru's path isn't writable. Please check $TORUPATH"
+ exit 1
+fi
+
LASTSYNCFILE=${TORUPATH}/lastsync.paths
# TODO pass other paths via flags
diff --git a/toru-utils b/toru-utils
index 0818aa6..c0918ae 100755
--- a/toru-utils
+++ b/toru-utils
@@ -5,11 +5,6 @@
source /etc/abs.conf
source /etc/libretools.conf
-if [ ! -w "$TORUPATH" ]; then
- error "Toru's path isn't writable. Please check $TORUPATH"
- exit 1
-fi
-
LASTSYNCFILE=${TORUPATH}/lastsync
FORCE=false
QUIET=false
diff --git a/toru-where b/toru-where
new file mode 100755
index 0000000..02a7a88
--- /dev/null
+++ b/toru-where
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Locates a PKGBUILD dir on toru's path cache
+
+source $(dirname $(command -v $0))/toru-utils
+
+# 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 $?
diff --git a/treepkg b/treepkg
index d05f05e..00ec0e0 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}")"
}
@@ -166,11 +157,14 @@ if ! ${BUILDNOW}; then
# NOTE: getting depends from package() is a PITA
for _dep in ${deps[@]}; do
-# Move the dependency one step deeper in the tree if we were going to build it before
+# Move deps deeper in the tree if
+# pkgbase - dep1
+# \ dep2 - dep1
+# dep1 should be depth + 1
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