In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e5a8a0fbd70ee31a016b7cf1c4b8c07839c6cf97?hp=c02d599bfd636e89753a6ed00b136798dc1661c3>
- Log ----------------------------------------------------------------- commit e5a8a0fbd70ee31a016b7cf1c4b8c07839c6cf97 Author: Leon Timmermans <faw...@gmail.com> Date: Wed May 21 13:56:54 2014 +0200 Remove x2p This removes find2perl, s2p and a2p from core. They have all been released to CPAN as separate distributions. ----------------------------------------------------------------------- Summary of changes: MANIFEST | 19 - Makefile.SH | 64 +- Porting/exec-bit.txt | 1 - pod/perlutil.pod | 62 +- t/x2p/find2perl.t | 229 ---- t/x2p/s2p.t | 892 -------------- utils.lst | 3 - vms/descrip_mms.template | 67 +- win32/Makefile | 46 +- win32/makefile.mk | 51 +- x2p/.gitignore | 7 - x2p/EXTERN.h | 21 - x2p/INTERN.h | 23 - x2p/Makefile.SH | 178 --- x2p/a2p.c | 2941 ---------------------------------------------- x2p/a2p.h | 462 -------- x2p/a2p.pod | 175 --- x2p/a2p.y | 432 ------- x2p/a2py.c | 1300 -------------------- x2p/find2perl.PL | 919 --------------- x2p/hash.c | 149 --- x2p/hash.h | 47 - x2p/s2p.PL | 2072 -------------------------------- x2p/str.c | 260 ---- x2p/str.h | 41 - x2p/util.c | 196 --- x2p/util.h | 32 - x2p/walk.c | 2055 -------------------------------- 28 files changed, 19 insertions(+), 12725 deletions(-) delete mode 100644 t/x2p/find2perl.t delete mode 100644 t/x2p/s2p.t delete mode 100644 x2p/.gitignore delete mode 100644 x2p/EXTERN.h delete mode 100644 x2p/INTERN.h delete mode 100755 x2p/Makefile.SH delete mode 100644 x2p/a2p.c delete mode 100644 x2p/a2p.h delete mode 100644 x2p/a2p.pod delete mode 100644 x2p/a2p.y delete mode 100644 x2p/a2py.c delete mode 100644 x2p/find2perl.PL delete mode 100644 x2p/hash.c delete mode 100644 x2p/hash.h delete mode 100644 x2p/s2p.PL delete mode 100644 x2p/str.c delete mode 100644 x2p/str.h delete mode 100644 x2p/util.c delete mode 100644 x2p/util.h delete mode 100644 x2p/walk.c diff --git a/MANIFEST b/MANIFEST index 9bd0745..f2eab2c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5374,8 +5374,6 @@ t/win32/runenv.t Test if Win* perl honors its env variables t/win32/signal.t Test Win32 signal emulation t/win32/system.t See if system works in Win* t/win32/system_tests Test runner for system.t -t/x2p/find2perl.t Test find2perl -t/x2p/s2p.t See if s2p/psed work uconfig64.sh Configuration script for microperl for LP64 uconfig.h Configuration header for microperl uconfig.sh Configuration script for microperl @@ -5491,21 +5489,4 @@ win32/wince.c WinCE port win32/wince.h WinCE port win32/wincesck.c WinCE port write_buildcustomize.pl Generate lib/buildcustomize.pl -x2p/a2p.c Output of a2p.y run through byacc -x2p/a2p.h Global declarations -x2p/a2p.pod Pod for awk to perl translator -x2p/a2p.y A yacc grammar for awk -x2p/a2py.c Awk compiler, sort of -x2p/EXTERN.h Same as above -x2p/find2perl.PL A find to perl translator -x2p/hash.c Hashes again -x2p/hash.h Public declarations for the above -x2p/INTERN.h Same as above -x2p/Makefile.SH Precursor to Makefile -x2p/s2p.PL Sed to perl translator -x2p/str.c String handling package -x2p/str.h Public declarations for the above -x2p/util.c Utility routines -x2p/util.h Public declarations for the above -x2p/walk.c Parse tree walker XSUB.h Include file for extension subroutines diff --git a/Makefile.SH b/Makefile.SH index 727a763..7287853 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -435,7 +435,7 @@ SH_to_target() { echo $@ | sed -e s/\\\.SH//g -e s/_/./g } -SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH runtests.SH pod/Makefile.SH x2p/Makefile.SH' +SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH runtests.SH pod/Makefile.SH' shextract=`SH_to_target $SH` ## In the following dollars and backticks do not need the extra backslash. @@ -589,30 +589,15 @@ perl$(OBJ_EXT): git_version.h case "$usedl$static_cwd" in defineundef) util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE' - x2p_deps="\$(MINIPERL_EXE) \$(CONFIGPM) \$(dynamic_ext) x2p/$firstmakefile FORCE" ;; definedefine) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' - x2p_deps="\$(PERL_EXE) \$(CONFIGPM) \$(dynamic_ext) x2p/$firstmakefile FORCE" ;; *) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' - x2p_deps="\$(PERL_EXE) \$(CONFIGPM) x2p/$firstmakefile FORCE" ;; esac $spitshell >>$Makefile <<!GROK!THIS! -x2p/$firstmakefile: makedepend - cd x2p; \$(MAKE) depend - -translators: $x2p_deps - @echo " "; echo " Making x2p stuff"; cd x2p; \$(LDLIBPTH) \$(MAKE) all - -x2p/s2p: $x2p_deps - cd x2p; \$(LDLIBPTH) \$(MAKE) s2p - -x2p/find2perl: $x2p_deps - cd x2p; \$(LDLIBPTH) \$(MAKE) find2perl - utils/Makefile: \$(MINIPERL_EXE) \$(CONFIGPM) utils/Makefile.PL \$(MINIPERL) -Ilib utils/Makefile.PL @@ -1269,7 +1254,6 @@ _mopup: _tidy: -cd pod; $(LDLIBPTH) $(MAKE) clean -cd utils; $(LDLIBPTH) $(MAKE) clean - -cd x2p; $(LDLIBPTH) $(MAKE) clean -rm -f lib/Config_git.pl git_version.h -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ $(MINIPERL) make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \ @@ -1279,7 +1263,6 @@ _cleaner1: -cd os2; rm -f Makefile -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) - -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) -@if test -f $(MINIPERL_EXE) ; then \ for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ $(MINIPERL) make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \ @@ -1409,15 +1392,14 @@ test_prep_pre: preplibrary utilities $(nonxs_ext) case "$targethost" in '') $spitshell >>$Makefile <<'!NO!SUBS!' test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \ - $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \ - $(generated_pods) + $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) !NO!SUBS! ;; *) $spitshell >>$Makefile <<!GROK!THIS! test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \ - \$(dynamic_ext) \$(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \ + \$(dynamic_ext) \$(TEST_PERL_DLL) runtests \ \$(generated_pods) $to libperl.* $to t/* @@ -1454,8 +1436,6 @@ test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE # --- For Module::Build $to cpan/Module-Build/lib/* $to *.h -# --- For t/x2p/s2p.t - $to x2p # --- For t/TEST $to config.sh # --- For lib/diagnostics.t with -Duseshrplib @@ -1608,44 +1588,6 @@ define) echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2 case "$osname" in os390|posix-bc) - if cd x2p - then - rm -f y.tab.c y.tab.h - case "$osname" in - posix-bc) - # we are using two different yaccs in BS2000 Posix! - byacc a2p.y >/dev/null 2>&1 - ;; - *) # e.g. os390 - yacc a2p.y >/dev/null 2>&1 - ;; - esac - if cmp -s y.tab.c a2p.c - then - rm -f y.tab.c - else - echo "a2p.y -> a2p.c" >&2 - mv -f y.tab.c a2p.c - chmod u+w a2p.c - sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \ - -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \ - -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c - xxx="$xxx a2p.c" - fi - # In case somebody yacc -d:ed the a2p.y. - if test -f y.tab.h - then - if cmp -s y.tab.h a2p.h - then - rm -f y.tab.h - else - echo "a2p.h -> a2p.h" >&2 - mv -f y.tab.h a2p.h - xxx="$xxx a2p.h" - fi - fi - cd .. - fi ;; *) echo "'$osname' is an EBCDIC system I don't know that well." >&4 diff --git a/Porting/exec-bit.txt b/Porting/exec-bit.txt index 1dd17ba..a89d496 100644 --- a/Porting/exec-bit.txt +++ b/Porting/exec-bit.txt @@ -27,7 +27,6 @@ regen/regcharclass.pl regen/uconfig_h.pl runtests.SH t/TEST -x2p/Makefile.SH Porting/Maintainers.pl Porting/add-package.pl Porting/bisect.pl diff --git a/pod/perlutil.pod b/pod/perlutil.pod index ed73229..4047b42 100644 --- a/pod/perlutil.pod +++ b/pod/perlutil.pod @@ -76,56 +76,9 @@ typeset PostScript or text file of the whole lot. =head2 Converters -To help you convert legacy programs to Perl, we've included three -conversion filters: - -=over 3 - -=item L<a2p|a2p> - -F<a2p> converts F<awk> scripts to Perl programs; for example, C<a2p -F:> -on the simple F<awk> script C<{print $2}> will produce a Perl program -based around this code: - - while (<>) { - ($Fld1,$Fld2) = split(/[:\n]/, $_, -1); - print $Fld2; - } - -=item L<s2p|s2p> and L<psed> - -Similarly, F<s2p> converts F<sed> scripts to Perl programs. F<s2p> run -on C<s/foo/bar> will produce a Perl program based around this: - - while (<>) { - chomp; - s/foo/bar/g; - print if $printit; - } - -When invoked as F<psed>, it behaves as a F<sed> implementation, written in -Perl. - -=item L<find2perl|find2perl> - -Finally, F<find2perl> translates C<find> commands to Perl equivalents which -use the L<File::Find|File::Find> module. As an example, -C<find2perl . -user root -perm 4000 -print> produces the following callback -subroutine for C<File::Find>: - - sub wanted { - my ($dev,$ino,$mode,$nlink,$uid,$gid); - (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && - $uid == $uid{'root'}) && - (($mode & 0777) == 04000); - print("$name\n"); - } - -=back - -As well as these filters for converting other languages, the -L<pl2pm|pl2pm> utility will help you convert old-style Perl 4 libraries to -new-style Perl5 modules. +To help you convert legacy programs to more modern Perl, the +L<pl2pm|pl2pm> utility will help you convert old-style Perl 4 libraries +to new-style Perl5 modules. =head2 Administration @@ -284,10 +237,9 @@ validate your packlists and even create a tarball from an installed module. L<perldoc|perldoc>, L<pod2man|pod2man>, L<perlpod>, L<pod2html|pod2html>, L<pod2usage|pod2usage>, L<podselect|podselect>, L<podchecker|podchecker>, L<splain|splain>, L<perldiag>, -C<roffitall|roffitall>, L<a2p|a2p>, L<s2p|s2p>, L<find2perl|find2perl>, -L<File::Find|File::Find>, L<pl2pm|pl2pm>, L<perlbug|perlbug>, -L<h2ph|h2ph>, L<c2ph|c2ph>, L<h2xs|h2xs>, L<enc2xs>, L<xsubpp>, -L<cpan>, L<instmodsh>, L<piconv>, L<prove>, -L<corelist>, L<ptar>, L<ptardiff>, L<shasum>, L<zipdetails> +C<roffitall|roffitall>, L<File::Find|File::Find>, L<pl2pm|pl2pm>, +L<perlbug|perlbug>, L<h2ph|h2ph>, L<c2ph|c2ph>, L<h2xs|h2xs>, L<enc2xs>, +L<xsubpp>, L<cpan>, L<instmodsh>, L<piconv>, L<prove>, L<corelist>, L<ptar>, +L<ptardiff>, L<shasum>, L<zipdetails> =cut diff --git a/t/x2p/find2perl.t b/t/x2p/find2perl.t deleted file mode 100644 index f0dfa03..0000000 --- a/t/x2p/find2perl.t +++ /dev/null @@ -1,229 +0,0 @@ -#!./perl - -# Based on ideas from x2p/s2p.t -# -# This doesn't currently test -exec etc, just the default -print on -# the platforms below. - -BEGIN { - chdir 't' if -d 't'; - @INC = ( '../lib' ); -} - -use strict; -use warnings; -use File::Path 'remove_tree'; -use File::Spec; -require "./test.pl"; - -# add more platforms if you feel like it, but make sure the -# tests below are portable to the find(1) for any new platform, -# or that they skip on that platform -$^O =~ /^(?:linux|\w+bsd|darwin)$/ - or skip_all("Need something vaguely POSIX"); - -my $VERBOSE = grep $_ eq '-v', @ARGV; - -my $tmpdir = tempfile(); -my $script = tempfile(); -mkdir $tmpdir - or die "Cannot make temp dir $tmpdir: $!"; - -# test file names shouldn't contain any shell special characters, -# and for portability, probably shouldn't contain any high ascii or -# Unicode characters -# -# handling Unicode here would be nice, but I think handling of Unicode -# in perl's file system interfaces (open, unlink, readdir) etc needs to -# be more regular before we can expect interoperability between find2perl -# and a system find(1) -# -# keys for the test file list: -# name - required -# type - type of file to create: -# "f" regular file, "d" directory, "l" link to target, -# "s" symlink to target -# atime, mtime - file times (default now) -# mode - file mode (default per umask) -# content - file content for type f files -# target - target for link for type l and s -# -# I could have simply written code to create all the files, but I think -# this makes the file tree a little more obvious -use constant HOUR => 3600; # an hour in seconds -my @test_files = - ( - { name => "abc" }, - { name => "acc", mtime => time() - HOUR * 48 }, - { name => "ac", content => "x" x 10 }, - { name => "somedir", type => "d" }, - { name => "link", type => "l", target => "abc" }, - { name => "symlink", type => "s", target => "brokenlink" }, - ); -# make some files to search -for my $spec (@test_files) { - my $file = File::Spec->catfile($tmpdir, split '/', $spec->{name}); - my $type = $spec->{type} || "f"; - if ($type eq "f") { - open my $fh, ">", $file - or die "Cannot create test file $file: $!"; - if ($spec->{content}) { - binmode $fh; - print $fh $spec->{content}; - } - close $fh - or die "Cannot close $file: $!"; - } - elsif ($type eq "d") { - mkdir $file - or die "Cannot create test directory $file: $!"; - } - elsif ($type eq "l") { - my $target = File::Spec->catfile($tmpdir, split '/', $spec->{target}); - link $target, $file - or die "Cannot create test link $file: $!"; - } - elsif ($type eq "s") { - my $target = File::Spec->catfile($tmpdir, split '/', $spec->{target}); - symlink $target, $file - or die "Cannot create test symlink $file: $!"; - } - if ($spec->{mode}) { - chmod $spec->{mode}, $file - or die "Cannot set mode of test file $file: $!"; - } - if ($spec->{mtime} || $spec->{atime}) { - # default the times to now, since we just created the files - my $mtime = $spec->{mtime} || time(); - my $atime = $spec->{atime} || time(); - utime $atime, $mtime, $file - or die "Cannot set times of test file $file: $!"; - } -} - -# do we have a vaguely sane find(1)? -# BusyBox find is non-POSIX - it doesn't have -links -my @files = sort `find '$tmpdir' '(' -name 'abc' -o -name 'acc' ')' -a -links +0`; -@files == 2 && $files[0] =~ /\babc\n\z/ && $files[1] =~ /\bacc\n\z/ - or skip_all("doesn't appear to be a sane find(1)"); - -# required keys: -# args - find search spec as an array ref -# optional: -# name - short description of the test (defaults to args) -# expect - an array ref of files expected to be found (skips the find(1) call) -# TODO - why this test is TODO (if it is), if a code reference that is -# called to check if the test is TODO (and why) -# SKIP - return a message for why to skip -my @testcases = - ( - { - name => "all files", - args => [], - }, - { - name => "mapping of *", - args => [ "-name", "a*c" ], - }, - { - args => [ "-type", "d" ], - expect => [ "", "somedir" ], - }, - { - args => [ "-type", "f" ], - }, - { - args => [ "-mtime", "+1" ], - expect => [ "acc" ], - }, - { - args => [ "-mtime", "-1" ], - }, - { - args => [ "-size", "10c" ], - expect => [ "ac" ], - }, - { - args => [ "-links", "2" ], - }, - { - name => "[perl #113054] mapping of ?", - args => [ "-name", "a?c" ], - }, - ); - -plan(tests => 1 + 4 * @testcases); - -my $find2perl = File::Spec->catfile(File::Spec->updir(), "x2p", "find2perl"); -ok (-x $find2perl, "find2perl exists"); -our $TODO; - -for my $test (@testcases) { - SKIP: - { - local $TODO = $test->{TODO}; - $TODO = $TODO->() if ref $TODO; - my $args = $test->{args} - or die "Missing test args"; - my $name = $test->{name} || "@$args"; - - my $skip = $test->{SKIP} && $test->{SKIP}->(); - $skip - and skip($skip, 4); - - my $code = runperl(args => [ $find2perl, $tmpdir, @$args ]); - - ok($code, "$name: run findperl") - or skip("", 3); - - open my $script_fh, ">", $script - or die "Cannot create $script: $!"; - print $script_fh $code; - close $script_fh - or die "Cannot close $script: $!"; - - my $files = runperl(progfile => $script); - - ok(length $files, "$name: run output script") - or skip("", 2); - - my $find_files; - my $source; - if ($test->{expect}) { - $find_files = join "\n", - map { $_ eq "" ? $tmpdir : "$tmpdir/$_" } - @{$test->{expect}}; - $source = "expected"; - # to balance the ok() in the other branch - pass("$name: got files ok"); - } - else { - my $findcmd = "find $tmpdir ". join " ", map "'$_'", @$args; - - # make sure PERL_UNICODE doesn't reinterpret the output of find - use open IN => ':raw'; - $find_files = `$findcmd`; - ok(length $find_files, "$name: run find") - or skip("", 1); - $source = "find"; - } - - # is the order from find (or find2perl) guaranteed? - # assume it isn't - $files = join("\n", sort split /\n/, $files); - $find_files = join("\n", sort split /\n/, $find_files); - - if ($VERBOSE) { - note("script:\n$code"); - note("args:\n@$args"); - note("find2perl:\n$files"); - note("find:\n$find_files"); - } - - is($files, $find_files, "$name: find2perl matches $source"); - } -} - -END { - remove_tree($tmpdir); -} diff --git a/t/x2p/s2p.t b/t/x2p/s2p.t deleted file mode 100644 index 0a0716d..0000000 --- a/t/x2p/s2p.t +++ /dev/null @@ -1,892 +0,0 @@ -#!./perl - -=head1 NAME - -s2p.t - test suite for s2p/psed - -=head1 NOTES - -The general idea is to - - (a) run psed with a sed script and input data to obtain some output - (b) run s2p with a sed script creating a Perl program and then run the - Perl program with the input data, again producing output - -Both final outputs should be identical to the expected output. - -A $testcase{<name>} contains entries (after the comment ### <name> ###): - - - script: the sed script - - input: the key of the input data, stored in $input{<input>} - - expect: the expected output - - datfil: an additional file [ <path>, <data> ] (if required) - -Temporary files are created in the working directory (embedding $$ -in the name), and removed after the test. - -Except for bin2dec (which indeed converts binary to decimal) none of the -sed scripts is doing something useful. - -Author: Wolfgang Laun. - -=cut - -BEGIN { - chdir 't' if -d 't'; - @INC = ( '../lib' ); -} - -use File::Copy; -use File::Spec; -require './test.pl'; - -# BRE extensions -$ENV{PSEDEXTBRE} = '<>wW'; - -our %input = ( - bins => <<'[TheEnd]', -0 -111 -1000 -10001 -[TheEnd] - - text => <<'[TheEnd]', -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] - - adr1 => <<'[TheEnd]', -#no autoprint -# This script should be run on itself -/^#__DATA__$/,${ - /^#A$/p - s/^# *[0-9]* *// - /^#\*$/p - /^#\.$/p - /^#\(..\)\(..\)\2\1*$/p - /^#[abc]\{1,\}[def]\{1,\}$/p -} -#__DATA__ -#A -#* -#. -#abxyxy -#abxyxyab -#abxyxyabab -#ad -#abcdef -[TheEnd] -); - - -our %testcase = ( - -### bin2dec ### -'bin2dec' => { - script => <<'[TheEnd]', -# binary -> decimal -s/^[ ]*\([01]\{1,\}\)[ ]*/\1/ -t go -i\ -is not a binary number -d - -# expand binary to Xs -: go -s/^0*// -s/^1/X/ -: expand -s/^\(X\{1,\}\)0/\1\1/ -s/^\(X\{1,\}\)1/\1\1X/ -t expand - -# count Xs in decimal -: count -s/^X/1/ -s/0X/1/ -s/1X/2/ -s/2X/3/ -s/3X/4/ -s/4X/5/ -s/5X/6/ -s/6X/7/ -s/7X/8/ -s/8X/9/ -s/9X/X0/ -t count -s/^$/0/ -[TheEnd] - input => 'bins', - expect => <<'[TheEnd]', -0 -7 -8 -17 -[TheEnd] -}, - - -### = ### -'=' => { - script => <<'[TheEnd]', -1= -$= -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -1 -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -8 -line 8 -[TheEnd] -}, - -### D ### -'D' => { - script => <<'[TheEnd]', -#no autoprint -/1/{ -N -N -N -D -} -p -/2/D -= -p -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 2 -line 3 -line 4 -line 3 -line 4 -4 -line 3 -line 4 -line 5 -5 -line 5 -line 6 -6 -line 6 -line 7 -7 -line 7 -line 8 -8 -line 8 -[TheEnd] -}, - -### H ### -'H' => { - script => <<'[TheEnd]', -#no autoprint -1,$H -$g -$= -$p -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -8 - -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### N ### -'N' => { - script => <<'[TheEnd]', -3a\ -added line -4a\ -added line -5a\ -added line -3,5N -= -d -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -1 -2 -added line -4 -added line -6 -7 -8 -[TheEnd] -}, - -### P ### -'P' => { - script => <<'[TheEnd]', -1N -2N -3N -4= -4P -4,$d -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -4 -line 1 -[TheEnd] -}, - -### a ### -'a' => { - script => <<'[TheEnd]', -1a\ -added line 1.1\ -added line 1.2 - -3a\ -added line 3.1 -3a\ -added line 3.2 - -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -added line 1.1 -added line 1.2 -line 2 -line 3 -added line 3.1 -added line 3.2 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### b ### -'b' => { - script => <<'[TheEnd]', -#no autoprint -2 b eos -4 b eos -p -: eos -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 3 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### block ### -'block' => { - script => "#no autoprint\n1,3{\n=\np\n}", - input => 'text', - expect => <<'[TheEnd]', -1 -line 1 -2 -line 2 -3 -line 3 -[TheEnd] -}, - -### c ### -'c' => { - script => <<'[TheEnd]', -2= - -2,4c\ -change 2,4 line 1\ -change 2,4 line 2 - -2= - -3,5c\ -change 3,5 line 1\ -change 3,5 line 2 - -3= - -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -2 -change 2,4 line 1 -change 2,4 line 2 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### c1 ### -'c1' => { - script => <<'[TheEnd]', -1c\ -replaces line 1 - -2,3c\ -replaces lines 2-3 - -/5/,/6/c\ -replaces lines 3-4 - -8,10c\ -replaces lines 6-10 -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -replaces line 1 -replaces lines 2-3 -line 4 -replaces lines 3-4 -line 7 -[TheEnd] -}, - -### c2 ### -'c2' => { - script => <<'[TheEnd]', -3!c\ -replace all except line 3 - -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -replace all except line 3 -replace all except line 3 -line 3 -replace all except line 3 -replace all except line 3 -replace all except line 3 -replace all except line 3 -replace all except line 3 -[TheEnd] -}, - -### c3 ### -'c3' => { - script => <<'[TheEnd]', -1,4!c\ -replace all except 1-4 - -/5/,/8/!c\ -replace all except 5-8 -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -replace all except 5-8 -replace all except 5-8 -replace all except 5-8 -replace all except 5-8 -replace all except 1-4 -replace all except 1-4 -replace all except 1-4 -replace all except 1-4 -[TheEnd] -}, - -### d ### -'d' => { - script => <<'[TheEnd]', -# d delete pattern space, start next cycle -2,4 d -5 d -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### gh ### -'gh' => { - script => <<'[TheEnd]', -1h -2g -3h -4g -5q -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 1 -line 3 -line 3 -line 5 -[TheEnd] -}, - -### i ### -'i' => { - script => <<'[TheEnd]', -1i\ -inserted line 1.1\ -inserted line 1.2 - -3i\ -inserted line 3.1 -3i\ -inserted line 3.2 -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -inserted line 1.1 -inserted line 1.2 -line 1 -line 2 -inserted line 3.1 -inserted line 3.2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### n ### -'n' => { - script => <<'[TheEnd]', -3a\ -added line -4a\ -added line -5a\ -added line -3,5n -= -d -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -1 -2 -line 3 -added line -4 -line 5 -added line -6 -7 -8 -[TheEnd] -}, - -### o ### -'o' => { - script => <<'[TheEnd]', -/abc/,/def/ s//XXX/ -// i\ -cheers -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### q ### -'q' => { - script => <<'[TheEnd]', -2a\ -append to line 2 -3a\ -append to line 3 - should not appear in output -3q -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -append to line 2 -line 3 -[TheEnd] -}, - -### r ### -'r' => { - datfil => [ 'r.txt', "r.txt line 1\nr.txt line 2\nr.txt line 3\n" ], - script => <<'[TheEnd]', -2r%r.txt% -4r %r.txt% -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -r.txt line 1 -r.txt line 2 -r.txt line 3 -line 3 -line 4 -r.txt line 1 -r.txt line 2 -r.txt line 3 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### s ### -'s' => { - script => <<'[TheEnd]', -# enclose any '(a)'.. '(c)' in '-' -s/([a-z])/-\1-/g - -s/\([abc]\)/-\1-/g -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### s1 ### -'s1' => { - script => <<'[TheEnd]', -s/\w/@1/ -s/\y/@2/ - -s/\n/@3/ - -# this is literal { } -s/a{3}/@4/ - -# proper repetition -s/a\{3\}/a rep 3/ -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -@1ine 1 -@1ine 2 -@1ine 3 -@1ine 4 -@1ine 5 -@1ine 6 -@1ine 7 -@1ine 8 -[TheEnd] -}, - -### s2 ### RT #115156 -'s2' => { - todo => 'RT #115156', - script => 's/1*$/x/g', - input => 'bins', - expect => <<'[TheEnd]', -0x -x -1000x -1000x -[TheEnd] -}, - -### t ### -'t' => { - script => join( "\n", - '#no autoprint', 's/./X/p', 's/foo/bar/p', 't bye', '=', 'p', ':bye' ), - input => 'text', - expect => <<'[TheEnd]', -Xine 1 -Xine 2 -Xine 3 -Xine 4 -Xine 5 -Xine 6 -Xine 7 -Xine 8 -[TheEnd] -}, - -### w ### -'w' => { - datfil => [ 'w.txt', '' ], - script => <<'[TheEnd]', -w %w.txt% -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -line 3 -line 4 -line 5 -line 6 -line 7 -line 8 -[TheEnd] -}, - -### x ### -'x' => { - script => <<'[TheEnd]', -1h -1d -2x -2,$G -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -line 1 -line 2 -line 3 -line 2 -line 4 -line 2 -line 5 -line 2 -line 6 -line 2 -line 7 -line 2 -line 8 -line 2 -[TheEnd] -}, - -### y ### -'y' => { - script => <<'[TheEnd]', -y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ -y/|/\ -/ -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -LINE 1 -LINE 2 -LINE 3 -LINE 4 -LINE 5 -LINE 6 -LINE 7 -LINE 8 -[TheEnd] -}, - -### cnt ### -'cnt' => { - script => <<'[TheEnd]', -#no autoprint - -# delete line, append NL to hold space -s/.*// -H -$!b - -# last line only: get hold -g -s/./X/g -t count -: count -s/^X/1/ -s/0X/1/ -s/1X/2/ -s/2X/3/ -s/3X/4/ -s/4X/5/ -s/5X/6/ -s/6X/7/ -s/7X/8/ -s/8X/9/ -s/9X/X0/ -t count -p -[TheEnd] - input => 'text', - expect => <<'[TheEnd]', -8 -[TheEnd] -}, - -### adr1 ### -'adr1' => { - script => <<'[TheEnd]', -#no autoprint -# This script should be run on itself -/^#__DATA__$/,${ - /^#A$/p - s/^# *[0-9]* *// - /^#\*$/p - /^#\.$/p - /^#\(..\)\(..\)\2\1*$/p - /^#[abc]\{1,\}[def]\{1,\}$/p -} -#__DATA__ -#A -#* -#. -#abxyxy -#abxyxyab -#abxyxyabab -#ad -#abcdef -[TheEnd] - input => 'adr1', - expect => <<'[TheEnd]', -#A -[TheEnd] -}, - -); - -my @aux = (); -my $ntc = 2 * keys %testcase; -plan( $ntc ); - -# temporary file names -my $script = "s2pt$$.sed"; -my $stdin = "s2pt$$.in"; -my $plsed = "s2pt$$.pl"; - -# various command lines for -my $s2p = File::Spec->catfile( File::Spec->updir(), 'x2p', 's2p' ); -my $psed = File::Spec->catfile( File::Spec->curdir(), 'psed' ); -if ($^O eq 'VMS') { - # default in the .com extension if it's not already there - $s2p = VMS::Filespec::vmsify($s2p); - $psed = VMS::Filespec::vmsify($psed); - # Converting file specs from Unix format to VMS with the extended - # character set active can result in a trailing '.' added for null - # extensions. This must be removed if the intent is to default the - # extension. - $s2p =~ s/\.$//; - $psed =~ s/\.$//; - $s2p = VMS::Filespec::rmsexpand($s2p, '.com'); - $psed = VMS::Filespec::rmsexpand($psed, '.com'); -} -my $sedcmd = [ $psed, '-f', $script, $stdin ]; -my $s2pcmd = [ $s2p, '-f', $script ]; -my $plcmd = [ $plsed, $stdin ]; - -# psed: we create a local copy as linking may not work on some systems. -copy( $s2p, $psed ); -push( @aux, $psed ); - -# process all testcases -# -my $indat = ''; -for my $tc ( sort keys %testcase ){ - my( $psedres, $s2pres ); - - local $TODO = $testcase{$tc}{todo}; - - # 1st test: run psed - # prepare the script - open( SED, ">$script" ) || goto FAIL_BOTH; - my $script = $testcase{$tc}{script}; - - # additional files for r, w: patch script, inserting temporary names - if( exists( $testcase{$tc}{datfil} ) ){ - my( $datnam, $datdat ) = @{$testcase{$tc}{datfil}}; - my $datfil = "s2pt$$" . $datnam; - push( @aux, $datfil ); - open( DAT, ">$datfil" ) || goto FAIL_BOTH; - print DAT $datdat; - close( DAT ); - $script =~ s/\%$datnam\%/$datfil/eg; - } - print SED $script; - close( SED ) || goto FAIL_BOTH; - - # prepare input - # - if( $indat ne $testcase{$tc}{input} ){ - $indat = $testcase{$tc}{input}; - open( IN, ">$stdin" ) || goto FAIL_BOTH; - print IN $input{$indat}; - close( IN ) || goto FAIL_BOTH; - } - - # on VMS, runperl eats blank lines to work around - # spurious newlines in pipes - $testcase{$tc}{expect} =~ s/\n\n/\n/ if $^O eq 'VMS'; - - # run and compare - # - $psedres = runperl( args => $sedcmd ); - is( $psedres, $testcase{$tc}{expect}, "psed $tc" ); - - # 2nd test: run s2p - # translate the sed script to a Perl program - - my $perlprog = runperl( args => $s2pcmd ); - open( PP, ">$plsed" ) || goto FAIL_S2P; - print PP $perlprog; - close( PP ) || goto FAIL_S2P; - - # execute generated Perl program, compare - $s2pres = runperl( args => $plcmd ); - is( $s2pres, $testcase{$tc}{expect}, "s2p $tc" ); - next; - -FAIL_BOTH: - fail( "psed $tc" ); -FAIL_S2P: - fail( "s2p $tc" ); -} - -END { - for my $f ( $script, $stdin, $plsed, @aux ){ - 1 while unlink( $f ); # hats off to VMS... - } -} diff --git a/utils.lst b/utils.lst index 0922407..c108c4a 100644 --- a/utils.lst +++ b/utils.lst @@ -26,6 +26,3 @@ utils/shasum utils/splain utils/xsubpp utils/zipdetails -x2p/a2p -x2p/find2perl -x2p/s2p # link = x2p/psed diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index ff5f82b..3398e91 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -166,11 +166,9 @@ MTHREADLINKFLAGS = # C preprocessor manifest "DEBUGGING" ==> perl -D, not the VMS debugger .IFDEF LARGEFILE CFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS)/Define=$(LARGEFILE) -X2PCFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS)/Define=(PERL_FOR_X2P,$(LARGEFILE)) CORECFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS)/Define=(PERL_CORE,$(LARGEFILE)) .ELSE CFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS) -X2PCFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS)/Define=PERL_FOR_X2P CORECFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)$(FLAGS)/Define=PERL_CORE .ENDIF @@ -289,19 +287,11 @@ utils3 = [.utils]perlivp.com [.lib]splain.com [.utils]pl2pm.com [.utils]xsubpp.c utils4 = [.utils]enc2xs.com [.utils]piconv.com [.utils]cpan.com [.utils]prove.com [.utils]ptar.com [.utils]ptardiff.com [.utils]shasum.com utils5 = [.utils]corelist.com [.utils]ptargrep.com [.utils]zipdetails.com -.ifdef NOX2P all : base extras archcorefiles preplibrary [.pod]perltoc.pod @ QUALIFIERS := $(MMSQUALIFIERS) @ QUALIFIERS = QUALIFIERS - """" - """" @ write sys$output " " @ write sys$output " Everything is up to date. '$(MMS)''QUALIFIERS' test' to run test suite." -.else -all : base extras x2p archcorefiles preplibrary [.pod]perltoc.pod - @ QUALIFIERS := $(MMSQUALIFIERS) - @ QUALIFIERS = QUALIFIERS - """" - """" - @ write sys$output " " - @ write sys$output " Everything is up to date. '$(MMS)''QUALIFIERS' test' to run test suite." -.endif git_version.h : $(MINIPERL_EXE) make_patchnum.pl $(MINIPERL) make_patchnum.pl @@ -314,8 +304,6 @@ libmods : $(LIBPREREQ) @ $(NOOP) utils : $(utils1) $(utils2) $(utils3) $(utils4) $(utils5) @ $(NOOP) -x2p : [.x2p]$(DBG)a2p$(E) [.x2p]s2p.com [.x2p]find2perl.com - @ $(NOOP) extra.pods : miniperl @ @extra_pods.com @@ -511,12 +499,6 @@ nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE) [.pod]perlfunc.pod $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE) Copy/NoConfirm/Log [.utils]splain.com [.lib] -[.x2p]find2perl.com : [.x2p]find2perl.PL $(ARCHDIR)Config.pm - $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE) - -[.x2p]s2p.com : [.x2p]s2p.PL $(ARCHDIR)Config.pm - $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE) - [.utils]xsubpp.com : [.utils]xsubpp.PL $(ARCHDIR)Config.pm nonxsext $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE) @@ -526,35 +508,6 @@ nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE) [.pod]perlfunc.pod [.utils]pod2html.com : [.utils]pod2html.PL $(ARCHDIR)Config.pm nonxsext $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE) -# Rename catches problem with some DECC versions in which object file is -# placed in current default dir, not same one as source file. -[.x2p]$(DBG)a2p$(E) : [.x2p]a2p$(O), [.x2p]hash$(O), [.x2p]str$(O), [.x2p]util$(O), [.x2p]walk$(O) - @ If F$Search("hash$(O)").nes."" Then Rename/NoLog hash$(O),str$(O),util$(O),walk$(O) [.x2p] - Link $(LINKFLAGS) /Exe=$(MMS$TARGET) $(MMS$SOURCE_LIST) $(CRTLOPTS) - -# Accommodate buggy cpp in some version of DECC, which chokes on illegal -# filespec "y.tab.c", and broken gcc cpp, which doesn't start #include "" -# search in same dir as source file -[.x2p]a2p$(O) : [.x2p]a2p.c [.x2p]a2py.c [.x2p]INTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h config.h handy.h vmsish.h $(MINIPERL_EXE) - $(MINIPERL) -pe "s/^#line\s+(\d+)\s+\Q""y.tab.c""/#line $1 ""y_tab.c""/;" $(MMS$SOURCE) >$(MMS$TARGET_NAME)_vms.c - $(CC) $(X2PCFLAGS) /Object=$(MMS$TARGET)/Include=([.x2p],[],"./x2p") $(MMS$TARGET_NAME)_vms.c - Delete/Log/NoConfirm $(MMS$TARGET_NAME)_vms.c; - -# gcc cpp broken -- doesn't look in directory of source file for #include "" -.ifdef GNUC -[.x2p]hash$(O) : [.x2p]hash.c - $(CC) $(X2PCFLAGS) /Include=[.x2p] $(MMS$SOURCE) - -[.x2p]str$(O) : [.x2p]str.c - $(CC) $(X2PCFLAGS) /Include=[.x2p] $(MMS$SOURCE) - -[.x2p]util$(O) : [.x2p]util.c - $(CC) $(X2PCFLAGS) /Include=[.x2p] $(MMS$SOURCE) - -[.x2p]walk$(O) : [.x2p]walk.c - $(CC) $(X2PCFLAGS) /Include=[.x2p] $(MMS$SOURCE) -.endif - preplibrary : $(MINIPERL_EXE) $(LIBPREREQ) @ $(NOOP) @@ -625,8 +578,8 @@ archify : all Delete/Log/NoConfirm [.lib.auto...]*.*;*/exclude=(*.al,*.ix,*.dir) Delete/Log/NoConfirm [.lib]Config.pm;* Delete/Log/NoConfirm [.lib]Config_heavy.pl;* - Copy/Log/NoConfirm *$(E);,[.x2p]$(DBG)a2p$(E); $(ARCHDIR) - Delete/Log/NoConfirm Perl*$(E);*,[.x2p]$(DBG)a2p$(E);* + Copy/Log/NoConfirm *$(E);, $(ARCHDIR) + Delete/Log/NoConfirm Perl*$(E);* @ QUALIFIERS := $(MMSQUALIFIERS) @ QUALIFIERS = QUALIFIERS - """" - """" @ Write Sys$Output "Architecture-specific setup completed." @@ -655,7 +608,7 @@ $(ARCHAUTO)time.stamp : .ifdef LINK_ONLY .else -# We need an action line here for broken older versions of MMS which +# We need(ed?) an action line here for broken older versions of MMS which # otherwise conclude that they should be compiling [.x2p]utils.c :-( #util$(O) : util.c # $(CC) $(CORECFLAGS) $(MMS$SOURCE) @@ -743,18 +696,6 @@ util$(O) : util.c $(h) vms$(O) : vms.c $(h) $(CC) $(CORECFLAGS) $(MMS$SOURCE) -[.x2p]hash$(O) : [.x2p]hash.c [.x2p]EXTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h [.x2p]util.h config.h handy.h vmsish.h - $(CC) $(X2PCFLAGS) $(MMS$SOURCE) - -[.x2p]str$(O) : [.x2p]str.c [.x2p]EXTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h [.x2p]util.h config.h handy.h vmsish.h - $(CC) $(X2PCFLAGS) $(MMS$SOURCE) - -[.x2p]util$(O) : [.x2p]util.c [.x2p]EXTERN.h [.x2p]INTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h [.x2p]util.h config.h handy.h vmsish.h - $(CC) $(X2PCFLAGS) $(MMS$SOURCE) - -[.x2p]walk$(O) : [.x2p]walk.c [.x2p]EXTERN.h [.x2p]a2p.h [.x2p]hash.h [.x2p]str.h [.x2p]util.h config.h handy.h vmsish.h - $(CC) $(X2PCFLAGS) $(MMS$SOURCE) - # End of automatically generated make dependencies .endif # !LINK_ONLY @@ -819,7 +760,6 @@ tidy : cleanlis - If F$Search("[.lib]*.com;-1").nes."" Then Purge/NoConfirm/Log [.lib]*.com - If F$Search("[.pod]*.com;-1").nes."" Then Purge/NoConfirm/Log [.pod]*.com - If F$Search("[.utils]*.com;-1").nes."" Then Purge/NoConfirm/Log [.utils]*.com - - If F$Search("[.x2p]*.com;-1").nes."" Then Purge/NoConfirm/Log [.x2p]*.com - If F$Search("[.lib]buildcustomize.pl;-1").nes."" Then Purge/NoConfirm/Log [.lib]buildcustomize.pl clean : tidy cleantest @@ -869,7 +809,6 @@ realclean : clean - If F$Search("[.lib...].exists").nes."" Then Delete/NoConfirm/Log [.lib...].exists;* - If F$Search("[.pod]*.com").nes."" Then Delete/NoConfirm/Log [.pod]*.com;* - If F$Search("[.utils]*.com").nes."" Then Delete/NoConfirm/Log [.utils]*.com;* - - If F$Search("[.x2p]*.com").nes."" Then Delete/NoConfirm/Log [.x2p]*.com;* - If F$Search("$(ARCHDIR)Config.pm").nes."" Then Delete/NoConfirm/Log $(ARCHDIR)Config.pm;* - If F$Search("$(ARCHDIR)Config_heavy.pl").nes."" Then Delete/NoConfirm/Log $(ARCHDIR)Config_heavy.pl;* - If F$Search("[.utils]perldoc.com").nes."" Then Delete/NoConfirm/Log [.utils]perldoc.com;* diff --git a/win32/Makefile b/win32/Makefile index 9979998..383bee7 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -581,7 +581,6 @@ WPERLEXE = ..\wperl.exe PERLEXESTATIC = ..\perl-static.exe GLOBEXE = ..\perlglob.exe CONFIGPM = ..\lib\Config.pm ..\lib\Config_heavy.pl -X2P = ..\x2p\a2p.exe GENUUDMAP = ..\generate_uudmap.exe !IF "$(BUILD_STATIC)" == "define" || "$(ALL_STATIC)" == "define" PERLSTATIC = static @@ -640,9 +639,6 @@ UTILS = \ ..\utils\instmodsh \ ..\utils\json_pp \ ..\utils\pod2html \ - ..\x2p\find2perl \ - ..\x2p\psed \ - ..\x2p\s2p \ bin\exetype.pl \ bin\runperl.pl \ bin\pl2bat.pl \ @@ -722,13 +718,6 @@ WIN32_SRC = $(WIN32_SRC) .\win32io.c #!ENDIF -X2P_SRC = \ - ..\x2p\a2p.c \ - ..\x2p\hash.c \ - ..\x2p\str.c \ - ..\x2p\util.c \ - ..\x2p\walk.c - CORE_NOCFG_H = \ ..\av.h \ ..\cop.h \ @@ -786,7 +775,6 @@ MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \ MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\) MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) DLL_OBJ = $(DYNALOADER) -X2P_OBJ = $(X2P_SRC:.c=.obj) GENUUDMAP_OBJ = $(GENUUDMAP:.exe=.obj) PERLDLL_OBJ = $(CORE_OBJ) @@ -845,7 +833,7 @@ CFG_VARS = \ # all : .\config.h ..\git_version.h $(GLOBEXE) $(CONFIGPM) \ - $(UNIDATAFILES) MakePPPort $(PERLEXE) $(X2P) Extensions_nonxs Extensions $(PERLSTATIC) + $(UNIDATAFILES) MakePPPort $(PERLEXE) Extensions_nonxs Extensions $(PERLSTATIC) @echo Everything is up to date. '$(MAKE_BARE) test' to run test suite. regnodes : ..\regnodes.h @@ -855,7 +843,7 @@ regnodes : ..\regnodes.h ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(CONFIGPM) \ - $(UNIDATAFILES) $(PERLEXE) $(X2P) Extensions_reonly + $(UNIDATAFILES) $(PERLEXE) Extensions_reonly @echo Perl and 're' are up to date. static: $(PERLEXESTATIC) @@ -1024,7 +1012,6 @@ $(MINI_OBJ) : $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H) $(CORE_OBJ) : $(CORE_H) $(DLL_OBJ) : $(CORE_H) -$(X2P_OBJ) : $(CORE_H) perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl $(MINIPERL) -I..\lib create_perllibst_h.pl @@ -1046,29 +1033,6 @@ $(PERLSTATICLIB): Extensions_static $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO) -..\x2p\a2p$(o) : ..\x2p\a2p.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c - -..\x2p\hash$(o) : ..\x2p\hash.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c - -..\x2p\str$(o) : ..\x2p\str.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c - -..\x2p\util$(o) : ..\x2p\util.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c - -..\x2p\walk$(o) : ..\x2p\walk.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c - -$(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions - $(MINIPERL) -I..\lib ..\x2p\find2perl.PL - $(MINIPERL) -I..\lib ..\x2p\s2p.PL - $(LINK32) -subsystem:console -out:$@ @<< - $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ) -<< - $(EMBED_EXE_MANI) - $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS) $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) @@ -1154,7 +1118,7 @@ doc: $(PERLEXE) ..\pod\perltoc.pod # Note that this next section is parsed (and regenerated) by pod/buildtoc # so please check that script before making structural changes here -utils: $(PERLEXE) $(X2P) ..\utils\Makefile +utils: $(PERLEXE) ..\utils\Makefile cd ..\utils $(MAKE) PERL=$(MINIPERL) cd ..\pod @@ -1299,7 +1263,6 @@ distclean: realclean -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \ perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \ xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails - -cd ..\x2p && del /f find2perl s2p psed *.bat -del /f ..\config.sh perlmain.c dlutils.c config.h.new \ perlmainst.c -del /f $(CONFIGPM) @@ -1326,7 +1289,6 @@ installbare : utils ..\pod\perltoc.pod if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.* $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.* - if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.* $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* installhtml : doc @@ -1414,10 +1376,8 @@ _clean : -@$(DEL) $(UNIDATAFILES) -@$(DEL) $(WIN32_OBJ) -@$(DEL) $(DLL_OBJ) - -@$(DEL) $(X2P_OBJ) -@$(DEL) ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res -@$(DEL) ..\t\*.exe ..\t\*.dll ..\t\*.bat - -@$(DEL) ..\x2p\*.exe ..\x2p\*.bat -@$(DEL) *.ilk -@$(DEL) *.pdb -@$(DEL) Extensions_static diff --git a/win32/makefile.mk b/win32/makefile.mk index 6aeef74..b0f54d7 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -692,7 +692,6 @@ PERLEXESTATIC = ..\perl-static.exe STATICDIR = .\static.tmp GLOBEXE = ..\perlglob.exe CONFIGPM = ..\lib\Config.pm ..\lib\Config_heavy.pl -X2P = ..\x2p\a2p.exe GENUUDMAP = ..\generate_uudmap.exe .IF "$(BUILD_STATIC)" == "define" || "$(ALL_STATIC)" == "define" PERLSTATIC = static @@ -749,9 +748,6 @@ UTILS = \ ..\utils\shasum \ ..\utils\instmodsh \ ..\utils\json_pp \ - ..\x2p\find2perl \ - ..\x2p\psed \ - ..\x2p\s2p \ bin\exetype.pl \ bin\runperl.pl \ bin\pl2bat.pl \ @@ -845,13 +841,6 @@ WIN32_SRC = \ WIN32_SRC += .\win32io.c #.ENDIF -X2P_SRC = \ - ..\x2p\a2p.c \ - ..\x2p\hash.c \ - ..\x2p\str.c \ - ..\x2p\util.c \ - ..\x2p\walk.c - CORE_NOCFG_H = \ ..\av.h \ ..\cop.h \ @@ -907,7 +896,6 @@ MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)} MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)} MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) DLL_OBJ = $(DYNALOADER) -X2P_OBJ = $(X2P_SRC:db:+$(o)) GENUUDMAP_OBJ = $(GENUUDMAP:db:+$(o)) PERLDLL_OBJ = $(CORE_OBJ) @@ -976,7 +964,7 @@ CFG_VARS = \ all : CHECKDMAKE .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ - $(PERLEXE) $(X2P) Extensions Extensions_nonxs $(PERLSTATIC) + $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC) regnodes : ..\regnodes.h @@ -986,7 +974,7 @@ regnodes : ..\regnodes.h reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \ - $(X2P) Extensions_reonly + Extensions_reonly static: $(PERLEXESTATIC) @@ -1181,8 +1169,6 @@ $(CORE_OBJ) : $(CORE_H) $(DLL_OBJ) : $(CORE_H) -$(X2P_OBJ) : $(CORE_H) - perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl $(MINIPERL) -I..\lib create_perllibst_h.pl $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \ @@ -1229,33 +1215,6 @@ $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO) -..\x2p\a2p$(o) : ..\x2p\a2p.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c - -..\x2p\hash$(o) : ..\x2p\hash.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c - -..\x2p\str$(o) : ..\x2p\str.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c - -..\x2p\util$(o) : ..\x2p\util.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c - -..\x2p\walk$(o) : ..\x2p\walk.c - $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c - -$(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions - $(MINIPERL) -I..\lib ..\x2p\find2perl.PL - $(MINIPERL) -I..\lib ..\x2p\s2p.PL -.IF "$(CCTYPE)" == "GCC" - $(LINK32) -v -o $@ $(BLINK_FLAGS) \ - $(mktmp $(LKPRE) $(X2P_OBJ) $(LIBFILES) $(LKPOST)) -.ELSE - $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \ - @$(mktmp $(LIBFILES) $(X2P_OBJ)) - $(EMBED_EXE_MANI) -.ENDIF - $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS) $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) @@ -1355,7 +1314,7 @@ doc: $(PERLEXE) ..\pod\perltoc.pod # Note that this next section is parsed (and regenerated) by pod/buildtoc # so please check that script before making structural changes here -utils: $(PERLEXE) $(X2P) ..\utils\Makefile +utils: $(PERLEXE) ..\utils\Makefile cd ..\utils && $(MAKE) PERL=$(MINIPERL) copy ..\README.aix ..\pod\perlaix.pod copy ..\README.amiga ..\pod\perlamiga.pod @@ -1497,7 +1456,6 @@ distclean: realclean -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \ perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \ xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails - -cd ..\x2p && del /f find2perl s2p psed *.bat -del /f ..\config.sh perlmain.c dlutils.c config.h.new \ perlmainst.c -del /f $(CONFIGPM) @@ -1524,7 +1482,6 @@ installbare : utils ..\pod\perltoc.pod if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.* $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.* - if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.* $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* installhtml : doc @@ -1618,10 +1575,8 @@ _clean : -@erase $(UNIDATAFILES) -@erase $(WIN32_OBJ) -@erase $(DLL_OBJ) - -@erase $(X2P_OBJ) -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat - -@erase ..\x2p\*.exe ..\x2p\*.bat -@erase *.ilk -@erase *.pdb -@erase Extensions_static diff --git a/x2p/.gitignore b/x2p/.gitignore deleted file mode 100644 index 1ee0a5b..0000000 --- a/x2p/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/a2p -/find2perl -/find2perl.bat -/psed -/psed.bat -/s2p -/s2p.bat diff --git a/x2p/EXTERN.h b/x2p/EXTERN.h deleted file mode 100644 index dcc1b24..0000000 --- a/x2p/EXTERN.h +++ /dev/null @@ -1,21 +0,0 @@ -/* EXTERN.h - * - * Copyright (C) 1991, 1992, 1993, 1994, by Larry Wall and others - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - */ - -#undef EXT -#define EXT extern - -#ifdef __cplusplus -# define EXTERN_C extern "C" -#else -# define EXTERN_C extern -#endif - -#undef INIT -#define INIT(x) - -#undef DOINIT diff --git a/x2p/INTERN.h b/x2p/INTERN.h deleted file mode 100644 index 2933294..0000000 --- a/x2p/INTERN.h +++ /dev/null @@ -1,23 +0,0 @@ -/* INTERN.h - * - * Copyright (C) 1993, 1994, by Larry Wall and others - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - */ - -#undef EXT -#define EXT - -#ifdef __cplusplus -# define EXTERN_C extern "C" -#else -# ifndef EXTERN_C -# define EXTERN_C -# endif -#endif - -#undef INIT -#define INIT(x) = x - -#define DOINIT diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH deleted file mode 100755 index 2e55401..0000000 --- a/x2p/Makefile.SH +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/sh - -case $PERL_CONFIG_SH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac -: This forces SH files to create target in same directory as SH file. -: This is so that make depend always knows where to find SH derivatives. -case "$0" in -*/Makefile.SH) cd `expr X$0 : 'X\(.*\)/'` ;; -Makefile.SH) ;; -*) case `pwd` in - */x2p) ;; - *) if test -d x2p; then cd x2p - else echo "Can't figure out where to write output."; exit 1 - fi;; - esac;; -esac - -echo "Extracting x2p/Makefile (with variable substitutions)" -rm -f Makefile - -# The .PL extractions use the Cwd extension. For statically-built -# perls, we need perl, not just miniperl. -case "$usedl" in - define) perl="../miniperl" ;; - *) perl="../perl" ;; -esac - -cat >Makefile <<!GROK!THIS! -# $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:07 $ -# -# $Log: Makefile.SH,v $ - -CC = $cc -BYACC = $byacc -LDFLAGS = $ldflags -shellflags = $shellflags - -libs = $perllibs - -$make_set_make -# grrr -SHELL = $sh - -# These variables may need to be manually set for non-Unix systems. -AR = $ar -EXE_EXT = $_exe -LIB_EXT = $_a -OBJ_EXT = $_o -PATH_SEP = $p_ - -FIRSTMAKEFILE = $firstmakefile - -# how to tr(anslate) newlines - -TRNL = '$trnl' - -OPTIMIZE = $optimize - -.SUFFIXES: .c \$(OBJ_EXT) - -RUN = -PERL = $perl - -!GROK!THIS! - -cat >>Makefile <<'!NO!SUBS!' - -REALPERL = ../perl -CCCMD = `sh $(shellflags) ../cflags "optimize='$(OPTIMIZE)'" $@` - -pl = find2perl.PL s2p.PL -plextract = find2perl s2p - -h = EXTERN.h INTERN.h ../config.h ../handy.h hash.h a2p.h str.h util.h - -c = hash.c str.c util.c walk.c - -obj = hash$(OBJ_EXT) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT) - -lintflags = -phbvxac - - -.c$(OBJ_EXT): - $(CCCMD) -DPERL_FOR_X2P $*.c - -all: a2p$(EXE_EXT) s2p find2perl **** PATCH TRUNCATED AT 2000 LINES -- 11246 NOT SHOWN **** -- Perl5 Master Repository