Skip to content

Add and use MANIFEST.SKIP file for Porting files #19542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ lib/unicore/mktables.lst
# generated by WinCE build
xlib/

/stuff

# test byproducts
t/rantests
t/tmp*
Expand All @@ -150,6 +152,8 @@ t/test_state
t/*.ph
t/lib/*.ph

/rel2abs2rel*.pl

# t/op/require.t byproducts
t/bleah.pm
t/bleah.do
Expand Down
22 changes: 6 additions & 16 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.editorconfig EditorConfig style file
.lgtm.yml LGTM.com configuration file
.metaconf-exclusions.txt Symbols that should ignored when generating Configure
.travis.yml continuous integration on github (where enabled)
amigaos4/amigaio.c AmigaOS4 port
amigaos4/amigaio.h AmigaOS4 port
amigaos4/amigaos.c AmigaOS4 port
Expand Down Expand Up @@ -5311,8 +5310,8 @@ pod/perl58delta.pod Perl changes in version 5.8.0
pod/perlapio.pod Perl internal IO abstraction interface
pod/perlartistic.pod Perl Artistic License
pod/perlbook.pod Perl book information
pod/perlboot.pod
pod/perlbot.pod
pod/perlboot.pod Links to info on OO programming in Perl
pod/perlbot.pod Links to info on OO programming in Perl
pod/perlcall.pod Perl calling conventions from C
pod/perlcheat.pod Perl cheat sheet
pod/perlclib.pod Internal replacements for standard C library functions
Expand Down Expand Up @@ -5376,7 +5375,7 @@ pod/perlrecharclass.pod Perl regular expression character classes
pod/perlref.pod Perl references, the rest of the story
pod/perlreftut.pod Perl references short introduction
pod/perlreguts.pod Perl regular expression engine internals
pod/perlrepository.pod
pod/perlrepository.pod Links to current info on the Perl source repository
pod/perlrequick.pod Perl regular expressions quick start
pod/perlreref.pod Perl regular expressions quick reference
pod/perlretut.pod Perl regular expressions tutorial
Expand All @@ -5389,9 +5388,9 @@ pod/perlsub.pod Perl subroutines
pod/perlsyn.pod Perl syntax
pod/perlthrtut.pod Perl threads tutorial
pod/perltie.pod Perl objects hidden behind simple variables
pod/perltodo.pod
pod/perltooc.pod
pod/perltoot.pod
pod/perltodo.pod Link to the Perl to-do list
pod/perltooc.pod Links to info on OO programming in Perl
pod/perltoot.pod Links to info on OO programming in Perl
pod/perltrap.pod Perl traps for the unwary
pod/perlunicode.pod Perl Unicode support
pod/perlunicook.pod Perl Unicode cookbook
Expand All @@ -5409,13 +5408,9 @@ Porting/acknowledgements.pl Generate perldelta acknowledgements text
Porting/add-package.pl Add/Update CPAN modules that are part of Core
Porting/add-pod-file Utility to add new pod/*.pod file to core distribution
Porting/bench.pl Run benchmarks against t/perf/benchmarks
Porting/bisect.pl A tool to make bisecting easy
Porting/bisect-example.sh Example script to use with git bisect run
Porting/bisect-runner.pl Tool to be called by git bisect run
Porting/bump-perl-version bump the perl version in relevant files
Porting/check-cpan-pollution Check for commits that may wrongly touch CPAN distros
Porting/checkansi.pl Check source code for ANSI-C violations
Porting/checkAUTHORS.pl Check that the AUTHORS file is complete
Porting/checkcfguse.pl Check that config symbols are being used
Porting/checkcfgvar.pl Check that config scripts define all symbols
Porting/checkpodencoding.pl Check POD encoding
Expand All @@ -5438,10 +5433,6 @@ Porting/exec-bit.txt List of files that get +x in release tarball
Porting/exercise_makedef.pl Brute force testing for makedef.pl
Porting/expand-macro.pl A tool to expand C macro definitions in the Perl source
Porting/findrfuncs Find reentrant variants of functions used in an executable
Porting/git-deltatool Mark commits for perldelta in git notes
Porting/git-find-p4-change Find the change for a p4 change number
Porting/git-make-p4-refs Output git refs for each p4 change number, suitable for appending to .git/packed-refs
Porting/GitUtils.pm Generate the contents of a .patch file
Porting/Glossary Glossary of config.sh variables
Porting/harness-timer-report.pl Analyze the timings from the test harness
Porting/how_to_write_a_perldelta.pod Bluffer's guide to writing a perldelta.
Expand Down Expand Up @@ -5479,7 +5470,6 @@ Porting/sync-with-cpan Sync with CPAN
Porting/timecheck.c Test program for the 2038 fix
Porting/timecheck2.c Test program for the 2038 fix
Porting/todo.pod Perl things to do
Porting/updateAUTHORS.pl Tool to automatically update AUTHORS and .mailmap from git log data
Porting/valgrindpp.pl Summarize valgrind reports
Porting/vote_admin_guide.pod Perlgov Vote Administrator guide
pp.c Push/Pop code
Expand Down
21 changes: 21 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
^MANIFEST\.SKIP

\.mailmap
\.gitignore
\.gitattributes
\.git_patch
^\.git\b
^\.github/
\.travis\.yml

# Porting tools
Porting/bisect-example.sh
Porting/bisect-runner.pl
Porting/bisect.pl
Porting/checkAUTHORS.pl
Porting/git-deltatool
Porting/git-find-p4-change
Porting/git-make-p4-refs
Porting/GitUtils.pm
Porting/Manifest.pm
Porting/updateAUTHORS.pl
30 changes: 8 additions & 22 deletions Porting/Maintainers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,27 @@ our @EXPORT_OK = qw(%Modules %Maintainers
show_results process_options files_to_modules
finish_tap_output
reload_manifest);
our $VERSION = 0.14;
our $VERSION = 0.15;

require Exporter;

use File::Find;
use Getopt::Long;

use Manifest; # aka 'use Porting::Manifest' - note: Porting is in lib

my %MANIFEST;

# (re)read the MANIFEST file, blowing away any previous effort

sub reload_manifest {
%MANIFEST = ();

my $manifest_path = 'MANIFEST';
if (! -e $manifest_path) {
$manifest_path = "../MANIFEST";
}
%MANIFEST = ( map { $_ => 1 } Porting::Manifest::get_files_from_all_manifests( 1 ) );

if (open(my $manfh, '<', $manifest_path )) {
while (<$manfh>) {
if (/^(\S+)/) {
$MANIFEST{$1}++;
}
else {
warn "MANIFEST:$.: malformed line: $_\n";
}
}
close $manfh;
} else {
die "$0: Failed to open MANIFEST for reading: $!\n";
}
return;
}

reload_manifest;
reload_manifest();


sub get_module_pat {
Expand Down Expand Up @@ -355,7 +341,8 @@ sub duplicated_maintainers {

sub warn_maintainer {
my $name = shift;
ok($files{$name}, "$name has a maintainer (see Porting/Maintainers.pl)");
ok($name=~/\.gitignore\z/ or $files{$name},
"$name has a maintainer (see Porting/Maintainers.pl)");
}

sub missing_maintainers {
Expand All @@ -380,4 +367,3 @@ sub finish_tap_output {
}

1;

79 changes: 79 additions & 0 deletions Porting/Manifest.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!perl

package Porting::Manifest;

use strict;
use warnings;

use v5.34;

##
## list of all files from MANIFEST and ignored by MANIFEST.SKIP
##

sub get_files_from_all_manifests {

my ($reload) = @_;

state @list;

@list = () if $reload;

return @list if scalar @list;

require ExtUtils::Manifest;
require Cwd;

local $ExtUtils::Manifest::Quiet = $ExtUtils::Manifest::Quiet = 1; # no warnings 'once'

my @from_manifest;
my @from_manifest_skip;

my $skip;

my $cwd = Cwd::getcwd();
my @ls_files;
my $ls_status;
{
my $root_pwd = Cwd::abs_path( $INC{"strict.pm"} );

#my $strict_path = $INC{"strict.pm"};
$root_pwd =~ s{/*\Qlib/strict.pm\E$}{};
chdir($root_pwd);

# read the manifest files
@from_manifest = keys %{ ExtUtils::Manifest::maniread("MANIFEST") };
$skip = ExtUtils::Manifest::maniskip("MANIFEST.SKIP");

@ls_files = `git ls-files --full-name`;
$ls_status = $?
}
chdir($cwd);
die q[Fail to run git ls-files] if $ls_status;

chomp(@ls_files);

foreach my $f (@ls_files) {
next unless $skip->($f);
push @from_manifest_skip, $f;
}

my %uniq = map { $_ => 1 } @from_manifest, @from_manifest_skip;

return ( @list = sort keys %uniq );
}

##
## list of Porting files listed in MANIFEST or ignored by MANIFEST.SKIP
##

sub get_porting_files {

return grep { $_ =~ qr{^Porting} && $_ !~ qr{\.(?:gitignore$|github|gitattributes|mailmap|travis)} } get_files_from_all_manifests();
}

sub get_porting_perl_files {
return grep { $_ !~ qr{\.sh} } get_porting_files();
}

1;
49 changes: 39 additions & 10 deletions Porting/README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ file is normally updated each time F<Configure> is updated.

=head2 F<core-cpan-diff>

Compare CPAN modules with their equivalent in core.
Compare CPAN modules with their equivalent in core.
Originally based on App::DualLivedDiff by Steffen Mueller.

=head2 F<corecpan.pl>
Expand Down Expand Up @@ -188,15 +188,15 @@ digits which acts the internal unique identifier for this commit
=head2 F<Glossary>

This file is built by F<metaconfig>. This file contains a description of all
the shell variables whose value is determined by the Configure script.
the shell variables whose value is determined by the Configure script.
It later gets incorporated into the pod for F<Config.pm>.

=head2 F<harness-timer-report.pl>

For analyzing the output of "env HARNESS_TIMER=1 make test", to find
outliers of test execution times.

=head2 F<how_to_write_a_perldelta.pod>
=head2 F<how_to_write_a_perldelta.pod>

This file contains a specification as to how to write a perldelta pod.
Related file: F<perldelta_template.pod>
Expand Down Expand Up @@ -244,20 +244,44 @@ This script creates a release checklist as a simple HTML document.
=head2 F<make_snapshot.pl>

This script is a quick and dirty snapshot generator for the perl5.git.perl.org
web page to use to generate the snapshot files.
web page to use to generate the snapshot files.

=head2 F<manicheck>

This script outputs a list of files in F<MANIFEST> which don't exist and a
list of files that exist and aren't in F<MANIFEST>.
This script outputs a list of files in F<MANIFEST> which don't exist
and a list of files that exist and aren't skipped by F<MANIFEST.SKIP>.

=head2 F<manifest_lib.pl>

This library provides functions used in checking and sorting the F<MANIFEST>.
This library provides functions used in checking and sorting the
F<MANIFEST> files. The sort order is similar to
dictionary sort order (alphabetical case insensitive) but where path
components and extensions are sorted independently such that the
following files would be sorted into the following order:

Configure
configure
lib/Foo/Bar
lib/Foo/Bar.pm
lib/Foo/Bar/Alpha.pm
lib/Foo-Alpha/Baz

Currently this code does not support EBCDIC. Patches welcome.

=head2 F<Manifest.pm>

A package which provides helper to list files from F<MANIFEST>
taking into account F<MANIFEST.SKIP>.

=head2 F<MANIFEST.SKIP>

List files that we do not want to ship and are versionned in git.

=head2 F<manisort>

This script sorts the files in F<MANIFEST>.
This script sorts the files in F<MANIFEST>. It uses
F<manifest_list.pl> to do the sorting. Use C<Porting/manisort --man>
to see instructions for use.

=head2 F<mksample>

Expand Down Expand Up @@ -294,6 +318,12 @@ distribution, provides functions useful during testing.
Generate the sections of files listed in C<%Targets> from F<pod/perl.pod>.
Mostly these are rules in Makefiles.

An example of what this tool does is to ensure that every podfile listed
in F<pod/perl.pod> is also listed in F<MANIFEST> with the same
description in F<pod/perl.pod>. If they differ in test mode it will
complain. To update the manifest entries run it from the command line
without the --test argument.

--verbose gives slightly more output
--build-all tries to build everything
--build-foo updates foo as follows
Expand All @@ -308,7 +338,7 @@ Applies F<podtidy> to a file.
=head2 F<pumpkin.pod>

Pumpkin - Notes on handling the Perl Patch Pumpkin And Porting Perl.
Many of these are out of date or superseded by other documents in
Many of these are out of date or superseded by other documents in
this directory.

=head2 F<README.pod>
Expand Down Expand Up @@ -398,4 +428,3 @@ leaks.
Guide for Vote Administrators for running Steering Council elections.

=cut

Loading