Merge branch 'master' of gitorious.org:xen-tools/xen-tools
Conflicts: debian/changelog
This commit is contained in:
1
debian/changelog
vendored
1
debian/changelog
vendored
@@ -41,6 +41,7 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low
|
||||
- Fix export of environment variables. Previously they could contain
|
||||
dashes and then were only accessible from within Perl, but not from
|
||||
within Bash.
|
||||
- Uses Test::NoTabs; add according build-dependency.
|
||||
* Add debian/gbp.conf to be able to to build xen-tools with
|
||||
git-buildpackage.
|
||||
* Clean up debian/rules:
|
||||
|
||||
1
debian/control
vendored
1
debian/control
vendored
@@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 7.0.0),
|
||||
libfile-slurp-perl,
|
||||
libfile-which-perl,
|
||||
libmoose-perl,
|
||||
libtest-notabs-perl,
|
||||
libtest-pod-coverage-perl,
|
||||
libtest-pod-perl,
|
||||
libtext-template-perl
|
||||
|
||||
47
t/no-tabs.t
47
t/no-tabs.t
@@ -9,8 +9,10 @@
|
||||
|
||||
use strict;
|
||||
use File::Find;
|
||||
use Test::More;
|
||||
use Test::NoTabs;
|
||||
|
||||
# Check all Perl files
|
||||
all_perl_files_ok();
|
||||
|
||||
#
|
||||
# Find all the files beneath the current directory,
|
||||
@@ -18,8 +20,6 @@ use Test::More;
|
||||
#
|
||||
find( { wanted => \&checkFile, no_chdir => 1 }, '.' );
|
||||
|
||||
done_testing();
|
||||
|
||||
#
|
||||
# Check a file.
|
||||
#
|
||||
@@ -62,50 +62,17 @@ sub checkFile
|
||||
( $line =~ /\/bin\/bash/ ) )
|
||||
{
|
||||
$isShell = 1;
|
||||
last;
|
||||
}
|
||||
if ( $line =~ /\/usr\/bin\/perl/ )
|
||||
{
|
||||
$isPerl = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close( INPUT );
|
||||
|
||||
#
|
||||
# Return if it wasn't a perl file.
|
||||
# Run check if it is a shell file.
|
||||
#
|
||||
if ( $isShell || $isPerl )
|
||||
{
|
||||
#
|
||||
# Count TAB characters
|
||||
#
|
||||
my $count = countTabCharacters( $file );
|
||||
|
||||
is( $count, 0, "Script has no tab characters: $file" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=head2 countTabCharacters
|
||||
|
||||
=cut
|
||||
|
||||
sub countTabCharacters
|
||||
{
|
||||
my ( $file ) = (@_);
|
||||
|
||||
my $count = 0;
|
||||
|
||||
open( FILE, "<", $file )
|
||||
or die "Cannot open $file - $!";
|
||||
foreach my $line ( <FILE> )
|
||||
{
|
||||
while( $line =~ /(.*)\t(.*)/ )
|
||||
{
|
||||
$count += 1;
|
||||
$line = $1 . $2;
|
||||
}
|
||||
}
|
||||
close( FILE );
|
||||
|
||||
return( $count );
|
||||
notabs_ok( $file ) if $isShell;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user