teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.5.90-topdir.patch

Jindrich Novy 507434
commit b16df5b3089e36cf0bd697177983dcae11b849ec
Jindrich Novy 507434
Author: Jindrich Novy <jnovy@redhat.com>
Jindrich Novy 507434
Date:   Mon Sep 1 14:31:33 2008 +0200
Jindrich Novy 507434
Jindrich Novy 507434
    Create _topdir if it doesn't exist when installing SRPM
Jindrich Novy 507434
    - otherwise creating _sourcedir and _specdir fails
Jindrich Novy 507434
Jindrich Novy 507434
diff --git a/lib/psm.c b/lib/psm.c
Jindrich Novy 507434
index d4bea69..046964b 100644
Jindrich Novy 507434
--- a/lib/psm.c
Jindrich Novy 507434
+++ b/lib/psm.c
Jindrich Novy 507434
@@ -231,6 +231,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
Jindrich Novy 507434
 {
Jindrich Novy 507434
     int scareMem = 1;
Jindrich Novy 507434
     rpmfi fi = NULL;
Jindrich Novy 507434
+    char * _topdir = NULL;
Jindrich Novy 507434
     char * _sourcedir = NULL;
Jindrich Novy 507434
     char * _specdir = NULL;
Jindrich Novy 507434
     char * specFile = NULL;
Jindrich Novy 507434
@@ -335,6 +336,13 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
Jindrich Novy 507434
 	}
Jindrich Novy 507434
     }
Jindrich Novy 507434
 
Jindrich Novy 507434
+    _topdir = rpmGenPath(rpmtsRootDir(ts), "%{_topdir}", "");
Jindrich Novy 507434
+    rpmrc = rpmMkdirPath(_topdir, "_topdir");
Jindrich Novy 507434
+    if (rpmrc) {
Jindrich Novy 507434
+	rpmrc = RPMRC_FAIL;
Jindrich Novy 507434
+	goto exit;
Jindrich Novy 507434
+    }
Jindrich Novy 507434
+
Jindrich Novy 507434
     _sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", "");
Jindrich Novy 507434
     rpmrc = rpmMkdirPath(_sourcedir, "_sourcedir");
Jindrich Novy 507434
     if (rpmrc) {