[SCM] UNNAMED PROJECT branch, master, updated. 0.43-9-g7b6ab0b
Niels Thykier
niels at thykier.net
Thu Apr 25 18:54:47 UTC 2013
The following commit has been merged in the master branch:
commit a57560735cd52adae86dc619553c172672146b53
Author: Niels Thykier <niels at thykier.net>
Date: Thu Apr 25 18:29:03 2013 +0200
lib: Replace tabs with spaces
Signed-off-by: Niels Thykier <niels at thykier.net>
diff --git a/lib/Debian/Javahelper/Eclipse.pm b/lib/Debian/Javahelper/Eclipse.pm
index f7f7c1f..2f71378 100644
--- a/lib/Debian/Javahelper/Eclipse.pm
+++ b/lib/Debian/Javahelper/Eclipse.pm
@@ -115,22 +115,22 @@ sub install_zipped_feature{
doit('mkdir', '-p', $loc);
doit('unzip', '-qq', '-n', '-d', $loc, $fzip);
foreach my $orbitdep (@$orbitdeps){
- my $symname = $orbitdep->{${\EOB_SYM_NAME}};
- my $sysjar = $orbitdep->{${\EOB_SYS_JAR}};
- my @matches = glob("$loc/eclipse/plugins/${symname}_*.jar");
- if(scalar(@matches) > 1){
- error("${symname}_*.jar unexpected matched more than one jar; ".
- 'please assert whether this is intended and report a bug '.
- 'against javahelper.');
- }
- foreach my $match (@matches){
- doit('rm', '-f', $match);
- doit('ln', '-s', $sysjar, $match);
- if(defined($needs) && $sysjar =~ m@^/usr/share/java/@o){
- $needs->{$sysjar} = {} unless(exists($needs->{$sysjar}));
- $needs->{$sysjar}{$package} = 1;
- }
- }
+ my $symname = $orbitdep->{${\EOB_SYM_NAME}};
+ my $sysjar = $orbitdep->{${\EOB_SYS_JAR}};
+ my @matches = glob("$loc/eclipse/plugins/${symname}_*.jar");
+ if(scalar(@matches) > 1){
+ error("${symname}_*.jar unexpected matched more than one jar; ".
+ 'please assert whether this is intended and report a bug '.
+ 'against javahelper.');
+ }
+ foreach my $match (@matches){
+ doit('rm', '-f', $match);
+ doit('ln', '-s', $sysjar, $match);
+ if(defined($needs) && $sysjar =~ m@^/usr/share/java/@o){
+ $needs->{$sysjar} = {} unless(exists($needs->{$sysjar}));
+ $needs->{$sysjar}{$package} = 1;
+ }
+ }
}
1;
}
diff --git a/lib/Debian/Javahelper/Java.pm b/lib/Debian/Javahelper/Java.pm
index 35c344c..cab2506 100644
--- a/lib/Debian/Javahelper/Java.pm
+++ b/lib/Debian/Javahelper/Java.pm
@@ -108,28 +108,28 @@ sub scan_javadoc{
my @packages = slurp_file("$docloc/package-list");
# For each package in package-list (replacing "." with "/")
foreach my $pack ( map { s@\.@/@go; $_; } @packages) {
- opendir(my $dir, "$docloc/$pack");
- # For each html file in $dir
- foreach my $file ( grep { m/\.html$/iox } readdir($dir)){
- open(my $htfile, '<', "$docloc/$pack/$file");
- while( my $line = <$htfile> ){
- my $target;
- my $packname;
- my $apif;
- next unless($line =~ m@ href=" (/usr/share/doc/[^.]++\.html) @oxi);
- $target = $1;
- $target =~ m@/usr/share/doc/([^/]++)/([^/]++)/@o;
- $packname = $1;
- $apif = $2;
- if(!defined($packname)){
- print STDERR "Ignoring weird URL target ($target).\n";
- next;
- }
- $phash{"/usr/share/doc/$packname/$apif"} = 1;
- }
+ opendir(my $dir, "$docloc/$pack");
+ # For each html file in $dir
+ foreach my $file ( grep { m/\.html$/iox } readdir($dir)){
+ open(my $htfile, '<', "$docloc/$pack/$file");
+ while( my $line = <$htfile> ){
+ my $target;
+ my $packname;
+ my $apif;
+ next unless($line =~ m@ href=" (/usr/share/doc/[^.]++\.html) @oxi);
+ $target = $1;
+ $target =~ m@/usr/share/doc/([^/]++)/([^/]++)/@o;
+ $packname = $1;
+ $apif = $2;
+ if(!defined($packname)){
+ print STDERR "Ignoring weird URL target ($target).\n";
+ next;
+ }
+ $phash{"/usr/share/doc/$packname/$apif"} = 1;
+ }
close($htfile);
- }
- closedir($dir);
+ }
+ closedir($dir);
}
return keys(%phash);
}
@@ -139,9 +139,9 @@ sub slurp_file{
my @data;
open(my $handle, '<', $file);
while(my $line = <$handle> ){
- chomp($line);
+ chomp($line);
$line =~ s/\r$//o;
- push(@data, $line);
+ push(@data, $line);
}
close($handle);
return @data;
@@ -151,17 +151,17 @@ sub find_package_for_existing_files{
my %pkgs;
my %files;
foreach my $file (@_){
- die("$file must be given with absolute path.") unless( $file =~ m@^/@o );
- die("$file does not exist") unless( -e $file );
- $file =~ s@/{2,}@/@og;
- $file =~ s@[/]+$@@og;
- $files{$file} = 1;
+ die("$file must be given with absolute path.") unless( $file =~ m@^/@o );
+ die("$file does not exist") unless( -e $file );
+ $file =~ s@/{2,}@/@og;
+ $file =~ s@[/]+$@@og;
+ $files{$file} = 1;
}
open(my $dpkg, '-|', 'dpkg', '-S', @_);
while( my $line = <$dpkg> ){
- my ($pkg, $file) = split(/:\s++/ox, $line);
- chomp($file);
- $pkgs{$pkg} = 1 if(exists($files{$file}));
+ my ($pkg, $file) = split(/:\s++/ox, $line);
+ chomp($file);
+ $pkgs{$pkg} = 1 if(exists($files{$file}));
}
close($dpkg);
return keys(%pkgs);
@@ -175,14 +175,14 @@ sub parse_manifest_fd{
my $atname = '';
my $atval = '';
while( my $line = <$fd> ){
- $line =~ s/[\r]?[\n]$//og;
- if($line =~ m/^ /o){
- # extension to a value.
- die("Unexpected \"extension line\" in $name,") unless($atname);
- $atval .= substr($line, 1);
- next;
- }
- if($line ne ''){
+ $line =~ s/[\r]?[\n]$//og;
+ if($line =~ m/^ /o){
+ # extension to a value.
+ die("Unexpected \"extension line\" in $name,") unless($atname);
+ $atval .= substr($line, 1);
+ next;
+ }
+ if($line ne ''){
if($atname){
if(!defined($sec)){
$sec = $manifest->get_section($atval, 1);
@@ -190,18 +190,18 @@ sub parse_manifest_fd{
$sec->set_value($atname, $atval);
}
}
- ($atname, $atval) = split(/ :\s /ox, $line, 2);
+ ($atname, $atval) = split(/ :\s /ox, $line, 2);
if(!$atval){
die("Expected <attr>: <val> pair in $name,")
unless($line =~ m/ :\s /ox);
$atval = '';
}
- if(!defined($sec)){
- die("A section must start with the Name attribute in $name,")
- unless(lc($atname) eq 'name');
- }
- next;
- }
+ if(!defined($sec)){
+ die("A section must start with the Name attribute in $name,")
+ unless(lc($atname) eq 'name');
+ }
+ next;
+ }
if($atname) {
if(!defined($sec)){
$sec = $manifest->get_section($atval, 1);
@@ -209,8 +209,8 @@ sub parse_manifest_fd{
$sec->set_value($atname, $atval);
}
}
- $atname = '';
- $sec = undef;
+ $atname = '';
+ $sec = undef;
}
$sec->set_value($atname, $atval) if($atname);
@@ -223,17 +223,17 @@ sub write_manifest_section_fd{
my $name = shift;
# return manifest-version and name first
foreach my $entry ($sec->get_values()) {
- my $line = join(': ', @$entry);
- # Extend long lines. Technically this is incorrect since the
- # rules says "bytes" and not "characters".
- #
- # (for future reference this is: Insert '\n ' after every 72
- # chars, but only if there is a 73rd character following them)
- #
- # If you change this, remember to change jh_build as well,
- # which also have this.
- $line =~ s/(.{72})(?=.)/$1\n /go;
- print {$fd} $line, "\n";
+ my $line = join(': ', @$entry);
+ # Extend long lines. Technically this is incorrect since the
+ # rules says "bytes" and not "characters".
+ #
+ # (for future reference this is: Insert '\n ' after every 72
+ # chars, but only if there is a 73rd character following them)
+ #
+ # If you change this, remember to change jh_build as well,
+ # which also have this.
+ $line =~ s/(.{72})(?=.)/$1\n /go;
+ print {$fd} $line, "\n";
}
print $fd "\n";
1;
@@ -245,7 +245,7 @@ sub write_manifest_fd{
my $name = shift;
# returns main section first.
foreach my $sec ($manifest->get_sections()){
- write_manifest_section_fd($sec, $fd, $name);
+ write_manifest_section_fd($sec, $fd, $name);
}
# must end with two empty lines.
print $fd "\n";
diff --git a/lib/Debian/Javahelper/Manifest.pm b/lib/Debian/Javahelper/Manifest.pm
index 34603b9..15fa2c9 100644
--- a/lib/Debian/Javahelper/Manifest.pm
+++ b/lib/Debian/Javahelper/Manifest.pm
@@ -106,8 +106,8 @@ sub get_section {
my $create = shift//0;
my $sec = $this->{$sname};
if(!defined($sec) && $create){
- $sec = Debian::Javahelper::ManifestSection->new($sname);
- $this->{$sname} = $sec;
+ $sec = Debian::Javahelper::ManifestSection->new($sname);
+ $this->{$sname} = $sec;
}
return $sec;
}
@@ -118,8 +118,8 @@ sub get_sections {
my $main = $this->get_section(MAIN_SECTION, 1);
my @sections = ($main);
while( my ($name, $sec) = each(%$this) ){
- next if($name eq MAIN_SECTION);
- push(@sections, $sec);
+ next if($name eq MAIN_SECTION);
+ push(@sections, $sec);
}
return @sections;
}
@@ -128,10 +128,10 @@ sub merge {
my $this = shift;
my $other = shift;
while( my ($osname, $osec) = each(%$other) ){
- my $tsec = $this->get_section($osname, 1);
- foreach my $val ($osec->get_values()){
- $tsec->set_value($val->[0], $val->[1]);
- }
+ my $tsec = $this->get_section($osname, 1);
+ foreach my $val ($osec->get_values()){
+ $tsec->set_value($val->[0], $val->[1]);
+ }
}
1;
}
diff --git a/lib/Debian/Javahelper/ManifestSection.pm b/lib/Debian/Javahelper/ManifestSection.pm
index 2247bb5..3ed0fad 100644
--- a/lib/Debian/Javahelper/ManifestSection.pm
+++ b/lib/Debian/Javahelper/ManifestSection.pm
@@ -103,9 +103,9 @@ sub new{
my $name = shift;
my $this = bless({}, $type);
if($name eq MAIN_SECTION){
- $this->set_value('Manifest-Version', '1.0');
+ $this->set_value('Manifest-Version', '1.0');
} else {
- $this->set_value('Name', $name);
+ $this->set_value('Name', $name);
}
return $this;
}
@@ -126,7 +126,7 @@ sub get_value {
my $empty = shift//0;
my $val = $this->{lc($name)};
if(defined($val)){
- return $val->[1];
+ return $val->[1];
}
return '' if($empty);
return;
@@ -137,14 +137,14 @@ sub get_values {
my @values = ();
# These go first
foreach my $var (qw(manifest-version name)){
- my $val = $this->{$var};
- push(@values, $val) if(defined($val));
+ my $val = $this->{$var};
+ push(@values, $val) if(defined($val));
}
# any order is okay for the rest.
while( my ($name, $val) = each(%$this)){
- # we already got these
- next if($name eq 'manifest-version' or $name eq 'name');
- push(@values, [$val->[0], $val->[1]]);
+ # we already got these
+ next if($name eq 'manifest-version' or $name eq 'name');
+ push(@values, [$val->[0], $val->[1]]);
}
return @values;
}
--
UNNAMED PROJECT
More information about the pkg-java-commits
mailing list