Blob Blame History Raw
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) {