summaryrefslogtreecommitdiff
path: root/fullpkg
diff options
context:
space:
mode:
Diffstat (limited to 'fullpkg')
-rwxr-xr-xfullpkg43
1 files changed, 26 insertions, 17 deletions
diff --git a/fullpkg b/fullpkg
index 14c4e9f..f281df3 100755
--- a/fullpkg
+++ b/fullpkg
@@ -10,7 +10,7 @@ source /usr/bin/libremessages
[ -r $XDG_CONFIG_HOME/libretools/libretools.conf ] && \
source $XDG_CONFIG_HOME/libretools/libretools.conf
-## START FUNCTIONS ##
+##### START FUNCTIONS #####
function usage {
echo "cd to a dir containing a PKGBUILD and run:"
@@ -67,7 +67,7 @@ update_queue() {
remove_queue() {
get_queue
- grep -vw "^$(basename $PWD)" $queue_file > $queue_file.2
+ grep -Evw "^$(basename $PWD)" $queue_file > $queue_file.2
mv $queue_file.2 $queue_file
put_queue && return 0 || return $?
@@ -161,11 +161,12 @@ function find_deps {
# if search pkgname in repo doesn't work
# this should find pkgsplits
- elif _dir=($(find "$ABSROOT/${_repo}" -type f -name PKGBUILD -print0 | \
- "xargs" -0 -e grep -HEw "pkgname=|pkgbase=|provides=" | grep $_dep 2>&1));
+ elif _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))
plain "guess for $_dep -> $_dir"
- pushd $(dirname $(echo $_dir | cut -d: -f1)) > /dev/null
+ pushd $_dir > /dev/null
$0 -c -d ${build_dir} -l ${next_level}
# Circular deps must fail
[ $? -eq 20 ] && return 20
@@ -237,20 +238,28 @@ function _pkg_build () {
# this buildcmd is on libretools.conf
$FULLBUILDCMD; r=$?
case $r in
- 0) plain "The build was succesful."
- source .INFO && [ -n $repo ] && {
- librestage $repo || {
- echo "unstaged:$(basename $PWD)" >> $build_dir/log
+###### Succesfull Build ######
+ 0)
+ plain "The build was succesful."
+ source .INFO && [ -n $repo ] && {
+# Release locally
+ mipsrelease *.pkg.tar.?z
+
+# Stage for releasing
+ librestage $repo || {
+ echo "unstaged:$(basename $PWD)" >> $build_dir/log
+ }
+
+ msg "Updating pacman db and packages"
+ sudo pacman -Syu --noconfirm
}
- }
- echo "built:$(basename $PWD)" >> $build_dir/log
- cleanup "$(basename $PWD)"
- ;;
- 1) error "There were errors while trying to build the package."
- echo "failed:$(basename $PWD)" >> $build_dir/log
+ echo "built:$(basename $PWD)" >> $build_dir/log
+ cleanup "$(basename $PWD)"
;;
- 2) error "The build failed."
- echo "failed:$(basename $PWD)" >> $build_dir/log
+###### Failed Build ######
+ *)
+ error "There were errors while trying to build the package."
+ echo "failed:$(basename $PWD)" >> $build_dir/log
;;
esac