[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mawk(1) , gawk(1) and package control files (questions)

The following are my best guesses at answers.  If I guess wrong,
someone with better information will correct me.

Chris Fearnley <cjf@netaxs.com> said:

> [...] I have a few questions on this my first
> debianization effort.
>  o Why is gawk a required package?  And is there any reason why gawk
> forcibly installs awk to be a symbolic link to awk?  [...]

I'm not sure.  The FSSTND doesn't require awk, none of the base
system packages seem to need it in order to install, dpkg and dselect
don't seem to need it.

It may be that "Required" indicates facilities expected to be present
in a traditional unix environment.  I'm just guessing about that,
though.  I don't offhand recall the exact definition of the PRIORITY
field in package control files, and haven't been able to find that
documented anyplace in a brief search for that info this morning.

>  o I'm not clear on the "provides" virtual package as it would apply to
> 'awk'.  Should gawk "provide" 'awk'?  Should mawk "provide" 'awk'?
> Since clearly awk should be a symbolic link to gawk or mawk but not
> both, is there a conflict here?  Or should the "conflict" be resolved
> by the {post,pre}{inst,rm} scripts (this seems best to me as most
> people would have both installed side by side)?  Maybe my mawk package
> should Recommends or Suggests gawk?

Yes, both gawk and mawk could provide awk (presuming that mawk is
100.00% backwards compatable with standard awk).  Other packages
could then have a dependency on awk satisfied by either of the
packages which provided it being installed.

This sounds like a situation which might be resolved with Ian Jackson's
update-alternatives script, which is part of the dpkg package.  I don't
think there's any documentation on it, though.  It'd allow gawk and
mawk to both be installed, would and link one or the other to awk depending
on relative "priorities" agreed to between the gawk and mawk
maintainers.  Some (perhaps all, by now.  perhaps not) of the vi clones
use it.  Elvis uses it, for one.  Look in the pre* and post* scripts
in the elvis package for an example of usage, or read the script itself
for info.  In the meantime, or as an alternative to update-alternatives,
the mawk package might just provide mawk, without making the symlink to awk.

If my guess above about "PRIORITY:  Required" is correct, I don't
think mawk vs. awk can presently be resolved by updates-alternatives
to the point where they are true alternatives.  At least one of
them would need to be "PRIORITY:  Required" in order to provide the
awk facility.  I don't think dselect knows about alternative "Required"
packages to the point that it can install any of the alternatives to
satisfy a requirement.  The awk facility would be what is actually
required here, but the PRIORITY field is associated with particular
packages, not with the facilities which they provide.

>  o It occurs to me that many packages should "Recommends" or "Suggests"
> man and/or info.  Yet they don't.  Why?  What am I missing?  And most
> packages depend on ldso.  So are essential packages too basic to be
> listed in the control files?  Is it possible that this lack of
> consistency in setting dependencies could affect us much like the
> current libc, libc4 and libc5 (which as required packages under Debian
> 0.93R6 weren't mentioned in the depends fields of any packages).

True.  Packages install their man pages regardless of whether
/usr/bin/man is installed.  Ditto with info pages and /usr/bin/info.
Also, some facilities provided by base system packages are necessary
for installation of (some or all) packages, but no dependency is
declared on the packages which provide those facilities.

Generally, packages presume that the base system packages will be
present without declaring explicit dependencies (though I don't
think it's documented precisely what the base system is guaranteed
to provide), only declare dependencies on other packages which are
needed for their proper installation and operation, and omit declaring
dependencies on packages needed to display their docs.

> Thanks for Debian.  I'm thoroughly enjoying it!  I just wish I could
> easily order a CD :(


Reply to: