[pacman-dev] [PATCH] A variety of small changes

Allan McRae mcrae_allan at hotmail.com
Mon May 19 10:24:59 EDT 2008


Xavier wrote:
> On Mon, May 19, 2008 at 3:20 PM, Allan McRae <mcrae_allan at hotmail.com> wrote:
>
>   
>>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>>> index cc44c68..8009ef0 100644
>>>> --- a/scripts/makepkg.sh.in
>>>> +++ b/scripts/makepkg.sh.in
>>>> @@ -1315,7 +1315,7 @@ if [ "$arch" = 'any' ]; then
>>>>  fi
>>>>
>>>>  if ! in_array $CARCH ${arch[@]}; then
>>>> -       if [ "$IGNOREARCH" = "0" ]; then
>>>> +       if [ "$IGNOREARCH" = "0"  -o "$GENINTEG" = "1" ]; then
>>>>                error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgname" "$CARCH"
>>>>                plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
>>>>                plain "$(gettext "such as arch=('%s').")" "$CARCH"
>>>>
>>>>         
>>> I really don't understand the logic here :)
>>>
>>>       
>> I will add a comment there.  Essentially, if we are only generating
>> integrity checks, then we don't care if the arch line is missing.  Well,
>> at least not error level care.  Maybe in that case a warning should
>> still be printed. Opinions?
>>
>>     

My bad.... it does actually print a warning as it is.  That is in the 
else block of this if statement  :palmface:

>
> It was more the implementation that I didn't understand :
> if [ "$IGNOREARCH" = "0"  -o "$GENINTEG" = "1" ]; then
> Shouldn't it rather be something like this :
> if [ "$IGNOREARCH" = "0"  -a "$GENINTEG" = "0" ]; then
> ?
>
>   

Yes.  I have no idea who wrote the original code.  An implementation 
that bad/wrong could not have come from me...

> otherwise an additional if before that check :
> if [  "$GENINTEG" = "1" ]; then
> IGNOREARCH=1
> fi
>
>   

I think going the above way with a comment would be clearer.

> But I think the current behavior is fine, just print an error in any cases.
> Are there really situations where you only want to generate md5sums,
> but not build the package or simply fix the pkgbuild so that others
> can build it?
>   
When using the geninteg flag, it is not a error condition for the 
operation being run so it should continue.  It is an edge case but I am 
sure I saw someone else suggest this as well so that is my justification 
of usefulness... Found it: 
http://wiki.archlinux.org/index.php/User:Romashka#Pacman

Allan






More information about the pacman-dev mailing list