[Pm-utils] RFC - PATCH to functions.in to support Slackware init

Robby Workman rw at rlworkman.net
Wed Oct 29 21:15:08 PDT 2008


On Wed, 29 Oct 2008 16:44:39 -0500
Victor Lowther <victor.lowther at gmail.com> wrote:

> On Oct 29, 2008, at 4:02 PM, Robby Workman <rw at rlworkman.net> wrote:
> 
> >> A better way to do it might be to add a distro.d directory
> >> to /usr/lib/pm-utils that can have the following content:
> >>
> >> pm-functions: Sourced at the end of /usr/lib/pm-utils/pm-functions
> >> if present.
> >>
> >> functions:  Sourced at the end in /usr/lib/pm-utils/functions if
> >> present.
> >
> >
> > I like the idea, I think.  I almost prefer to have those named in a
> > format of "$distro.functions" and "$distro.pm-functions" though.
> > This, of course, would require testing if the directory is not empty
> > and then sourcing all of its contents if not, or perhaps this, to
> > add (probably needless) complexity:  a --with-distro=$distro
> > configure flag, and then configure could write that value into the
> > stock functions files so that it knows what to source.  Did that
> > make any sense? :-)
> 
> Well, Part of the idea is that upstream pm-utils would not do
> anything in the distro.d directory - it would be there for the
> distros to use or ignore as they choose. I don't want to be in the
> business of maintaining every distro-specific method for doing
> something out there  
> - I just want to provide sane defaults and make it easy for distro  
> maintainers to customize things. Giving y'all a designated place and
> a method to do so is part of that goal.


I don't think I was very clear in explaining what I meant.  Maybe you
still won't like it, and if not, fine :) but I'll try again...

The idea was that, for example in our case, it would be even more clear
that the directory is Slackware-specific, as the directory would be
named /usr/lib/pm-utils/distro.d/ and contain files named
"slackware.functions" and "slackware.pm-functions"

There wouldn't be a need for the pm-utils package itself to create
anything but the "distro.d" directory.  The packager would decide the
naming scheme of the files inside via the --with-distro flag to
configure.  If the package sets --with-distro=slackware, then the files
are named as I stated above.  If --with-distro=redhat, then the files
are named redhat.functions and redhat.pm-functions, and if nothing is
specified there, it could default to distro.functions and
distro.pm-functions.  In the process, configure would also substitute
in that value to the stock "functions" and "pm-functions" files from
the .in files so that it would be seamless.

Now, with all that said, I'm second-guessing myself and thinking that
it's just needless complexity, so at this point, unless you're
agreeing, let's nix that idea. :-)  

However, perhaps "vendor.d" is a bit better sounding than "distro.d" as
are "vendor.functions" and "vendor.pm-functions"  :-)

-RW


More information about the Pm-utils mailing list