from <package>.spec,
-bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
only package from <package>.spec,
+-bp, --build-prep - execute the %prep phase of <package>.spec,
+-bc - reserved (not implemented)
+-bi reserved (not implemented)
-bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
them into src.rpm,
--bp, --build-prep - execute the %prep phase of <package>.spec,
+--short-circuit - reserved (not implemented)
-B, --branch - add branch
-c, --clean - clean all temporarily created files (in BUILD, SOURCES,
SPECS and \$RPM_BUILD_ROOT),
-sp, --source-paths - list sources - filenames with full local paths (intended for
offline operations; does not work when Icon field is present
but icon file is absent),
+-su, --source-urls - list urls - urls to sources and patches
+ intended for copying urls with spec with lots of macros in urls
-T <cvstag> , --tag <cvstag>
- add cvs tag <cvstag> for files,
-Tvs, --tag-version-stable
update_shell_title() {
[ -t 1 ] || return
- local msg="builder[$SPECFILE] $*"
+ local len=${COLUMNS:-80}
+ local msg=$(echo "$*" | cut -c-$len)
+
+ msg="builder[$SPECFILE] $msg"
case "$TERM" in
cygwin|xterm*)
- echo -ne "\033]1;$msg\007\033]2;$msg\007"
+ echo >&2 -ne "\033]1;$msg\007\033]2;$msg\007"
;;
screen*)
- echo -ne "\033]0;$msg\007"
+ echo >&2 -ne "\033]0;$msg\007"
;;
esac
}
parse_spec()
{
- update_shell_title "parse_spec"
+ update_shell_title "parsing specfile"
if [ -n "$DEBUG" ]; then
set -x;
set -v;
get_files()
{
GET_FILES="$@"
- update_shell_title "get_files"
+ update_shell_title "fetching sources"
if [ -n "$DEBUG" ]; then
set -x;
set_bconds_values()
{
- update_shell_title "set_bconds_values"
+ update_shell_title "set bcond values"
AVAIL_BCONDS_WITHOUT=""
AVAIL_BCONDS_WITH=""
run_sub_builder()
{
package_name="${1}"
- echo -ne "Package installation failed:\t$package_name\n"
+ update_shell_title "run_sub_builder $package_name"
#
# No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
# pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
parent_spec_name=''
# Istnieje taki spec? ${package}.spec
- if [ -f "${SPECS_DIR}${package}.spec" ]; then
+ if [ -f "${SPECS_DIR}/${package}.spec" ]; then
parent_spec_name=${package}.spec
- elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
- parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
+ elif [ -f "${SPECS_DIR}/`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
+ parent_spec_name="`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec"
else
for provides_line in `grep ^Provides:.*$package ${SPECS_DIR} -R`
do
fi
if [ "${parent_spec_name}" != "" ]; then
- sub_builder_opts=''
- if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
- sub_builder_opts="${sub_builder_opts} -R"
- fi
- if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
- sub_builder_opts="${sub_builder_opts} -RB"
- elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
- sub_builder_opts="${sub_builder_opts} -FRB"
- fi
- if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
- sub_builder_opts="${sub_builder_opts} -Upi"
- fi
- cd "${SPECS_DIR}"
- ./builder ${sub_builder_opts} ${parent_spec_name}
+ spawn_sub_builder $parent_spec_name
fi
NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
}
+spawn_sub_builder()
+{
+ package_name="${1}"
+ update_shell_title "spawn_sub_builder $package_name"
+
+ sub_builder_opts=''
+ if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
+ sub_builder_opts="${sub_builder_opts} -R"
+ fi
+ if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
+ sub_builder_opts="${sub_builder_opts} -RB"
+ elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
+ sub_builder_opts="${sub_builder_opts} -FRB"
+ fi
+ if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
+ sub_builder_opts="${sub_builder_opts} -Upi"
+ fi
+
+ cd "${SPECS_DIR}"
+ ./builder ${sub_builder_opts} "$@"
+}
+
remove_build_requires()
{
if [ "$INSTALLED_PACKAGES" != "" ]; then
fetch_build_requires()
{
if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
- update_shell_title "fetch_build_requires"
+ update_shell_title "fetch build requires"
if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
- CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
- DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
+ local CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
+ local DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
- update_shell_title "fetch_build_requires: update indexes"
+ update_shell_title "poldek: update indexes"
if [ -n "$CONF" ] || [ -n "$DEPS" ]; then
- $SU_SUDO /usr/bin/poldek --update || $SU_SUDO /usr/bin/poldek --upa
+ $SU_SUDO /usr/bin/poldek -q --update || $SU_SUDO /usr/bin/poldek -q --upa
fi
if [ -n "$CONF" ]; then
- update_shell_title "fetch_build_requires: uninstall conflicting packages"
+ update_shell_title "uninstall conflicting packages: $CONF"
echo "Trying to uninstall conflicting packages ($CONF):"
$SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CONF
fi
- if [ -n "$DEPS" ]; then
- update_shell_title "fetch_build_requires: install deps ($DEPS)"
+
+ while [ "$DEPS" ]; do
+ update_shell_title "install deps: $DEPS"
echo "Trying to install dependencies ($DEPS):"
- $SU_SUDO /usr/bin/poldek --caplookup -uGv $DEPS
- fi
+ local log=.${SPECFILE}_poldek.log
+ $SU_SUDO /usr/bin/poldek --caplookup -uGq $DEPS | tee $log
+ failed=$(awk -F: '/^error:/{print $2}' $log)
+ rm -f $log
+ local ok
+ if [ -n "$failed" ]; then
+ for package in $failed; do
+ # FIXME: sanitise, deps could be not .spec files
+ spawn_sub_builder -bb $package && ok="$ok $package"
+ done
+ DEPS="$ok"
+ else
+ DEPS=""
+ fi
+ done
return
fi
;;
*)
echo "Attempting to run spawn sub - builder..."
+ echo -ne "Package installation failed:\t$package_name\n"
run_sub_builder $package_name
if [ $? -eq 0 ]; then
install_required_packages $package_name;
rm -f ".$package-req.txt"
else
echo "Attempting to run spawn sub - builder..."
+ echo -ne "Package installation failed:\t$package\n"
run_sub_builder $package
if [ $? -eq 0 ]; then
install_required_packages $package;
-sp | --sources-paths)
COMMAND="list-sources-local-paths"
shift ;;
+ -su | --sources-urls)
+ COMMAND="list-sources-urls"
+ shift ;;
-Tvs | --tag-version-stable )
COMMAND="tag";
TAG="STABLE"
echo $SAP | awk '{gsub(/.*\//,"") ; print}'
done
;;
+ "list-sources-urls" )
+ init_builder
+ NOCVSSPEC="yes"
+ DONT_PRINT_REVISION="yes"
+ get_spec
+ parse_spec
+ SAPS="$SOURCES $PATCHES"
+ for SAP in $SAPS ; do
+ echo $SAP
+ done
+ ;;
"list-sources-local-paths" )
init_builder
NOCVSSPEC="yes"