public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: linux-man@vger.kernel.org, Oskari Pirhonen <xxc3ncoredxx@gmail.com>
Cc: Sam James <sam@gentoo.org>, Marcos Fouces <marcos@debian.org>,
	Tom Schwindl <schwindl@posteo.de>
Subject: Re: Revert "Many Pages: Remove references to C89"
Date: Wed, 22 Mar 2023 02:20:28 +0100	[thread overview]
Message-ID: <c4d97aec-427a-a082-ff1e-dbe9ae968c94@gmail.com> (raw)
In-Reply-To: <ZBVE1QUaoCZZ73Os@dj3ntoo>


[-- Attachment #1.1: Type: text/plain, Size: 5559 bytes --]

[CC += Sam, Marcos]

Hi Oskari, Sam, Marcos,

On 3/18/23 05:58, Oskari Pirhonen wrote:
> Hi,
> 
> On Thu, Mar 16, 2023 at 02:43:54 +0100, Alejandro Colomar wrote:
>> Hi Tom,
>>
>> On 3/15/23 19:10, Tom Schwindl wrote:
>>> Hi Alex,
>>>>
>>>> Do you know if we can distribute them?  which license applied to them?
>>>> I'm worried that some distros are very strict in what can be distributed
>>>> in a package (e.g., Fedora, Debian (main)).  There were issues with
>>>> man-pages-posix in the past.
>>>>
>>>> Should we maybe open a separate project iso-c-drafts that installs
>>>> drafts of the ISO C standards and maybe some scripts that will be useful
>>>> with them?
>>>>
>>>
>>> This is probably a legal gray area and I'd be careful.
>>
>> Yeah, that's what I think.  Until I'm 100% sure that it's legal, I
>> won't do it.
>>
>>> ISOs license agreement[0] explicitly states the following:
>>
>> I had some doubts, because since the drafts have always been published
>> in many sites, I don't know if that's legal, or simply ISO doesn't
>> enforce the license over drafts...  If someone knows for sure and can
>> clarify, that would help.  In fact, maybe I can write to someone in the
>> committee...
>>
>> Thanks,
>>
>> Alex
>>
>>>
>>>   > The ISO publication(s) you order is/are copyrighted by the International
>>>   > Organization for Standardization. You acknowledge and agree to respect ISO’s
>>>   > copyright in our publications by purchasing, downloading, copying or
>>>   > otherwise using (an) ISO publication(s). Except as provided for under this
>>>   > Licence Agreement, you may not lend, lease, reproduce, distribute or
>>>   > otherwise commercially exploit ISO publication(s). In the case of joint
>>>   > standards (such as ISO/IEC standards), this clause shall apply to the
>>>   > respective joint copyright ownership.
>>>
>>> As we (or a third party) can only produce a plaintext version by downloading the
>>> original PDF draft and converting it, we agree with the above. Thus, we can't
>>> "reproduce" or "distribute" the standard, at least that's my understanding[1].
>>> I highly doubt that major distibutions would take that risk, nor should we.
>>>
>>>
>>> [0] <https://www.iso.org/terms-conditions-licence-agreement.html#Customer-Licence>
>>> [1] For the record: I'm not a lawyer, this is not legal advice. It's very well
>>>     possible that I've overlooked something.
>>>
> 
> Gentoo has a concept of "fetch restricted packages" [1] where ebuilds
> are available through Portage, but you have to provide the distfiles
> yourself. Perhaps something similar in spririt can be used here if the
> license terms forbid/are unclear about distributing the standards (or
> drafts) themselves?
> 
> Here's my idea:
> 
> - Create the utils with the assumption that the docs exist at some TBD
>   path and ship them (the utils, that is).

I think that would qualify as a "contrib" package in Debian policy.  So
that would be for a new package, separate from the man-pages, which
should go in main.

> - Include a check for the docs and instruct the user to install them to
>   that path manually if they don't exist.

I'm not even sure about the legality of that.  So far I've written the
script assuming the files exist, and we'll see how to get the files
there (I have them in my system).  I'll be cautious before writing any
advice on how to get them in a program :).

