]> git.proxmox.com Git - llvm-toolchain.git/blobdiff - debian/orig-tar.sh
Merge tag 'debian/11.0.0-5' into proxmox/buster
[llvm-toolchain.git] / debian / orig-tar.sh
index 129ceb489e0ad32ebe623b9dcbac539b1188c20a..db09674c83f4662565e8f7adf8a54bf8a991af84 100755 (executable)
@@ -35,7 +35,6 @@ fi
 GIT_BASE_URL=https://github.com/llvm/llvm-project
 GIT_TOOLCHAIN_CHECK=https://github.com/opencollab/llvm-toolchain-integration-test-suite.git
 
-
 reset_repo ()
 {
     cd $1
@@ -51,6 +50,9 @@ reset_repo ()
 
 PATH_DEBIAN="$(pwd)/$(dirname $0)/../"
 cd "$PATH_DEBIAN"
+
+git stash && git pull && git stash apply || true
+
 MAJOR_VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p")
 if test -z "$MAJOR_VERSION"; then
     echo "Could not detect the major version"
@@ -133,6 +135,14 @@ if test -z  "$TAG" -a -z "$FINAL_RELEASE"; then
         VERSION=$MAJOR_VERSION
         MAJOR_VERSION=snapshot
     fi
+    # When upstream released X, they will update X to have X.0.1
+    # In general, in Debian, we will keep X until X.0.1 is released (or rc in experimental)
+    # However, on apt.llvm.org, we will update the version to have X.0.1
+    # This code is doing that.
+    MAJOR=$(grep "set(LLVM_VERSION_MAJOR" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_MAJOR \(.*\))|\1|")
+    MINOR=$(grep "set(LLVM_VERSION_MINOR" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_MINOR \(.*\))|\1|")
+    PATCH=$(grep "set(LLVM_VERSION_PATCH" llvm/CMakeLists.txt|sed -e "s|.*LLVM_VERSION_PATCH \(.*\))|\1|")
+    CURRENT_VERSION="$MAJOR.$MINOR.$PATCH"
     # the + is here to make sure that this version is considered more recent than the svn
     # dpkg --compare-versions 10~svn374977-1~exp1 lt 10~+2019-svn374977-1~exp1
     # to verify that