Skip to content

Commit 7c3a9db

Browse files
authored
Merge pull request #324 from tetlowgm/master
Cleanup update logic for embedded openssl git tree.
2 parents 4f2f9fa + bcf271c commit 7c3a9db

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ uninstall:
138138
rm -f $(DESTDIR)$(MAN1DIR)/sslscan.1
139139

140140
.openssl.is.fresh: opensslpull
141-
true
141+
@true
142+
142143
opensslpull:
144+
upstream=`git ls-remote https://github.com/openssl/openssl | grep -Eo '(openssl-3\.0\.[0-9]+)' | sort -V | tail -n 1` ; \
143145
if [ -d openssl -a -d openssl/.git ]; then \
144-
cd ./openssl && git checkout `git ls-remote https://github.com/openssl/openssl | grep -Eo '(openssl-3\.0\.[0-9]+)' | sort --version-sort | tail -n 1` && git pull | grep -q "Already up to date." && [ -e ../.openssl.is.fresh ] || touch ../.openssl.is.fresh ; \
146+
if [ "$$upstream" != "`cd ./openssl && git describe --exact-match --tags`" ]; then \
147+
cd ./openssl && git fetch --depth 1 origin refs/tags/$$upstream:refs/tags/$$upstream && git checkout $$upstream && touch ../.openssl.is.fresh ; \
148+
fi \
145149
else \
146-
git clone --depth 1 -b `git ls-remote https://github.com/openssl/openssl | grep -Eo '(openssl-3\.0\.[0-9]+)' | sort -V | tail -n 1` https://github.com/openssl/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \
150+
git clone --depth 1 -b $$upstream https://github.com/openssl/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \
147151
fi
148152

149153
openssl/Makefile: .openssl.is.fresh

0 commit comments

Comments
 (0)