From 5f70fd80b2070d8a7e789375d4c4b82b697a869f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 7 Jan 2012 09:40:58 +0000 Subject: [PATCH] Switch back to the previous approach of base tar ball + patch git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4053 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/kernel-functions | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/scripts/kernel-functions b/scripts/kernel-functions index a67a2db06..9446cb8b2 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -29,7 +29,7 @@ function patchlevel { function download_file { if [ ! -e "$(basename "$1")" ]; then if [ "${quiet_download}" = "false" ]; then - echo "Downloading $1 ..." + wget --spider -q -nc "$1" && echo "Downloading $1 ..." fi wget -q -nc "$1" fi @@ -51,9 +51,16 @@ function download_kernel { test -w "${kernel_sources}" || return $? ( cd "${kernel_sources}" || return $? - download_file "${kernel_mirror}/v$series/linux-$1.tar.xz" \ - || download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-$1.tar.xz" \ - || return $? + if download_file "${kernel_mirror}/v$series/patch-$1.xz" \ + || download_file "${kernel_mirror}/v$series/longterm/v${kver}/patch-$1.xz"; then + download_file "${kernel_mirror}/v$series/linux-${kver}.tar.xz" \ + || download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-${kver}.tar.xz" \ + || return $? + else + download_file "${kernel_mirror}/v$series/linux-$1.tar.xz" \ + || download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-$1.tar.xz" \ + || return $? + fi ) } @@ -68,7 +75,18 @@ function extract_kernel_tree { mkdir "${tmpdir}" || return $? ( cd "${tmpdir}" || return $? - { xz -cd "${kernel_sources}/linux-$1.tar.xz" | tar xf -; } || return $? + if [ -e "${kernel_sources}/patch-$1.xz" \ + -a -e "${kernel_sources}/linux-${kver}.tar.xz" ] + then + { xz -cd "${kernel_sources}/linux-${kver}.tar.xz" | tar xf -; } \ + || return $? + mv linux-$kver linux-$1 + ( cd linux-$1 && xz -cd "${kernel_sources}/patch-$1.xz" \ + | patch -p1 -f -s; ) \ + || return $? + else + { xz -cd "${kernel_sources}/linux-$1.xz" | tar xf -; } || return $? + fi mv "linux-$1" ".." || return $? cd "../linux-$1" || return $? if [ "$1" = "2.6.29" -o "$1" = "2.6.29.1" -o "$1" = "2.6.29.2" -o "$1" = "2.6.29.3" ]