Bug 97416 - Ability to overrule "hostname" as "Buildhost"
Ability to overrule "hostname" as "Buildhost"
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Johnson
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-14 22:13 EDT by Paul Bolle
Modified: 2007-03-27 00:07 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-07 13:07:40 EDT
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 Paul Bolle 2003-06-14 22:13:13 EDT
At present one can define (a.o.) 'Packager' and 'Vendor' when one builds an rpm but not the 
'Buildhost'. 'Buildhost' will equal the 'hostname'. There seem to be valid reasons for that, but I 
still thought a 'buildhost' macro would be nice. Therefore, too much work let to this (trivial?) 
patch (against build/names.c of rpm 4.2 as distributed with Red Hat Linux 9): 
 
--- build/names.c	2002-07-02 21:07:03.000000000 +0200 
+++ build/names.c	2003-06-15 01:39:57.000000000 +0200 
@@ -198,7 +198,17 @@ 
     static char hostname[1024]; 
     static int gotit = 0; 
     struct hostent *hbn; 
+    char *rpmbh; 
  
+    if (gotit) return hostname; 
+    rpmbh=rpmExpand("%{?buildhost}", NULL); 
+    if (*rpmbh!='\0' && strlen(rpmbh)<sizeof hostname) { 
+        gotit=1; 
+        strcpy (hostname, rpmbh); 
+        rpmMessage(RPMMESS_NORMAL, "Buildhost set to '%s' for this build\n", rpmbh); 
+    } 
+    _free(rpmbh); 
+     
     if (! gotit) { 
         (void) gethostname(hostname, sizeof(hostname)); 
 	/*@-unrecog -multithreaded @*/ 
 
Do as you please with this patch.

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