SOURCES: rpm-etc_dir.patch - merged baggins's changes from AC-branch
qboosh
qboosh at pld-linux.org
Tue Sep 13 13:37:38 CEST 2005
Author: qboosh Date: Tue Sep 13 11:37:38 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- merged baggins's changes from AC-branch
---- Files affected:
SOURCES:
rpm-etc_dir.patch (1.6 -> 1.7)
---- Diffs:
================================================================
Index: SOURCES/rpm-etc_dir.patch
diff -u SOURCES/rpm-etc_dir.patch:1.6 SOURCES/rpm-etc_dir.patch:1.7
--- SOURCES/rpm-etc_dir.patch:1.6 Sat Jul 23 13:35:24 2005
+++ SOURCES/rpm-etc_dir.patch Tue Sep 13 13:37:33 2005
@@ -1,101 +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.1/rpmio/macro.c.orig 2005-07-19 18:53:09.358430440 +0200
-+++ rpm-4.4.1/rpmio/macro.c 2005-07-19 19:04:25.098702304 +0200
-@@ -6,6 +6,12 @@
- #include "system.h"
- #include <stdarg.h>
-
-+#ifdef USE_HOME_ETC
-+#include <home_etc.h>
-+#else
-+#define _HE(x) (x)
-+#endif
-+
- #if !defined(isblank)
- #define isblank(_c) ((_c) == ' ' || (_c) == '\t')
- #endif
-@@ -1732,7 +1738,7 @@
- /* XXX Prepend the URL leader for globs that have stripped it off */
- maxb = 0;
- for (i = 0; i < gl.gl_pathc; i++) {
-- if ((nb = strlen(&(gl.gl_pathv[i][0]))) > maxb)
-+ if ((nb = strlen(_HE(&(gl.gl_pathv[i][0])))) > maxb)
- maxb = nb;
- }
-
-@@ -1766,7 +1772,7 @@
- const char * globFile = &(gl.gl_pathv[i][0]);
- if (globRoot > globURL && globRoot[-1] == '/')
- while (*globFile == '/') globFile++;
-- strcpy(globRoot, globFile);
-+ strcpy(globRoot, _HE(globFile));
- if (_debug)
- fprintf(stderr, "*** rpmGlob argv[%d] \"%s\"\n", argc, globURL);
- argv[argc++] = xstrdup(globURL);
---- 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.2/rpmio/Makefile.am.orig 2005-07-23 13:40:23.194135096 +0200
-+++ rpm-4.4.2/rpmio/Makefile.am 2005-07-23 13:42:06.205474992 +0200
-@@ -40,6 +40,7 @@
- @WITH_LUA_LIB@ \
- @WITH_MAGIC_LIB@ \
- @WITH_ZLIB_LIB@ \
-+ @HOME_ETC_LIB@ \
- -lpthread
- librpmio_la_LIBADD = # $(BEECRYPTLOBJS)
- librpmio_la_DEPENDENCIES = # .created
---- 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.6&r2=1.7&f=u
More information about the pld-cvs-commit
mailing list