diff options
author | Tomek Mrugalski <tomek@isc.org> | 2022-01-03 15:40:56 +0100 |
---|---|---|
committer | Tomek Mrugalski <tomek@isc.org> | 2022-01-03 15:40:56 +0100 |
commit | 7a325158c51db2f51ef9bf102721641d629def9c (patch) | |
tree | af2264a63c5ebd4486d91ea5fd6d8746c0bff2a9 | |
parent | 9048bfc4c4bba1d894f22aa1d4b106ab48421705 (diff) | |
download | isc-dhcp-7a325158c51db2f51ef9bf102721641d629def9c.tar.gz |
Updated util/bind.sh to not use kit.sh
-rw-r--r-- | util/bind.sh | 91 |
1 files changed, 41 insertions, 50 deletions
diff --git a/util/bind.sh b/util/bind.sh index 551076c8..4991eb15 100644 --- a/util/bind.sh +++ b/util/bind.sh @@ -73,7 +73,7 @@ case $# in ### For ease of use, this records the sticky tag of versions ### released with each point release. ### - 4.4.3) BINDTAG=v9_11_36 ;; + 4.4.3) BINDTAG=v9_11_15 ;; 4.4.2) noSNAP=snapshot BINDTAG=v9_11_14 ;; 4.4.2b1) noSNAP=snapshot BINDTAG=v9_11_14 ;; 4.4.2-dev) noSNAP=snapshot BINDTAG=v9_11_8 ;; @@ -121,63 +121,54 @@ esac if test -d bind/bind9/.git then - cp util/Makefile.bind.in bind/Makefile.in - rm -rf bind/include bind/lib + echo "Detected existing bind9 repo" cd bind/bind9 - test -f Makefile && make distclean - git fetch - git checkout $BINDTAG && test -n "${noSNAP}" && \ - git merge --ff-only HEAD + git reset --hard + git clean -fxd + git checkout main + git branch -D $BINDTAG + git pull --ff-only + git checkout $BINDTAG -b $BINDTAG else + echo "Checking out a new repo" # Delete all previous bind stuff rm -rf bind # Make and move to our directory for all things bind - mkdir $binddir + mkdir -p $binddir cp util/Makefile.bind.in bind/Makefile.in cd $binddir - # Get the bind version file and move it to version.tmp - if type wget - then - wget https://$repo_host/$repo_path/raw/$BINDTAG/version || - { echo "Fetch of version file failed" ; exit -1; } - elif type fetch - then - fetch https://$repo_host/$repo_path/raw/$BINDTAG/version || - { echo "Fetch of version file failed" ; exit -1; } - else - echo "Fetch of version file failed" - exit 1 - fi - mv version version.tmp - - # Get the bind release kit shell script - if type wget - then - wget https://$repo_host/$repo_path/raw/v9_11/util/kit.sh || - { echo "Fetch of kit.sh file failed" ; exit -1; } - elif type fetch - then - fetch https://$repo_host/$repo_path/raw/v9_11/util/kit.sh || - { echo "Fetch of kit.sh failed" ; exit -1; } - else - echo "Fetch of kit.sh failed" - exit 1 - fi - - # Create the bind tarball, which has the side effect of - # setting up the bind directory we will use for building - # the libraries - echo Creating tarball for $BINDTAG - sh kit.sh --remote="git@$repo_host:$repo_path.git" $SNAP $BINDTAG $binddir - . ./version.tmp + # Get the bind code of specified version. Couple tricks here: + # --single-branch will download only a history from a single branch (see --branch) + # --depth 1 will get only the latest commit + # As a result, the repo will take 68MB rather than 360MB+. + #git clone --depth 1 https://$repo_host/$repo_path --branch ${BINDTAG} --single-branch bind9 + git clone https://$repo_host/$repo_path bind9 + cd bind9 + git checkout $BINDTAG -b $BINDTAG +fi - version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER} - bindsrcdir=bind-$version - mm=${MAJORVER}.${MINORVER} +# Now generate version +# I'm too lazy to get rid of v from v9 in the bindtag. But that's ok. +# We'll never have any other number here than 9. +MAJORVER="9" +MINORVER="$(echo ${BINDTAG} | cut -d'_' -f2)" +PATCHVER="$(echo ${BINDTAG} | cut -d'_' -f3)" +RELEASETYPE= +RELEASEVER= +EXTENSIONS= - # move the tar file to a known place for use by the make dist command - echo Moving tar file to bind.tar.gz for distribution - mv bind-${mm}*.tar.gz bind.tar.gz -fi +cat <<EOF >version +# This file must follow /bin/sh rules. It is imported directly via +# configure. +# +PRODUCT=BIND +DESCRIPTION="(Extended Support Version)" +MAJORVER=${MAJORVER} +MINORVER=${MINORVER} +PATCHVER=${PATCHVER} +RELEASETYPE=${RELEASETYPE} +RELEASEVER=${RELEASEVER} +EXTENSIONS=${EXTENSIONS} +EOF |