RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Mark Hatle Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 03-Jul-2007 19:49:14 Branch: HEAD Handle: 2007070318491301 Modified files: rpm CHANGES rpm/lib rpmfc.c Log: When the rpmfc_magic_path is not set or is empty, act as if there is no rpm magic and fall back to the behavior if HAVE_MAGIC_H is not configured. Summary: Revision Changes Path 1.1428 +1 -0 rpm/CHANGES 1.6 +7 -1 rpm/lib/rpmfc.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.1427 -r1.1428 CHANGES --- rpm/CHANGES 3 Jul 2007 15:25:36 -0000 1.1427 +++ rpm/CHANGES 3 Jul 2007 17:49:13 -0000 1.1428 @@ -1,4 +1,5 @@ 4.5 -> 5.0: + - mgh: When the rpmfc_magic_path is not set or can't be expanded, act as if there is no magic file - mgh: add lib32 as a valid directory in rpmfc - mgh: change uses of @USRLIBRPM@ to %{_usrlibrpm} (needed for runtime relocation) - mgh: ensure the rpm python module is linked the same as the rest of RPM @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmfc.c ============================================================================ $ cvs diff -u -r1.5 -r1.6 rpmfc.c --- rpm/lib/rpmfc.c 3 Jul 2007 15:25:36 -0000 1.5 +++ rpm/lib/rpmfc.c 3 Jul 2007 17:49:14 -0000 1.6 @@ -886,6 +886,8 @@ int xx; int skipping; +/* Make sure something didn't go wrong previously! */ +assert(fc->fn != NULL); /* Generate package and per-file dependencies. */ for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) { @@ -994,7 +996,7 @@ #ifdef HAVE_MAGIC_H magicfile = rpmExpand("%{?_rpmfc_magic_path}", NULL); if (magicfile == NULL || *magicfile == '\0' || *magicfile == '%') - goto exit; + magicfile = _free(magicfile); #endif fc->nfiles = argvCount(argv); @@ -1008,6 +1010,7 @@ xx = argvAdd(&fc->cdict, "directory"); #ifdef HAVE_MAGIC_H + if (magicfile) { ms = magic_open(msflags); if (ms == NULL) { xx = RPMERR_EXEC; @@ -1023,6 +1026,7 @@ magicfile, magic_error(ms)); assert(xx != -1); /* XXX figger a proper return path. */ } + } #endif for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) { @@ -1083,6 +1087,7 @@ ftype = ""; else #ifdef HAVE_MAGIC_H + if (magicfile) { ftype = magic_file(ms, s); if (ftype == NULL) { @@ -1091,6 +1096,7 @@ s, mode, magic_error(ms)); assert(ftype != NULL); /* XXX figger a proper return path. */ } + } #else ftype = ""; #endif @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org