rpm/rpm-4.5.90-topdir.patch
Jindrich Novy 507434f781 - 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@mandriva.com
2008-09-11 06:16:20 +00:00

34 lines
970 B
Diff

commit b16df5b3089e36cf0bd697177983dcae11b849ec
Author: Jindrich Novy <jnovy@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) {