Cherrypick from master 2010-05-08 12:32:02 UTC sparky <sparky@pld-linux.org> '- chroot back to old root, not to old pwd':
rpm-lua-exit-chroot-correctly.patch -> 1.1
rpm-popt-aliases.patch -> 1.4
Cherrypick from rpm-4_4_9 2010-05-28 19:25:09 UTC Marcin Banasiak <marcin.banasiak@gmail.com> '- don't generate:':
rpm-macros-th.patch -> 1.5.2.4
--- /dev/null
+--- rpm-4.5/lib/psm.c 2010-05-08 14:14:22.817080224 +0200
++++ rpm-4.5/lib/psm.c 2010-05-08 14:14:03.063343062 +0200
+@@ -469,6 +469,7 @@
+ /*@modifies psm, fileSystem, internalState @*/
+ {
+ const rpmts ts = psm->ts;
++ int pwdFdno = -1;
+ int rootFdno = -1;
+ const char *n, *v, *r;
+ rpmRC rc = RPMRC_OK;
+@@ -487,9 +488,12 @@
+
+ /* Save the current working directory. */
+ /*@-nullpass@*/
+- rootFdno = open(".", O_RDONLY, 0);
++ pwdFdno = open(".", O_RDONLY, 0);
+ /*@=nullpass@*/
+
++ /* Save the current root directory. */
++ rootFdno = open("/", O_RDONLY, 0);
++
+ /* Get into the chroot. */
+ if (!rpmtsChrootDone(ts)) {
+ const char *rootDir = rpmtsRootDir(ts);
+@@ -554,10 +558,12 @@
+ /*@=superuser =noeffect @*/
+ xx = rpmtsSetChrootDone(ts, 0);
+ }
++ xx = fchdir(pwdFdno);
+ } else
+- xx = fchdir(rootFdno);
++ xx = fchdir(pwdFdno);
+
+ xx = close(rootFdno);
++ xx = close(pwdFdno);
+
+ return rc;
+ }
--- /dev/null
+diff -urN rpm-4.5/macros.in rpm-4.5.new//macros.in
+--- rpm-4.5/macros.in 2010-05-28 20:56:02.854032755 +0200
++++ rpm-4.5.new//macros.in 2010-05-28 20:59:04.177348180 +0200
+@@ -277,6 +277,9 @@
+ #
+ #%distribution
+
++# PLD Linux Release
++%pld_release th
++
+ # Configurable distribution URL, same as DistURL: tag in a specfile.
+ # The URL will be used to supply reliable information to tools like
+ # rpmfind.
+@@ -1449,7 +1452,7 @@
+ # Note: Used iff _use_internal_dependency_generator is non-zero. The
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ %__libtool_provides %{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name}
+-%__libtool_requires %{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name}
++%__libtool_requires %{nil}
+
+ #------------------------------------------------------------------------
+ # pkgconfig(...) configuration.
+@@ -1459,7 +1462,7 @@
+ # Note: Used iff _use_internal_dependency_generator is non-zero. The
+ # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+ %__pkgconfig_provides %{_rpmhome}/pkgconfigdeps.sh --provides
+-%__pkgconfig_requires %{_rpmhome}/pkgconfigdeps.sh --requires
++%__pkgconfig_requires %{nil}
+
+ #------------------------------------------------------------------------
+ # executable(...) configuration.
+@@ -1482,6 +1485,9 @@
+ # -feliminate-dwarf2-dups disabled until PR ld/3290 is fixed.
+
+ %debugcflags -O0 -g -Wall
++%debugcppflags %{nil}
++%optldflags -Wl,--as-needed -Wl,-z,relro -Wl,-z,combreloc
++%optcppflags -D_FORTIFY_SOURCE=2
+
+ # Warning: those macros are overwritten by macros.build,
+ # left here for compatibility
--- /dev/null
+--- rpm-4.4.9/rpmpopt.in 2008-03-24 22:09:33.709972364 +0200
++++ rpm-4.4.9/rpmpopt.in 2008-04-04 18:51:45.658923774 +0300
+@@ -595,4 +595,19 @@
+ rpmv alias --httpproxy --define '_httpproxy !#:+'
+
++rpm alias --downgrade --oldpackage \
++ --POPTdesc=$"Allow an upgrade to replace a newer package with an older one."
++
++rpm alias --what-provides --whatprovides \
++ --POPTdesc=$"find package name that contains a provided capability"
++
++rpm alias --what-requires --whatrequires \
++ --POPTdesc=$"find package name that contains a required capability"
++
++rpm alias --norepackage --define '_repackage_all_erasures 0' \
++ --POPTdesc=$"Disable re-package of the files before erasing"
++
++rpmbuild alias --disable-debuginfo --define '_enable_debug_packages 0' \
++ --POPTdesc=$"Disable debuginfo package creation"
++
+ # \endverbatim
+ #*/