Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
775190f
The start of a fatpack approach. Adds a base module.
briandfoy Jan 25, 2026
fe5bbb4
Don't care about powershell, which doesn't actually glob
briandfoy Mar 9, 2026
7395b90
use @args so the options are removed
briandfoy Mar 9, 2026
fe5681d
if the argument is an exact match, use it as a literal
briandfoy Mar 9, 2026
638eed5
grammar nit
briandfoy Mar 9, 2026
bf0209f
don't need the packed perlpowertools right now
briandfoy Mar 9, 2026
c2007b2
add a make target to pack the programs under bin_to_pack/
briandfoy Mar 9, 2026
b95d899
Getopt needs an array ref, not an array
briandfoy Mar 9, 2026
d08ec50
some docs grammar
briandfoy Mar 9, 2026
99224d6
move programs to pack to bin_to_pack
briandfoy Mar 9, 2026
639ce43
ignore fatpack.trace
briandfoy Mar 9, 2026
1653eee
nix the warning about the README.pod
briandfoy Mar 9, 2026
45da220
go back to including all the exe files
briandfoy Mar 9, 2026
3ae13bd
put the EXIT constants in the example program
briandfoy Mar 14, 2026
e5eb02a
pass the raw and resolved arguments to run
briandfoy Mar 14, 2026
bb4c925
start on a fatpack version of rm
briandfoy Mar 14, 2026
ecba9b9
update email address
briandfoy Mar 14, 2026
9894918
make Base handle more exit stuff
briandfoy Mar 14, 2026
e86f841
begin converting rm tests
briandfoy Mar 14, 2026
224363e
File::Glob is case sensitive
briandfoy Mar 15, 2026
ebea8b3
make things in Base an instance method
briandfoy Mar 15, 2026
04be41b
different error message in rm for no matching file
briandfoy Mar 15, 2026
f6cd13c
dumper is in Base now
briandfoy Mar 15, 2026
e329042
rmeove some debugging statements
briandfoy Mar 15, 2026
002e2f5
Take out module docs, just have program docs
briandfoy Mar 15, 2026
dcc1c85
stripping out more unneeded things
briandfoy Mar 15, 2026
5ef7707
use ->program_name instead of global
briandfoy Mar 15, 2026
fa8c4c9
Warn for -P no-op
briandfoy Mar 15, 2026
6c31149
doc grammar
briandfoy Mar 15, 2026
551d130
adapt rm test to new setup
briandfoy Mar 15, 2026
9e3291e
add PERL5LIB to fatpack
briandfoy Mar 15, 2026
961f829
remove a couple of debugging statements
briandfoy Mar 15, 2026
f32e4d6
the translated fatpack version of ls
briandfoy Mar 15, 2026
46f6bc9
Add the window size stuff to ::Base
briandfoy Mar 15, 2026
862ac90
remove EX_ constants that are in ::Base
briandfoy Mar 15, 2026
ecca413
Add metadata to program_example
briandfoy Mar 15, 2026
9cdf521
Add more of the modules that ::Base needs
briandfoy Mar 15, 2026
5853311
add metadata block to the fatpack version of rm
briandfoy Mar 15, 2026
6c5c5cc
update program example for change to ::Base to use `main`
briandfoy Mar 15, 2026
0fc76ed
Don't track program-example in bin/
briandfoy Mar 15, 2026
37631c9
call exit on $self
briandfoy Mar 15, 2026
afe82d6
Report program errors from ->main
briandfoy Mar 15, 2026
1afbe0a
Find the last of -i and -f in bundled args
briandfoy Mar 16, 2026
09d0a61
Lots of movement to streamline and document the process
briandfoy Mar 16, 2026
0834b90
argv is now command_line
briandfoy Mar 16, 2026
4399a36
silence some error output from backticks in bc
briandfoy Mar 16, 2026
fd83949
all the options stuff is inside process_options now
briandfoy Mar 16, 2026
284736c
some stuff in ls moved into ::Base
briandfoy Mar 16, 2026
461f7fd
adjust ls.t test to use a subtest
briandfoy Mar 16, 2026
09fdf85
pack target needs to be Windows sensitive
briandfoy Mar 16, 2026
a7a53c7
finish thoughts in get_columns
briandfoy Mar 17, 2026
dafa936
default() is now in ::Base
briandfoy Mar 17, 2026
57f674b
set default columns if -w is 0
briandfoy Mar 17, 2026
3c1ed36
capture -w with no argument and make it the default column width
briandfoy Mar 17, 2026
5fc96bd
start_time moves to ::Base
briandfoy Mar 17, 2026
4830ce0
call has() as a method
briandfoy Mar 17, 2026
4a53ea8
typo
briandfoy Mar 17, 2026
e712a49
regenerate bin/ls
briandfoy Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ Changes*[123456789]
/test/
output.txt
.DS_Store
fatpacker.trace
bin/program-example
2 changes: 2 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ PROGRAMMING_STYLE.md
.token

