Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-07-25 12:26:37 +0200
committerMichal Marek <mmarek@suse.cz>2011-07-25 12:26:37 +0200
commit657f6a3dae7a469e94151a4090f587fa28c9133b (patch)
tree24ebdff33066dc1dc8459d55724b92cbf4ccc82a
parentdfe0dcf0437348de10d54887fb95ba9ab417439f (diff)
parent384948eafcfe26b7673ced6794da3d6e2a160b17 (diff)
Merge branch 'scripts'
-rwxr-xr-xscripts/mainline-commit42
1 files changed, 28 insertions, 14 deletions
diff --git a/scripts/mainline-commit b/scripts/mainline-commit
index 1a4d343c5d..7b79abba51 100755
--- a/scripts/mainline-commit
+++ b/scripts/mainline-commit
@@ -138,7 +138,7 @@ fetch_from()
name=${name##**/}
case "$version" in
- 2.*)
+ *.* )
version=v${version}
esac
base_id=$(rev_parse "$version^{commit}")
@@ -146,12 +146,12 @@ fetch_from()
return 0
fi
refspec=($(git ls-remote "$url" | \
- sed -rn -e 's@.*(refs/tags/v2\.[^^]*)$@\1:\1@p' -e \
+ sed -rn -e 's@.*(refs/tags/v[1-9][^^]*)$@\1:\1@p' -e \
"s@.*(refs/heads/master)\$@\\1:upstream/$name@p"))
case "$version" in
- v2.*)
+ v*)
if ! echo "${refspec[@]}" | grep -q "/$version:"; then
- # if we are looking for a v2.* tag and it is not there,
+ # if we are looking for a v* tag and it is not there,
# do not bother fetching anything
return 1
fi
@@ -165,10 +165,13 @@ kernel_version()
{
local version=$1 major minor micro
- major=${version%%.*}; version=${version#*.}
- minor=${version%%.*}; version=${version#*.}
- micro=${version%%[^0-9]*}
- expr "$major" '*' 65536 '+' "$minor" '*' 256 + "$micro"
+ version=${version%%[^0-9.]*}
+ local IFS=.
+ set -- $version
+ major=$1
+ minor=$2
+ micro=$3
+ expr "$major" '*' 65536 '+' "0$minor" '*' 256 + "0$micro"
}
get_base_id()
@@ -204,6 +207,14 @@ get_base_id()
return
fi
fi
+ local is_stable=false
+ case "$base" in
+ [3-9].*.0-rc* | [1-9][0-9].*.0-rc*)
+ base=${base/.0-/-}
+ ;;
+ [3-9].*.0 | [1-9][0-9].*.0)
+ base=${base%.0}
+ esac
case "$base" in
2.6.11.*)
# The history tree has 2.6.11.y up to 2.6.11.5; but there
@@ -213,12 +224,13 @@ get_base_id()
2.6.*-rt*)
fetch_from "tip/linux-2.6-tip.git"
;;
- 2.6.*.*)
+ 2.6.*.* | [3-9].*.* | [1-9][0-9].*.* )
+ is_stable=true
if ! fetch_from "stable/linux-${base%.*}.y.git" "$base"; then
fetch_from "longterm/linux-${base%.*}.y.git" "$base"
fi
;;
- 2.6.*)
+ 2.6.* | [3-9].* | [1-9][0-9].*)
fetch_from "torvalds/linux-2.6.git" "$base"
;;
*)
@@ -226,14 +238,16 @@ get_base_id()
esac
if test -z "$base_id"; then
case "$base" in
- 2.6.*.*-rc*)
- # RCs for stable are typically not in git
- base_id=0
- ;;
2.6.*-rt*)
# not all rt releases are tagged in tip
base_id=0
;;
+ *-rc* )
+ if $is_stable; then
+ # RCs for stable are typically not in git
+ base_id=0
+ fi
+ ;;
esac
fi
}