]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
make-dist: do not use make_version (and remove it)
authorSage Weil <sage@redhat.com>
Thu, 27 Oct 2016 16:39:20 +0000 (11:39 -0500)
committerSage Weil <sage@redhat.com>
Mon, 31 Oct 2016 14:10:47 +0000 (10:10 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
make-dist
src/make_version [deleted file]

index c66e988cdf3506ad4266547968e5ea3a0491884c..021e9e381b94e3f8e8795c33d1203110ea8ce92e 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -33,7 +33,8 @@ bin/git-archive-all.sh --prefix ceph-$version/ \
 
 # populate files with version strings
 echo "including src/.git_version, ceph.spec"
-src/make_version -g src/.git_version
+
+(git rev-parse HEAD ; git describe) 2> /dev/null > src/.git_version
 
 # if the version has '-' in it, it has a 'release' part,
 # like vX.Y.Z-N-g<shortsha1>.  If it doesn't, it's just
diff --git a/src/make_version b/src/make_version
deleted file mode 100755 (executable)
index 4834579..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-GIT_VERSION_FILE=
-CEPH_VER_HEADER=
-NO_VERSION=0
-
-is_git() {
-    type git > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-        echo "Could not find git command. Assuming this is not a git repository, not updating .git_version"
-        return 1
-    fi
-    git status > /dev/zero 2>&1;
-    if [ $? -ne 0 ]; then
-        echo "This is no git repository, not updating .git_version"
-        return 1
-    else
-        return 0
-    fi
-}
-
-check_gitversion() {
-    if is_git; then
-        current=`git rev-parse HEAD 2> /dev/null; git describe 2> /dev/null`
-        if [ -f $GIT_VERSION_FILE ] ; then
-            old=`cat $GIT_VERSION_FILE`
-
-            if [ "$current" != "$old" ]; then
-                echo "$current" > $GIT_VERSION_FILE
-            fi
-        else
-            echo "$current" > $GIT_VERSION_FILE
-        fi
-    fi
-}
-
-print_ceph_ver() {
-    # print the content of the ceph_ver.h file
-    if [ $NO_VERSION -eq 1 ]; then
-        ver="no_version"
-        ver_nice="Development"
-    else
-        ver=`head -1 $GIT_VERSION_FILE`
-        ver_nice=`tail -1 $GIT_VERSION_FILE | cut -c 2-`
-    fi
-
-    echo "#ifndef CEPH_VERSION_H"
-    echo "#define CEPH_VERSION_H"
-    echo
-    echo "#define CEPH_GIT_VER $ver"
-    echo "#define CEPH_GIT_NICE_VER \"$ver_nice\""
-    echo
-    echo "#endif"
-}
-
-set_ceph_ver() {
-    # compare new and old CEPH_VER_HEADER
-    if [ -f $CEPH_VER_HEADER ]; then
-       tmpfile=$(mktemp -t "ceph_ver_h.XXXXXXXXXXXXX")
-        print_ceph_ver > $tmpfile
-        cur_ver=`cat $CEPH_VER_HEADER`
-        new_ver=`cat $tmpfile`
-        if [ "$cur_ver" != "$new_ver" ]; then
-            mv $tmpfile $CEPH_VER_HEADER
-       else
-           rm $tmpfile
-        fi
-    else
-        print_ceph_ver > $CEPH_VER_HEADER
-    fi
-}
-
-usage() {
-    printf "usage: $0 -g FILEPATH [options]\n"
-    printf "\t-g|--git-version-file\tFILEPATH for git version file (e.g. ./src/.git_version)\n"
-    printf "\t-c|--ceph-ver-header\tFILEPATH for ceph version header (e.g. ./src/ceph_ver.h)\n"
-    printf "\t-n|--no-version\t\tdon't generate version from git\n"
-    printf "\t-h|--help\t\tprint this usage instructions\n"
-}
-
-until [ -z "$1" ]; do
-case $1 in
-    -n|--no-version)
-        NO_VERSION=1;
-        ;;
-    -g|--git-version-file)
-        GIT_VERSION_FILE=$2
-        shift;
-        ;;
-    -c|--ceph-ver-header)
-        CEPH_VER_HEADER=$2
-        shift;
-        ;;
-    -h|--help)
-        usage;
-        ;;
-    *)
-        ;;
-esac
-shift
-done;
-
-if [ -n "$GIT_VERSION_FILE" ] ; then
-    if [ -z "$CEPH_VER_HEADER" ] ; then
-        check_gitversion
-    else
-        check_gitversion
-        set_ceph_ver
-    fi
-else
-    usage
-fi