.downstream.json

bin/program-example
65 changes: 63 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,31 @@ Perl.

=cut


BEGIN {
use ExtUtils::MM_Any;
no warnings qw(redefine);

# get rid of the warning about README.pod, because I'm using it.
# It's also in INSTALL.SKIP
sub ExtUtils::MM_Any::libscan {
my($self,$path) = @_;

my($dirs,$file) = ($self->splitpath($path))[1,2];
return '' if grep /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/,
$self->splitdir($dirs), $file;

return $path;
}
}

# You can specify INSTALL_BASE on the command line or in an environment
# variable a tool sets. We should respect either of them.
my $install_base_in_argv = grep { /\AINSTALL_BASE\b/ } @ARGV;
my $install_base_in_perl_mm_opt = (defined $ENV{PERL_MM_OPT} ? $ENV{PERL_MM_OPT} : "") =~ /\bINSTALL_BASE\b/;
my $has_install_base =
$install_base_in_argv || $install_base_in_perl_mm_opt || 0;

use File::Spec::Functions qw(catfile);
my $home = home();
unless( $has_install_base ) {
my $path = catfile($home, 'perlpowertools');
Expand Down Expand Up @@ -98,6 +115,13 @@ my $module = __PACKAGE__;
my $github = 'https://github.com/briandfoy/PerlPowerTools';
my $main_file = catfile( 'lib', split /::/, "$module.pm" );

use File::Basename;
use File::Spec::Functions qw(catfile);
my $bin = 'bin'; # used later in the postamble too
my $bin_to_pack = 'bin_to_pack';
my @packed_bins = map { catfile $bin, basename($_) } glob( catfile $bin_to_pack, '*' );


my %WriteMakefile = (
'MIN_PERL_VERSION' => '5.008',

Expand All @@ -110,6 +134,7 @@ my %WriteMakefile = (
'EXE_FILES' => \@exe_files,

'CONFIGURE_REQUIRES' => {
'App::Fatpacker' => '0',
'ExtUtils::MakeMaker' => '6.64',
'File::Spec::Functions' => '0',
},
Expand Down Expand Up @@ -144,7 +169,7 @@ my %WriteMakefile = (
},
},

clean => { FILES => "$dist-*" },
clean => { FILES => "$dist-* @packed_bins" },
test => {TESTS => 't/*.t t/*/*.t'}
);

Expand Down Expand Up @@ -194,5 +219,41 @@ sub home {
}
}

sub MY::postamble {
my $pack_command =
$^O eq 'MSWin32'
?
q(set PERL5LIB=lib && fatpack pack "$<" > "$@")
:
q(PERL5LIB=lib fatpack pack "$<" > "$@")
;

# these vars at lexicals at the file level
my $v = <<"VARS";

PACK_SRC_DIR := $bin_to_pack
PACK_DEST_DIR := $bin

VARS

$v .= <<'POSTAMBLE';

SRC := $(wildcard $(PACK_SRC_DIR)/*)
OUT := $(patsubst $(PACK_SRC_DIR)/%,$(PACK_DEST_DIR)/%,$(SRC))

.PHONY: pack
pack: $(PACK_DEST_DIR) $(OUT)

config :: pack

$(PACK_DEST_DIR):
$(PERL) -MFile::Path=make_path -e "make_path(q{$@})"

$(PACK_DEST_DIR)/%: $(PACK_SRC_DIR)/%
POSTAMBLE

$v .= "\t$pack_command\n\n";
}

no warnings;
__PACKAGE__;
Loading
Loading