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

Re: dpkg-logger



On Sat, Jan 02, 1999 at 04:59:00PM +0100, Martin Bialasinski wrote:
>
> >> "WA" == Wichert Akkerman <wakkerma@cs.leidenuniv.nl> writes:
>
> WA> [1  <multipart/mixed>]
> WA> [1.1  <text/plain; us-ascii (quoted-printable)>]
> WA> Previously Ben Collins wrote:
> >> Well, this is my first shot at making a wrapper for logger for packages
> >> to use. This is just for testing and usability try outs. I used
> >> dpkg-divert as a template so that it could easily be droped into
> >> dpkg-?.?.?/scripts/ for actual usage.
>
> WA> I made a slight rewrite to remove some code duplication.
>
> Two additions:
>
> 1. Perl has an way to acces the logsystem without logger. use
> Sys::Syslog. This will save one exec, thous makeing the thing faster.
That's good, if perl is installed already and not just perl-base, or is
Sys::Syslog in perl-base?

> 2. No need to call it with the package name.
>
> $ppid = getppid;
> open IN, "/proc/$ppid/cmdline";
> $line = <IN>;
> close IN;
> ($package) = $line =~ m!/var/lib/dpkg/info/([^.]+)!;
Too complicated and depends on procfs being there, which it may not.

--
-----    -- - -------- --------- ----  -------  -----  - - ---   --------
Ben Collins <b.m.collins@larc.nasa.gov>                  Debian GNU/Linux
UnixGroup Admin - Jordan Systems Inc.                 bcollins@debian.org
------ -- ----- - - -------   ------- -- The Choice of the GNU Generation


Reply to: