rpms/rpm/devel rpm-4.5.90-cpio-hardlink.patch, NONE, 1.1 rpm-4.5.90-rpmbuild-dirs.patch, NONE, 1.1 rpm-4.5.90-topdir.patch, NONE, 1.1 rpm.spec, 1.294, 1.295

Jindrich Novy jnovy at fedoraproject.org
Thu Sep 11 06:16:50 UTC 2008


Author: jnovy

Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29334

Modified Files:
	rpm.spec 
Added Files:
	rpm-4.5.90-cpio-hardlink.patch rpm-4.5.90-rpmbuild-dirs.patch 
	rpm-4.5.90-topdir.patch 
Log Message:
* Thu Sep 11 2008 Jindrich Novy <jnovy at redhat.com>
- create directory structure for rpmbuild prior to build if it doesn't exist (#455387)
- create _topdir if it doesn't exist when installing SRPM
- don't generate broken cpio in case of hardlink pointing on softlink,
  thanks to pixel at mandriva.com


rpm-4.5.90-cpio-hardlink.patch:

--- NEW FILE rpm-4.5.90-cpio-hardlink.patch ---
commit 5c71ced2da7d99b870a07a83dd8f7e8d1f1b7e4b
Author: Jindrich Novy <jnovy at redhat.com>
Date:   Wed Sep 10 15:04:57 2008 +0200

    Don't generate broken cpio in case of hardlink pointing on softlink
    - thanks to Pixel

diff --git a/lib/fsm.c b/lib/fsm.c
index 0905e3c..8175f82 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1573,7 +1573,7 @@ static int fsmStage(FSM_t fsm, fileStage stage)
 	fsm->postpone = XFA_SKIPPING(fsm->action);
 	if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) {
 	    /* FIX: saveHardLink can modify fsm */
-	    if (!S_ISDIR(st->st_mode) && st->st_nlink > 1)
+	    if (S_ISREG(st->st_mode) && st->st_nlink > 1)
 		fsm->postpone = saveHardLink(fsm);
 	}
 	break;
@@ -1599,7 +1599,7 @@ static int fsmStage(FSM_t fsm, fileStage stage)
 	if (fsm->goal == FSM_PKGBUILD) {
 	    if (fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */
 		break;
-	    if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) {
+	    if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
 		hardLink_t li, prev;
 
 if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
@@ -1699,7 +1699,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
 	    if (!IS_DEV_LOG(fsm->path))
 		rc = CPIOERR_UNKNOWN_FILETYPE;
 	}
-	if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) {
+	if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
 	    fsm->li->createdPath = fsm->li->linkIndex;
 	    rc = fsmMakeLinks(fsm);
 	}
