RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES INSTALL configure.ac rpm/lib/ rpmfc.c rpmfc.h

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Wed 27 Jun 2007 - 23:05:07 CEST
Message-Id: <20070627210507.BB6553484E4@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   27-Jun-2007 23:05:07
  Branch: HEAD                             Handle: 2007062722050601

  Modified files:
    rpm                     CHANGES INSTALL configure.ac
    rpm/lib                 rpmfc.c rpmfc.h

  Log:
    Actually support Autoconf option "--without-file", i.e., building RPM
    without File/magic support. This way File/magic support is technically
    _really_ optional, although one usually builds RPM with it, of course.

  Summary:
    Revision    Changes     Path
    1.1408      +1  -0      rpm/CHANGES
    2.17        +1  -1      rpm/INSTALL
    2.149       +2  -2      rpm/configure.ac
    1.4         +19 -0      rpm/lib/rpmfc.c
    1.3         +0  -3      rpm/lib/rpmfc.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1407 -r1.1408 CHANGES
  --- rpm/CHANGES	27 Jun 2007 20:34:13 -0000	1.1407
  +++ rpm/CHANGES	27 Jun 2007 21:05:06 -0000	1.1408
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: implement --without-file, i.e., building RPM without File/magic support
       - rse: use regular LIBS for linking against SELinux library
       - rse: no longer re-build db_xxx utilities in rpmdb/ -- use already built db3/ versions instead
       - rse: no longer any librpm* libraries against external third-party libraries (rely on pkg-config)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/INSTALL
  ============================================================================
  $ cvs diff -u -r2.16 -r2.17 INSTALL
  --- rpm/INSTALL	27 Jun 2007 20:20:26 -0000	2.16
  +++ rpm/INSTALL	27 Jun 2007 21:05:06 -0000	2.17
  @@ -29,9 +29,9 @@
   POPT            mandatory 1.9     1.11    http://rpm5.org/files/popt/
   BeeCrypt        mandatory 4.0     4.1.2   http://www.virtualunlimited.com/products/beecrypt/
   Neon            mandatory 0.26    0.26.3  http://www.webdav.org/neon/
  -File/magic      mandatory 4.0     4.21    ftp://ftp.astron.com/pub/file/
   Berkeley-DB [1] mandatory -       4.5.20  http://www.oracle.com/database/berkeley-db.html
   SQLite          optional  3.3     3.4.0   http://www.sqlite.org/
  +File/magic      optional  4.0     4.21    ftp://ftp.astron.com/pub/file/
   ZLib [2]        optional  1.2     1.2.3   http://www.zlib.net/
   GNU bzip2       optional  1.0     1.0.4   http://www.bzip2.org/
   Lua [3]         optional  -       5.0     http://www.lua.org/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.148 -r2.149 configure.ac
  --- rpm/configure.ac	27 Jun 2007 20:34:13 -0000	2.148
  +++ rpm/configure.ac	27 Jun 2007 21:05:06 -0000	2.149
  @@ -717,8 +717,8 @@
   RPM_CHECK_LIB(
       [File (magic)], [file],
       [magic], [magic_open], [magic.h],
  -    [yes,external:internal], [file:src:src],
  -    [], [ AC_ERROR([mandatory File (magic) library not found]) ])
  +    [yes,external:internal:none], [file:src:src],
  +    [], [])
   
   dnl # POPT
   RPM_CHECK_LIB(
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmfc.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rpmfc.c
  --- rpm/lib/rpmfc.c	9 Jun 2007 19:07:57 -0000	1.3
  +++ rpm/lib/rpmfc.c	27 Jun 2007 21:05:07 -0000	1.4
  @@ -2,6 +2,11 @@
   
   #include <signal.h>	/* getOutputFrom() */
   
  +#ifdef HAVE_MAGIC_H
  +#undef	FILE_RCSID
  +#include "magic.h"
  +#endif
  +
   #define	_RPMEVR_INTERNAL
   #include <rpmbuild.h>
   #include <argv.h>
  @@ -976,16 +981,20 @@
       size_t slen;
       int fcolor;
       int xx;
  +#ifdef HAVE_MAGIC_H
       const char * magicfile;
       int msflags = MAGIC_CHECK;	/* XXX MAGIC_COMPRESS flag? */
       magic_t ms = NULL;
  +#endif
   
       if (fc == NULL || argv == NULL)
   	return 0;
   
  +#ifdef HAVE_MAGIC_H
       magicfile = rpmExpand("%{?_rpmfc_magic_path}", NULL);
       if (magicfile == NULL || *magicfile == '\0' || *magicfile == '%')
   	goto exit;
  +#endif
   
       fc->nfiles = argvCount(argv);
   
  @@ -997,6 +1006,7 @@
       xx = argvAdd(&fc->cdict, "");
       xx = argvAdd(&fc->cdict, "directory");
   
  +#ifdef HAVE_MAGIC_H
       ms = magic_open(msflags);
       if (ms == NULL) {
   	xx = RPMERR_EXEC;
  @@ -1012,6 +1022,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++) {
   	const char * ftype;
  @@ -1070,6 +1081,7 @@
   	    else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
   		ftype = "";
   	    else
  +#ifdef HAVE_MAGIC_H
   		ftype = magic_file(ms, s);
   
   	    if (ftype == NULL) {
  @@ -1078,6 +1090,9 @@
   			s, mode, magic_error(ms));
   assert(ftype != NULL);	/* XXX figger a proper return path. */
   	    }
  +#else
  +		ftype = "";
  +#endif
   	    /*@switchbreak@*/ break;
   	}
   /*@=branchstate@*/
  @@ -1119,11 +1134,15 @@
   
       fcav = argvFree(fcav);
   
  +#ifdef HAVE_MAGIC_H
       if (ms != NULL)
   	magic_close(ms);
  +#endif
   
  +#ifdef HAVE_MAGIC_H
   exit:
       magicfile = _free(magicfile);
  +#endif
   
       return 0;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmfc.h
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 rpmfc.h
  --- rpm/lib/rpmfc.h	25 May 2007 18:34:13 -0000	1.2
  +++ rpm/lib/rpmfc.h	27 Jun 2007 21:05:07 -0000	1.3
  @@ -1,9 +1,6 @@
   #ifndef _H_RPMFC_
   #define _H_RPMFC_
   
  -#undef	FILE_RCSID
  -#include "magic.h"
  -
   /*@-exportlocal@*/
   /*@unchecked@*/
   extern int _rpmfc_debug;
  @@ .
Received on Wed Jun 27 23:05:07 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.