[Pkg-xen-devel] [PATCH 02/19] d/shuffle-binaries: Remove useless extra argument being passed in
Hans van Kranenburg
hans at knorrie.org
Sat Dec 5 13:01:13 GMT 2020
Hi,
On 12/5/20 3:00 AM, Elliott Mitchell wrote:
> On Fri, Dec 04, 2020 at 09:14:32PM +0100, Hans van Kranenburg wrote:
>> On 9/19/20 8:24 AM, Elliott Mitchell wrote:
>>> This doesn't do anything. Really it is almost a bug the script /doesn't/
>>> complain.
>>
>> Hah, yes, good catch. The second argument is never used inside
>> shuffle-binaries.
>>
>> In shuffle-binaries, I see "version=$1; shift". Ian, is the shift and
>> the not-used but passed $(flavour) a left-over from some intermediate
>> steps while doing the WHRAAA reworking of the packaging?
>>
>> I guess we could add dropping that "; shift" in this same change,
>> because it only confuses the reader into thinking that there will be
>> some code later on using $1 again?
>
> The reason to *not* do that seems pretty obvious. Having your argument
> taking lines all follow the form "<var>=$1; shift" increases consistency.
> Other theory is this leaves the environment cleaner. With the shift,
> only $0 is left valid and $# is left zero.
>
> You'll notice in shuffle-binaries:
> version="$1"; shift
>
> In shuffle-boot-files before the change:
> version="$1"; shift
> flavour="$1"; shift
>
> The shift survived simply for consistency/documentation sake. $(flavour)
> might have been left in due to historic usage, but it also looks like it
> may have originated as a copy and paste of
> `debian/shuffle-boot-files $(upstream_version) $(flavour)`
Aha, yes, I see. That makes a lot of sense indeed.
Acked-by: Hans van Kranenburg <hans at knorrie.org>
Added to knorrie/sid, thanks.
Hans
More information about the Pkg-xen-devel
mailing list