public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Etaoin Shrdlu <shrdlu@unlimitedmail.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] gawk and filefuncs
Date: Fri, 3 Sep 2010 22:04:29 +0100	[thread overview]
Message-ID: <20100903220429.4c949e46@scooter.muppet.show> (raw)
In-Reply-To: <AANLkTin2UVHfi6yHWSsrAN3OdzXxQpRuPttq_CVQN657@mail.gmail.com>

On Fri, 3 Sep 2010 22:31:01 +0200 Al <oss.elmar@googlemail.com> wrote:

> Can anybody explain the Gentoo handling of filefuncs in the gawk package?
> 
> Why isn't a simple patch used like in all other cases?

gawk provides dynamic extension modules. This is explained here:

http://www.gnu.org/manual/gawk/gawk.html#Dynamic-Extensions

The gawk source distribution comes with a number of such extensions in the
(doh) extensions/ directory. filefuncs.c is such one extension, which
demonstrate how to add stat() and chdir() capabilities to awk.
The file is compiled into a .so file, which is then referenced from within
gawk to make the extended commands available.

A vanilla build of gawk does not have any dynamic extension.


Now, the Gentoo devs at some point in the past (very early) took that file
(filefuncs.c) and extended it to implement new commands like "symlink",
"unlink", "mkdir", "rmdir" and "stat", so those are callable from within
awk, effectively extending the language. (you can see the Gentoo copyright
in the file, look
into /usr/portage/sys-apps/gawk/files/filefuncs/filefuncs.c)

There are a number of Gentoo system scripts that use those awk extensions
(look into /lib/rcscripts and /lib/rcscripts/awk), which means that
compiling the expanded filefuncs.c (not the vanilla one) is mandatory on a
Gentoo system, because there are awk scripts that rely on the extended
functionaltiy provided by it. Hence Gentoo maintains the filefuncs.c file
independently, and the gawk ebuild, besides building gawk itself, also takes
care of building filefuncs.c containing the extensions.



  reply	other threads:[~2010-09-03 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 20:31 [gentoo-user] gawk and filefuncs Al
2010-09-03 21:04 ` Etaoin Shrdlu [this message]
2010-09-03 22:25   ` Al
2010-09-03 22:26     ` Al
2010-09-04  9:58     ` Etaoin Shrdlu
2010-09-04 10:51       ` Al

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=20100903220429.4c949e46@scooter.muppet.show \
    --to=shrdlu@unlimitedmail.org \
    --cc=gentoo-user@lists.gentoo.org \
    /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