App-GhostWork

 view release on metacpan or  search on metacpan

pmake.bat  view on Meta::CPAN

        $tardir =~ s#^lib-##;
        rmtree($tardir,0,0);

        if ($^O =~ /(?:solaris|linux)/i) {
            for my $file (@file) {
                if (-e $file) {
                    mkpath(dirname("$tardir/$file"), 0, 0777);
                    print STDERR "copy $file $tardir/$file\n";
                    copy($file, "$tardir/$file");
                    if ($file =~ m/ (?: Build\.PL | Makefile\.PL ) \z/oxmsi) {
                        chmod(0664, "$tardir/$file");
                    }
                    elsif ($file =~ m/\. (?: pl | bat | exe | com ) \z/oxmsi) {
                        chmod(0775, "$tardir/$file");
                    }
                    elsif ($file =~ m{^bin/}oxmsi) {
                        chmod(0775, "$tardir/$file");
                    }
                    else {
                        chmod(0664, "$tardir/$file");
                    }
                }
            }
            system(qq{tar -cvf $tardir.tar $tardir});
            system(qq{gzip $tardir.tar});
        }
        else {

#-----------------------------------------------------------------------------
# https://metacpan.org/search?q=Archive%3A%3ATar%3A%3AConstant

pmake.bat  view on Meta::CPAN

            print FH_TARBAT ":endofperl\n";
            close FH_TARBAT;
        }

        # make ptar
        else {
            open(FH_TARBAT, '>ptar') || die "Can't open file: ptar\n";
            print FH_TARBAT '#!', &which($^X), "\n";
            print FH_TARBAT $ptar;
            close FH_TARBAT;
            chmod 0755, 'ptar';
        }
    }

    # unzip and untar *.tar.gz
    elsif ($target =~ /^xzvf$/) {
        for my $gzfile (grep m/\.tar\.gz$/xmsi, @ARGV) {

            if ($^O =~ /(?:solaris|linux)/i) {
                system(qq{gzip -cd $gzfile | tar -xvf -});
            }

pmake.bat  view on Meta::CPAN

            print FH_WGETBAT ":endofperl\n";
            close FH_WGETBAT;
        }

        # make pwget
        else {
            open(FH_WGETBAT, '>pwget') || die "Can't open file: pwget\n";
            print FH_WGETBAT '#!', &which($^X), "\n";
            print FH_WGETBAT $pwget;
            close FH_WGETBAT;
            chmod 0755, 'pwget';
        }
    }
    else {
        warn "unknown target: $target.\n";
    }
}

sub which {
    if ($_[0] =~ m#\A / #oxms) {
        return $_[0];



( run in 0.468 second using v1.01-cache-2.11-cpan-496ff517765 )