Skip to content

Commit

Permalink
Item12748: support symbolic links and empty directories
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@17282 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Feb 13, 2014
1 parent ff34e2d commit b369ab4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions BuildContrib/data/System/BuildContrib.txt
Expand Up @@ -618,6 +618,7 @@ Another great Foswiki extension from the <a style="text-decoration:none" href="h
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change&nbsp;History: | |
| 1.8.0 (13 Feb 2014) | Foswikitask:Item12748: Support symbolic links and empty directories |
| 1.7.1 (8 May 2013) | Foswikitask:Item12492: expose test output while running tests Foswikitask:Item11851: minor bugfixes |
| 1.7.0 (11 May 2012) | Foswikitask:Item11716: correct paths in generated MANIFEST; Foswikitask:Item11851: internal maintenance |
| 1.6.3 (18 Aug 2011) | Foswikitask:Item11014: Improve error message if installer not run from Foswiki root. |
Expand Down
7 changes: 6 additions & 1 deletion BuildContrib/lib/Foswiki/Contrib/Build.pm
Expand Up @@ -882,7 +882,12 @@ sub cp {
print 'cp ' . $from . ' ' . $to . "\n";
}
unless ( $this->{-n} ) {
if ( -d $from ) {
if ( -l $from ) {
my $link = readlink($from);
symlink( $link, $to )
|| warn "Warning: Failed to create link from $to to $link: $!";
}
elsif ( -d $from ) {
unless ( -e $to ) {
mkdir($to) || warn 'Warning: Failed to make ' . $to . ': ' . $!;
}
Expand Down
4 changes: 2 additions & 2 deletions BuildContrib/lib/Foswiki/Contrib/BuildContrib.pm
@@ -1,8 +1,8 @@
package Foswiki::Contrib::BuildContrib;
use strict;

use version 0.77; our $VERSION = version->declare("v1.7.1");
our $RELEASE = '8 May 2013';
use version 0.77; our $VERSION = version->declare("v1.8.0");
our $RELEASE = '13 Feb 2014';

our $SHORTDESCRIPTION =
'Automates build and packaging process, including installer generation, for extension modules.';
Expand Down
8 changes: 6 additions & 2 deletions BuildContrib/lib/Foswiki/Contrib/BuildContrib/BaseBuild.pm
Expand Up @@ -164,8 +164,12 @@ sub readManifest {
close $fh;
$n->{md5} = $md5->hexdigest;
}
else {
warn "File $name does not exist on disk!";
elsif ( -l "$baseDir/$name" ) {
warn
"WARNING: File $name is a symbolic link - may not work on all target platforms";
}
elsif ( !-d "$baseDir/$name" ) {
warn "WARNING: File $name does not exist on disk!";
}
push( @files, $n );
}
Expand Down
Expand Up @@ -46,10 +46,10 @@ sub target_archive {
# and argument for group and user must be passed in as separate parameters.
print STDERR
"tar --owner / --group not supported. Recommend building as root\n";
$this->sys_action( 'tar', '-czhpf', $project . '.tgz', '*' );
$this->sys_action( 'tar', '-czpf', $project . '.tgz', '*' );
}
else {
$this->sys_action( 'tar', '--owner', '0', '--group', '0', '-czhpf',
$this->sys_action( 'tar', '--owner', '0', '--group', '0', '-czpf',
$project . '.tgz', '*' );
}

Expand Down
Expand Up @@ -57,6 +57,7 @@ sub target_stage {
$this->{basedir} . '/' . $project . '.txt'
);
}

$this->apply_perms( $this->{files}, $this->{tmpDir} );

if ( $this->{other_modules} ) {
Expand Down

0 comments on commit b369ab4

Please sign in to comment.