Skip to content

Commit 207b99e

Browse files
committed
Compute scriptsversion from Git
419 is the offset between the last Subversion revision and the corresponding git describe output. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 64f9780 commit 207b99e

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

server/fedora/Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ openafs_url = "https://www.openafs.org/dl/openafs/1.6.20.1/openafs-1.6.20.1-1.sr
4444
#zephyr_url = "http://zephyr.1ts.org/files/zephyr-3.0.2.tar.gz"
4545

4646
PKG = $(patsubst %.i686,%,$@)
47+
scriptsversion = $(shell git describe --dirty --match root | awk -F- '{print $$2 + 419 "." $$3 ($$4 ? "." $$4 : "")}')
4748

4849
.PHONY: minimal-clean
4950

@@ -105,25 +106,14 @@ patch-specs: install-srpms
105106
rm -f *.spec.~*~; \
106107
for i in $$list; do \
107108
patch -bV numbered < $$i; \
108-
done; \
109-
list2=`svn ls ${oursrcdir}`; \
110-
for i in $$list2; do \
111-
base=`basename $$i`; \
112-
[ -e ${tmp_specs}/$$base.spec ] || continue; \
113-
version=`svnversion ${oursrcdir}/$$i`; \
114-
version=$${version//:/_}; \
115-
echo "$$i version $$version"; \
116-
sed --in-place \
117-
-e "s/SVNVERSION_TO_UPDATE/$${version}/" \
118-
${tmp_specs}/$$base.spec; \
119109
done
120110

121111
# 1. use the package's Makefile to delete leftover files and run autoconf
122112
# 2. create a tarball (we want it to contain the autoconf output)
123113
tarballs: mkdir-tree
124114
@set -ex; \
125115
cd ${oursrcdir}; \
126-
list=`find -mindepth 1 -maxdepth 1 -type d | grep -v ".svn"`; \
116+
list=`find -mindepth 1 -maxdepth 1 -type d`; \
127117
for i in $$list; do \
128118
pushd $$i; \
129119
if [ -x ./mrproper ]; then \
@@ -148,7 +138,7 @@ upstream: mkdir-tree download
148138
all:
149139
make $(allsrc)
150140

151-
$(oursrc): rpmbuild_args += --define 'scriptsversion $(shell svnversion ${oursrcdir}/$** | tr ':' '_' | sed -e 's/-.*/0.uncommitted/')'
141+
$(oursrc): rpmbuild_args += --define 'scriptsversion $(scriptsversion)'
152142

153143
$(filter %.i686,$(oursrc)): %.i686: setup
154144
PATH="/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" \
@@ -160,7 +150,7 @@ $(filter-out %.i686,$(oursrc)): %: setup
160150
rpmbuild ${rpmbuild_args} -bs ${tmp_specs}/${PKG}.spec
161151
/usr/bin/mock -r scripts-fc20-`uname -m` ${rpmbuild_args} -v --rebuild `ls -t ${out_srpms}/${PKG}-[0-9]*.src.rpm | head -1`
162152

163-
$(upstream) openafs-kernel: rpmbuild_args += --define 'scriptsversion $(shell svnversion ${patches} | tr ':' '_')'
153+
$(upstream) openafs-kernel: rpmbuild_args += --define 'scriptsversion $(scriptsversion)'
164154

165155
kernel: rpmbuild_args += --define 'buildid .scripts.%{scriptsversion}' --without debug --without doc
166156

0 commit comments

Comments
 (0)