SOURCES (AC-branch): rpm-etc_dir.patch - with no macros.c hacking, ...
baggins
baggins at pld-linux.org
Mon Aug 29 19:03:21 CEST 2005
Author: baggins Date: Mon Aug 29 17:03:21 2005 GMT
Module: SOURCES Tag: AC-branch
---- Log message:
- with no macros.c hacking, we are now able to drop libhome_etc dependency
---- Files affected:
SOURCES:
rpm-etc_dir.patch (1.5.2.2 -> 1.5.2.3)
---- Diffs:
================================================================
Index: SOURCES/rpm-etc_dir.patch
diff -u SOURCES/rpm-etc_dir.patch:1.5.2.2 SOURCES/rpm-etc_dir.patch:1.5.2.3
--- SOURCES/rpm-etc_dir.patch:1.5.2.2 Mon Aug 29 18:49:07 2005
+++ SOURCES/rpm-etc_dir.patch Mon Aug 29 19:03:16 2005
@@ -1,58 +1,74 @@
---- rpm-4.4.1/lib/rpmrc.c.orig 2005-07-19 18:53:09.096470264 +0200
-+++ rpm-4.4.1/lib/rpmrc.c 2005-07-19 19:00:48.610613496 +0200
-@@ -1,6 +1,12 @@
- /*@-bounds@*/
- #include "system.h"
-
-+#ifdef USE_HOME_ETC
-+#include <home_etc.h>
-+#else
-+#define _HE(x) (x)
-+#endif
-+
- #include <stdarg.h>
- #if defined(__linux__) && defined(__powerpc__)
- #include <setjmp.h>
-@@ -1815,13 +1821,13 @@
- rc = 1;
- break;
- }
+diff -Nru rpm-4.1/lib/rpmrc.c rpm-4.1.new/lib/rpmrc.c
+--- rpm-4.1/lib/rpmrc.c Tue Aug 20 16:53:44 2002
++++ rpm-4.1.new/lib/rpmrc.c Tue Mar 11 18:41:48 2003
+@@ -1756,27 +1756,39 @@
+ /* Expand ~/ to $HOME/ */
+ fn[0] = '\0';
+ if (r[0] == '~' && r[1] == '/') {
++ const char * etc_dir = getenv("HOME_ETC");
+ const char * home = getenv("HOME");
+- if (home == NULL) {
++ if (etc_dir) {
++ if (strlen(etc_dir) > (sizeof(fn) - strlen(r))) {
++ rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME_ETC is too large.\n"),r);
++ rc = 1;
++ break;
++ }
++ strcpy(fn, etc_dir);
++ strncat(fn, "/", sizeof(fn) - strlen(fn));
++ r+=2;
++
++ } else {
++ if (home == NULL) {
+ /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
+- if (rcfiles == defrcfiles && myrcfiles != r)
+- continue;
+- rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
+- rc = 1;
+- break;
+- }
- if (strlen(home) > (sizeof(fn) - strlen(r))) {
-+ if (strlen(_HE(home)) > (sizeof(fn) - strlen(r))) {
- rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
+- rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
++ if (rcfiles == defrcfiles && myrcfiles != r)
++ continue;
++ rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
++ rc = 1;
++ break;
++ }
++ if (strlen(home) > (sizeof(fn) - strlen(r))) {
++ rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
r);
- rc = 1;
- break;
- }
+- rc = 1;
+- break;
+- }
- strcpy(fn, home);
-+ strcpy(fn, _HE(home));
- r++;
- }
- strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
---- rpm-4.4.2/lib/Makefile.am.orig 2005-07-23 13:40:23.191135552 +0200
-+++ rpm-4.4.2/lib/Makefile.am 2005-07-23 13:41:49.474018560 +0200
-@@ -46,6 +46,7 @@
- $(top_builddir)/rpmio/librpmio.la \
- @WITH_POPT_LIB@ \
- @WITH_SELINUX_LIB@ \
-+ @HOME_ETC_LIB@ \
- @INTLLIBS@
-
- getdate.c: getdate.y
---- rpm-4.4.1/configure.ac.orig 2005-07-19 18:53:09.385426000 +0200
-+++ rpm-4.4.1/configure.ac 2005-07-19 19:10:49.732229120 +0200
-@@ -945,6 +945,14 @@
- fi
- AC_SUBST(WITH_SELINUX_LIB)
+- r++;
+- }
+- strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
+- fn[sizeof(fn)-1] = '\0';
+-
++ rc = 1;
++ break;
++ }
++ strcpy(fn, home);
++ r++;
++ }
++ }
++ strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
++ fn[sizeof(fn)-1] = '\0';
+ /* Read another rcfile */
+ fd = Fopen(fn, "r.fpio");
+ if (fd == NULL || Ferror(fd)) {
+--- rpm-4.3/po/pl.po.orig 2003-06-10 23:59:11.000000000 +0200
++++ rpm-4.3/po/pl.po 2003-06-11 00:06:16.000000000 +0200
+@@ -2834,6 +2834,10 @@
+ msgid "Please contact rpm-list at redhat.com\n"
+ msgstr "Proszę skontaktować się z rpm-list at redhat.com\n"
-+withval=no
-+AC_ARG_WITH(home_etc, [ --with-home_etc build with home_etc support ])
-+if test $withval != no ; then
-+ AC_DEFINE(USE_HOME_ETC, 1, [Build with home_etc support?])
-+ HOME_ETC_LIB="-lhome_etc"
-+fi
-+AC_SUBST(HOME_ETC_LIB)
++#: lib/rpmrc.c:1764
++msgid "Cannot read %s, HOME_ETC is too large.\n"
++msgstr "Nie można odczytać %s, HOME_ETC jest zbyt duże.\n"
+
- WITH_LUA_LIB=
- WITH_LUA_SUBDIR=
- WITH_LUA_INCLUDE=
+ #: lib/rpmrc.c:1813
+ #, c-format
+ msgid "Cannot expand %s\n"
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/rpm-etc_dir.patch?r1=1.5.2.2&r2=1.5.2.3&f=u
More information about the pld-cvs-commit
mailing list