Skip to content

Commit

Permalink
Item12661: Add support for nested MANIFEST files
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@17106 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Nov 22, 2013
1 parent 9c9c373 commit ea3a79a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions core/pseudo-install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -727,14 +727,25 @@ sub gitCloneFromURL {
}

sub installFromMANIFEST {
my ( $module, $moduleDir, $manifest, $ignoreBlock ) = @_;
my ( $module, $moduleDir, $manifest, $ignoreBlock, $nodeps ) = @_;

trace "Using manifest from $manifest";

open( my $df, '<', $manifest )
or die "Cannot open manifest $manifest for reading: $!";
foreach my $file (<$df>) {
chomp($file);
if ( $file =~ /^!include\s+(\S+)\s*$/ ) {
my $incfile = $1;
trace
"Found include MANIFEST $incfile, process $moduleDir/$incfile";
if ( -f $incfile ) {
installFromMANIFEST( $module, $moduleDir,
$moduleDir . '/' . $incfile,
$ignoreBlock, 1 );
next;
}
}
next unless $file =~ /^\w+/;
$file =~ s/\s.*$//;
next if -d File::Spec->catdir( $moduleDir, $file );
Expand Down Expand Up @@ -782,7 +793,7 @@ sub installFromMANIFEST {
}

# process dependencies, if we are installing
if ($installing) {
if ( $installing && !$nodeps ) {
my $deps = $manifest;
$deps =~ s/MANIFEST/DEPENDENCIES/;
if ( open( $df, '<', $deps ) ) {
Expand Down Expand Up @@ -1504,8 +1515,8 @@ sub merge_gitignore {
if ( $match_rule =~ /\*/ ) {

# Normalise the rule
$old_rule =~ s/^\s*//;
$old_rule =~ s/\s*$//;
$old_rule =~ s/^\s*//;
$old_rule =~ s/\s*$//;
$match_rule =~ s/^\s*\!\s*(.*?)\s*$/$1/;

# It's a wildcard
Expand Down

0 comments on commit ea3a79a

Please sign in to comment.