summaryrefslogtreecommitdiff
path: root/fullpkg
diff options
context:
space:
mode:
Diffstat (limited to 'fullpkg')
-rwxr-xr-xfullpkg34
1 files changed, 15 insertions, 19 deletions
diff --git a/fullpkg b/fullpkg
index c25ed85..cae91da 100755
--- a/fullpkg
+++ b/fullpkg
@@ -11,7 +11,7 @@ if [ -z $XDG_CONFIG_HOME ]; then
error "There's no XDG_CONFIG_HOME var set"
exit 1
fi
-# set and ban_file
+# set ban_file
[ -e $XDG_CONFIG_HOME/libretools/libretools.conf ] && \
source $XDG_CONFIG_HOME/libretools/libretools.conf
ban_file=$XDG_CONFIG_HOME/libretools/ban
@@ -35,6 +35,7 @@ function usage {
echo " -m max_level : check deps until this level"
echo " -r \"command\" : use this instead of \"$FULLBUILDCMD\""
echo
+ exit 1
}
## Build order management ##
@@ -58,12 +59,12 @@ guess_repo() {
# return : full version spec, including epoch (if necessary), pkgver, pkgrel
##
get_full_version() {
- if [[ $1 -eq 0 ]]; then
- # zero epoch case, don't include it in version
- echo $2-$3
- else
- echo $1:$2-$3
- fi
+ if [[ $1 -eq 0 ]]; then
+ # zero epoch case, don't include it in version
+ echo $2-$3
+ else
+ echo $1:$2-$3
+ fi
}
# Usage: cleanup [ $(basename $PWD) ] from PKGBUILD dir
@@ -89,7 +90,6 @@ function find_deps {
local fullver=$(get_full_version ${epoch} ${pkgver} ${pkgrel})
# If package and correct ${fullver} is built exit
-# TODO?: If this package is in force_build: skip this step
if is_built "${pkgbase}>=${fullver}"; then
exit 0
fi
@@ -121,9 +121,6 @@ function find_deps {
# Increase build level
declare -i next_level=$level+1
-# Pass the offline flag to children
- [[ "$OFFLINE" -eq true ]]
-
for _dep in ${deps[@]}; do
for _repo in ${REPOS[@]}; do
# try to find $_dep on each repo from dirname
@@ -136,10 +133,12 @@ function find_deps {
[ $? -eq 20 ] && return 20
popd > /dev/null
break 1 # found, go to next dep
-
+ fi
+ done
# if search pkgname in repo doesn't work
# this should find pkgsplits
- elif _dir=($(find "$ABSROOT/${_repo}" -type f -name PKGBUILD -print0 2>/dev/null | \
+ for _repo in ${REPOS[@]}; do
+ if _dir=($(find "$ABSROOT/${_repo}" -type f -name PKGBUILD -print0 2>/dev/null | \
"xargs" -0 -e grep -HEw "pkgname=|pkgbase=|provides=" | grep -w "$_dep" 2>&1));
then
_dir=$(dirname $(echo $_dir | cut -d: -f1))
@@ -150,7 +149,6 @@ function find_deps {
[ $? -eq 20 ] && return 20
popd > /dev/null
break 1 # found, go to next dep
-
else
echo "dep_not_found:$_dep:$_repo" >> $build_dir/log
fi
@@ -278,15 +276,14 @@ check_deps_only='n'
do_cleanup='n'
max_level=21
OFFLINE=false
-while getopts 'ha:b:cCd:l:nm:r:o' arg; do
+while getopts 'ha:b:cCd:l:nm:r:' arg; do
case $arg in
- h) usage; exit 0 ;;
+ h) usage ;;
a) ABSROOT="$OPTARG" ;;
b) build_only='y'
build_dir="$OPTARG"
[ -z ${build_dir} ] && {
usage
- exit 1
}
[ ! -r ${build_dir}/BUILDORDER ] && {
error "${build_dir}/BUILDORDER doesn't exist."
@@ -301,7 +298,6 @@ while getopts 'ha:b:cCd:l:nm:r:o' arg; do
n) noupdate='y';;
m) max_level=$OPTARG ;;
r) FULLBUILDCMD="$OPTARG" ;;
- o) OFFLINE=true ;;
esac
done
@@ -312,7 +308,7 @@ if [ ${build_only} == 'n' ]; then
[ ! -r PKGBUILD ] && {
error "This isn't a build directory"
- usage && exit 1
+ usage
}
# Add mips64el if missing from arch=() and it isn't an 'any' package