summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-05-22 11:13:52 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-05-22 11:13:52 -0300
commit4f1392d774c081a03d9abab0c731704880d54d4c (patch)
treeabfa5f7c1dc185ddfbf2957b8094feb925a432b2
parent50435a2614fe7f28e47164082e846b0a57c7f48c (diff)
parent3c53f6e6e8a9dc767680c5a53969e3d9aa3c5d81 (diff)
Merge branch 'master' of ssh://vparabola/srv/git/projects/libretools
Conflicts: libremessages
-rwxr-xr-xaur22
-rwxr-xr-xcreateworkdir12
-rwxr-xr-xdiff-unfree11
-rwxr-xr-xfullpkg223
-rwxr-xr-xlibrechroot39
-rwxr-xr-xlibremakepkg55
-rwxr-xr-xlibremessages3
-rwxr-xr-xlibrerelease61
-rwxr-xr-xlibrerepkg16
-rwxr-xr-xlibrestage18
-rw-r--r--libretools.conf29
-rwxr-xr-xmipsrelease1
-rwxr-xr-xpkgbuild-check-nonfree18
13 files changed, 328 insertions, 180 deletions
diff --git a/aur b/aur
index e300dd1..b7ad018 100755
--- a/aur
+++ b/aur
@@ -3,6 +3,20 @@
source /etc/libretools.conf
source /etc/abs.conf
+function usage {
+ echo "Usage: $0 pkgname-from-aur1 [pkgname-from-aur2 ...]"
+ echo
+ echo "This script will download packages from aur to the current dir"
+ echo "and check their license for nonfree issues."
+}
+
+while getopts 'h' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ *) usage; exit 1 ;;
+ esac
+done
+
missing_deps=()
for _pkg in ${@}; do
msg "Downloading $_pkg..."
@@ -14,18 +28,20 @@ for _pkg in ${@}; do
continue
}
- stdnull pushd $_pkg
+ stdnull "pushd $_pkg"
source PKGBUILD
pkgbuild-check-nonfree || {
- warning "This PKGBUILD links to known unfree packages"
+ if [ $? -eq 15 ]; then
+ warning "This PKGBUILD links to known unfree packages"
+ fi
}
msg2 "Checking license..."
free=0
for _license in ${license[@]}; do
- if ! -d /usr/share/licenses/common/$_license; then
+ if [ ! -d /usr/share/licenses/common/$_license ]; then
warning "License $_license is not a common license"
free=1
fi
diff --git a/createworkdir b/createworkdir
index 8680215..a28d198 100755
--- a/createworkdir
+++ b/createworkdir
@@ -47,8 +47,7 @@ custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
}
-# Create the staging and repo dirs
-_repodir=${WORKDIR}/repos
+# Create the staging dirs
for _repo in ${REPOS[@]}; do
[[ ! -d ${WORKDIR}/staging/${_repo} ]] && {
stdnull "mkdir -p ${WORKDIR}/staging/${_repo}" || {
@@ -56,15 +55,6 @@ for _repo in ${REPOS[@]}; do
exit 1
}
}
-
- for _arch in ${ARCHES[@]}; do
- [[ ! -d ${_repodir}/${_repo}/${_arch} ]] && {
- stdnull "mkdir -p ${_repodir}/${_repo}/${_arch}" || {
- error "Can't create ${_repodir}/${_repo}/${_arch}"
- exit 1
- }
- }
- done
done
msg "Finished, your packaging dir tree looks like this now:"
diff --git a/diff-unfree b/diff-unfree
index 2cc3ac7..86a537f 100755
--- a/diff-unfree
+++ b/diff-unfree
@@ -27,7 +27,7 @@ custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
msg "Diff-Unfree helps you diff build scripts from ABSLibre against
(Unfree) ABS. Package name and repo will we guessed if you don't
specify them."
- msg2 "Usage: $0 [unfree-package] [repo]"
+ msg2 "Usage: $0 [repo] [unfree-package]"
exit 0
}
@@ -38,11 +38,10 @@ custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
package_guess=$(basename $PWD)
-package=${1:-${package_guess/-libre}}
-repo=${2:-$(basename $(dirname $PWD))}
+repo=${1:-$(basename $(dirname $PWD))}
+package=${2:-${package_guess/-libre}}
tmp_dir=$(mktemp -d /tmp/${package}.XXXXXX)
-unfree_dir="${tmp_dir}/packages/${package}/trunk"
svnrepo="packages"
case $repo in
@@ -56,6 +55,8 @@ case $repo in
;;
esac
+unfree_dir="${tmp_dir}/${svnrepo}/${package}/trunk"
+
[[ ! -d "${tmp_dir}" ]] && {
error "Can't create temp dir"
exit 1
@@ -67,7 +68,7 @@ msg "Getting diff from $repo/$package..."
stdnull 'svn checkout --depth=empty svn://svn.archlinux.org/$svnrepo'
-cd packages
+cd ${svnrepo}
svn update ${package}
# Back to start dir
diff --git a/fullpkg b/fullpkg
index c292bdd..d66067e 100755
--- a/fullpkg
+++ b/fullpkg
@@ -4,23 +4,56 @@
# * Detect circular builds
# * Detect pkgnames by provides, replaces, etc. instead of dir tree
+source /etc/makepkg.conf
+source /etc/abs.conf
+source /etc/libretools.conf
+
+[[ -r ~/.config/libretools/libretools.conf ]] && \
+ source ~/.config/libretools/libretools.conf
+
+function 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 "OPTIONS:"
+ echo " -h : this message."
+ echo " -f : build even when a package has been built."
+ echo " -n absdir : set ABSROOT to this dir"
+ echo " -r reponame : set repo name to reponame"
+ echo " -R pkgname : build pkgname if it is a dep"
+ echo
+}
+
+force_build='n'
+force_array=()
+_fullpkgargs=""
+failed=()
+missing=()
+
+while getopts 'hfn:r:R:' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ f) force_build='y' ;;
+ R) force_array=(${force_array[@]} $OPTARG); _fullpkgargs+="-R $OPTARG ";;
+ n) ABSROOT="$OPTARG" ;;
+ r) repo="$OPTARG" ;;
+ esac
+done
+
[[ ! -r PKGBUILD ]] && {
- echo "This isn't a build directory"
+ error "This isn't a build directory"
+ echo
+ usage
exit 1
}
tmp_dir=$(mktemp -d /tmp/$(basename $PWD).XXXXXX)
queue_file=$(mktemp /tmp/queue.XXXXXX)
-ban_file=$(mktemp)
-[[ ! -w $queue_file ]] && exit 1
-[[ ! -w $ban_file ]] && exit 1
+ban_file=$(mktemp /tmp/ban.XXXXXX)
-source /etc/makepkg.conf
-source /etc/abs.conf
-source /etc/libretools.conf
-
-[[ -r ~/.config/libretools/libretools.conf ]] && \
- source ~/.config/libretools/libretools.conf
+## START FUNCTIONS ##
# Queue Management
# * Always get the queue list from the server
@@ -30,10 +63,6 @@ source /etc/libretools.conf
# TODO
# * Check for concurrence
-guess_repo() {
- basename $(dirname $(pwd))
-}
-
# Get the queue list from the server
get_queue() {
rsync -e ssh -aq $PARABOLAHOST:mips64el/queue $queue_file >/dev/null 2>&1 || {
@@ -66,7 +95,7 @@ remove_queue() {
grep -vw "^$(basename $PWD)" $queue_file > $queue_file.2
cat $queue_file.2 > $queue_file
- put_queue || return $?
+ put_queue && rm $queue_file{,.2} && return 0 || return $?
}
# Checks if a package is listed
@@ -83,61 +112,87 @@ check_queue() {
return 0
}
+# END Queue Management #
+
# Checks if the package is banned from building
is_banned() {
rsync -e ssh -aq $PARABOLAHOST:mips64el/ban $ban_file >/dev/null 2>&1 || {
- echo ":: Failed to get ban list"
- return 0
+ plain "Failed to get ban list"
+ return 1
}
-
grep -w $1 $ban_file >/dev/null 2>&1
-
return $?
}
+guess_repo() {
+ basename $(dirname $(pwd))
+}
+
+# usage : in_array( $needle, $haystack )
+# return : 0 - found
+# 1 - not found
+function in_array {
+ [[ $2 ]] || return 1
+ local needle=$1; shift
+ local item
+ for item in "$@"; do
+ [[ ${item#@} = $needle ]] && return 0
+ done
+ return 1 # Not Found
+}
-# TODO keep track of spawned fullpkgs
-quit() {
+function quit {
remove_queue
-
exit 1
}
-repo=${1:-$(guess_repo)}
+function cleanup {
+ rm $ban_file $queue_file
+ rm -rf $tmp_dir
+}
+
+# TODO keep track of spawned fullpkgs
+
+## END FUNCTIONS ##
source PKGBUILD
+repo=${repo:-$(guess_repo)}
msg "Building ${repo:-missing repo}/${pkgbase:-${pkgname[@]}}: $pkgdesc"
-is_built "${pkgbase:-${pkgname[0]}}>=${pkgver}-${pkgrel}" && exit 0
+# Pre build tests
+if [ $force_build == 'n' ]; then
-#sudo pacman -Sy
+ # Be able to write files
+ if [[ ! -w $queue_file ]]; then
+ error "can't write queue file"
+ exit 1
+ elif [[ ! -w $ban_file ]] ; then
+ error "can't write ban file"
+ exit 1
+ fi
-trap "quit" TERM KILL INT
+ if is_built "${pkgbase:-${pkgname[0]}}>=${pkgver}-${pkgrel}"; then
+ msg2 "This package is built."
+ exit 0
+ fi
-if is_banned ${pkgbase:-$pkgname}; then
- error "This package is banned from building. Check the ban list"
- exit 1
-fi
+ if is_banned ${pkgbase:-$pkgname}; then
+ error "This package is banned from building. Check the ban list"
+ exit 1
+ fi
-check_queue || exit 1
+ check_queue || exit 1
-failed=()
-missing=()
+fi
+
+# This will be executed at exit for any reason.
+trap "quit" EXIT INT QUIT TERM KILL HUP
if ! grep mips64el PKGBUILD >/dev/null; then
msg "Adding mips64el arch"
sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" "PKGBUILD"
fi
-# Gets the dependency list from the package_* functions
-#pkgdeps=($(cat PKGBUILD | \
-# tr -d "\n" | \
-# sed -n "s/depends=(\([^)]\+\))/\n::\1\n/pg" | \
-# grep --color=never "^::" | \
-# tr -d [:\'\"] | \
-# tr " " "\n" | \
-# sort -u))
-
# Clean version checking
deps=$(echo "${depends[@]} ${makedepends[@]} ${pkgdeps[@]}" | \
sed "s/[=<>]\+[^ ]\+//g" | \
@@ -145,11 +200,6 @@ deps=$(echo "${depends[@]} ${makedepends[@]} ${pkgdeps[@]}" | \
sort -u)
msg "Checking dependencies"
-plain "${deps[@]}"
-
-#msg "Syncing database"
-#sudo pacman -Sy
-
for _dep in ${deps[@]}; do
is_banned $_dep && continue
@@ -158,14 +208,18 @@ for _dep in ${deps[@]}; do
[[ -e "$ABSROOT/${_repo}/$_dep/PKGBUILD" ]] && {
source "$ABSROOT/${_repo}/$_dep/PKGBUILD"
msg2 "Checking for $_dep>=$pkgver-$pkgrel"
-
-# If this version is built, continue with the next dep
-
- if is_built "$_dep>=$pkgver-$pkgrel"; then
- msg2 "No need to build this one"
- break
- fi
-
+
+ if ! in_array $_dep ${force_array[@]}; then
+ if is_built "$_dep>=$pkgver-$pkgrel"; then
+ plain "this package is built"
+ break
+ fi
+ else
+ _fullpkgargs+="-f "
+ _fullpkgargs="$(echo $_fullpkgargs | sed s/"-R $_dep "//)"
+ force_array=( $(echo ${forcearray[@]} | tr " " "\n" | grep -vw "^$_dep") )
+ fi
+
cp -r "$ABSROOT/$_repo/$_dep" $tmp_dir/ || {
error "Can't copy $_dep to the work dir."
exit 1
@@ -173,39 +227,25 @@ for _dep in ${deps[@]}; do
# Enter the work dir and run this command in it
pushd $tmp_dir/$_dep >/dev/null
- $0 $_repo
+
+ $0 -r $_repo $_fullpkgargs
[[ $? -ne 0 ]] && {
failed=(${failed[@]} $_dep)
}
popd >/dev/null
-
- break
-# } || {
-# The package can't be found
-# This can happen if:
-# * The package is built inside a split package
-# * The package is provided by some other package (ie by *-libre packages)
-# echo "==> Missing package $_dep"
-# missing=(${missing[@]} $_dep)
}
done
done
# TODO probably not elegant enough
-# [[ ${#failed[@]} -gt 0 ]] || [[ ${#missing[@]} -gt 0 ]] && {
- [[ ${#failed[@]} -gt 0 ]] && {
- error "This packages failed to build: ${failed[@]}"
- exit 1
- }
-
-# [[ ${#missing[@]} -gt 0 ]] && {
-# echo ":: This packages are missing: ${missing[@]}"
-# }
-
-# exit 1
-#}
+# TODO only the last fullpkg should show this message
+# and it should contain all failed pkgs
+[[ ${#failed[@]} -gt 0 ]] && {
+ error "This packages failed to build: ${failed[@]}"
+ exit 1
+}
# Let everybody know we're building this
update_queue || {
@@ -217,25 +257,18 @@ pushd $tmp_dir/$(basename $PWD) >/dev/null
msg "Syncing database"
sudo pacman -Syu --noconfirm
-makepkg --noconfirm -sLcr ; r=$?
+makepkg --noconfirm --nocheck -sLcr ; r=$?
case $r in
- 0)
- msg "The build was succesful."
- mipsrelease *.pkg.tar.*
-
- librestage $repo
-
- sudo pacman -Sy
- ;;
- 1)
- error "There were errors while trying to build the package."
- ;;
- 2)
- error "The build failed."
- ;;
+ 0) msg "The build was succesful."
+ mipsrelease *.pkg.tar.*
+ librestage $repo
+ librerelease
+ sudo pacman -Sy
+ # cleanup is only on succesfull build so failed can be inspected
+ cleanup;;
+ 1) error "There were errors while trying to build the package." ;;
+ 2) error "The build failed." ;;
esac
-# Remove from queue
-remove_queue
-
exit $r
+
diff --git a/librechroot b/librechroot
index ec437de..b308b7d 100755
--- a/librechroot
+++ b/librechroot
@@ -23,6 +23,19 @@
source /etc/libretools.conf
+function usage {
+ echo "Usage: $0 chrootname"
+ echo "Change to a chroot in $CHROOTDIR. Use it as root."
+ echo
+ echo "Default chroot name: $CHCOPY"
+}
+
+while getopts 'h' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ esac
+done
+
[[ "$UID" != "0" ]] && {
error "This script must be run as root."
exit 1
@@ -32,28 +45,28 @@ custom_config=${XDG_CONFIG_HOME}/libretools/libretools.conf
[[ -e ${custom_config} ]] && source ${custom_config}
# Enter the chroot copy by default
-root=${1:-$CHCOPY}
+chrootname=${1:-$CHCOPY}
CACHEDIR=${CACHEDIR:-/var/cache/pacman/pkg}
-[[ ! -d ${CHROOTDIR}/${root} ]] && {
- error "${CHROOTDIR}/$root is not a dir."
+[[ ! -d ${CHROOTDIR}/${chrootname} ]] && {
+ error "${CHROOTDIR}/${chrootname} is not a dir."
exit 1
}
-mount -t proc proc ${CHROOTDIR}/${root}/proc/
-mount -t sysfs sys ${CHROOTDIR}/${root}/sys/
-mount -o bind /dev ${CHROOTDIR}/${root}/dev/
+mount -t proc proc ${CHROOTDIR}/${chrootname}/proc/
+mount -t sysfs sys ${CHROOTDIR}/${chrootname}/sys/
+mount -o bind /dev ${CHROOTDIR}/${chrootname}/dev/
# Share pacman cache
-mount -o bind ${CACHEDIR} ${CHROOTDIR}/${root}/var/cache/pacman/pkg
+mount -o bind ${CACHEDIR} ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg
-cp -L /etc/resolv.conf ${CHROOTDIR}/${root}/etc/resolv.conf
+cp -L /etc/resolv.conf ${CHROOTDIR}/${chrootname}/etc/resolv.conf
-chroot ${CHROOTDIR}/${root} /bin/bash
+chroot ${CHROOTDIR}/${chrootname} /bin/bash
-umount ${CHROOTDIR}/${root}/proc/
-umount ${CHROOTDIR}/${root}/sys/
-umount ${CHROOTDIR}/${root}/dev/
-umount ${CHROOTDIR}/${root}/var/cache/pacman/pkg
+umount ${CHROOTDIR}/${chrootname}/proc/
+umount ${CHROOTDIR}/${chrootname}/sys/
+umount ${CHROOTDIR}/${chrootname}/dev/
+umount ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg
exit 0
diff --git a/libremakepkg b/libremakepkg
index 8cce89d..8af1581 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -1,5 +1,6 @@
#!/bin/bash
-# Copyright 2010 Nicolás Reynolds
+# Copyright 2010 - 2011 Nicolás Reynolds
+# Copyright 2011 Joshua Ismael Haase Hernández
# ---------- GNU General Public License 3 ----------
@@ -20,6 +21,42 @@
source /etc/libretools.conf
+function usage {
+ echo "cd to a dir containing a PKGBUILD and run:"
+ echo "$0 [options] [makepkg args]"
+ echo "This script will build your package on a chroot."
+ echo
+ echo "OPTIONS:"
+ echo
+ echo " -h : show this message."
+ echo " -c : cleans CHCOPY before building."
+ echo " -u : updates CHROOT before building."
+ echo " -n : use this dir instead of CHCOPY."
+ echo " -I pkgname : install this package, use it as many times needed."
+ echo
+}
+
+_CLEAN=""
+CLEAN_CACHE=""
+update_first="n"
+chrootname=${CHCOPY}
+_PKGINSTALL=""
+#libremakepkg own args
+libremakepkgargs='hcun:I:'
+#now makepkg args
+libremakepkgargs+='ACdefiLmop:rRs'
+
+while getopts ${libremakepkgargs} arg ; do
+ case "${arg}" in
+ h) usage; exit 0 ;;
+ c) _CLEAN="-c" ;;
+ u) update_first="y" ;;
+ n) chrootname="$OPTARG"; echo $chrootname ;;
+ I) _PKGINSTALL+="-I $OPTARG " ;;
+ *) _MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
+ esac
+done
+
if [ $UID -ne 0 ]; then
error "This script must be run as root"
exit 1
@@ -27,24 +64,20 @@ fi
msg "Checking PKGBUILD for non-free issues"
pkgbuild-check-nonfree ||{
- if [[$?=15]]; then
+ if [[ $? -eq 15 ]]; then
error "PKGBUILD contains non-free issues"
exit 15
- else
- error "Check failed, continuing"
fi
}
-[[ -z $1 ]] && {
- CLEAN="-c"
-
+if [ $update_first = y ]; then
msg "Updating the main chroot"
- mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT}
+ # -c option in mkarchroot indicates cache
+ mkarchroot -c ${CACHEDIR} -u "${CHROOTDIR}/${CHROOT}"
+fi
- mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHCOPY}/var/cache/pacman/pkg || exit 1
-}
msg "Creating the package"
-makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${CHCOPY} -- $@
+makechrootpkg $_CLEAN -r ${CHROOTDIR} -l "${chrootname}" $_PKGINSTALL -- $_MAKEPKG_ARGS
exit 0
diff --git a/libremessages b/libremessages
index 3d36085..c297f2d 100755
--- a/libremessages
+++ b/libremessages
@@ -46,8 +46,7 @@ else
fi
stdnull() {
- local action="$@";
- eval "${action} >/dev/null 2>&1"
+ eval "$@ >/dev/null 2>&1"
}
plain() {
diff --git a/librerelease b/librerelease
index 39d3e2d..4e7c491 100755
--- a/librerelease
+++ b/librerelease
@@ -24,29 +24,64 @@
source /etc/libretools.conf
custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
-usage () {
- printf "$(gettext "Usage: %s")" "$0"
+function usage {
+ echo "$(gettext "Usage: $0")"
echo
- printf "$(gettext "This script")"
+ echo "$(gettext "This script uploads packages on $WORKDIR/stagging")"
+ echo "$(gettext "to parabola server.")"
+ echo
+ echo "$(gettext "OPTIONS:")"
+ echo "$(gettext " -h this message.")"
+ echo "$(gettext " -l only list packages but not upload them.")"
+ echo "$(gettext " -c clean packages on $WORKDIR/staging.")"
+}
+
+function list_packages {
+ repos=($(find "$WORKDIR/staging/" -mindepth 1 -type d \! -empty -printf '%f ' 2>/dev/null))
+ for _repo in ${repos[@]}; do
+ msg2 "$_repo"
+ find ${WORKDIR}/staging/${_repo} -type f -printf "%f\n"
+ done
+ unset repos
+}
+
+function clean_non_packages {
+ find $WORKDIR/staging/ -type f \! -iname "*.pkg.tar.?z" -delete
}
+function clean_packages {
+ find ${WORKDIR}/staging/ -iname "*.pkg.tar.?z" -delete
+}
+
+while getopts 'hlc' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ l) list_packages; exit 0 ;;
+ c) clean_packages; exit $? ;;
+ esac
+done
+
[[ -e $custom_config ]] && source $custom_config
[[ ! -z ${HOOKPRERELEASE} ]] && bash -c "${HOOKPRERELEASE}"
+clean_non_packages
msg "Uploading packages..."
rsync --recursive \
- --copy-links \
- --hard-links \
- --partial \
- --prune-empty-dirs \
- --human-readable \
- --progress \
- -e "ssh " \
- ${WORKDIR}/staging \
- ${PARABOLAHOST}:${LIBREDESTDIR}/ || exit 1
+ --copy-links \
+ --hard-links \
+ --partial \
+ --prune-empty-dirs \
+ --human-readable \
+ --progress \
+ -e "ssh " \
+ ${WORKDIR}/staging \
+ ${PARABOLAHOST}:${LIBREDESTDIR}/ || {
+ error "Sync failed, try again"
+ exit 1
+}
msg "Removing packages from local [staging]"
-find ${WORKDIR}/staging/ -iname "*.pkg.tar.*" -delete
+clean_packages
exit 0
diff --git a/librerepkg b/librerepkg
index 22c237d..ba8dea1 100755
--- a/librerepkg
+++ b/librerepkg
@@ -36,9 +36,17 @@ source rePKGBUILD
usage() {
echo "cd to a dir with a rePKGBUILD and other file info and run"
- echo $0
+ echo "$0 "
+ echo
+ echo "This script will repackage an arch package without compiling"
}
+while getopts 'h' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ esac
+done
+
stdnull "tempdir=$(mktemp -d /tmp/$(basename $PWD).XXXXX)"
msg "Repackaging: $pkgname $pkgver-$pkgrel ($(date -u))"
@@ -47,6 +55,6 @@ stdnull "pushd ${tempdir}"
mv rePKGBUILD PKGBUILD
msg2 "Updating md5sums"
makepkg -g >> PKGBUILD
-msg "Repackaging using libremakepkg"
-sudo libremakepkg
-
+msg "Repackaging using makepkg"
+makepkg -Lc
+stdnull "popd ${tempdir}"
diff --git a/librestage b/librestage
index fa72098..6ecb19c 100755
--- a/librestage
+++ b/librestage
@@ -44,6 +44,12 @@ EOU
repos=$@
+while getopts 'h' arg; do
+ case $arg in
+ h) usage; exit 0 ;;
+ esac
+done
+
if [ ${#repos} -eq 0 ]; then
usage
exit 1;
@@ -55,10 +61,10 @@ fi
}
# Source the needed files
-source ./PKGBUILD
-[[ -e ./rePKGBUILD ]] && source ./rePKGBUILD
source /etc/makepkg.conf
[[ -e ~/.makepkg.conf ]] && source ~/.makepkg.conf
+source ./PKGBUILD
+[[ -e ./rePKGBUILD ]] && source ./rePKGBUILD
# Default package location
PKGDEST=${PKGDEST:-.}
@@ -66,6 +72,7 @@ SRCPKGDEST=${SRCPKGDEST:-.}
PKGEXT=".pkg.tar.?z"
+staged='n'
# Copies the packages to the specified repos inside staging
for _arch in ${ARCHES[@]}; do
for pkg in ${pkgname[@]}; do
@@ -89,6 +96,7 @@ for _arch in ${ARCHES[@]}; do
exit 1
} && {
msg2 "${pkg} staged on [${_repo}]"
+ staged='y'
}
} || {
ln "${canonical}" "${WORKDIR}/staging/${_repo}/${pkgfile}" || {
@@ -96,6 +104,7 @@ for _arch in ${ARCHES[@]}; do
exit 1
} && {
msg2 "${pkg} staged on [${_repo}]"
+ staged='y'
}
}
done
@@ -103,4 +112,9 @@ for _arch in ${ARCHES[@]}; do
done
done
+if [ $staged = 'n' ]; then
+ error "No package was staged"
+ exit 1
+fi
+
exit 0
diff --git a/libretools.conf b/libretools.conf
index 0999040..8a7769f 100644
--- a/libretools.conf
+++ b/libretools.conf
@@ -50,7 +50,20 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git/
#COMMITCMD=git
#COMMITCMD=hg
-# Recommended SSH Config
+# Checks if vars aren't empty
+#
+for VAR in CHROOTDIR CHROOT CHCOPY CACHEDIR PARABOLAHOST LIBREDESTDIR \
+ LIBRESRCDIR BLACKLIST WORKDIR PATCHDIR REPOS ARCHES ABSLIBREGIT COMMITCMD DIFFTOOL; do
+
+ [[ -z ${!VAR} ]] && {
+ echo "Configure $VAR var in /etc/libretools.conf"
+ exit 1
+ }
+done
+
+source /usr/bin/libremessages
+
+## Recommended SSH Config follows
# SSH host, it's better if you have it configured on ~/.ssh/config
# with ControlMaster auto (and a shell opened somewhere else)
#
@@ -73,17 +86,3 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git/
# HostName parabolagnulinux.org
# User parabola
# IdentityFile ~/.ssh/id_rsa
-
-
-# Checks if vars aren't empty
-#
-for VAR in CHROOTDIR CHROOT CHCOPY CACHEDIR PARABOLAHOST LIBREDESTDIR \
- LIBRESRCDIR BLACKLIST WORKDIR PATCHDIR REPOS ARCHES ABSLIBREGIT COMMITCMD DIFFTOOL; do
-
- [[ -z ${!VAR} ]] && {
- echo "Configure $VAR var in /etc/libretools.conf"
- exit 1
- }
-done
-
-source /usr/bin/libremessages
diff --git a/mipsrelease b/mipsrelease
index 97e12d2..400e9f1 100755
--- a/mipsrelease
+++ b/mipsrelease
@@ -4,7 +4,6 @@
source /etc/makepkg.conf
pushd ${PKGDEST} >/dev/null
-
repo-add stage3.db.tar.gz $@
popd >/dev/null
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree
index c55e7f6..7f04787 100755
--- a/pkgbuild-check-nonfree
+++ b/pkgbuild-check-nonfree
@@ -23,7 +23,7 @@ source /etc/libretools.conf
[[ -f $XDG_CONFIG_HOME/libretools/libretools.conf ]] && \
source $XDG_CONFIG_HOME/libretools/libretools.conf
-pushd /tmp >/dev/null
+pushd $(mktemp -d) >/dev/null
# This is the exit status.
ev=0
@@ -44,6 +44,7 @@ wget -N -q -O blacklist.txt "${BLACKLIST}" 2>/dev/null || {
# Get everything before the `:' in the blacklist (that's the names of the
# packages).
unfree=($(cut -d: -f1 blacklist.txt))
+freerep=($(cut -d: -f2 blacklist.txt))
popd >/dev/null
@@ -59,10 +60,17 @@ msg "Looking for unfree dependencies"
for item in ${pkgname[@]} ${depends[@]} ${makedepends[@]} ; do
# We cycle through all of the programs in the array (if any), and check if
# they are in the `unfree' array.
- if in_array $item ${unfree[@]}
- then
- ev=15
- msg2 "found $item"
+ if in_array $item ${unfree[@]} ; then
+ # if item has a free replacement, use error 16.
+ if in_array $item-libre ${freerep[@]} ; then
+ warning "$item -> $item-libre"
+ if [[ $ev -ne 15 ]]; then
+ ev=16
+ fi
+ else
+ ev=15
+ msg2 "found $item"
+ fi
fi
done