diff options
Diffstat (limited to 'fullpkg')
-rwxr-xr-x | fullpkg | 95 |
1 files changed, 3 insertions, 92 deletions
@@ -11,10 +11,9 @@ if [ -z $XDG_CONFIG_HOME ]; then error "There's no XDG_CONFIG_HOME var set" exit 1 fi -# set queue_file and ban_file +# set and ban_file [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ] && \ source $XDG_CONFIG_HOME/libretools/libretools.conf -queue_file=$XDG_CONFIG_HOME/libretools/queue ban_file=$XDG_CONFIG_HOME/libretools/ban @@ -35,72 +34,9 @@ function usage { 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 " -o : work offline (avoid queuing)" echo } -# Queue Management -# * Always get the queue list from the server -# * Add/Remove from queue -# * Check if a package is listed - -# Get the queue list from the server -get_queue() { - [[ "$OFFLINE" -eq true ]] && return 0 - - rsync -e ssh -aq $PARABOLAHOST:mips64el/queue $queue_file >/dev/null 2>&1 || { - error "Failed to retrieve queue list" - return 1 - } -} - -# Put the queue list on the server -put_queue() { - [[ "$OFFLINE" = true ]] && return 0 - - rsync -e ssh -aq $queue_file $PARABOLAHOST:mips64el/queue >/dev/null 2>&1 || { - error "Failed to put queue list" - return 1 - } -} - -# Add packages to the queue -update_queue() { - get_queue - echo "$(basename $PWD):$PACKAGER" >> $queue_file - put_queue || return $? -} - -# Remove a package from the queue -remove_queue() { - [[ "$OFFLINE" -eq true ]] && return 0 - - get_queue - - grep -Evw "^$(basename $PWD)" ${queue_file} > ${queue_file}2 - mv -f ${queue_file}2 ${queue_file} - - put_queue && return 0 || return $? -} - -# Checks if a package is listed -check_queue() { - [[ "$OFFLINE" = "true" ]] && return 0 - - get_queue - - local packager=$(grep -w "$(basename $PWD)" ${queue_file} | cut -d ':' -f2) - - [ -n "$packager" -a "$packager" != "$PACKAGER" ] && { - warning "$(basename $PWD) is being packaged by $packager. Please wait." - return 1 - } - - return 0 -} - -# END Queue Management # - ## Build order management ## # Removes a package from the buildorder @@ -186,7 +122,7 @@ function find_deps { declare -i next_level=$level+1 # Pass the offline flag to children - [[ "$OFFLINE" -eq true ]] && extra+=" -o" + [[ "$OFFLINE" -eq true ]] for _dep in ${deps[@]}; do for _repo in ${REPOS[@]}; do @@ -194,7 +130,7 @@ function find_deps { if [ -e "${ABSROOT}/${_repo}/${_dep}/PKGBUILD" ]; then pushd "${ABSROOT}/${_repo}/${_dep}" > /dev/null - $0 -c -d ${build_dir} -l ${next_level} ${extra} + $0 -c -d ${build_dir} -l ${next_level} # Circular deps must fail [ $? -eq 20 ] && return 20 @@ -240,21 +176,6 @@ function _pkg_build () { msg2 "${pkgbase:-${pkgname[0]}} $pkgver-$pkgrel" -# Check if pkg is being built - msg2 "Checking build queue" - check_queue || { - echo "someone_is_building:$(basename $PWD)" >> $build_dir/log - - remove_buildorder "$(basename $PWD)" $buildorder - continue - } - -# Let everybody know we're building this. - msg2 "Updating build queue" - update_queue || { - warning "Couldn't update the queue, let your partners know about this." - } - msg2 "Checking for non free deps" pkgbuild-check-nonfree || { if [ $? -eq 15 ]; then # this error means nonfree others means fail. @@ -302,9 +223,6 @@ function _pkg_build () { # Package was built or failed: take it out of $buildorder remove_buildorder "${build_packages[0]}" $buildorder || true -# Take package out from queue - remove_queue || true - # Set build_packages before next cycle run build_packages=($(sort -gr $buildorder | cut -d: -f2)) popd > /dev/null @@ -335,7 +253,6 @@ function _pkg_build () { # End inmediately but print a useful message trap_exit() { - remove_queue error "$@" warning "Leftover files left on $build_dir" @@ -406,12 +323,6 @@ if [ ${build_only} == 'n' ]; then fi -# If the queue file isn't writable go into offline mode -[ ! -w $queue_file ] && { - error "Can't write queue file" - OFFLINE=true -} - # Only on level 0 if [ $level -eq 0 ]; then # if build_dir exist use it, else make a build_dir |