@@ -1743,7 +1743,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
     case FSM_FINI:
 	if (!fsm->postpone && fsm->commit) {
 	    if (fsm->goal == FSM_PKGINSTALL)
-		rc = ((!S_ISDIR(st->st_mode) && st->st_nlink > 1)
+		rc = ((S_ISREG(st->st_mode) && st->st_nlink > 1)
 			? fsmCommitLinks(fsm) : fsmNext(fsm, FSM_COMMIT));
 	    if (fsm->goal == FSM_PKGCOMMIT)
 		rc = fsmNext(fsm, FSM_COMMIT);

rpm-4.5.90-rpmbuild-dirs.patch:

--- NEW FILE rpm-4.5.90-rpmbuild-dirs.patch ---
commit ff7bfd9a32d672f8582ea334ee351af8c32229ad
Author: Jindrich Novy <jnovy at redhat.com>
Date:   Mon Sep 1 14:35:34 2008 +0200

    Create directory structure for rpmbuild prior to build if it doesn't exist
    - creates all needed directories that rpmbuild uses for input and output

diff --git a/build.c b/build.c
index faa09c5..83aaf20 100644
--- a/build.c
+++ b/build.c
@@ -16,6 +16,7 @@
 #include <rpm/rpmts.h>
 #include <rpm/rpmfileutil.h>
 #include <rpm/rpmlog.h>
+#include <lib/misc.h>
 
 #include "build.h"
 #include "debug.h"
@@ -253,6 +254,28 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
 	goto exit;
     }
 
+    /* Be sure all required directories exist, attempt to create them if not */
+    {
+	char *_topdir = rpmGenPath(rpmtsRootDir(ts), "%{_topdir}", ""),
+	     *_builddir = rpmGenPath(rpmtsRootDir(ts), "%{_builddir}", ""),
+	     *_buildrootdir = rpmGenPath(rpmtsRootDir(ts), "%{_buildrootdir}", ""),
+	     *_sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", ""),
+	     *_rpmdir = rpmGenPath(rpmtsRootDir(ts), "%{_rpmdir}", ""),
+	     *_specdir = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", ""),
+	     *_srcrpmdir = rpmGenPath(rpmtsRootDir(ts), "%{_srcrpmdir}", "");
+
+	if ( rpmMkdirPath(_topdir, "_topdir") ||
+	     rpmMkdirPath(_builddir, "_builddir") ||
+	     rpmMkdirPath(_buildrootdir, "_buildrootdir") ||
+	     rpmMkdirPath(_sourcedir, "_sourcedir") ||
+	     rpmMkdirPath(_rpmdir, "_rpmdir") ||
+	     rpmMkdirPath(_specdir, "_specdir") ||
+	     rpmMkdirPath(_srcrpmdir, "_srcrpmdir")
+	) {
+	    goto exit;
+	}
+    }
+
     if (buildSpec(ts, spec, buildAmount, ba->noBuild)) {
 	goto exit;
     }

rpm-4.5.90-topdir.patch:

--- NEW FILE rpm-4.5.90-topdir.patch ---
commit b16df5b3089e36cf0bd697177983dcae11b849ec
Author: Jindrich Novy <jnovy at redhat.com>
Date:   Mon Sep 1 14:31:33 2008 +0200

    Create _topdir if it doesn't exist when installing SRPM
    - otherwise creating _sourcedir and _specdir fails

diff --git a/lib/psm.c b/lib/psm.c
index d4bea69..046964b 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -231,6 +231,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
 {
     int scareMem = 1;
     rpmfi fi = NULL;
+    char * _topdir = NULL;
     char * _sourcedir = NULL;
     char * _specdir = NULL;
     char * specFile = NULL;
@@ -335,6 +336,13 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
 	}
     }
 
+    _topdir = rpmGenPath(rpmtsRootDir(ts), "%{_topdir}", "");
+    rpmrc = rpmMkdirPath(_topdir, "_topdir");
+    if (rpmrc) {
+	rpmrc = RPMRC_FAIL;
+	goto exit;
+    }
+
     _sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", "");
     rpmrc = rpmMkdirPath(_sourcedir, "_sourcedir");
     if (rpmrc) {


Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -r1.294 -r1.295
--- rpm.spec	6 Sep 2008 13:36:14 -0000	1.294
+++ rpm.spec	11 Sep 2008 06:16:20 -0000	1.295
@@ -18,7 +18,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 0.%{snapver}.5
+Release: 0.%{snapver}.6
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -37,6 +37,9 @@
 Patch202: rpm-4.5.90-segfault.patch
 Patch203: rpm-4.5.90-macrofix.patch
 Patch204: rpm-4.5.90-patches.patch
+Patch205: rpm-4.5.90-topdir.patch
+Patch206: rpm-4.5.90-rpmbuild-dirs.patch
+Patch207: rpm-4.5.90-cpio-hardlink.patch
 
 # These are not yet upstream
 Patch300: rpm-4.5.90-posttrans.patch
@@ -172,6 +175,9 @@
 %patch202 -p1 -b .segfault
 %patch203 -p1 -b .macrofix
 %patch204 -p1 -b .patches
+%patch205 -p1 -b .topdir
+%patch206 -p1 -b .rpmbuild-dirs
+%patch207 -p1 -b .cpio-hardlink
 
 # needs a bit of upstream love first...
 #%patch300 -p1 -b .posttrans
@@ -350,6 +356,12 @@
 %doc doc/librpm/html/*
 
 %changelog
+* Thu Sep 11 2008 Jindrich Novy <jnovy at redhat.com>
+- create directory structure for rpmbuild prior to build if it doesn't exist (#455387)
+- create _topdir if it doesn't exist when installing SRPM
+- don't generate broken cpio in case of hardlink pointing on softlink,
+  thanks to pixel at mandriva.com
+
 * Sat Sep 06 2008 Jindrich Novy <jnovy at redhat.com>
 - fail hard if patch isn't found (#461347)
 




More information about the fedora-extras-commits mailing list