summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-12-28 01:23:53 -0600
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-12-28 01:23:53 -0600
commitaf6ac6ea9ef779c0f88fd456e8d73636f22773ce (patch)
treefed9d8e8d6340fedce713604ed5ebff2745c18bd
parentfa0b7b6f8e45982f1e2317c386ef0cf49ee840c7 (diff)
fullpkg: split in fullpkg-find and fullpkg-build
fullpkg-build: build, download and custom command on <build_dir> fullpkg-find: create a build_dir or append new building instruction libretools-mips64el: deprecation process pkgbuild-check-nonfree: minor bug corrected
-rwxr-xr-xfullpkg375
-rwxr-xr-xfullpkg-build211
-rw-r--r--fullpkg-find194
-rw-r--r--libretools.conf24
-rw-r--r--mips64el/mips64el.conf4
-rwxr-xr-xpkgbuild-check-nonfree8
6 files changed, 433 insertions, 383 deletions
diff --git a/fullpkg b/fullpkg
index bd2e8ae..fe74432 100755
--- a/fullpkg
+++ b/fullpkg
@@ -3,383 +3,30 @@
# Builds packages from ABS recursively. It tries to find dependencies that
# aren't built or need update and then makepkg them in order.
-# TODO move __build to chroot
-
-source /etc/makepkg.conf
-source /etc/abs.conf
-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
-
- source $XDG_CONFIG_HOME/libretools/libretools.conf
-
-fi
-
usage() {
echo "cd to a dir containing a PKGBUILD and run:"
- echo "$0 [options]"
- printf "This script will check dependencies, build them if possible "
- printf "and stage the packages on it's repo."
- echo
+ echo "$0 [build_dir]"
+ echo ""
+ echo "This script will check dependencies, build them if possible "
+ echo "and stage the packages on it's repo."
+ echo ""
echo "OPTIONS:"
echo " -h : this message."
- 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 " -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"
- echo " -r \"command\" : use this instead of \"$FULLBUILDCMD\""
- echo
+ echo ""
+ echo "Wrapper for \`fullpkg-find' and \`fullpkg-build'"
exit 1
}
-# Removes a package from the buildorder
-# $1 package name
-# $2 buildorder file
-remove_buildorder() {
- grep -Evw "${1}" ${2} > ${2}2
- mv -f ${2}2 ${2}
-
- return $?
-}
-
-# Get repo name. Asumes ${ABSROOT}/repo/package/PKGBUILD
-guess_repo() {
- basename $(dirname $(pwd))
-}
-
-# return : full version spec, including epoch (if necessary), pkgver, pkgrel
-# usage : get_fullver( ${epoch:-0}, $pkgver, $pkgrel )
-get_fullver() {
- if [[ $1 -eq 0 ]]; then
-# zero epoch case, don't include it in version
- echo $2-$3
- else
- echo $1:$2-$3
- fi
-
-}
-
-# Cleans the build_dir.
-cleanup() {
-# Do nothing or already cleaned.
- [[ "${do_cleanup}" = false || ! -d ${build_dir} ]] && return 0
-
-# Only do cleanup on level 0.
- msg "Cleaning up..."
- [ $level -eq 0 ] && rm -rf $build_dir/
-
-}
-
-# Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated.
-find_deps() {
-# Check this level
- source PKGBUILD
-
-# unset PKGBUILD variables
- unset pkgdesc url license groups optdepends provides conflicts replaces \
- backup options install changelog source noextract md5sums build \
- check package
- for _pkg in ${pkgname[@]}; do
- unset package_${_pkg} >/dev/null 2>&1
- done
-
- 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})
-
-# Check if the package is already built
- if is_built "${pkgbase}>=${fullver}"; then
-# pkg is built and updated
- exit 0
- fi
-
-# greater levels are built first
- echo "${level}:${pkgbase}" >>"${build_dir}/BUILDORDER"
-# PKGBUILD is already there
- if [ -d "${build_dir}/${pkgbase}" ]; then
- exit 0
-# Copy dir to build_dir
- else
- cp -r ../${pkgbase}/ ${build_dir}/
-
-# to identify repo later
- echo "repo=$repo" > "${build_dir}/${pkgbase}/.INFO"
- fi
-
-# current package plus a space for every level
- msg2 "%${level}s${pkgbase}-${fullver}"
-
-## Check next levels
- declare -i next_level=$level+1
-
-# All deps in separate line, only once, without version.
- deps=($(echo "${depends[@]} ${makedepends[@]}" | \
- sed "s/[=<>]\+[^ ]\+//g" | \
- tr ' ' "\n" | \
- sort -u))
-
- for _dep in ${deps[@]}; do
-
- local found=false
- local pkgdir=$(toru -p ${_dep})
-
- if [ -n "$pkgdir" -a -d "${pkgdir}" ]; then
- found=true
-
- pushd "${pkgdir}" > /dev/null
-# runs itself on dep's PKGBUILD dir
- $0 -c -d ${build_dir} -l ${next_level}
-
-# probable circular deps
- [ $? -eq 20 ] && return 20
- popd > /dev/null
- fi
-
- if ! (( found )); then
- echo "dep_not_found:$_dep" >>$build_dir/log
- fi
-
- done
-
-## End variable block
-
- unset next_level dir
-}
-
-__build() {
- pushd ${build_dir} >/dev/null
-
-# greater levels must be built first
- build_packages=($(sort -gr $buildorder | cut -d: -f2))
-
- while [ ${#build_packages[@]} -ge 1 ]; do
- pushd $build_dir/${build_packages[0]} >/dev/null
- source PKGBUILD
-
- msg2 "${pkgbase:-${pkgname[0]}} $pkgver-$pkgrel"
-
- msg2 "Checking for non free deps"
- pkgbuild-check-nonfree || {
-# this error means nonfree others means fail.
- if [ $? -eq 15 ]; then
-
- echo "nonfree:$(basename $PWD)" >>$build_dir/log
-
-# take out package from $buildorder
- remove_buildorder "$(basename $PWD)" $buildorder
-
-# build next package
- continue
- fi
- }
-
- msg2 "Building $(basename $PWD)"
-
-# this buildcmd is on libretools.conf
- $FULLBUILDCMD; r=$?
-
- case $r in
-
-## Succesfull build
- 0)
-
- plain "The build was succesful."
- if source .INFO && [ -n $repo ]; then
-
-# Calls a local release script if it's used
- if [ ! -z $HOOKLOCALRELEASE ]; then
- find -name "*.pkg.tar.?z" -print0 | xargs -0 $HOOKLOCALRELEASE $repo
- fi
-
- librestage $repo || echo "unstaged:$(basename $PWD)" >>$build_dir/log
-
- msg "Updating pacman db and packages"
- sudo pacman -Sy || true
-
- fi
-
- echo "built:$(basename $PWD)" >>$build_dir/log
- ;;
-
-# # Build failed
- *)
- error "There were errors while trying to build the package."
- echo "failed:$(basename $PWD)" >>$build_dir/log
- ;;
- esac
-
- remove_buildorder "${build_packages[0]}" $buildorder || true
-
-# which is next package?
- build_packages=($(sort -gr $buildorder | cut -d: -f2))
- popd > /dev/null
- done
-
- pkgs=($(grep "nonfree:" $build_dir/log)) && {
- error "Those packages contain nonfree deps:"
- echo ${pkgs[@]} | tr " " "\n" | cut -d: -f2
- }
-
- pkgs=($(grep "built:" $build_dir/log)) && {
- msg "Those packages were built and staged:"
- echo ${pkgs[@]} | tr " " "\n" | cut -d: -f2
- }
-
- pkgs=($(grep "failed:" $build_dir/log)) && {
- error "Those packages failed to build:"
- echo ${pkgs[@]} | tr " " "\n" | cut -d: -f2
- }
-
- pkgs=($(grep "unstaged:" $build_dir/log)) && {
- error "Those packages couldn't be staged because of missing reponame:"
- echo ${pkgs[@]} | tr " " "\n" | cut -d: -f2
- }
-
- popd >/dev/null
-}
-
-# End inmediately but print a useful message
-trap_exit() {
- error "$@"
- warning "Leftover files left on $build_dir"
-
- exit 1
-}
-
-# 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
-
-force_build=""
-level=0
-noupdate=false
-build_only=false
-check_deps_only=false
-do_cleanup=false
-max_level=21
-
-while getopts 'ha:b:cCd:l:nm:r:' arg; do
- case $arg in
+while getopts 'haA:l:nm:' arg; do
+ case "$arg" in
h) usage ;;
- a) ABSROOT="$OPTARG" ;;
- b) build_only=true
- build_dir="$OPTARG"
-
- if [ -z "${build_dir}" ]; then
- usage
- fi
-
- if [ ! -r "${build_dir}/BUILDORDER" ] ; then
- error "${build_dir}/BUILDORDER doesn't exist."
- exit 1
- fi
-
- ;;
- c) check_deps_only=true ;;
- C) do_cleanup=true;;
- d) build_dir="$OPTARG" ;;
-# hidden option to know dep level.
- l) level=$OPTARG ;;
- n) noupdate=true;;
- m) max_level=$OPTARG ;;
- r) FULLBUILDCMD="$OPTARG" ;;
esac
done
-if ! $build_only; then
-
-# Check if we are actually on a build directory. Do this early.
- if [ ! -r PKGBUILD ]; then
- error "This isn't a build directory"
- usage
- fi
-
-# Run the pre build hook
- if [ ! -z "${HOOKPKGBUILDMOD}" ]; then
- ${HOOKPKGBUILDMOD}
- fi
-
-fi
-
-if [ ${level} -eq 0 ]; then
-
-# use -d option or else mktemp
- build_dir="${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)}"
-
-# in case of custom -d option
- if [ ! -d "${build_dir}" ]; then
- mkdir -p "${build_dir}"
- else
-# files already there can screw find_deps
- cleanup
- fi
-
-# make files for log and buildorder
- touch "${build_dir}"/{log,BUILDORDER}
- buildorder="${build_dir}/BUILDORDER"
-
- if ! noupdate; then
-
- msg "Updating pacman db"
- sudo pacman -Sy --noconfirm || true
-
- fi
-
- if $build_only; then
-
- msg "Building Packages"
-
- __build
-
- exit 0
-
- fi
-
- msg "Checking dependencies"
-fi
-
-# Probable circular deps
-[ $level -ge $max_level ] && exit 20
-
-# Find the dependencies on the ABS itself
-find_deps || {
-
-# Probable circular deps
- if [ $? -eq 20 ]; then
-
-# Show error only on level 0
- if [ $level -eq 0 ]; then
- error "Check for circular deps on $build_dir/BUILDORDER";
- fi
-
- fi
-# Pass message 20
- exit 20
-}
-
-# only build on level 0
-if (( check_deps_only )) || [ $level -gt 0 ]; then
- exit 0
-fi
-
-# Build the packages
-msg "Building packages:"
-__build
+shift $(( OPTIND - 1 ))
-echo
-msg2 "Check if your system works fine and librerelease if it does."
+fullpkg-find "$1" && fullpkg-build -N "$1"
exit 0
diff --git a/fullpkg-build b/fullpkg-build
new file mode 100755
index 0000000..b497db5
--- /dev/null
+++ b/fullpkg-build
@@ -0,0 +1,211 @@
+#!/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.
+
+# TODO move __build to chroot
+
+source /etc/makepkg.conf
+source /etc/libretools.conf
+
+if [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
+ source $XDG_CONFIG_HOME/libretools/libretools.conf
+fi
+
+
+## List packages on log that are on status
+## usage: list_pkgs <status> <message>
+#
+## status: nonfree, built, failed, unstaged
+list_pkgs() {
+ msg="$2"
+ local pkgs=($(grep "$1:" $build_dir/log)) && {
+ msg "$2"
+ echo ${pkgs[@]} | tr " " "\n" | cut -d: -f2
+ }
+}
+
+# return : full version spec, including epoch (if necessary), pkgver, pkgrel
+# usage : get_fullver( ${epoch:-0}, $pkgver, $pkgrel )
+get_fullver() {
+ if [[ $1 -eq 0 ]]; then
+# zero epoch case, don't include it in version
+ echo $2-$3
+ else
+ echo $1:$2-$3
+ fi
+
+}
+
+## Check all build_dir, fails if one PKGBUILD is nonfree
+check_nonfree() {
+ find "$build_dir" -name PKGBUILD \
+ -exec pkgbuild-check-nonfree {} +
+ if [ "$?" -eq 15 ]; then
+ error "Some PKGBUILD have nonfree problems"
+ exit 15
+ fi
+
+}
+
+# Removes a package from the buildorder
+# $1 package name
+# $2 buildorder file
+remove_buildorder() {
+ grep -Evw "${1}" ${2} > ${2}2
+ mv -f ${2}2 ${2}
+
+ return $?
+}
+
+succesfull_build() {
+
+ if [ "$RUN" != "$FULLBUILDCMD" ]; then
+ return 0 # Custom command or download sources
+ fi
+
+ if source .INFO && [ -n "$repo" ]; then
+
+ if [ ! -z "$HOOKLOCALRELEASE" ]; then
+ find -name "*.pkg.tar.?z" -print0 | xargs -0 "$HOOKLOCALRELEASE" "$repo"
+ fi
+
+ librestage $repo || echo "unstaged:$(basename $PWD)" >>$build_dir/log
+
+ msg "Updating pacman db and packages"
+ sudo pacman -Sy || true
+
+ fi
+
+ echo "built:$(basename $PWD)" >>$build_dir/log
+}
+
+build_description() {
+ list_pkgs "nonfree" "Those packages contain nonfree deps:"
+ list_pkgs "built" "Those packages were built and staged:"
+ list_pkgs "failed" "Those packages failed to build:"
+ list_pkgs "unstaged" "Those packages couldn't be staged (missing reponame):"
+}
+
+__build() {
+ pushd ${build_dir} >/dev/null
+
+ build_packages=($(sort -gr $buildorder | cut -d: -f2)) # greater levels must be built first
+
+ while [ ${#build_packages[@]} -ge 1 ]; do
+
+ pushd "$build_dir/${build_packages[0]}" >/dev/null
+
+ if [ -n "${HOOKPKGBUILDMOD}" ]; then
+ ${HOOKPKGBUILDMOD} || true
+ fi
+
+ eval "$RUN"; r=$?
+
+ case $r in
+
+ 0) succesfull_build ;;
+
+ *) error "There were errors while trying to build the package."
+ echo "failed:$(basename $PWD)" >>$build_dir/log
+ ;;
+ esac
+
+ remove_buildorder "${build_packages[0]}" $buildorder || true
+
+# which is next package?
+ build_packages=($(sort -gr $buildorder | cut -d: -f2))
+ popd > /dev/null
+ done
+
+ popd >/dev/null
+}
+
+# End inmediately but print a useful message
+trap_exit() {
+ error "$@"
+ warning "Leftover files left on $build_dir"
+ mv .BUILDORDER BUILDORDER
+ exit 1
+}
+
+# Trap signals from makepkg
+set -E
+trap 'trap_exit "(fullpkg-build) TERM signal caught. Exiting..."' TERM HUP QUIT
+trap 'trap_exit "(fullpkg-build) Aborted by user! Exiting..."' INT
+trap 'trap_exit "(fullpkg-build) An unknown error has occurred. Exiting..."' ERR
+
+CLEANUP="false"
+CHECKNONFREE="true"
+RUN="$FULLBUILDCMD"
+MESSAGE="Building packages"
+
+usage() {
+
+ echo ""
+ echo "$(basename $0) [options] <build_dir>"
+ echo ""
+ echo "Builds packages from build_dir, create a build_dir using:"
+ echo "'fullpkg-find <build_dir>'"
+ echo ""
+ echo "If no <build_dir> is specified, it uses the current directory."
+ echo ""
+ echo "OPTIONS:"
+ echo " -h : this message."
+ echo " -c : clean <build_dir> on succesfull build"
+ echo " -N : don't check for freedom issues." #Also made by fullpkg-find
+ echo " -r \"command\" : use this instead of \"$FULLBUILDCMD\"."
+ echo " -g : get sources for building packages on build_dir."
+ echo ""
+ exit 1
+
+}
+
+while getopts 'hNr:g' arg; do
+ case $arg in
+ h) usage ;;
+ c) CLEAN ;;
+ N) CHECKNONFREE="false" ;;
+ r) RUN="$OPTARG"
+ MESSAGE="Executing custom action";;
+ g) RUN='makepkg -g > /dev/null'
+ MESSAGE="Downloading packages";;
+ esac
+done
+
+shift $(( OPTIND - 1 ))
+build_dir="${1:-`pwd`}"
+buildorder="${build_dir}/BUILDORDER"
+
+if [ ! -e "$buildorder" ]; then
+ error "This is not a build_dir. Make one using fullpkg."
+ usage
+else
+# backup BUILDORDER
+ cp "$buildorder" "$build_dir/.BUILDORDER"
+fi
+
+if "$CHECKNONFREE"; then
+ check_nonfree
+fi
+
+if [ -z "$FULLBUILDCMD" ]; then
+ error "Set your FULLBUILDCMD on libretools.conf"
+fi
+
+msg "$MESSAGE"
+__build
+
+if [ "$RUN" != "$FULLBUILDCMD" ]; then
+ # Used for downloading or custom command
+ mv "$build_dir/.BUILDORDER" "$buildorder"
+ exit 0
+elif "$CLEANUP"; then
+ find "$build_dir" -mindepth 1 -delete
+fi
+
+build_description
+
+plain "Test packages on and if they work fine librerelease."
+
+exit 0
diff --git a/fullpkg-find b/fullpkg-find
new file mode 100644
index 0000000..25565ae
--- /dev/null
+++ b/fullpkg-find
@@ -0,0 +1,194 @@
+#!/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.
+
+# TODO: fullpkg-find should find packages wich depend on the
+# package to be build, so we can avoid "missing $name.so errors"
+
+# Get repo name. Asumes ${ABSROOT}/repo/package/PKGBUILD
+guess_repo() {
+ basename $(dirname $(pwd))
+}
+
+# return : full version spec, including epoch (if necessary), pkgver, pkgrel
+# usage : get_fullver( ${epoch:-0}, $pkgver, $pkgrel )
+get_fullver() {
+ if [[ $1 -eq 0 ]]; then
+# zero epoch case, don't include it in version
+ echo $2-$3
+ else
+ echo $1:$2-$3
+ fi
+
+}
+
+# Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated.
+find_deps() {
+# Check this level
+ source PKGBUILD
+
+ local repo="${repo:-$(guess_repo)}"
+ local pkgbase="${pkgbase:-${pkgname[0]}}"
+ local fullver="$(get_fullver ${epoch:-0} ${pkgver} ${pkgrel})"
+
+ if ! pkgbuild-check-nonfree > /dev/null 2> /dev/null; then
+ if [ "$?" -eq 15 ]; then
+ error "pkgbase" has nonfree issues
+ return 15
+ fi
+ fi
+
+ if is_built "${pkgbase}>=${fullver}"; then
+ exit 0 # pkg is built and updated
+ fi
+
+# greater levels are built first
+ echo "${LEVEL}:${pkgbase}" >>"$build_dir/BUILDORDER"
+# PKGBUILD is already there
+ if [ -d "${build_dir}/${pkgbase}" ]; then
+ exit 0
+# Copy dir to build_dir
+ else
+ cp -r ../${pkgbase}/ ${build_dir}/
+
+# to identify repo later
+ echo "repo=$repo" > "${build_dir}/${pkgbase}/.INFO"
+ fi
+
+# current package plus a space for every level
+ msg2 "%${LEVEL}s${pkgbase}-${fullver}"
+
+## Check next levels
+ declare -i next_level=$LEVEL+1
+
+# All deps in separate line, only once, without version.
+ deps=($(echo "${depends[@]} ${makedepends[@]}" | \
+ sed "s/[=<>]\+[^ ]\+//g" | \
+ tr ' ' "\n" | \
+ sort -u))
+
+ for _dep in ${deps[@]}; do
+
+ local found=false
+ local pkgdir=$(toru -p ${_dep})
+
+ if [ -n "$pkgdir" -a -d "${pkgdir}" ]; then
+ found=true
+
+ pushd "${pkgdir}" > /dev/null
+# runs itself on dep's PKGBUILD dir
+ $0 -l ${next_level} ${build_dir}
+
+# probable circular deps
+ [ $? -eq 20 ] && return 20
+ popd > /dev/null
+ fi
+
+ if ! (( found )); then
+ echo "dep_not_found:$_dep" >>$build_dir/log
+ fi
+
+ done
+
+## End variable block
+
+ unset next_level dir
+}
+
+source /etc/libretools.conf
+
+if [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
+ source $XDG_CONFIG_HOME/libretools/libretools.conf
+fi
+
+LEVEL=0
+MAXLEVEL=20
+CLEANFIRST='false'
+UPDATEDB='true'
+
+usage() {
+
+ echo ""
+ echo "cd to a dir containing a PKGBUILD and run:"
+ echo "$(basename $0) [options] <build_dir>"
+ echo ""
+ echo "This script will create a build_dir for recursive building"
+ echo "it tries to find dependencies that aren't built or need update."
+ echo ""
+ echo "If no <build_dir> is specified, the script works on a tempdir"
+ echo ""
+ echo "OPTIONS:"
+ echo " -h : this message."
+# echo " -A <absroot> : use this ABSROOT." # Is it needed anymore?
+ echo " -c : clean <build_dir> before working."
+ echo " -m <max_level> : check deps until this level"
+ echo " -n : don't update pacman db."
+ echo ""
+ exit 1
+
+}
+
+while getopts 'hA:l:cmn' arg; do
+ case "$arg" in
+ h) usage ;;
+# A) ABSROOT="$OPTARG" ;;
+ l) LEVEL="$OPTARG" ;; # hidden option to know dep level.
+ c) CLEANFIRST='true' ;;
+ m) MAXLEVEL="$OPTARG" ;;
+ n) UPDATEDB='false' ;;
+ esac
+done
+
+if [ ! -r PKGBUILD ]; then
+ error "This directory doesnt contain a PKGBUILD"
+ usage
+fi
+
+shift $(( OPTIND - 1 ))
+build_dir="${1}"
+
+if [ "$LEVEL" -eq 0 ]; then
+
+ build_dir="${1:-$(mktemp -d /tmp/fullpkg.XXXXXX)}"
+
+ if [ ! -d "$build_dir" ]; then
+ mkdir -p "$build_dir"
+ elif "$CLEANFIRST"; then
+ # Erase files already in dir
+ msg "Cleaning up files in dir"
+ find "$build_dir" -mindepth 1 -delete
+ fi
+
+ if "$UPDATEDB"; then
+ msg "Updating pacman db"
+ sudo pacman -Sy --noconfirm || true
+ fi
+
+# make files for log and buildorder
+ touch "${build_dir}"/{log,BUILDORDER}
+ buildorder="${build_dir}/BUILDORDER"
+
+ msg "Checking dependencies"
+fi
+
+# Probable circular deps
+[ "$LEVEL" -gt "$MAXLEVEL" ] && exit 20
+
+# Find the dependencies on the ABS itself
+find_deps || {
+
+# Probable circular deps
+ if [ "$?" -eq 20 ]; then
+
+# Show error only on level 0
+ if [ "$LEVEL" -eq 0 ]; then
+ error "Check for circular deps on $build_dir/BUILDORDER";
+ fi
+
+ fi
+# Pass message 20
+ exit 20
+}
+
+exit 0
diff --git a/libretools.conf b/libretools.conf
index 05971d3..9e7f938 100644
--- a/libretools.conf
+++ b/libretools.conf
@@ -19,9 +19,10 @@ ARCHES=('i686' 'x86_64' 'mips64el' 'any')
CHROOTDIR=/home/chroot
## The working chroot
-# A chroot is useful to build packages isolated from the current system and avoid
-# unwanted (as in not in dependencies) automatic library linking
-CHROOT=root
+## A chroot is useful to build packages isolated from the current system and avoid
+## unwanted (as in not in dependencies) automatic library linking
+# CHROOT=$SUDO_USER
+# CHROOT=root
## Obtains CacheDir from pacman.conf
CACHEDIR=`grep "^#\?CacheDir" /etc/pacman.conf | cut -d'=' -f2`
@@ -46,10 +47,11 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git
#COMMITCMD=git
#COMMITCMD=hg
-## Build cmd for fullpkg-ng
## Uncomment one of those or make one of your choice
-FULLBUILDCMD="sudo libremakepkg -cumL -M --noconfirm -M --nocheck"
-#FULLBUILDCMD="here is a place for cross-compiling build cmd"
+# Normal fullpkg
+FULLBUILDCMD="sudo libremakepkg -cuN -- -d"
+# Cross compiling fullkpg
+# FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot' -- -d"
## Toru
# Section for toru's vars
@@ -71,18 +73,14 @@ for VAR in CHROOTDIR CHROOT CACHEDIR PARABOLAHOST LIBREDESTDIR \
echo "Configure $VAR var in /etc/libretools.conf"
ret=1
}
- [ $ret -ne 0 ] && exit 1
+ [ $ret -ne 0 ] && exit 1
done
source /usr/bin/libremessages
## These are architecture specific files.
-## Uncomment them if you installed libretools-arch
-#source /etc/libretools.d/mips64el.conf
-#source /etc/libretools.d/x86_64.conf
-#source /etc/libretools.d/i686.conf
-
-
+## Uncomment them if you installed libretools-mips64el
+# source /etc/libretools.d/mips64el.conf
## Recommended SSH Config follows
# SSH host, it's better if you have it configured on ~/.ssh/config
diff --git a/mips64el/mips64el.conf b/mips64el/mips64el.conf
index 0825fad..836b407 100644
--- a/mips64el/mips64el.conf
+++ b/mips64el/mips64el.conf
@@ -2,11 +2,11 @@
## Run a command for PKGBUILD modifications before building
## Like adding 'mips64el' to arch if it's not there
-HOOKPKGBUILDMOD="mips-add"
+# HOOKPKGBUILDMOD="mips-add"
## Run a command for local releasing of packages
# Useful for mass packaging (ie. mips port)
# Must accept the following parameters even if the command won't use them:
# $1 repo name
# $2+ packages
-HOOKLOCALRELEASE="mipsrelease"
+# HOOKLOCALRELEASE="mipsrelease"
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree
index 6f365e3..bd6fa4b 100755
--- a/pkgbuild-check-nonfree
+++ b/pkgbuild-check-nonfree
@@ -111,7 +111,7 @@ function check_deps { # Check wheter a package depends on non-free
return 1 # not PKGBUILD
fi
- msg "${pkgbase:-${pkgname[0]}} $pkgver $pkgrel ${epoch:-""}" # > "$logpipe"
+ msg2 "${pkgbase:-${pkgname[0]}} $pkgver $pkgrel ${epoch:-""}" # > "$logpipe"
for pkg in ${pkgname[@]} ${depends[@]} ${makedepends[@]} ${checkdepends[@]}; do
@@ -128,10 +128,10 @@ function check_deps { # Check wheter a package depends on non-free
elif [ -n "$rep" ]; then
if [ "$rep" = "$pkg" ]; then
- msg2 "$pkg is repackaged with the same name." # > "$logpipe"
+ plain "$pkg is repackaged with the same name." # > "$logpipe"
continue
else
- msg2 "$pkg -> $rep" # > "$logpipe"
+ plain "$pkg -> $rep" # > "$logpipe"
continue
fi
@@ -188,7 +188,7 @@ shift $(( OPTIND - 1))
msg "Looking for unfree dependencies"
-if [ $# -gt 1 ]; then
+if [ $# -ge 1 ]; then
for p in $@; do
if [ -n "$p" ]; then