From aeb58b920411711dc54a37d00f7d1ae238dfe5ba Mon Sep 17 00:00:00 2001 From: Flavio Soibelmann Glock Date: Sat, 28 Mar 2026 10:42:30 +0100 Subject: [PATCH 1/3] fix: protect patched files from sync.pl overwrites Mark the following files as protected in config.yaml so they will not be overwritten when running dev/import-perl5/sync.pl: - Pod/Perldoc.pm - has case-insensitive Pod/ directory search for JAR paths - Test/Harness.pm - filters out jar: paths from @INC for child processes - TAP/Parser/Iterator/Process.pm - handles missing fork in get_select_handles This prevents loss of PerlOnJava-specific patches when syncing from perl5. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- dev/import-perl5/config.yaml | 9 +++++++++ src/main/java/org/perlonjava/core/Configuration.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/import-perl5/config.yaml b/dev/import-perl5/config.yaml index e14ac0e91..b1f9caf73 100644 --- a/dev/import-perl5/config.yaml +++ b/dev/import-perl5/config.yaml @@ -420,8 +420,15 @@ imports: type: directory # Test::Harness - Test harness for running tests (needed by CPAN make test) + # Protected because we filter out jar: paths from @INC for child processes - source: perl5/cpan/Test-Harness/lib/Test/Harness.pm target: src/main/perl/lib/Test/Harness.pm + protected: true + + # TAP::Parser::Iterator::Process - Protected because we handle missing fork + - source: perl5/cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm + target: src/main/perl/lib/TAP/Parser/Iterator/Process.pm + protected: true # TAP - Test Anything Protocol modules (required by Test::Harness) - source: perl5/cpan/Test-Harness/lib/TAP @@ -531,8 +538,10 @@ imports: target: src/main/perl/lib/Getopt/Std.pm # Pod::Perldoc - Look up Perl documentation (for jcpan -h) + # Protected because we added case-insensitive Pod/ directory search for JAR paths - source: perl5/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm target: src/main/perl/lib/Pod/Perldoc.pm + protected: true - source: perl5/cpan/Pod-Perldoc/lib/Pod/Perldoc target: src/main/perl/lib/Pod/Perldoc type: directory diff --git a/src/main/java/org/perlonjava/core/Configuration.java b/src/main/java/org/perlonjava/core/Configuration.java index 45c9291e0..2d92d6c78 100644 --- a/src/main/java/org/perlonjava/core/Configuration.java +++ b/src/main/java/org/perlonjava/core/Configuration.java @@ -33,7 +33,7 @@ public final class Configuration { * Automatically populated by Gradle/Maven during build. * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String gitCommitId = "6331b9337"; + public static final String gitCommitId = "9eef52388"; /** * Git commit date of the build (ISO format: YYYY-MM-DD). From 1c38fbc7f08c5228cbf79d67fd6e3fa2e2a464ec Mon Sep 17 00:00:00 2001 From: Flavio Soibelmann Glock Date: Sat, 28 Mar 2026 10:56:52 +0100 Subject: [PATCH 2/3] fix: add exclude patterns to sync.pl for pod directory - Add exclude option support to sync.pl for directory imports - Exclude build artifacts from perl5/pod: Makefile, buildtoc, etc. - Exclude broken symlinks: perllinux.pod, perlmacosx.pod, etc. (these point to ../README.* which do not exist in target) This prevents untracked files from being created after running sync.pl. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- dev/import-perl5/config.yaml | 40 +++++++++++++++++++ dev/import-perl5/sync.pl | 22 ++++++++-- .../org/perlonjava/core/Configuration.java | 2 +- 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/dev/import-perl5/config.yaml b/dev/import-perl5/config.yaml index b1f9caf73..9671b153d 100644 --- a/dev/import-perl5/config.yaml +++ b/dev/import-perl5/config.yaml @@ -697,6 +697,46 @@ imports: - source: perl5/pod target: src/main/perl/lib/pod type: directory + exclude: + # Build artifacts that shouldn't be copied + - .gitignore + - Makefile + - Makefile.SH + - buildtoc + - perlmodlib.PL + - rofftoc + - roffitall + - splitman + - splitpod + # Broken symlinks pointing to ../README.* (don't exist in target) + - perlaix.pod + - perlamiga.pod + - perlandroid.pod + - perlbs2000.pod + - perlcn.pod + - perlcygwin.pod + - perlfreebsd.pod + - perlhaiku.pod + - perlhpux.pod + - perlhurd.pod + - perlirix.pod + - perljp.pod + - perlko.pod + - perllinux.pod + - perlmacosx.pod + - perlopenbsd.pod + - perlos2.pod + - perlos390.pod + - perlos400.pod + - perlplan9.pod + - perlqnx.pod + - perlriscos.pod + - perlsolaris.pod + - perlsynology.pod + - perltru64.pod + - perltw.pod + - perlvos.pod + - perlwin32.pod # Add more imports below as needed # Example with minimal fields: diff --git a/dev/import-perl5/sync.pl b/dev/import-perl5/sync.pl index 1e5e4fd6b..086541d07 100755 --- a/dev/import-perl5/sync.pl +++ b/dev/import-perl5/sync.pl @@ -39,6 +39,14 @@ sub parse_yaml { elsif ($line =~ /^\s+protected:\s*(.+)/) { $current_import->{protected} = ($1 =~ /true|yes|1/i) ? 1 : 0; } + elsif ($line =~ /^\s+exclude:\s*$/) { + # Start of exclude list + $current_import->{exclude} = []; + } + elsif ($line =~ /^\s+-\s+(.+)/ && $current_import->{exclude}) { + # Exclude list item + push @{$current_import->{exclude}}, $1; + } } } push @imports, $current_import if $current_import; @@ -64,7 +72,7 @@ sub apply_patch { # Copy a directory recursively using rsync sub copy_directory { - my ($source, $target, $project_root, $protected_files) = @_; + my ($source, $target, $project_root, $protected_files, $exclude_patterns) = @_; # Build rsync command with exclusions for protected files my $cmd = "rsync -a"; @@ -88,6 +96,14 @@ sub copy_directory { } } + # Add explicit exclude patterns from config + if ($exclude_patterns && @$exclude_patterns) { + for my $pattern (@$exclude_patterns) { + $cmd .= " --exclude='$pattern'"; + print " Excluding pattern: $pattern\n"; + } + } + $cmd .= " '$source/' '$target/'"; print " Running: $cmd\n"; @@ -167,8 +183,8 @@ sub main { }; } - # Copy directory using rsync (with protected file exclusions) - unless (copy_directory($source, $target, $project_root, \@protected_files)) { + # Copy directory using rsync (with protected file exclusions and explicit excludes) + unless (copy_directory($source, $target, $project_root, \@protected_files, $import->{exclude})) { $error_count++; next; } diff --git a/src/main/java/org/perlonjava/core/Configuration.java b/src/main/java/org/perlonjava/core/Configuration.java index 2d92d6c78..5cbf5c30f 100644 --- a/src/main/java/org/perlonjava/core/Configuration.java +++ b/src/main/java/org/perlonjava/core/Configuration.java @@ -33,7 +33,7 @@ public final class Configuration { * Automatically populated by Gradle/Maven during build. * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String gitCommitId = "9eef52388"; + public static final String gitCommitId = "6b6a8bf44"; /** * Git commit date of the build (ISO format: YYYY-MM-DD). From 92d62dfff50b9ef9ab378f6d39240a3a857683d8 Mon Sep 17 00:00:00 2001 From: Flavio Soibelmann Glock Date: Sat, 28 Mar 2026 11:01:31 +0100 Subject: [PATCH 3/3] fix: prevent patch from creating .orig backup files Add --no-backup-if-mismatch to patch command to prevent creating Unix.pm.orig and similar backup files during sync. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- dev/import-perl5/sync.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/import-perl5/sync.pl b/dev/import-perl5/sync.pl index 086541d07..8bb4b28da 100755 --- a/dev/import-perl5/sync.pl +++ b/dev/import-perl5/sync.pl @@ -59,7 +59,8 @@ sub parse_yaml { sub apply_patch { my ($target, $patch_file) = @_; - my $cmd = "patch -p0 '$target' < '$patch_file'"; + # --no-backup-if-mismatch prevents creating .orig files + my $cmd = "patch --no-backup-if-mismatch -p0 '$target' < '$patch_file'"; print " Applying patch: $patch_file\n"; my $result = system($cmd);