[Pkg-xen-devel] [PATCH 04/12] debian/rules: Adjust boot shuffling script for POSIX

Ian Jackson ijackson at chiark.greenend.org.uk
Thu Sep 17 17:01:21 BST 2020


Elliott Mitchell writes ("[PATCH 04/12] debian/rules: Adjust boot shuffling script for POSIX"):
> Often /bin/sh is distinctly faster than Bash, so move to the better
> interpreter.  Simplify variable usage to conform.

See my previous comment.

Your argument here is "it's faster".  Have you done benchmarks ?  I
suspect changing everything to sh probably takes off a few
milliseconds from a half-hour-long Xen package build.

> diff --git a/debian/shuffle-boot-files b/debian/shuffle-boot-files
> index f7492c0c72..8e4ed7e64c 100755
> --- a/debian/shuffle-boot-files
> +++ b/debian/shuffle-boot-files
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/bin/sh
>  
>  set -e
>  
> @@ -26,6 +26,7 @@ verstring=$(readlink debian/tmp/boot/xen.gz ||
>  verstring=${verstring##*/}
>  verstring=${verstring%.gz}
>  
> -for f in `cd $t/boot && find * -type f -print`; do
> -	cp -v $t/boot/$f $dest/${f/$verstring/xen-$version-$flavour}
> +find "$t/boot" -type f -print | while read f
> +do
> +	cp -v "$f" "$dest${f#$t/boot}"
>  done

(1) I'm not sure this does precisely the same thing as before
(2) even the amount of time I have just spent staring at it was
wasted because there is no need for this change.

Ian.



More information about the Pkg-xen-devel mailing list