Mail archive
alpine-devel

Re: [alpine-devel] Normalizing Python packages in aports

From: A. Wilcox <awilfox_at_adelielinux.org>
Date: Thu, 14 Mar 2019 17:30:00 -0500

On 03/14/19 15:37, Drew DeVault wrote:
> On 2019-03-14 3:37 PM, A. Wilcox wrote:
>> Unspecified, not undefined.
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01
>
> Is there a meaningful difference?

Yes.

Quoting the Rationale for Base Definitions[1]:


-8<-

The definitions for "unspecified" and "undefined" appear nearly
identical at first examination, but are not. The term "unspecified"
means that a conforming application may deal with the unspecified
behavior, and it should not care what the outcome is. The term
"undefined" says that a conforming application should not do it because
no definition is provided for what it does (and implicitly it would care
what the outcome was if it tried it). It is important to remember,
however, that if the syntax permits the statement at all, it must have
some outcome in a real implementation.

Thus, the terms "undefined" and "unspecified" apply to the way the
application should think about the feature. In terms of the
implementation, it is always "defined''-there is always some result,
even if it is an error. The implementation is free to choose the
behavior it prefers.

-8<-


It is therefore conformant for a POSIX shell script to use any of the
unspecified keywords, as long as they can "deal with" the unspecified
behaviour.

This can be trivially accomplished using `type` and defining a small
`local` function for shells that don't have it[2], *if* abuild were ever
to *use* such a shell. Note that I doubt that would be possible anyway,
as abuild require multiple changes that were rejected when we proposed
strict POSIX compatibility. (This was so we could use zsh or dash as
/bin/sh and let abuild use a /bin/sh hashbang instead of requiring a
hard dependency on BusyBox. We gave up and gave it a hashbang of
/bin/bash in our soft-fork.) In addition, all build scripts inside of
packages which use /bin/sh as their hashbang would *also* have to be
compatible with this theoretical shell.

Best,
--arw


[1]:
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap01.html#tag_21_01_15

[2]: example:

type local 2>/dev/null || local() { [ ... ] }

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
https://www.adelielinux.org




---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Thu Mar 14 2019 - 17:30:00 UTC