Dumb thinko breaking tar builds from relative paths (rhbz#456321)
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Jul 2008 08:17:50 +0000 (11:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 24 Jul 2008 08:18:02 +0000 (11:18 +0300)
build.c

diff --git a/build.c b/build.c
index bdbdfef..faa09c5 100644 (file)
--- a/build.c
+++ b/build.c
@@ -195,11 +195,12 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
        /* Make the directory of the tarball %_sourcedir for this run */
        /* dirname() may modify contents so extra hoops needed. */
        if (*arg != '/') {
-           srcdir = dir = rpmGetCwd();
+           dir = rpmGetCwd();
+           rstrscat(&dir, "/", arg, NULL);
        } else {
            dir = xstrdup(arg);
-           srcdir = dirname(dir);
        }
+       srcdir = dirname(dir);
        addMacro(NULL, "_sourcedir", NULL, srcdir, RMIL_TARBALL);
        free(dir);
     } else {