For distro builds it is much more useful to fill .version with the exact tag for the build in question, i.e. %{name}-%{version}-%{release} in case of rpm builds, so the output can easily linked to the exact package build. Timestamp and buildhost don't carry much useful information in that case, so allow to opt-out without patching the source tree.
Keep them enabled by default so (test) builds done by normal users continue to have them, to simplify trouble shooting on the mailing list.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- scripts/buildversion.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/buildversion.sh b/scripts/buildversion.sh index e5ce96c..bdbf65e 100755 --- a/scripts/buildversion.sh +++ b/scripts/buildversion.sh @@ -11,7 +11,14 @@ elif [ -f .version ]; then else VERSION="?" fi -VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`" + +# add timestamp +if test "${NO_TIMESTAMP}" = ""; then + VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`" +fi +if test "${NO_HOSTNAME}" = ""; then + VERSION="${VERSION}-`hostname`" +fi echo "Version: ${VERSION}"
# Build header file
On Wed, Apr 08, 2015 at 11:39:41AM +0200, Gerd Hoffmann wrote:
For distro builds it is much more useful to fill .version with the exact tag for the build in question, i.e. %{name}-%{version}-%{release} in case of rpm builds, so the output can easily linked to the exact package build. Timestamp and buildhost don't carry much useful information in that case, so allow to opt-out without patching the source tree.
Keep them enabled by default so (test) builds done by normal users continue to have them, to simplify trouble shooting on the mailing list.
What does a build command line look like when one uses this feature to disable hostname and/or timestamps?
-Kevin
On Mi, 2015-04-08 at 22:46 -0400, Kevin O'Connor wrote:
On Wed, Apr 08, 2015 at 11:39:41AM +0200, Gerd Hoffmann wrote:
For distro builds it is much more useful to fill .version with the exact tag for the build in question, i.e. %{name}-%{version}-%{release} in case of rpm builds, so the output can easily linked to the exact package build. Timestamp and buildhost don't carry much useful information in that case, so allow to opt-out without patching the source tree.
Keep them enabled by default so (test) builds done by normal users continue to have them, to simplify trouble shooting on the mailing list.
What does a build command line look like when one uses this feature to disable hostname and/or timestamps?
I would simply add "export NO_TIMESTAMP=1" to the top of the %build section in the rpm spec file, so it is set for the whole build process.
Using "NO_TIMESTAMP=1 make" to run make with the variable set works too.
cheers, Gerd