2008-11-22 07:15:20 +08:00
|
|
|
# rpmvercmp.at: rpm config file behavior tests
|
|
|
|
|
2008-11-22 19:26:43 +08:00
|
|
|
AT_BANNER([RPM config file behavior])
|
|
|
|
|
2008-11-22 07:15:20 +08:00
|
|
|
# ------------------------------
|
|
|
|
# (Build and) upgrade package with config file, no backup here
|
|
|
|
AT_SETUP([rpm -U to package with unchanged config file])
|
2008-11-22 20:07:34 +08:00
|
|
|
AT_KEYWORDS([install])
|
2008-11-22 07:15:20 +08:00
|
|
|
AT_CHECK([
|
|
|
|
RPMDB_CLEAR
|
2011-04-01 22:43:13 +08:00
|
|
|
RPMDB_INIT
|
2008-11-22 07:15:20 +08:00
|
|
|
rm -rf "${TOPDIR}"
|
|
|
|
rm -rf "${RPMTEST}/etc/my.conf"
|
|
|
|
|
|
|
|
for v in "1.0" "2.0"; do
|
|
|
|
run rpmbuild --quiet -bb \
|
|
|
|
--define "ver $v" \
|
|
|
|
--define "filedata foo" \
|
|
|
|
${RPMDATA}/SPECS/configtest.spec
|
|
|
|
done
|
|
|
|
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
|
|
|
|
],
|
|
|
|
[0],
|
|
|
|
)
|
|
|
|
AT_CLEANUP
|
|
|
|
#
|
|
|
|
# ------------------------------
|
|
|
|
# Upgrade package with locally modified config file, unchanged in pkg
|
|
|
|
AT_SETUP([rpm -U to package with locally modified config file])
|
2008-11-22 20:07:34 +08:00
|
|
|
AT_KEYWORDS([install])
|
2008-11-22 07:15:20 +08:00
|
|
|
AT_CHECK([
|
|
|
|
RPMDB_CLEAR
|
2011-04-01 22:43:13 +08:00
|
|
|
RPMDB_INIT
|
2008-11-22 07:15:20 +08:00
|
|
|
rm -rf "${TOPDIR}"
|
|
|
|
rm -rf "${RPMTEST}/etc/my.conf"
|
|
|
|
|
|
|
|
for v in "1.0" "2.0"; do
|
|
|
|
run rpmbuild --quiet -bb \
|
|
|
|
--define "ver $v" \
|
|
|
|
--define "filedata foo" \
|
|
|
|
${RPMDATA}/SPECS/configtest.spec
|
|
|
|
done
|
|
|
|
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
|
|
|
|
echo "otherstuff" > "${RPMTEST}"/etc/my.conf
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
|
|
|
|
],
|
|
|
|
[0],
|
|
|
|
)
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
# Upgrade package with unmodified config file, changed in pkg
|
|
|
|
AT_SETUP([rpm -U to package with unchanged config file])
|
2008-11-22 20:07:34 +08:00
|
|
|
AT_KEYWORDS([install])
|
2008-11-22 07:15:20 +08:00
|
|
|
AT_CHECK([
|
|
|
|
RPMDB_CLEAR
|
2011-04-01 22:43:13 +08:00
|
|
|
RPMDB_INIT
|
2008-11-22 07:15:20 +08:00
|
|
|
rm -rf "${TOPDIR}"
|
|
|
|
rm -rf "${RPMTEST}/etc/my.conf"
|
|
|
|
|
|
|
|
for v in "1.0" "2.0"; do
|
|
|
|
run rpmbuild --quiet -bb \
|
|
|
|
--define "ver $v" \
|
|
|
|
--define "filedata foo-$v" \
|
|
|
|
${RPMDATA}/SPECS/configtest.spec
|
|
|
|
done
|
|
|
|
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
|
|
|
|
],
|
|
|
|
[0],
|
|
|
|
)
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
# Upgrade package with locally modified config file, changed in pkg
|
|
|
|
AT_SETUP([rpm -U to package with modified config file])
|
2008-11-22 20:07:34 +08:00
|
|
|
AT_KEYWORDS([install])
|
2008-11-22 07:15:20 +08:00
|
|
|
AT_CHECK([
|
|
|
|
RPMDB_CLEAR
|
2011-04-01 22:43:13 +08:00
|
|
|
RPMDB_INIT
|
2008-11-22 07:15:20 +08:00
|
|
|
rm -rf "${TOPDIR}"
|
|
|
|
rm -rf "${RPMTEST}/etc/my.conf"
|
|
|
|
|
|
|
|
for v in "1.0" "2.0"; do
|
|
|
|
run rpmbuild --quiet -bb \
|
|
|
|
--define "ver $v" \
|
|
|
|
--define "filedata foo-$v" \
|
|
|
|
${RPMDATA}/SPECS/configtest.spec
|
|
|
|
done
|
|
|
|
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
|
|
|
|
echo "otherstuff" > "${RPMTEST}"/etc/my.conf
|
|
|
|
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
|
|
|
|
],
|
|
|
|
[0],
|
|
|
|
[ignore],
|
|
|
|
[warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
|
|
|
|
)
|
|
|
|
AT_CLEANUP
|