Hi Michal, Le Wednesday 13 November 2013 à 15:49 +0100, Michal Marek a écrit :
On Wed, Nov 13, 2013 at 09:13:55AM +0100, Jean Delvare wrote:
Thanks, this will start the transition period nicely. Ultimately it would be great if we could stop fetching *.bz2 and only use *.xz. But I have to admit I'm not too sure how to achieve that. Switching only new products to use *.xz would require adding some magic to several of our scripts. Switching them all would be even more work with a risk of regression. None of these options is really appealing, but maybe I'm missing an easier path.
This worked for me, can you test it? If it works, then I'll commit the script changes and maybe switch master and SLE12 right away to use linux-*.xz.
My first testing 10 days ago seemed wrong, however I tested it again today and it worked just fine. So I'm not sure what I did last time, but let's call it working and commit it. If the problem reappears (assuming it was not just my mistake - might as well be) we'll fix it then. I think you want to split this patch in two parts: the infrastructure itself which should go to the scripts branch and be pulled to all other branches from there, and the actual switch to tar.xz format (in rpm/kernel-source.spec.in) which should be committed to recent branches only. Overall the code looks great, nice job. Just two comment:
--- a/scripts/tar-up-old.sh +++ b/scripts/tar-up-old.sh @@ -154,7 +154,7 @@ done mkdir -p "$build_dir" if test ! -e "$build_dir/linux-$SRCVERSION.tar.bz2"; then echo "linux-$SRCVERSION.tar.bz2" - get_tarball "$SRCVERSION" "$build_dir" + get_tarball "$SRCVERSION" "tar.bz2" "$build_dir" fi
# list of patches to include.
Can't we get rid of tar-up-old.sh now? Anyone still using it?
--- a/scripts/wd-functions.sh +++ b/scripts/wd-functions.sh @@ -41,7 +41,7 @@ get_branch_name()
_find_tarball() { - local version=$1 xz_ok=$2 dir subdir major + local version=$1 force_suffix=$2 dir subdir major suffixes suffix
set -- ${version//[.-]/ } major=$1.$2 @@ -49,16 +49,19 @@ _find_tarball() 3.*) major=3.x esac + if test -n "$force_suffix"; then + suffixes=("$force_suffix") + else + suffixes=(tar.xz tar.bz2) + fi
If "suffixes" is supposed to be an array then it should have been declared as such with "local -a". But given that you are never accessing it by index, and items will never contain a space, I think you could make it a simple string. That will be easier and probably slightly faster, as the code can then be simplified to: local ... suffixes=$2 ... suffix ... test -z "$suffixes" && suffixes="tar.xz tar.bz2" ... for suffix in $suffixes; do
for dir in . $MIRROR {/mounts,/labs,}/mirror/kernel; do for subdir in "" "/v$major" "/testing" "/v$major/testing"; do - if test -n "$xz_ok" -a -r "$dir$subdir/linux-$version.tar.xz"; then - echo "$dir$subdir/linux-$version.tar.xz" - return - fi - if test -r "$dir$subdir/linux-$version.tar.bz2"; then - echo "$dir$subdir/linux-$version.tar.bz2" - return - fi + for suffix in "${suffixes[@]}"; do + if test -r "$dir$subdir/linux-$version.$suffix"; then + echo "$_" + return + fi + done done done }
-- Jean Delvare Suse L3 Support -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org