[pacman-dev] [PATCH 4/4] makepkg: use c-style for loops for integrity checks

Allan McRae allan at archlinux.org
Wed Sep 4 23:33:19 EDT 2013


On 04/09/13 13:19, Dave Reisner wrote:
> These loops already maintain an independent loop counter, so cut out
> the middle man. An extra fix is needed to continue supporting sparse
> arrays which, while weird, are valid.
> 
> Signed-off-by: Dave Reisner <dreisner at archlinux.org>
> ---
> If we don't care about supporting sparse arrays, I can simply drop the final
> hunk off of this patch and adjust the commit message. Keeping support was
> simple enough that I felt compelled to offer it.
> 
> Note, however, that removing support then causes makepkg to fail in cryptic
> ways when it does encounter a sparse array, e.g.:
> 
>   $ makepkg -g
>   ...
>   ==> Generating checksums for source files...
>   md5sums=('SKIP'
>            'e99e9189aa2f6084ac28b8ddf605aeb8'
>            'fb37e34ea006c79be1c54cbb0f803414'
>   ==> ERROR: Unable to find source file .

Would putting quotes around the outputted source file name clear this
up?   Note that the output of 'makepkg -g' is incorrect (but working -
see below) in the case of sparse source arrays.

>       Aborting...
> 
> And if you're still lost, a sparse array could be constructed like this:
> 
>   source=('git://anongit.freedesktop.org/systemd/systemd.git'
>           'initcpio-hook-udev'
>           'initcpio-install-udev')
>   source[5]='initcpio-install-systemd'
>   md5sums=('SKIP'
>            'e99e9189aa2f6084ac28b8ddf605aeb8'
>            'fb37e34ea006c79be1c54cbb0f803414')
>   md5sums[5]='fbea6190413f5e54a4d0784ca4a340e4'
> 
> This is perhaps a contrived example, but it's valid, and today's makepkg
> handles it just fine.

Also, this currently works with the above source array...

   md5sums=('SKIP'
            'e99e9189aa2f6084ac28b8ddf605aeb8'
            'fb37e34ea006c79be1c54cbb0f803414'
            'fbea6190413f5e54a4d0784ca4a340e4')

Which I am guess is not supported after this patch.

I am in favour of dropping support for sparse source arrays and just
clarifying the output when an empty source entry is present.  That could
just be added in check_sanity.

A


More information about the pacman-dev mailing list