Home Home > GIT Browse
diff options
authorMichal Marek <mmarek@suse.cz>2014-11-03 17:27:24 +0100
committerMichal Marek <mmarek@suse.cz>2014-11-03 17:28:15 +0100
commitfeab4f1daae515aa3358a3bde83accc066646741 (patch)
parentaa7f1cb28d8fd8be59160e837645866064711519 (diff)
Add a source-timestamp file with the git commit hash and branch
This is required by the bs-upload-kernel script to upload packages to the BS. It can also be used by the specfile in the future. Signed-off-by: Michal Marek <mmarek@suse.cz>
2 files changed, 10 insertions, 0 deletions
diff --git a/rpm/kgraft-patch.spec b/rpm/kgraft-patch.spec
index 6f20285..f42d56a 100644
--- a/rpm/kgraft-patch.spec
+++ b/rpm/kgraft-patch.spec
@@ -28,6 +28,7 @@ Source0: uname_patch.tar.bz2
Source1: Makefile
Source2: kgr_patch_main.c
Source3: config.sh
+Source4: source-timestamp
BuildRequires: kernel-syms kgraft-devel
ExclusiveArch: s390x x86_64
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index 2b2b906..cd0d683 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -54,3 +54,12 @@ install -m 644 rpm/config.sh $build_dir/config.sh
sed -i "s/@@RELEASE@@/$RELEASE/g" $build_dir/kgr_patch_main.c \
+ts=$(git show --pretty=format:%ct HEAD | head -n 1)
+date "+%Y-%m-%d %H:%M:%S %z" -d "1970-01-01 00:00 UTC $ts seconds" >$build_dir/$tsfile
+echo "GIT Revision: $(git rev-parse HEAD)" >> $build_dir/$tsfile
+branch=$(sed -ne 's|^ref: refs/heads/||p' .git/HEAD 2>/dev/null)
+if test -n "$branch"; then
+ echo "GIT Branch: $branch" >>$build_dir/$tsfile