Bug 1026 - rpm: Setting buildroot via rpmrc and --buildroot does not work
rpm: Setting buildroot via rpmrc and --buildroot does not work
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
5.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-02-02 10:54 EST by moh
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-12-16 14:29:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description moh 1999-02-02 10:54:12 EST
Setting the buildroot path via command line option
  --buildroot or rpmrc file does not work as expected.

As far as I can see the entry in the rpmrc file is
completely ignored.

When using the --buildroot switch together with badly
formatted directory names (/x//y/z/) the first characters
from filenames found in the resulting rpm package are
removed. (usr/bin/xx instead of /usr/bin/xx) This
happens when directories are specified in the %files
section.

Fix:

--- rpm-2.5.5/build.c   Thu Sep 24 22:23:16 1998
+++ rpm-2.5.5_mod/build.c       Tue Feb  2 15:59:45 1999
@@ -18,6 +18,7 @@
 #include "build/build.h"
 #include "build/parse.h"
 #include "build/spec.h"
+#include "build/misc.h"

 int build(char *arg, int buildAmount, char *passPhrase,
                 char *buildRoot, int fromTarball, int test,
char *cookie) {
@@ -135,6 +136,11 @@
        }
        s++;
     }
+
+    if (!buildRoot)
+       buildRoot = rpmGetVar(RPMVAR_BUILDROOT);
+    if (buildRoot)
+       buildRoot = strdup(cleanFileName(buildRoot));

 #define        _anyarch(_f)    \
 (((_f)&(RPMBUILD_PACKAGESOURCE|RPMBUILD_PACKAGEBINARY)) ==
RPMBUILD_PACKAGESOURCE)
Comment 1 Jeff Johnson 1999-12-16 14:29:59 EST
Fixed in rpm-3.0.4-0.16 (with apologies for the long delay).

Note You need to log in before you can comment on or make changes to this bug.