import os
import re
import shutil
+import socket
import stat
import time
# The version of the kernel this machine is running.
kernel_version = os.uname()[2]
- def __init__(self, pakfire, pkg, **settings):
+ def __init__(self, pakfire, pkg, build_id="", **settings):
self.pakfire = pakfire
self.pkg = pkg
self._lock = None
self.lock()
+ # Save the build time.
+ self.build_time = int(time.time())
+ self.build_id = build_id
+
# Initialize the environment
self.prepare()
+ @property
+ def info(self):
+ return {
+ "build_date" : time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(self.build_time)),
+ "build_host" : socket.gethostname(),
+ "build_id" : self.build_id,
+ "build_time" : self.build_time,
+ }
+
@property
def path(self):
return self.pakfire.path
VERSION="%(package_format)s"
# Build information
-BUILD_DATE="XXX"
-BUILD_HOST="XXX"
-BUILD_ID="XXX"
+BUILD_DATE="%(build_date)s"
+BUILD_HOST="%(build_host)s"
+BUILD_ID="%(build_id)s"
+BUILD_TIME="%(build_time)s"
# Distribution information
DISTRO_NAME="%(distro_name)s"
}
self.info.update(self.pkg.info)
self.info.update(self.pakfire.distro.info)
+ self.info.update(self.env.info)
### Create temporary files
# Create temp directory to where we extract all files again and