PAR-Packer

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - Now officially requires Perl 5.6.1 and up in the Makefile.PL.
        This has been the case for a long time anyway, but this change
        should suppress some spurious CPAN testers failures.

  - Documentation
      - Clarified examples in the pp documentation, thanks to Dave Howorth.

0.981  2008-05-14

  - Bug fixes, etc.
      - Make get_username_from_getpwuid work for uid=0. (Scott Stanton)
      - Fixed crash in get_username_from_getpwuid when getpwuid fails.
        (Scott Stanton)
      - Fix broken build on win32 when searching for dll and finding static perl
        library. (Alexey Borzenkov)
      - Fix compilation on MacOS 10.5's gcc because that doesn't seem to support
        the --output option. (Matthew Andersen)

o0.980  2008-05-14
  - Emergency bug fix release
      - The test suite in the previous release was broken by my debugging
        code. Sorry about that. (Steffen)

Changes  view on Meta::CPAN

      - myldr/Makefile.PL fix: Clean up myldr/usernamefrompwuid.h.
      - Silence warning in myldr/internals.c.
      - Silence warnings seen on Irix from myldr/env.c.
      - Skip most tests in 10-parl-generation.t if there is no parl.
      - Skip loading ActiveState Perl's "sitecustomize.pl" in par.pl.
      - Load modules via require and other files via do.
      - The parl-regeneration-for-every-pp-call addition of the 0.958 release
        should now also work for static perls.

  - New features
      - Adressing RT ticket #6612: Now using getpwuid() to determine the
        user name if supported by the OS.

0.959  2006-11-12

  - This is just a hotfix release because 0.958 lacked META.yml. One day, I will
    switch from Module::Install to Module::Build...

0.958  2006-10-25

  - Bug fixes, etc.

myldr/mktmpdir.c  view on Meta::CPAN

#ifdef WIN32
    {
        DWORD buflen = MAXPATHLEN;
        username = malloc(MAXPATHLEN);
        GetUserName((LPTSTR)username, &buflen);
        // FIXME this is uncondifionally overwritten below - WTF?
    }
#endif

    /* Determine username */
    username = get_username_from_getpwuid();
    if ( !username ) { /* fall back to env vars */
        for ( i = 0 ; username == NULL && (key = user_keys[i]); i++) {
            if ( (val = par_getenv(key)) && strlen(val) ) 
                username = strdup(val);
        }
    }
    if ( username == NULL )
        username = "SYSTEM";
   
    /* sanitize username: encode all bytes as 2 hex digits */

myldr/usernamefrompwuid.c  view on Meta::CPAN

#include "usernamefrompwuid.h"
#ifdef I_PWD
#  include <sys/types.h>
#  include <pwd.h>
#endif

/* This piece of code uses getpwuid from pwd.h to determine the current
 * user name.
 * Since pwd.h might not be available and perl's configure script probed
 * for this, we require access to perl's config.h. Whether or not we have that
 * can be determined by the Makefile.PL in myldr/. It writes the
 * usernamefrompwuid.h file for us. In the header, we include config.h if
 * available or sets I_PWD to undefined.
 * -- Steffen Mueller
 */

char *get_username_from_getpwuid () {
    char *username = NULL;
#ifdef I_PWD
    struct passwd *userdata = NULL;
    userdata = getpwuid(getuid());
    if (userdata)
        username = userdata->pw_name;
#endif
    return(username);
}

script/par.pl  view on Meta::CPAN

    }

    foreach my $path (
        (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )),
        qw( C:\\TEMP /tmp . )
    ) {
        next unless defined $path and -d $path and -w $path;
        my $username;
        my $pwuid;
        # does not work everywhere:
        eval {($pwuid) = getpwuid($>) if defined $>;};

        if ( defined(&Win32::LoginName) ) {
            $username = &Win32::LoginName;
        }
        elsif (defined $pwuid) {
            $username = $pwuid;
        }
        else {
            $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM';
        }



( run in 0.275 second using v1.01-cache-2.11-cpan-8d75d55dd25 )