RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/build/ files.c rpm/lib/ rpmlib.h

From: Bernhard Rosenkraenzer <bero@rpm5.org>
Date: Fri 12 Oct 2007 - 20:53:48 CEST
Message-Id: <20071012185349.012FE348451@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Bernhard Rosenkraenzer
  Root:   /v/rpm/cvs                       Email:  bero@rpm5.org
  Module: rpm                              Date:   12-Oct-2007 20:53:48
  Branch: HEAD                             Handle: 2007101219534800

  Modified files:
    rpm                     CHANGES
    rpm/build               files.c
    rpm/lib                 rpmlib.h

  Log:
    Add %optional keyboard
    
    Submitted by: bero

  Summary:
    Revision    Changes     Path
    1.1675      +2  -0      rpm/CHANGES
    1.267       +18 -6      rpm/build/files.c
    2.440       +2  -1      rpm/lib/rpmlib.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1674 -r1.1675 CHANGES
  --- rpm/CHANGES	12 Oct 2007 18:15:10 -0000	1.1674
  +++ rpm/CHANGES	12 Oct 2007 18:53:48 -0000	1.1675
  @@ -1,4 +1,6 @@
   4.5 -> 5.0:
  +    - bero: Add %optional flag on files (packages a file if it is there,
  +      but doesn't error out if it isn't there)
       - bero: Support multiple %files files per package (%files -f f1,f2,...)
       - bero: Detect Ark Linux as RPMCANONVENDOR
       - rpm.org: have selinux disabled imply RPMTRANS_FLAG_NOCONTEXTS.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/files.c
  ============================================================================
  $ cvs diff -u -r1.266 -r1.267 files.c
  --- rpm/build/files.c	12 Oct 2007 18:15:11 -0000	1.266
  +++ rpm/build/files.c	12 Oct 2007 18:53:48 -0000	1.267
  @@ -878,6 +878,7 @@
   	{ "%license",	0,	RPMFILE_LICENSE },
   	{ "%pubkey",	0,	RPMFILE_PUBKEY },
   	{ "%policy",	0,	RPMFILE_POLICY },
  +	{ "%optional",	0,	RPMFILE_OPTIONAL },
   
   #if WHY_NOT
   	{ "%icon",	0,	RPMFILE_ICON },
  @@ -1770,9 +1771,14 @@
   	    statp->st_mtime = now;
   	    statp->st_ctime = now;
   	} else if (Lstat(diskURL, statp)) {
  -	    rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskURL);
  -	    fl->processingFailed = 1;
  -	    rc = RPMRC_FAIL;
  +	    if (fl->currentFlags & RPMFILE_OPTIONAL) {
  +		rpmlog(RPMLOG_WARNING, _("Optional file not found: %s\n"), diskURL);
  +		rc = 0;
  +	    } else {
  +		rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskURL);
  +		fl->processingFailed = 1;
  +		rc = RPMRC_FAIL;
  +	    }
   	    goto exit;
   	}
       }
  @@ -2099,9 +2105,15 @@
   	    }
   	    argv = _free(argv);
   	} else {
  -	    rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"),
  -			diskURL);
  -	    rc = 1;
  +	    if (fl->currentFlags & RPMFILE_OPTIONAL) {
  +		rpmlog(RPMLOG_WARNING, _("Optional file not found by glob: %s\n"),
  +			    diskURL);
  +		rc = 0;
  +	    } else {
  +		rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"),
  +			    diskURL);
  +		rc = 1;
  +	    }
   	    goto exit;
   	}
   	/*@=branchstate@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmlib.h
  ============================================================================
  $ cvs diff -u -r2.439 -r2.440 rpmlib.h
  --- rpm/lib/rpmlib.h	30 Sep 2007 22:38:28 -0000	2.439
  +++ rpm/lib/rpmlib.h	12 Oct 2007 18:53:48 -0000	2.440
  @@ -489,7 +489,8 @@
       RPMFILE_SPARSE	= (1 << 14),	/*!< was ((512*st->st_blocks) < st->st_size) ? */
       RPMFILE_TYPED	= (1 << 15),	/*!< (unimplemented) from %%spook */
       RPMFILE_SOURCE	= (1 << 16),	/*!< from SourceN: (srpm only). */
  -    RPMFILE_PATCH	= (1 << 17)	/*!< from PatchN: (srpm only). */
  +    RPMFILE_PATCH	= (1 << 17),	/*!< from PatchN: (srpm only). */
  +    RPMFILE_OPTIONAL	= (1 << 18)	/*!< from %%optional. */
   } rpmfileAttrs;
   
   #define	RPMFILE_SPOOK	(RPMFILE_GHOST|RPMFILE_TYPED)
  @@ .
Received on Fri Oct 12 20:53:49 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.