summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfullpkg11
-rw-r--r--mips64el/mips-add1
-rw-r--r--mips64el/mips64el.conf2
-rwxr-xr-xpkgbuild-check-nonfree11
-rwxr-xr-xprtools/prfullpkg15
-rwxr-xr-xtoru2
6 files changed, 21 insertions, 21 deletions
diff --git a/fullpkg b/fullpkg
index 43f780d..6fb580c 100755
--- a/fullpkg
+++ b/fullpkg
@@ -1,4 +1,5 @@
#!/bin/bash
+# set -x # uncomment for debug
# Builds packages from ABS recursively. It tries to find dependencies that
# aren't built or need update and then makepkg them in order.
@@ -31,7 +32,6 @@ usage() {
echo " -a absdir : set absdir as ABSROOT."
echo " -b build_dir : use a fullpkg build_dir and only build."
echo " -c : check deps only, do not build."
- echo " -C : cleanup the build_dir."
echo " -d build_dir : use this dir to build. Defaults to mktemp."
echo " -n : don't update pacman db."
echo " -m max_level : check deps until this level"
@@ -86,6 +86,7 @@ find_deps() {
local repo=${repo:-$(guess_repo)}
local pkgbase=${pkgbase:-${pkgname[0]}}
+# Provide a default 0 to epoch
local epoch=${epoch:-0}
local fullver=$(get_fullver ${epoch} ${pkgver} ${pkgrel})
@@ -305,7 +306,7 @@ while getopts 'ha:b:cCd:l:nm:r:' arg; do
esac
done
-if [ ! ${build_only} ]; then
+if [[ ! ${build_only} ]]; then
# Check if we are actually on a build directory. Do this early.
if [ ! -r PKGBUILD ]; then
@@ -336,14 +337,14 @@ if [ $level -eq 0 ]; then
touch ${build_dir}/{log,BUILDORDER} ${ban_file}
buildorder=${build_dir}/BUILDORDER
- if [ ! ${noupdate} ]; then
+ if ! (( noupdate )); then
msg "Updating pacman db and packages"
sudo pacman -Syu --noconfirm || true
fi
- if [ ${build_only} ]; then
+ if (( build_only )); then
msg "Build Packages"
@@ -375,7 +376,7 @@ find_deps || {
}
# only build on level 0
-[ $check_deps_only = true -o $level -gt 0 ] && exit 0
+$( (( check_deps_only )) || [ $level -gt 0 ] ) && exit 0
msg "Building packages:"
diff --git a/mips64el/mips-add b/mips64el/mips-add
index 0d4e494..da9b431 100644
--- a/mips64el/mips-add
+++ b/mips64el/mips-add
@@ -1,4 +1,5 @@
#!/bin/bash
+source /etc/libretools.conf
if ! grep mips64el PKGBUILD >/dev/null; then # Add mips64el in ${arch} array if it isn't 'any'
warning "Adding mips64el arch"
sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" "PKGBUILD"
diff --git a/mips64el/mips64el.conf b/mips64el/mips64el.conf
index 48674b2..0825fad 100644
--- a/mips64el/mips64el.conf
+++ b/mips64el/mips64el.conf
@@ -2,7 +2,7 @@
## Run a command for PKGBUILD modifications before building
## Like adding 'mips64el' to arch if it's not there
-HOOKPKGBUILDMOD="mipsadd"
+HOOKPKGBUILDMOD="mips-add"
## Run a command for local releasing of packages
# Useful for mass packaging (ie. mips port)
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree
index b7c1237..55976a8 100755
--- a/pkgbuild-check-nonfree
+++ b/pkgbuild-check-nonfree
@@ -33,6 +33,7 @@ function in_array { # usage : in_array( $needle, $haystack )
function get_blacklist { # Download the blacklist.
+ pushd $XDG_CONFIG_HOME/libretools/ >/dev/null
msg "Downloading the blacklist of proprietary software packages."
wget -N -q -O blacklist.txt "${BLACKLIST}" 2>/dev/null || {
[ -e $XDG_CONFIG_HOME/libretools/blacklist.txt ] || {
@@ -41,6 +42,7 @@ function get_blacklist { # Download the blacklist.
}
warning "Using local copy of blacklist"
}
+ popd > /dev/null
}
function check_deps { # Check wheter a package depends on non-free
@@ -68,15 +70,11 @@ function check_deps { # Check wheter a package depends on non-free
fi
fi
done
-
- return $ev
}
source /etc/libretools.conf
-if [ -z $XDG_CONFIG_HOME ]; then # Avoid /libretools dir doesn't exist errors
- error "There's no XDG_CONFIG_HOME var set"; exit 1
-elif [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
+if [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
source $XDG_CONFIG_HOME/libretools/libretools.conf
fi
@@ -98,5 +96,4 @@ get_blacklist
check_deps
-exit $?
-
+exit $ev
diff --git a/prtools/prfullpkg b/prtools/prfullpkg
index e3a022b..dd2ba3a 100755
--- a/prtools/prfullpkg
+++ b/prtools/prfullpkg
@@ -67,11 +67,13 @@ function get_fullver { # return : full version spec, including epoch (if necessa
function cleanup { # Cleans the build_dir.
- [[ "${do_cleanup}" = "n" || ! -d ${build_dir} ]] && return 0 # Do nothing or already cleaned.
+ [ ! -d "${build_dir}" -o "${build_only}" = 'y' ] && return 0 # Do nothing or already cleaned.
- msg "Cleaning up..."
- [ $level -eq 0 ] && rm -rf $build_dir/* # Only do cleanup on level 0.
+ if [ $level -eq 0 ]; then # Only do cleanup on level 0.
+ msg "Cleaning up ${build_dir}"
+ rm -rf "$build_dir/*"
+ fi
}
function find_deps { # Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated.
@@ -166,7 +168,7 @@ function find_deps { # Checks ABSROOT and look for target pkg deps. Adds them i
unset next_level dir
# unset PKGBUILD variables
- unset pkgname pkgver pkgrel epoch pkgdesc arch url license groups depends \
+ unset pkgbase pkgname pkgver pkgrel epoch pkgdesc arch url license groups depends \
makedepens checkdepends optdepends provides conflicts replaces backup \
options install changelog source noextract md5sums build check package
}
@@ -264,7 +266,6 @@ function trap_exit { # End inmediately but print a useful message
# Trap signals from makepkg
set -E
-trap 'cleanup' 0
trap 'trap_exit "(prfullpkg:${level}) TERM signal caught. Exiting..."' TERM HUP QUIT
trap 'trap_exit "(prfullpkg:${level}) Aborted by user! Exiting..."' INT
trap 'trap_exit "(prfullpkg:${level}) An unknown error has occurred. Exiting..."' ERR
@@ -314,14 +315,14 @@ fi
if [ $level -eq 0 ]; then
- build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)} # use -d option or else mktemp
-
if [ ! -d ${build_dir} ]; then # in case of custom -d option
mkdir -p ${build_dir}
else
cleanup # files already there can screw find_deps
fi
+ build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)} # use -d option or else mktemp
+
touch ${build_dir}/{log,BUILDORDER} ${ban_file} # make files for log and buildorder
buildorder=${build_dir}/BUILDORDER
diff --git a/toru b/toru
index 153d825..a9f0be7 100755
--- a/toru
+++ b/toru
@@ -50,7 +50,7 @@ lastsync() {
# Saves contents on a named cache
# $1 cache name (repo)
# $2+ contents
-store_cache() {
+function store_cache {
cache=$1; shift
[ -z "$cache" ] && return 1