compat-wireless: update code-metrics to reflect extra patches applied
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 27 Sep 2010 23:10:37 +0000 (16:10 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 27 Sep 2010 23:12:57 +0000 (16:12 -0700)
This will peg the characters options we used to apply extra
patches to our compat-wireless release to identify the extra
patches applied.

For example with "-s", we will now get:

compat-wireless-v2.6.36-rc5-1-2-g2ac99dc-s

This should be also picked up on the compat module which when loaded
will display the above string. This is useful when troubleshooting
issues and trying to find out what a user is using exactly.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
scripts/admin-update.sh

index c1cf1f21c87f79bc7a85bb8669c1643e76b12bfc..fc15e20311662aca944358a7d7bae372803598f1 100755 (executable)
@@ -136,6 +136,7 @@ nagometer() {
 EXTRA_PATCHES="patches"
 REFRESH="n"
 GET_STABLE_PENDING="n"
+POSTFIX_RELEASE_TAG=""
 if [ $# -ge 1 ]; then
        if [ $# -gt 4 ]; then
                usage $0
@@ -149,18 +150,22 @@ if [ $# -ge 1 ]; then
                if [[ "$1" = "-s" ]]; then
                        GET_STABLE_PENDING="y"
                        EXTRA_PATCHES="${EXTRA_PATCHES} pending-stable" 
+                       POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}s"
                        shift; continue;
                fi
                if [[ "$1" = "-n" ]]; then
                        EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-cherry-picks"
+                       POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}n"
                        shift; continue;
                fi
                if [[ "$1" = "-p" ]]; then
                        EXTRA_PATCHES="${EXTRA_PATCHES} linux-next-pending"
+                       POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}p"
                        shift; continue;
                fi
                if [[ "$1" = "-c" ]]; then
                        EXTRA_PATCHES="${EXTRA_PATCHES} crap"
+                       POSTFIX_RELEASE_TAG="${POSTFIX_RELEASE_TAG}c"
                        shift; continue;
                fi
                if [[ "$1" = "refresh" ]]; then
@@ -526,7 +531,11 @@ echo -e "${GREEN}Updated${NORMAL} from local tree: ${BLUE}${GIT_TREE}${NORMAL}"
 echo -e "Origin remote URL: ${CYAN}${GIT_REMOTE_URL}${NORMAL}"
 cd $DIR
 if [ -d ./.git ]; then
-       git describe > compat_version
+       if [[ ${POSTFIX_RELEASE_TAG} != "" ]]; then
+               echo -e "$(git describe)-${POSTFIX_RELEASE_TAG}" > compat_version
+       else
+               echo -e "$(git describe)" > compat_version
+       fi
 
        cd $GIT_TREE
        TREE_NAME=${GIT_REMOTE_URL##*/}