> - If it turns out the docs can be distributed, the check can be removed.
>   Although it might be better to keep it around for the sake of the
>   pickier distros in hopes that they don't patch out the utils from
>   their packages.
> 
> Obligatory I'm not a lawyer either.
> 
> For people unfamiliar with Gentoo terminology, "ebuilds" are basically
> scripts used to fetch, build, and install packages and "distfiles" are
> what's being fetched (source code, etc).
> 
> - Oskari
> 
> [1]: https://devmanual.gentoo.org/general-concepts/licenses/index.html#license-implied-restrictions

Here goes something that works for c89, c99, and c11 (thoroughly tested
only for c89; lightly tested for the others).

I'll create a public git repository for it in my website later this week
(if I find the time this week).

Cheers,

Alex
---

(I might change the interface in the future, and will document it when
I'm convinced by it.)


$ cat /usr/local/bin/stdc 
#!/bin/bash

set -Eefuo pipefail;

prefix="/usr/local";
datarootdir="$prefix/share";
docdir="$datarootdir/doc";

err()
{
	>&2 echo "$(basename "$0"): error: $*";
	exit 1;
}

grep_proto()
{
	pcregrep -M "(?s)\b$1 *\([[:alnum:]*,._\s\(\)-]*\);$";
}

c89_libc_summ()
{
	sed -n '/A.3 LIBRARY SUMMARY/,$p' <"$docdir/c/c89/c89-draft.txt";
}

c99_libc_summ()
{
	sed -n '/Library summary$/,/Sequence points$/p' \
		<"$docdir/c/c99/n1256.txt";
}

c11_libc_summ()
{
	sed -n '/Library summary$/,/Sequence points$/p' \
		<"$docdir/c/c11/n1570.txt";
}

case $# in
0)
	err "missing ISO C version.";
	;;
1)
	err "missing function name.";
	;;
2)
	;;
*)
	shift;
	shift;
	err "unsupported extra argument(s): $*";
	;;
esac;

case "$1" in
c89)
	shift;
	c89_libc_summ | grep_proto $@;
	;;
c99)
	shift;
	c99_libc_summ | grep_proto $@;
	;;
c11)
	shift;
	c11_libc_summ | grep_proto $@;
	;;
*)
	err "$1: unsupported ISO C version.";
	;;
esac;

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-03-22  1:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  1:51 Revert "Many Pages: Remove references to C89" Matt Jolly
2023-03-10  1:51 ` [PATCH] Revert "Many pages: " Matt Jolly
2023-03-10  2:22 ` Revert "Many Pages: " Alejandro Colomar
2023-03-10  5:00   ` Oskari Pirhonen
2023-03-10 13:29     ` Alejandro Colomar
2023-03-10 13:32       ` Alejandro Colomar
2023-03-13  1:42       ` Oskari Pirhonen
2023-03-13 12:00         ` Alejandro Colomar
2023-03-14  5:39           ` Oskari Pirhonen
2023-03-15 12:30             ` Alejandro Colomar
2023-03-15 12:53               ` Alejandro Colomar
2023-03-15 12:54                 ` Alejandro Colomar
2023-03-15 14:22                 ` Alejandro Colomar
2023-03-15 16:51               ` Brian Inglis
2023-03-15 17:01                 ` Alejandro Colomar
2023-03-15 18:10                   ` Tom Schwindl
2023-03-16  1:43                     ` Alejandro Colomar
2023-03-18  4:58                       ` Oskari Pirhonen
2023-03-22  1:20                         ` Alejandro Colomar [this message]
2023-03-15  4:36           ` Guillem Jover
2023-03-10  6:40   ` Brian Inglis
2023-03-10 12:49     ` Alejandro Colomar
2023-03-23  5:32   ` Sam James
2023-03-23 13:13     ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4d97aec-427a-a082-ff1e-dbe9ae968c94@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=marcos@debian.org \
    --cc=sam@gentoo.org \
    --cc=schwindl@posteo.de \
    --cc=xxc3ncoredxx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox