}
# inserts git log instead of %changelog
-# outputs name of modified file created by tempfile
+# @output directory containing modified specfile
insert_gitlog() {
local SPECFILE=$1 specdir=$(tempdir) gitlog=$(tempfile) speclog=$(tempfile)
%remove_etc_shells(p) %{p:<lua>}
%lua_add_etc_shells() %{nil}
%lua_remove_etc_shells() %{nil}
-%required_jdk %{nil}
+%required_jdk jdk
%buildrequires_jdk %{nil}
%pear_package_print_optionalpackages %{nil}
EOF
# @return exit code from poldek
#
# this requires following sudo rules:
-# - poldek -q --update --upa
+# - poldek --noask --caplookup -uG
poldek_install() {
-# TODO: if carme sudo rules are updated, this function could be just:
-# LANG=C $POLDEK_CMD --noask --caplookup -uG $*
-
- local log=$(tempfile poldek) rc
-
- echo "install $*" | LANG=C script -e -f $log -c "$POLDEK_CMD"; rc=$?
- # remove color and other terminal escapes
- # see https://bugs.launchpad.net/poldek/+bug/1434393
- sed -i -e 's/\r/\n/g;s/\ f//g;' $log
- perl -pe 's/\033\[[\d;]*m//g' -i $log
-
- # error: libjpeg-devel: no such package
- local failed=$(awk '/^error:/{a=$2; sub(/^error: /, "", a); sub(/:$/, "", a); print a}' $log)
- rm $log
-
- # failed to capture error?
- if [ -n "$failed" -a $rc = 0 ]; then
- echo >&2 "Failed to install: "$failed
- rc=1
- fi
-
- return $rc
+ LANG=C $POLDEK_CMD --noask --caplookup --uniq -uG "$@"
}
# install packages
+#
+# this requires following sudo rules:
+# - poldek -q --update --upa
install_packages() {
# sync poldek indexes once per invocation
if [ -z "$package_indexes_updated" ]; then
# outputs all dependencies which current rpmdb doesn't satisfy.
# input can be either STDIN or parameters
_rpm_prov_check() {
- local DEPS
+ local deps out
if [ $# -gt 0 ]; then
- DEPS="$@"
+ deps="$@"
else
- DEPS=$(cat)
+ deps=$(cat)
fi
- DEPS=$(LANG=C rpm -q --whatprovides $DEPS 2>&1 | awk '/^(error:|no package provides)/ { print }')
+ out=$(LC_ALL=C rpm -q --whatprovides $deps 2>&1)
# packages
- echo "$DEPS" | awk '/^no package provides/ { print $NF }'
+ echo "$out" | awk '/^no package provides/ { print $NF }'
# other deps (files)
- echo "$DEPS" | awk -F: '/^error:.*No such file/{o = $2; gsub("^ file ", "", o); print o}'
+ echo "$out" | sed -rne 's/file (.*): No such file or directory/\1/p'
}
# checks if given package/files/provides exists in rpmdb.
fi
if [ -n "$CNFL" ]; then
- echo "Uninstall conflicting packages ($CNFL):"
+ echo "Uninstall conflicting packages: $CNFL"
uninstall_packages $CNFL
fi
if [ -n "$DEPS" ]; then
- echo "Install dependencies ($DEPS):"
+ echo "Install dependencies: $DEPS"
install_packages $DEPS
fi
}
exit 1
fi
+# stuff global $BUILDER_OPTS from env as args
+if [ "$BUILDER_OPTS" ]; then
+ set -- "$BUILDER_OPTS" "$@"
+fi
+
while [ $# -gt 0 ]; do
case "${1}" in
-4|-6)
;;
--alt_kernel)
shift
- RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\""
+ RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\" --define \"build_kernels $1\""
shift
;;
--short-circuit)