[Rt-commit] rt branch, 4.0/docs-from-extension-tarballs, created. rt-4.0.14rc1-1-gfbed461
Thomas Sibley
trs at bestpractical.com
Mon Jul 15 17:34:58 EDT 2013
The branch, 4.0/docs-from-extension-tarballs has been created
at fbed46142611b11795a02fff1bd13dc049db8c5d (commit)
- Log -----------------------------------------------------------------
commit fbed46142611b11795a02fff1bd13dc049db8c5d
Author: Thomas Sibley <trs at bestpractical.com>
Date: Mon Jul 15 14:30:37 2013 -0700
Use the first directory we find instead of "rt-*" so extension tarballs work
There should be only one directory for well-behaved tarballs.
Additionally, die if we can't find a directory to chdir into when
unpacking instead of falling back silently to the current directory.
diff --git a/devel/tools/rt-static-docs b/devel/tools/rt-static-docs
index 9b619cc..e9bda9a 100755
--- a/devel/tools/rt-static-docs
+++ b/devel/tools/rt-static-docs
@@ -55,6 +55,7 @@ use File::Spec;
use File::Path qw(make_path rmtree);
use File::Copy qw(copy);
use HTML::Entities qw(encode_entities);
+use List::Util qw(first);
use RT::Pod::HTMLBatch;
my %opts;
@@ -85,7 +86,10 @@ if (($opts{source} || '') =~ /\.tar\.gz$/ and -f $opts{source}) {
$tmpdir = File::Temp->newdir();
system("tar", "xzpf", $opts{source}, "-C", $tmpdir);
- $opts{source} = <$tmpdir/rt-*>;
+ $opts{source} = first { -d $_ } <$tmpdir/*>;
+
+ die "Can't find directory to chdir into after unpacking tarball"
+ unless $opts{source};
}
chdir $opts{source} if $opts{source};
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list