Eliminate buildHost() and getBuildTime() from librpmbuild API
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 24 Aug 2010 10:54:04 +0000 (13:54 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 24 Aug 2010 10:54:04 +0000 (13:54 +0300)
- Neither is needed anywhere outside pack.c, bury there and make static

build/names.c
build/pack.c
build/rpmbuild.h

index aea9acf..6dd78d4 100644 (file)
@@ -177,30 +177,3 @@ gid_t getGidS(const char *gname)
     return gids[gid_used++];
 }
 
-rpm_time_t * getBuildTime(void)
-{
-    static rpm_time_t buildTime[1];
-
-    if (buildTime[0] == 0)
-       buildTime[0] = (int32_t) time(NULL);
-    return buildTime;
-}
-
-const char * buildHost(void)
-{
-    static char hostname[1024];
-    static int oneshot = 0;
-    struct hostent *hbn;
-
-    if (! oneshot) {
-        (void) gethostname(hostname, sizeof(hostname));
-       hbn = gethostbyname(hostname);
-       if (hbn)
-           strcpy(hostname, hbn->h_name);
-       else
-           rpmlog(RPMLOG_WARNING,
-                       _("Could not canonicalize hostname: %s\n"), hostname);
-       oneshot = 1;
-    }
-    return(hostname);
-}
index a4fcddf..26d31fb 100644 (file)
@@ -6,6 +6,8 @@
 #include "system.h"
 
 #include <errno.h>
+#include <netdb.h>
+#include <time.h>
 
 #include <rpm/rpmlib.h>                        /* RPMSIGTAG*, rpmReadPackageFile */
 #include <rpm/rpmts.h>
@@ -147,6 +149,33 @@ exit:
     return sb;
 }
 
+static rpm_time_t * getBuildTime(void)
+{
+    static rpm_time_t buildTime[1];
+
+    if (buildTime[0] == 0)
+       buildTime[0] = (int32_t) time(NULL);
+    return buildTime;
+}
+
+static const char * buildHost(void)
+{
+    static char hostname[1024];
+    static int oneshot = 0;
+    struct hostent *hbn;
+
+    if (! oneshot) {
+        (void) gethostname(hostname, sizeof(hostname));
+       hbn = gethostbyname(hostname);
+       if (hbn)
+           strcpy(hostname, hbn->h_name);
+       else
+           rpmlog(RPMLOG_WARNING,
+                       _("Could not canonicalize hostname: %s\n"), hostname);
+       oneshot = 1;
+    }
+    return(hostname);
+}
 /**
  */
 static int addFileToTag(rpmSpec spec, const char * file, Header h, rpmTag tag)
index 62c72c7..7f020ff 100644 (file)
@@ -135,18 +135,6 @@ const char * getGnameS(const char * gname);
 gid_t getGidS(const char * gname);
 
 /** \ingroup rpmbuild
- * Return build hostname.
- * @return             build hostname
- */
-const char * buildHost(void)   ;
-
-/** \ingroup rpmbuild
- * Return build time stamp.
- * @return             build time stamp
- */
-rpm_time_t * getBuildTime(void)        ;
-
-/** \ingroup rpmbuild
  * Read next line from spec file.
  * @param spec         spec file control structure
  * @param strip                truncate comments?