autospec/patches/autospec-1.4.14-add_rpm_root_option.patch
2011-04-26 21:39:44 +02:00

80 lines
3.1 KiB
Diff

--- plugins/pck-update.in 2010-03-12 19:52:44.000000000 +0100
+++ /usr/bin/pck-update 2010-03-22 00:56:15.000000000 +0100
@@ -142,6 +142,7 @@
-f, --format "$"Enable specfile autoformatting""
-L, --log "$"Unable logging to file (logging dir: \`\$logging_dir')""
-R, --rebuild "$"Enable rebuilding mode and settings (action 4 only)""
+ --root "$"Specify an alternative root directory to rpm""
"$"Operation modes"":
-h, --help "$"Print this help, then exit""
@@ -191,7 +192,7 @@
force-update,force-build,force-install,force,\
ignore-test:,clear,format,log,rebuild,\
debug,quiet,colorize,help,version,\
-frontend_opts: \
+frontend_opts:,root: \
-n "$me" -- "$@"`
[ $? = 0 ] || exit 1
@@ -263,6 +264,8 @@
let "verbose = 0" ;;
-r|--colorize)
let "colorize = 1" ;;
+ --root)
+ rpm_root_opts="-r $2"; shift ;;
-h|--help)
usage 0 ;;
-V|--version)
@@ -2122,11 +2125,12 @@
--define=\"%_specdir $spec_dir\" \
--define=\"%_sourcedir $source_dir\" \
--define=\"%_builddir $build_dir\" \
- --define=\"%_tmppath $tmppath_dir\""
+ --define=\"%_tmppath $tmppath_dir\" \
+ $rpm_root_opts"
# check if we are cross-compiling
[ "$BUILD_ARCH" != "$target_cpu" ] &&
- rpmbuild_opts="--target $target_cpu"
+ rpmbuild_opts="$rpmbuild_opts --target $target_cpu"
[ "$cleanup" = "1" ] && rpmbuild_opts="$rpmbuild_opts --clean"
@@ -2140,7 +2144,6 @@
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
eval "rpmbuild --nobuild \
$rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
- $spec_dir/$SRPM_SPECFILE 2>&1 ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
@@ -2140,7 +2144,6 @@
notify.note "${NOTE}"$"testing out specfile""${NORM}..."
eval "rpmbuild --nobuild \
$rpmbuild_opts $spec_dir/$SRPM_SPECFILE $rpmdefine_opts 2>&1" ||
- $spec_dir/$SRPM_SPECFILE 2>&1 ||
notify.error $"rpmbuild exited with error code \`$?'"
notify.debug "define_list_name = (${define_list_name[*]})"
@@ -2362,7 +2365,7 @@
notify.error $"package not found"": \`$filename'"
done
- rpm -U --test \
+ rpm -U --test $rpm_root_opts \
$(for pck in ${SPEC_TARGET[*]}; do
echo -n "$rpms_dir/$target_cpu/\
$pck-$pck_rpmversion-$pck_rpmrelease$DISTRO_rpm.$target_cpu.rpm "
@@ -3083,8 +3086,8 @@
else
[ "$rpm_install" ] || notify.error "\
\`rpm_install': "$"unset in the configuration files"
- notify.debug "$rpm_install $pck2install_list"
- $rpm_install $pck2install_list ||
+ notify.debug "$rpm_install $pck2install_list $rpm_root_opts"
+ $rpm_install $pck2install_list $rpm_root_opts ||
notify.error $"cannot install the new rpm packages"
fi
fi