From 4c8953f03248d2084d98a9a357a67c370a89573c Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernández Date: Wed, 15 Jun 2011 16:57:28 -0500 Subject: * log expression changed --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libremakepkg b/libremakepkg index 58dc352..2226f81 100755 --- a/libremakepkg +++ b/libremakepkg @@ -89,7 +89,7 @@ msg "Creating the package" makechrootpkg $_CLEAN -r ${CHROOTDIR} -l "${chrootname}" $_PKGINSTALL -- $_MAKEPKG_ARGS ev=$? # exit value -[ $ev -ne 0 -a "$use_log" == 'y' -a -e ${CHROOTDIR}/${chrootname}/build/*.log ] && { +[ "$use_log" == 'y' -a -e ${CHROOTDIR}/${chrootname}/build/*.log ] && { cp ${CHROOTDIR}/${chrootname}/build/*.log ./ } exit $ev -- cgit v1.2.3-54-g00ecf From d48d50d162315e5ce915effbd27f3600d836e56e Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernández Date: Wed, 15 Jun 2011 18:06:10 -0500 Subject: fixed build_only test --- fullpkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fullpkg b/fullpkg index 39d4fa9..a03ff1b 100755 --- a/fullpkg +++ b/fullpkg @@ -371,7 +371,7 @@ while getopts 'ha:b:cCd:l:nm:r:o' arg; do usage exit 1 } - [ -e ${build_dir}/BUILDORDER ] && { + [ ! -r ${build_dir}/BUILDORDER ] && { error "${build_dir}/BUILDORDER doesn't exist." exit 1 };; @@ -454,7 +454,7 @@ find_deps || { else rsync -e ssh -aq $PARABOLAHOST:mips64el/ban >/dev/null 2>&1 || { - warning "Failed to get ban list" && [ -r $ban_file ] && { + warning "Failed to get ban list" && [ -r ${ban_file} ] && { # Use local copy of ban file if it is avaliable and continue. search=$(cat ${ban_file} | tr "\n" "|") -- cgit v1.2.3-54-g00ecf From c4dd603dfa1ae48767675945af5182774fb44471 Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Fri, 17 Jun 2011 16:25:14 -0300 Subject: Toru's outline and TODO --- toru | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 23 deletions(-) diff --git a/toru b/toru index 9716744..1ae336b 100755 --- a/toru +++ b/toru @@ -2,46 +2,97 @@ # Queries the ABS # License: GPL3 -# TODO +## TODO # * Add license text -# * Use libremessages +# * Add everything +# * Compare pacman sync against ABS (db-functions could be useful) +# * Create symlinks from pkgbase to pkgname[@] for easy package finding + +## GOALS +# * Have a searchable database of PKGBUILD metadata +# * Have an interface for source-only builds +# * Possibility to hook up ABS dirs besides ABSROOT +# * Tell updates and non available binary packages source /etc/abs.conf source /etc/libretools.conf +[ ! -w / ] && { + error "This script must be run as root." + exit 1 +} + +# This is the syncfile, stores the last date as content and mtime +lastsyncfile=${ABSROOT}/toru.lastsync + TMPDIR=$(mktemp -d) [[ -z ${TMPDIR} ]] && exit 1 -update() { - pushd ${ABSROOT} >/dev/null +# Stores the lastsync date +lastsync() { + [ -e ${lastsyncfile} -a ! -w ${lastsyncfile} ] && { + error "The sync date can't be saved. ${lastsyncfile} isn't writable." + return 1 + } -# Find all the PKGBUILDs newer than the last update - find * -type f -name 'PKGBUILD' -newer ${ABSROOT}/toru >> ${TMPDIR}/update.list + date +%s > ${lastsyncfile} + touch ${lastsyncfile} +} + +# Adds a field=value on the package description +addfield() { +} - while read _pkgbuild; do - pushd $(dirname ${_pkgbuild}) >/dev/null +# Updates the database by finding all PKGBUILDS +# Args: +update() { +# Find all the PKGBUILDs newer than the last update +# Update newer, otherwise everything + if [ ! -e ${lastsyncfile} -o "${force}" = "y" ]; then + msg "Forcing upgrade" + pkgbuilds=($(find ${@} -maxdepth 2 -type f -name 'PKGBUILD')) + else + pkgbuilds=($(find ${@} -maxdepth 2 -type f -name 'PKGBUILD' -newer ${lastsyncfile})) + fi + +# Inform how many PKGBUILDS were found and quit immediately if none + msg "Found $((${#pkgbuilds[*]}-1)) packages to update" + [ ${#pkgbuilds[*]} -eq 1 ] && { + msg2 "There's nothing to be done. Phew!" + exit 0 + } + + for _pkgbuild in ${pkgbuilds[@]}; do + +# The repo name is guessed +# You *must* use repo/pkgbase structure + _pkgpath=$(dirname "${_pkgbuild}") + _pkgbase=$(basename "${_pkgpath}") + _pkgrepo=$(basename $(dirname "${_pkgpath}")) + + msg2 "Updating ${_pkgrepo}/${_pkgbase}" + + source ${_pkgbuild} + + for _pkg in ${pkgname[@]}; do + done - unset pkgbase pkgname pkgver pkgrel + unset pkgbase pkgname pkgver pkgrel source - source PKGBUILD + done - for _pkg in ${pkgbase:-${pkgname[@]}}; do - dir="${TMPDIR}/packages/${_pkg}-${pkgver}-${pkgver}" - mkdir -p "${dir}" + lastsync - echo "${ABSROOT}/${_pkgbuild}" >> "${dir}/path" +} - done - popd >/dev/null - done < ${TMPDIR}/update.list - popd >/dev/null +## MAIN +command=${1:-update}; shift +force=${1:-n}; shift +dirs=${@} - last_update -} +${command} ${dirs[@]} -last_update() { - touch ${ABSROOT}/toru -} +exit $? -- cgit v1.2.3-54-g00ecf From 1c7f5b8c2807f08df766d6845e8565a13c46b333 Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernández Date: Sat, 18 Jun 2011 06:59:24 -0500 Subject: * updated *commit --- abslibre-commit | 3 ++- librecommit | 34 +++++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/abslibre-commit b/abslibre-commit index 8922cc0..e906fbd 100755 --- a/abslibre-commit +++ b/abslibre-commit @@ -27,7 +27,8 @@ for _pkg in ${@}; do unset pkgbase pkgname source ${_pkg}/PKGBUILD - git stage ${_pkg}/* +# use . instead of * will use .gitignore + git stage ${_pkg}/. git commit -m "${pkgbase:-$pkgname}-${pkgver}-${pkgrel}" done diff --git a/librecommit b/librecommit index bec5915..9444bd9 100755 --- a/librecommit +++ b/librecommit @@ -21,19 +21,43 @@ source /etc/libretools.conf usage () { - printf "$(gettext "cd to the dir with the PKGBUILD you are commiting and %s")" "$0" + echo "cd to the dir with the PKGBUILD you are commiting and" + echo + echo "$0 [optionally files to commit]" + echo + echo "This script commits the package using name, pkgver an pkgver" echo - printf "$(gettext "This script commits the package using name, pkgver an pkgver")" } +msg='Commiting libre package $pkg-$pkgver-$pkgrel' +files="" + +for opt in $@ ; do + case ${opt} in + h) usage ;; + m) msg=${OPTARG} ;; + *) files+="${opt} " ;; + esac +done + if [ ! -e PKGBUILD ]; then exit 1; fi source PKGBUILD -pkg=$pkgbase +pkg=${pkgbase:-${pkgname}} + +if [ ${COMMITCD} = 'git' ]; then + + ${COMMITCD} add $@ && ${COMMITCD} -m "" + +elif [ ${COMMITCD} = 'hg' ]; then + + ${COMMITCMD} commit $@ -m -v || exit 1 + +else -if [ ${#pkg} -eq 0 ]; then pkg=$pkgname; fi + error "COMMITCD is not correctly set on libretools.conf" -$COMMITCMD commit $@ -m "Commiting libre package $pkg-$pkgver-$pkgrel" -v || exit 1 +fi exit 0 -- cgit v1.2.3-54-g00ecf From 702cc20bd94cdb2939e0c163e8e9671c920c5b19 Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernández Date: Sat, 18 Jun 2011 19:09:56 -0500 Subject: exec find before LOCALHOOKRELEASE --- fullpkg | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fullpkg b/fullpkg index 1349e9a..be9ed70 100755 --- a/fullpkg +++ b/fullpkg @@ -202,17 +202,17 @@ 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 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 $_dir > /dev/null -# $0 -c -d ${build_dir} -l ${next_level} -## Circular deps must fail -# [ $? -eq 20 ] && return 20 -# popd > /dev/null -# break 1 # found, go to next dep + 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 $_dir > /dev/null + $0 -c -d ${build_dir} -l ${next_level} +# Circular deps must fail + [ $? -eq 20 ] && return 20 + popd > /dev/null + break 1 # found, go to next dep else echo "dep_not_found:$_dep:$_repo" >> $build_dir/log @@ -279,7 +279,8 @@ function _pkg_build () { # Calls a local release script if it's used [ -z $HOOKLOCALRELEASE ] || \ - $HOOKLOCALRELEASE $repo *.pkg.tar.?z + find -name "*.pkg.tar.?z" -print0 | \ + xargs -0 $HOOKLOCALRELEASE $repo # Stage for releasing librestage $repo || { -- cgit v1.2.3-54-g00ecf