develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [MAINT] perl@18639

Thread Previous | Thread Next
From:
Abe Timmerman
Date:
February 4, 2003 18:12
Subject:
Re: [MAINT] perl@18639
Message ID:
200302050311.18710.abe@ztreet.demon.nl
Op een druilerige winterdag (Tuesday 04 February 2003 07:33), schreef Jarkko 
Hietaniemi:

> > Isn't there a clean way to expose this "Locally applied patches" bit from
> > the "-V" switch to perl?
> >
> > It seems like m/^MAINT\d+$/m should be easy to match...
>
> Yup, it would be, but unfortunately that info is not exposed at the moment
> (e.g. through %Config)

Somebody who knows what (s)he is doing, could perhaps make this into something 
usable... (It seems to work for MAINT18638 on Linux and 5.6.1 on Solaris 2.9)

package Config::Patches;
use strict;

use vars qw( $VERSION @EXPORT );
$VERSION = '0.001';

use base 'Exporter';
@EXPORT = qw( &get_local_patches );

use Inline (
    C => <<'EOC',
#include <patchlevel.h>

/* returns a perl-list of locally applied patches from patchlevel.h */
void get_local_patches( ) {
    int i;
    Inline_Stack_Vars;
    Inline_Stack_Reset;

#if defined(LOCAL_PATCH_COUNT)
    for (i = 1; i <= LOCAL_PATCH_COUNT; i++) {
        Inline_Stack_Push(newSVpv(local_patches[i],
                          strlen(local_patches[i])));
    }
#endif

    Inline_Stack_Done;
}
EOC
    NAME => 'Config::Patches',
);

1;

Good luck,

Abe
-- 
(*) Before the testing posse is on my case :-) let me preempt them by
saying that fake networks don't really help here.  You'll be testing
a fake network.  That proves that the module worked on a fake network.
That's great.  Like drinking decaffeinated.
                                   -- Jarkko Hietaniemi on p5p @ 2001-11-22


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About