Skip to content

Commit

Permalink
Merge pull request #324 from tetlowgm/master
Browse files Browse the repository at this point in the history
Cleanup update logic for embedded openssl git tree.
  • Loading branch information
rbsec authored Jan 18, 2025
2 parents 4f2f9fa + bcf271c commit 7c3a9db
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ uninstall:
rm -f $(DESTDIR)$(MAN1DIR)/sslscan.1

.openssl.is.fresh: opensslpull
true
@true

opensslpull:
upstream=`git ls-remote https://github.com/openssl/openssl | grep -Eo '(openssl-3\.0\.[0-9]+)' | sort -V | tail -n 1` ; \
if [ -d openssl -a -d openssl/.git ]; then \
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 ; \
if [ "$$upstream" != "`cd ./openssl && git describe --exact-match --tags`" ]; then \
cd ./openssl && git fetch --depth 1 origin refs/tags/$$upstream:refs/tags/$$upstream && git checkout $$upstream && touch ../.openssl.is.fresh ; \
fi \
else \
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 ; \
git clone --depth 1 -b $$upstream https://github.com/openssl/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \
fi

openssl/Makefile: .openssl.is.fresh
Expand Down

0 comments on commit 7c3a9db

Please sign in to comment.