This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=158e88f6cfae512612dee42bfb8e3242cdde6891 commit 158e88f6cfae512612dee42bfb8e3242cdde6891 Author: Guillem Jover <[email protected]> AuthorDate: Thu Sep 18 12:23:19 2025 +0200 perl: Fix space style Add missing spaces after !. Add missing spaces after control flow keywords. Blame-Ignore: yes --- dselect/methods/Dselect/Method/Ftp.pm | 12 +++---- dselect/methods/file/install.pl | 4 +-- dselect/methods/ftp/install.pl | 55 ++++++++++++++++---------------- dselect/methods/ftp/setup.pl | 10 +++--- dselect/methods/ftp/update.pl | 12 +++---- dselect/methods/media/install.pl | 4 +-- scripts/Dpkg/Arch.pm | 6 ++-- scripts/Dpkg/Archive/Ar.pm | 2 +- scripts/Dpkg/BuildTypes.pm | 2 +- scripts/Dpkg/Changelog/Debian.pm | 2 +- scripts/Dpkg/Changelog/Entry.pm | 4 +-- scripts/Dpkg/Deps/Simple.pm | 2 +- scripts/Dpkg/Shlibs.pm | 2 +- scripts/Dpkg/Shlibs/Objdump/Object.pm | 4 +-- scripts/Dpkg/Shlibs/Symbol.pm | 8 ++--- scripts/Dpkg/Shlibs/SymbolFile.pm | 6 ++-- scripts/Dpkg/Source/Package.pm | 2 +- scripts/Dpkg/Source/Package/V1.pm | 4 +-- scripts/Dpkg/Source/Package/V3/Native.pm | 4 +-- scripts/Dpkg/Substvars.pm | 2 +- scripts/Dpkg/Vendor/Ubuntu.pm | 12 +++---- scripts/dpkg-architecture.pl | 4 +-- scripts/dpkg-buildpackage.pl | 2 +- scripts/dpkg-genbuildinfo.pl | 4 +-- scripts/dpkg-genchanges.pl | 4 +-- scripts/dpkg-gencontrol.pl | 2 +- scripts/dpkg-name.pl | 4 +-- scripts/dpkg-scansources.pl | 6 ++-- scripts/dpkg-shlibdeps.pl | 8 ++--- scripts/t/Dpkg_Arch.t | 40 +++++++++++------------ scripts/t/Dpkg_BuildEnv.t | 2 +- scripts/t/Dpkg_BuildFlags.t | 6 ++-- scripts/t/Dpkg_BuildOptions.t | 2 +- scripts/t/Dpkg_BuildTypes.t | 16 +++++----- scripts/t/Dpkg_Checksums.t | 2 +- scripts/t/Dpkg_Control_Fields.t | 4 +-- scripts/t/Dpkg_Path.t | 2 +- scripts/t/Dpkg_Shlibs.t | 14 ++++---- scripts/t/Dpkg_Version.t | 30 ++++++++--------- utils/t/update_alternatives.t | 30 ++++++++--------- 40 files changed, 170 insertions(+), 171 deletions(-) diff --git a/dselect/methods/Dselect/Method/Ftp.pm b/dselect/methods/Dselect/Method/Ftp.pm index 1482e193b..ae34ad1b4 100644 --- a/dselect/methods/Dselect/Method/Ftp.pm +++ b/dselect/methods/Dselect/Method/Ftp.pm @@ -65,11 +65,11 @@ sub do_connect { $ftp = Net::FTP->new($remotehost, Passive => $opts{passive}, ); - if(!$ftp || !$ftp->ok) { + if (! $ftp || ! $ftp->ok) { print "Failed to connect\n"; $exit = 1; } - if (!$exit) { + if (! $exit) { # $ftp->debug(1); if ($opts{useproxy}) { print "Login on $opts{proxyhost}...\n"; @@ -92,16 +92,16 @@ sub do_connect { $exit = 1; } } - if (!$exit) { + if (! $exit) { print "Setting transfer mode to binary...\n"; if (! $ftp->binary()) { print $ftp->message . "\n"; $exit = 1; } } - if (!$exit) { + if (! $exit) { print "Cd to '$opts{ftpdir}'...\n"; - if (!$ftp->cwd($opts{ftpdir})) { + if (! $ftp->cwd($opts{ftpdir})) { print $ftp->message . "\n"; $exit = 1; } @@ -166,7 +166,7 @@ sub do_mdtm { if ($ftp->code() == 502 || # MDTM not implemented $ftp->code() == 500) { # command not understood (SUN firewall) $has_mdtm = 0; - } elsif (!$ftp->ok()) { + } elsif (! $ftp->ok()) { return; } #} diff --git a/dselect/methods/file/install.pl b/dselect/methods/file/install.pl index 6ed899a9d..69fe4d6df 100755 --- a/dselect/methods/file/install.pl +++ b/dselect/methods/file/install.pl @@ -78,7 +78,7 @@ while (1) { if (not defined $c) { die "failed to fork for find: $!\n"; } - if (!$c) { + if (! $c) { exec('find', '-L', length($binaryprefix) ? $binaryprefix : q{.}, @@ -95,7 +95,7 @@ while (1) { $print = substr $print, length $binaryprefix; } } - if (!length($invoke)) { + if (! length($invoke)) { warn <<"WARN"; Cannot find the appropriate file(s) anywhere needed to install or upgrade diff --git a/dselect/methods/ftp/install.pl b/dselect/methods/ftp/install.pl index f8fd764fe..fbc385db6 100755 --- a/dselect/methods/ftp/install.pl +++ b/dselect/methods/ftp/install.pl @@ -120,7 +120,7 @@ sub procstatus { open(my $status_fh, '<', "$vardir/status") or die 'Could not open status file'; while (%flds = get_stanza($status_fh), %flds) { - if($flds{'status'} =~ /^install ok/) { + if ($flds{'status'} =~ /^install ok/) { my $cs = (split(/ /, $flds{'status'}))[2]; if (($cs eq 'not-installed') || ($cs eq 'half-installed') || @@ -160,7 +160,7 @@ sub procpkgfile { $curpkgs{$pkg} = $flds{'version'}; } $nfs = scalar(@files); - if(($nfs != scalar(@sizes)) || ($nfs != scalar(@md5sums)) ) { + if (($nfs != scalar(@sizes)) || ($nfs != scalar(@md5sums)) ) { print "Different number of filenames, sizes and md5sums for $flds{'package'}\n"; } else { my $i = 0; @@ -218,14 +218,14 @@ foreach my $pkg (keys(%pkgs)) { rename "$dldir/$fn.partial", "$dldir/$fn"; } $dir = dirname($fn); - if(! -d "$dldir/$dir") { + if (! -d "$dldir/$dir") { make_path("$dldir/$dir", { mode => 0o755 }); } @info = @{$pkgfiles{$fn}}; $csize = int($info[1]/1024)+1; - if(-f "$dldir/$fn") { + if (-f "$dldir/$fn") { $size = -s "$dldir/$fn"; - if($info[1] > $size) { + if ($info[1] > $size) { # partial download if (yesno('y', "continue file: $fn (" . nb($size) . '/' . nb($info[1]) . ')')) { @@ -267,10 +267,10 @@ print "Available space in $dldir: ${avsp}k\n"; #$avsp = qx(df -k $::dldir| paste -s | awk '{ print \$11}); #chomp $avsp; -if($totsize == 0) { +if ($totsize == 0) { print 'Nothing to get.'; } else { - if($totsize > $avsp) { + if ($totsize > $avsp) { print "Space required is greater than available space,\n"; print "you will need to select which items to get.\n"; } @@ -350,10 +350,10 @@ sub download { print "getting: $pre$fn (". nb($pkgfiles{$fn}[1]) . ")\n"; } $res = $ftp->get("$pre$fn", "$dldir/$fn", $downloads{$fn}); - if(! $res) { + if (! $res) { my $r = $ftp->code(); print $ftp->message() . "\n"; - if (!($r == 550 || $r == 450)) { + if (! ($r == 550 || $r == 450)) { return 1; } else { #Try to find another file or this package @@ -386,7 +386,7 @@ sub download { } # download stuff (protect from Ctrl+C) -if($totsize != 0) { +if ($totsize != 0) { if (yesno('y', "\nDo you want to download the required files")) { DOWNLOAD_TRY: while (1) { print "Downloading files... (use Ctrl+C to stop)\n"; @@ -396,7 +396,7 @@ if($totsize != 0) { next DOWNLOAD_TRY; } }; - if($@ =~ /Interrupted|Timeout/i ) { + if ($@ =~ /Interrupted|Timeout/i ) { # close the FTP connection if needed if ((ref($ftp) =~ /Net::FTP/) and ($@ =~ /Interrupted/i)) { $ftp->abort(); @@ -445,9 +445,9 @@ my %files; # package-version => files... sub chkdeb { my ($fn) = @_; # check to see if it is a .deb file - if (!system "dpkg-deb --info $fn >/dev/null 2>&1 && dpkg-deb --contents $fn >/dev/null 2>&1") { + if (! system "dpkg-deb --info $fn >/dev/null 2>&1 && dpkg-deb --contents $fn >/dev/null 2>&1") { return 1; - } elsif (!system "dpkg-split --info $fn >/dev/null 2>&1") { + } elsif (! system "dpkg-split --info $fn >/dev/null 2>&1") { return 2; } return 0; @@ -456,7 +456,7 @@ sub getdebinfo { my ($fn) = @_; my $type = chkdeb($fn); my ($pkg, $ver); - if($type == 1) { + if ($type == 1) { open(my $pkgfile_fh, '-|', "dpkg-deb --field $fn") or die "cannot create pipe for 'dpkg-deb --field $fn'"; my %fields = get_stanza($pkgfile_fh); @@ -486,11 +486,11 @@ sub getdebinfo { sub prcdeb { my ($dir, $fn) = @_; my ($pkg, $ver) = getdebinfo($fn); - if(!defined($pkg) || !defined($ver)) { + if (! defined($pkg) || ! defined($ver)) { print "could not get package info from file\n"; return 0; } - if($vers{$pkg}) { + if ($vers{$pkg}) { my $ver_rel = version_compare($vers{$pkg}, $ver); if ($ver_rel == 0) { $files{$pkg . $ver} = [ $files{$pkg . $ver }, "$dir/$fn" ]; @@ -519,26 +519,25 @@ sub prcfile { $dir = substr($File::Find::dir, length($dldir)+1); } print "$dir/$fn\n"; - if(defined($pkgfiles{"$dir/$fn"})) { + if (defined($pkgfiles{"$dir/$fn"})) { my @info = @{$pkgfiles{"$dir/$fn"}}; my $size = -s $fn; - if($size == 0) { + if ($size == 0) { print "zero length file\n"; unlink $fn; - } elsif($size < $info[1]) { + } elsif ($size < $info[1]) { print "partial file\n"; rename $fn, "$fn.partial"; - } elsif(( (exists $md5sums{"$dldir/$fn"}) - and ($md5sums{"$dldir/$fn"} ne $info[0]) ) - or - (md5sum($fn) ne $info[0])) { + } elsif (((exists $md5sums{"$dldir/$fn"}) and + ($md5sums{"$dldir/$fn"} ne $info[0])) or + (md5sum($fn) ne $info[0])) { print "corrupt file\n"; unlink $fn; } else { prcdeb($dir, $fn); } - } elsif($fn =~ /.deb$/) { - if(chkdeb($fn)) { + } elsif ($fn =~ /.deb$/) { + if (chkdeb($fn)) { prcdeb($dir, $fn); } else { print "corrupt file\n"; @@ -572,7 +571,7 @@ if (yesno('y', "\nDo you want to install the files fetched")) { } #Installing other packages after $r = system('dpkg', '-iGREOB', $dldir); - if($r) { + if ($r) { print "DPKG ERROR\n"; $exit = 1; } @@ -585,9 +584,9 @@ sub removeinstalled { if (length($File::Find::dir) > length($dldir)) { $dir = substr($File::Find::dir, length($dldir)+1); } - if($fn =~ /.deb$/) { + if ($fn =~ /.deb$/) { my($pkg, $ver) = getdebinfo($fn); - if(!defined($pkg) || !defined($ver)) { + if (! defined($pkg) || ! defined($ver)) { print "Could not get info for: $dir/$fn\n"; } elsif ($curpkgs{$pkg} && version_compare($ver, $curpkgs{$pkg}) <= 0) { diff --git a/dselect/methods/ftp/setup.pl b/dselect/methods/ftp/setup.pl index f28f609fb..11e1ef57d 100755 --- a/dselect/methods/ftp/setup.pl +++ b/dselect/methods/ftp/setup.pl @@ -126,7 +126,7 @@ sub download { foreach my $dist (@dists) { my $dir = "$dist/binary-$arch"; print "Checking $dir...\n"; -# if (!$ftp->pasv()) { +# if (! $ftp->pasv()) { # print $ftp->message . "\n"; # die 'error'; # } @@ -134,11 +134,11 @@ sub download { my $got_pkgfile = 0; foreach my $line (@dirlst) { - if($line =~ /Packages/) { + if ($line =~ /Packages/) { $got_pkgfile = 1; } } - if( !$got_pkgfile) { + if (! $got_pkgfile) { print "warning: could not find a Packages file in $dir\n", "This may not be a problem if the directory is a symbolic link\n"; $problem = 1; @@ -157,7 +157,7 @@ eval { }; download(); }; -if($@) { +if ($@) { $ftp->quit(); print 'FTP ERROR - '; if ($@ eq 'connect') { @@ -173,7 +173,7 @@ $CONFIG{done} = 1; store_config("$methdir/vars"); chmod 0o600, "$methdir/vars"; -if($exit || $problem) { +if ($exit || $problem) { print "Press <enter> to continue\n"; <STDIN>; } diff --git a/dselect/methods/ftp/update.pl b/dselect/methods/ftp/update.pl index 7e6aa951c..6e01ace50 100755 --- a/dselect/methods/ftp/update.pl +++ b/dselect/methods/ftp/update.pl @@ -37,7 +37,7 @@ my $option = $ARGV[2]; if ($option eq 'manual') { print "Enter package file names or a blank line to finish\n"; - while(1) { + while (1) { print 'Enter package file name:'; my $fn = <STDIN>; chomp $fn; @@ -124,7 +124,7 @@ sub download { } else { # else check last modification date my @pack_stat = stat($file); - if($newest_pack_date > $pack_stat[9]) { + if ($newest_pack_date > $pack_stat[9]) { # print "Packages has changed; must get it.\n"; $must_get = 1; } elsif ($newest_pack_date < $pack_stat[9]) { @@ -188,7 +188,7 @@ sub download { last TRY_GET_PACKAGES; } - if (!rename 'Packages', "Packages.$site->[0].$dist") { + if (! rename 'Packages', "Packages.$site->[0].$dist") { print " Couldn't rename Packages to Packages.$site->[0].$dist"; die 'error'; } else { @@ -210,9 +210,9 @@ eval { }; download(); }; -if($@) { +if ($@) { $ftp->quit() if (ref($ftp)); - if($@ =~ /timeout/i) { + if ($@ =~ /timeout/i) { print "FTP TIMEOUT\n"; } else { print "FTP ERROR - $@\n"; @@ -238,7 +238,7 @@ EOM } } -if (!$packages_modified) { +if (! $packages_modified) { print "No Packages files was updated.\n"; } else { foreach my $file (@pkgfiles) { diff --git a/dselect/methods/media/install.pl b/dselect/methods/media/install.pl index c01cfd9ff..5dd56bcd3 100755 --- a/dselect/methods/media/install.pl +++ b/dselect/methods/media/install.pl @@ -131,7 +131,7 @@ INFO if (not defined $c) { die "failed to fork for find: $!\n"; } - if (!$c) { + if (! $c) { exec('find', '-L', length($binaryprefix) ? $binaryprefix : '.', '-name', $base); @@ -147,7 +147,7 @@ INFO $print = substr $print, length $binaryprefix; } } - if (!length($invoke)) { + if (! length($invoke)) { warn <<"WARN"; Cannot find the appropriate file(s) anywhere needed to install or upgrade diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 013da6d96..1d370b3ef 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -214,7 +214,7 @@ sub get_raw_host_arch set_host_gnu_type($host_gnu_type); } - if (!defined($host_arch)) { + if (! defined($host_arch)) { # Switch to native compilation. $host_arch = get_raw_build_arch(); } @@ -377,7 +377,7 @@ sub gnutriplet_to_debtuple } } - return if !defined($cpu) || !defined($os); + return if ! defined($cpu) || ! defined($os); return (split(/-/, $os, 3), $cpu); } @@ -418,7 +418,7 @@ sub debtuple_to_debarch _load_tupletable(); - if (!defined $abi || !defined $libc || !defined $os || !defined $cpu) { + if (! defined $abi || ! defined $libc || ! defined $os || ! defined $cpu) { return; } elsif (exists $debtuple_to_debarch{"$abi-$libc-$os-$cpu"}) { return $debtuple_to_debarch{"$abi-$libc-$os-$cpu"}; diff --git a/scripts/Dpkg/Archive/Ar.pm b/scripts/Dpkg/Archive/Ar.pm index 3a845803e..b1b81e223 100644 --- a/scripts/Dpkg/Archive/Ar.pm +++ b/scripts/Dpkg/Archive/Ar.pm @@ -328,7 +328,7 @@ sub extract_member { $self->_copy_fh_fh({ fh => $self->{fh}, name => $self->{filename} }, { fh => $ofh, name => $member->{name} }, - $member->{size}); + $member->{size}); $ofh->close() or syserr(g_('cannot write file %s to the filesystem'), diff --git a/scripts/Dpkg/BuildTypes.pm b/scripts/Dpkg/BuildTypes.pm index 895e0a036..d93e406ee 100644 --- a/scripts/Dpkg/BuildTypes.pm +++ b/scripts/Dpkg/BuildTypes.pm @@ -166,7 +166,7 @@ sub build_has_none { my ($bits) = @_; - return !($current_type & $bits); + return ! ($current_type & $bits); } =item build_is($bits) diff --git a/scripts/Dpkg/Changelog/Debian.pm b/scripts/Dpkg/Changelog/Debian.pm index 2113563e0..fd67adac0 100644 --- a/scripts/Dpkg/Changelog/Debian.pm +++ b/scripts/Dpkg/Changelog/Debian.pm @@ -216,7 +216,7 @@ sub parse { $entry->extend_part('changes', [ @blanklines, $_ ]); @blanklines = (); $expect = CHANGES_OR_TRAILER; - } elsif (!m/\S/) { + } elsif (! m/\S/) { if ($expect eq START_CHANGES) { $entry->extend_part('blank_after_header', $_); next; diff --git a/scripts/Dpkg/Changelog/Entry.pm b/scripts/Dpkg/Changelog/Entry.pm index 51729f254..090c000bb 100644 --- a/scripts/Dpkg/Changelog/Entry.pm +++ b/scripts/Dpkg/Changelog/Entry.pm @@ -174,8 +174,8 @@ parts. sub is_empty { my $self = shift; - return !(defined($self->{header}) || defined($self->{trailer}) || - scalar(@{$self->{changes}})); + return ! (defined($self->{header}) || defined($self->{trailer}) || + scalar(@{$self->{changes}})); } =item $entry->normalize() diff --git a/scripts/Dpkg/Deps/Simple.pm b/scripts/Dpkg/Deps/Simple.pm index 103a1a3b9..9c7c6336d 100644 --- a/scripts/Dpkg/Deps/Simple.pm +++ b/scripts/Dpkg/Deps/Simple.pm @@ -255,7 +255,7 @@ sub output { $res .= ':' . $self->{archqual}; } if (defined $self->{relation}) { - $res .= ' (' . $self->{relation} . ' ' . $self->{version} . ')'; + $res .= ' (' . $self->{relation} . ' ' . $self->{version} . ')'; } if (defined $self->{arches}) { $res .= ' [' . join(' ', @{$self->{arches}}) . ']'; diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm index e15bb7b59..915fcb96d 100644 --- a/scripts/Dpkg/Shlibs.pm +++ b/scripts/Dpkg/Shlibs.pm @@ -77,7 +77,7 @@ sub parse_ldso_conf { if (/^include\s+(\S.*\S)\s*$/) { foreach my $include (glob($1)) { parse_ldso_conf($include) if -e $include - && !$visited{$include}; + && ! $visited{$include}; } } elsif (m{^\s*/}) { s/^\s+//; diff --git a/scripts/Dpkg/Shlibs/Objdump/Object.pm b/scripts/Dpkg/Shlibs/Objdump/Object.pm index a7282aeb6..46ea89199 100644 --- a/scripts/Dpkg/Shlibs/Objdump/Object.pm +++ b/scripts/Dpkg/Shlibs/Objdump/Object.pm @@ -337,14 +337,14 @@ sub get_symbol { sub get_exported_dynamic_symbols { my $self = shift; return grep { - $_->{defined} && $_->{dynamic} && !$_->{local} + $_->{defined} && $_->{dynamic} && ! $_->{local} } values %{$self->{dynsyms}}; } sub get_undefined_dynamic_symbols { my $self = shift; return grep { - (!$_->{defined}) && $_->{dynamic} + (! $_->{defined}) && $_->{dynamic} } values %{$self->{dynsyms}}; } diff --git a/scripts/Dpkg/Shlibs/Symbol.pm b/scripts/Dpkg/Shlibs/Symbol.pm index 70375f049..c57e4a5e0 100644 --- a/scripts/Dpkg/Shlibs/Symbol.pm +++ b/scripts/Dpkg/Shlibs/Symbol.pm @@ -120,7 +120,7 @@ sub parse_symbolspec { $symbol = $1; $rest = $2; } - error(g_('symbol name unspecified: %s'), $symbolspec) if (!$symbol); + error(g_('symbol name unspecified: %s'), $symbolspec) if (! $symbol); } elsif ($symbolspec =~ m/^(\S+)(.*)$/) { # foobarsymbol@Base 1.0 1 # No tag specification. Symbol name is up to the first space. @@ -213,10 +213,10 @@ sub set_symbolname { my ($self, $name, $templ, $quoted) = @_; $name //= $self->{symbol}; - if (!defined $templ && $name =~ /\s/) { + if (! defined $templ && $name =~ /\s/) { $templ = $name; } - if (!defined $quoted && defined $templ && $templ =~ /\s/) { + if (! defined $quoted && defined $templ && $templ =~ /\s/) { $quoted = '"'; } $self->{symbol} = $name; @@ -312,7 +312,7 @@ sub arch_is_concerned { my $arches = $self->{tags}{arch}; return 0 if defined $arch && defined $arches && - !debarch_is_concerned($arch, split /[\s,]+/, $arches); + ! debarch_is_concerned($arch, split /[\s,]+/, $arches); my ($bits, $endian) = debarch_to_abiattrs($arch); return 0 if defined $bits && defined $self->{tags}{'arch-bits'} && diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index eb0096d54..e117dee77 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -366,7 +366,7 @@ sub find_matching_pattern { my $pattern_ok = sub { my $p = shift; - return defined $p && ($inc_deprecated || !$p->{deprecated}) && + return defined $p && ($inc_deprecated || ! $p->{deprecated}) && $p->arch_is_concerned($self->get_arch()); }; @@ -606,7 +606,7 @@ sub lookup_pattern { } } elsif ($refpat->get_pattern_type() eq 'generic') { for my $p (@{$obj->{patterns}{generic}}) { - if (($inc_deprecated || !$p->{deprecated}) && + if (($inc_deprecated || ! $p->{deprecated}) && $p->equals($refpat, versioning => 0)) { $pat = $p; @@ -614,7 +614,7 @@ sub lookup_pattern { } } } - if ($pat && ($inc_deprecated || !$pat->{deprecated})) { + if ($pat && ($inc_deprecated || ! $pat->{deprecated})) { if (wantarray) { return ( symbol => $pat, diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index f1da68d47..8e60c97a2 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/scripts/Dpkg/Source/Package.pm @@ -402,7 +402,7 @@ sub get_basename { my $v = Dpkg::Version->new($f->{'Version'}); my $vs = $v->as_string( omit_epoch => 1, - omit_revision => !$with_revision, + omit_revision => ! $with_revision, ); return $f->{'Source'} . '_' . $vs; } diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm index 611a9b573..275277542 100644 --- a/scripts/Dpkg/Source/Package/V1.pm +++ b/scripts/Dpkg/Source/Package/V1.pm @@ -205,7 +205,7 @@ sub do_extract { if ($tarfile =~ m/\.orig\.tar\.gz$/) { # We only need to warn on this branch, because of the $native reset # below, otherwise the V3::Native module will handle the warning. - if (!$v->__is_native()) { + if (! $v->__is_native()) { warning(g_('native package version may not have a revision')); } @@ -381,7 +381,7 @@ sub do_build { error(g_('non-native package version does not contain a revision')) if $v->__is_native(); } else { - if (!$v->__is_native) { + if (! $v->__is_native) { if (run_vendor_hook('has-fuzzy-native-source')) { warning(g_('native package version may not have a revision')); } else { diff --git a/scripts/Dpkg/Source/Package/V3/Native.pm b/scripts/Dpkg/Source/Package/V3/Native.pm index d4002de27..0739c4afd 100644 --- a/scripts/Dpkg/Source/Package/V3/Native.pm +++ b/scripts/Dpkg/Source/Package/V3/Native.pm @@ -71,7 +71,7 @@ sub do_extract { error(g_('no tarfile in Files field')) unless $tarfile; my $v = Dpkg::Version->new($fields->{'Version'}); - if (!$v->__is_native()) { + if (! $v->__is_native()) { warning(g_('native package version may not have a revision')); } @@ -92,7 +92,7 @@ sub can_build { my ($self, $dir) = @_; my $v = Dpkg::Version->new($self->{fields}->{'Version'}); - if (!$v->__is_native()) { + if (! $v->__is_native()) { if (run_vendor_hook('has-fuzzy-native-source')) { warning(g_('native package version may not have a revision')); } else { diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 81e85edaa..b987d0ec1 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -213,7 +213,7 @@ sub parse { binmode($fh); while (<$fh>) { - next if m/^\s*\#/ || !m/\S/; + next if m/^\s*\#/ || ! m/\S/; s/\s*\n$//; if (! m/^(\w[-:0-9A-Za-z]*)([?!])?\=(.*)$/) { error(g_('bad line in substvars file %s at line %d'), diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm index 37258748a..b8bd9fe37 100644 --- a/scripts/Dpkg/Vendor/Ubuntu.pm +++ b/scripts/Dpkg/Vendor/Ubuntu.pm @@ -157,22 +157,22 @@ sub add_build_flags { # In Ubuntu these flags are set by the compiler, so when disabling the # features we need to pass appropriate flags to disable them. - if (!$flags->use_feature('hardening', 'stackprotectorstrong') && - !$flags->use_feature('hardening', 'stackprotector')) { + if (! $flags->use_feature('hardening', 'stackprotectorstrong') && + ! $flags->use_feature('hardening', 'stackprotector')) { my $flag = '-fno-stack-protector'; $flags->append($_, $flag) foreach @compile_flags; } - if (!$flags->use_feature('hardening', 'stackclash')) { + if (! $flags->use_feature('hardening', 'stackclash')) { my $flag = '-fno-stack-clash-protection'; $flags->append($_, $flag) foreach @compile_flags; } - if (!$flags->use_feature('hardening', 'fortify')) { + if (! $flags->use_feature('hardening', 'fortify')) { $flags->append('CPPFLAGS', '-D_FORTIFY_SOURCE=0'); } - if (!$flags->use_feature('hardening', 'format')) { + if (! $flags->use_feature('hardening', 'format')) { my $flag = '-Wno-format -Wno-error=format-security'; $flags->append('CFLAGS', $flag); $flags->append('CXXFLAGS', $flag); @@ -180,7 +180,7 @@ sub add_build_flags { $flags->append('OBJCXXFLAGS', $flag); } - if (!$flags->use_feature('hardening', 'branch')) { + if (! $flags->use_feature('hardening', 'branch')) { my $cpu = $flags->get_option_value('hardening-branch-cpu'); my $flag; if ($cpu eq 'arm64') { diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 770275c55..6c1a7bcfc 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -425,9 +425,9 @@ if ($action eq 'list') { } } } elsif ($action eq 'equal') { - exit !debarch_eq($v{DEB_HOST_ARCH}, $req_eq_arch); + exit ! debarch_eq($v{DEB_HOST_ARCH}, $req_eq_arch); } elsif ($action eq 'is') { - exit !debarch_is($v{DEB_HOST_ARCH}, $req_is_arch); + exit ! debarch_is($v{DEB_HOST_ARCH}, $req_is_arch); } elsif ($action eq 'command') { @ENV{keys %v} = values %v; ## no critic (TestingAndDebugging::ProhibitNoWarnings) diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 795ee792f..04c4a72fa 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -312,7 +312,7 @@ while (@ARGV) { } elsif (/^(?:-k|--sign-keyid=|--sign-key=)(.*)$/) { $signkeyid = $1; } elsif (/^--(no-)?check-builddeps$/) { - $checkbuilddep = !(defined $1 and $1 eq 'no-'); + $checkbuilddep = ! (defined $1 and $1 eq 'no-'); } elsif (/^-([dD])$/) { $checkbuilddep = ($1 eq 'D'); } elsif (/^--ignore-builtin-builddeps$/) { diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index 4c6b80a8c..d5cbfe1bb 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -206,7 +206,7 @@ sub collect_installed_builddeps { my $pkg; my $qualified_pkg_name; foreach my $installed_pkg (@{$facts->{pkg}->{$pkg_name}}) { - if (!defined $required_architecture || + if (! defined $required_architecture || $required_architecture eq $installed_pkg->{architecture}) { $pkg = $installed_pkg; $qualified_pkg_name = $pkg_name . ':' . $installed_pkg->{architecture}; @@ -218,7 +218,7 @@ sub collect_installed_builddeps { my $architecture = $pkg->{architecture}; my $new_deps_str = defined $depends->{$qualified_pkg_name} ? deps_concat(@{$depends->{$qualified_pkg_name}}) : ''; my $new_deps = deps_parse($new_deps_str); - if (!defined $required_architecture) { + if (! defined $required_architecture) { $installed_deps->add(Dpkg::Deps::Simple->new("$pkg_name (= $version)")); } else { $installed_deps->add(Dpkg::Deps::Simple->new("$qualified_pkg_name (= $version)")); diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 1755e7c9d..4dba51d57 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -300,7 +300,7 @@ if (build_has_any(BUILD_SOURCE)) { } my $ext = compression_get_file_extension_regex(); - if ((($sourcestyle =~ m/i/ && !$include_tarball) || + if ((($sourcestyle =~ m/i/ && ! $include_tarball) || $sourcestyle =~ m/d/) && any { m/\.(?:debian\.tar|diff)\.$ext$/ } $checksums->get_files()) { @@ -416,7 +416,7 @@ foreach my $pkg ($control->get_packages()) { if (build_has_any(BUILD_ARCH_DEP) and (any { debarch_is($host_arch, $_) } debarch_list_parse($v, positive => 1))) { $v = $host_arch; - } elsif (!debarch_eq('all', $v)) { + } elsif (! debarch_eq('all', $v)) { $v = ''; } push(@archvalues, $v) if $v and not $archadded{$v}++; diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index bd8cab830..a7ff89e8b 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -355,7 +355,7 @@ if ($binarypackage ne $sourcepackage || $verdiff) { $fields->{'Source'} .= ' (' . $sourceversion . ')' if $verdiff; } -if (!defined($substvars->get('Installed-Size'))) { +if (! defined($substvars->get('Installed-Size'))) { my $installed_size = 0; my %hardlink; my $scan_installed_size = sub { diff --git a/scripts/dpkg-name.pl b/scripts/dpkg-name.pl index ae6580383..513b6b0f5 100755 --- a/scripts/dpkg-name.pl +++ b/scripts/dpkg-name.pl @@ -144,11 +144,11 @@ sub getdir my ($filename, $fields, $arch) = @_; my $dir; - if (!$options{destdir}) { + if (! $options{destdir}) { $dir = dirname($filename); if ($options{subdir}) { my $section = $fields->{Section}; - if (!$section) { + if (! $section) { $section = 'no-section'; warning(g_("assuming section '%s' for '%s'"), $section, $filename); diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl index d2a7ab7fc..1495db810 100755 --- a/scripts/dpkg-scansources.pl +++ b/scripts/dpkg-scansources.pl @@ -123,7 +123,7 @@ sub load_override { $package, $.); next; } - if (!$priority{$priority}) { + if (! $priority{$priority}) { warning(g_('ignoring override entry for %s, invalid priority %s'), $package, $priority); next; @@ -132,7 +132,7 @@ sub load_override { $override{$package} = []; $override{$package}[O_PRIORITY] = $priority; $override{$package}[O_SECTION] = $section; - if (!defined $maintainer) { + if (! defined $maintainer) { # do nothing } elsif ($maintainer =~ /^(.*\S)\s*=>\s*(.*)$/) { $override{$package}[O_MAINT_TO] = $2; @@ -268,7 +268,7 @@ sub process_dsc { # binary. Modify the maintainer if necessary. my $maintainer_override = $override{$binary[0]}; if ($maintainer_override && defined $maintainer_override->[O_MAINT_TO]) { - if (!defined $maintainer_override->[O_MAINT_FROM] || + if (! defined $maintainer_override->[O_MAINT_FROM] || any { $fields->{Maintainer} eq $_ } @{ $maintainer_override->[O_MAINT_FROM] }) { $fields->{Maintainer} = $maintainer_override->[O_MAINT_TO]; diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 74168a003..cf8f1a76c 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -160,8 +160,8 @@ sub ignore_pkgdir { } if (-d 'debian') { - push @pkg_symbols, grep { !ignore_pkgdir($_) } glob 'debian/*/DEBIAN/symbols'; - push @pkg_shlibs, grep { !ignore_pkgdir($_) } glob 'debian/*/DEBIAN/shlibs'; + push @pkg_symbols, grep { ! ignore_pkgdir($_) } glob 'debian/*/DEBIAN/symbols'; + push @pkg_shlibs, grep { ! ignore_pkgdir($_) } glob 'debian/*/DEBIAN/shlibs'; my %uniq = map { guess_pkg_root_dir($_) => 1 } (@pkg_symbols, @pkg_shlibs); push @pkg_root_dirs, keys %uniq; } @@ -639,7 +639,7 @@ foreach my $field (reverse @depfields) { $substvars->save($varlistfilenew); # Replace old file by new one -if (!$stdout) { +if (! $stdout) { rename $varlistfilenew, $varlistfile or syserr(g_("install new varlist file '%s'"), $varlistfile); } @@ -733,7 +733,7 @@ sub update_dependency_version { { $dependencies{$cur_field}{$subdep} = $minver; } - } elsif (!$existing_only) { + } elsif (! $existing_only) { $dependencies{$cur_field}{$subdep} = $minver; } } diff --git a/scripts/t/Dpkg_Arch.t b/scripts/t/Dpkg_Arch.t index e04174fdb..be620e432 100644 --- a/scripts/t/Dpkg_Arch.t +++ b/scripts/t/Dpkg_Arch.t @@ -109,21 +109,21 @@ is(debarch_to_multiarch('i386'), 'i386-linux-gnu', is(debarch_to_multiarch('amd64'), 'x86_64-linux-gnu', 'normalized amd64 multiarch triplet'); -ok(!debarch_eq('amd64', 'i386'), 'no match, simple arch'); -ok(!debarch_eq('', 'amd64'), 'no match, empty first arch'); -ok(!debarch_eq('amd64', ''), 'no match, empty second arch'); -ok(!debarch_eq('amd64', 'unknown'), 'no match, with first unknown arch'); -ok(!debarch_eq('unknown', 'i386'), 'no match, second unknown arch'); +ok(! debarch_eq('amd64', 'i386'), 'no match, simple arch'); +ok(! debarch_eq('', 'amd64'), 'no match, empty first arch'); +ok(! debarch_eq('amd64', ''), 'no match, empty second arch'); +ok(! debarch_eq('amd64', 'unknown'), 'no match, with first unknown arch'); +ok(! debarch_eq('unknown', 'i386'), 'no match, second unknown arch'); ok(debarch_eq('unknown', 'unknown'), 'match equal unknown arch'); ok(debarch_eq('amd64', 'amd64'), 'match equal known arch'); ok(debarch_eq('amd64', 'linux-amd64'), 'match implicit linux arch'); -ok(!debarch_is('unknown', 'linux-any'), 'no match unknown on wildcard cpu'); -ok(!debarch_is('unknown', 'any-amd64'), 'no match unknown on wildcard os'); -ok(!debarch_is('amd64', 'unknown'), 'no match amd64 on unknown wildcard'); -ok(!debarch_is('amd64', 'unknown-any'), 'no match amd64 on unknown wildcard'); -ok(!debarch_is('amd64', 'any-unknown'), 'no match amd64 on unknown wildcard'); -ok(!debarch_is('amd64', 'linux-anyway'), 'no match amd64 on partial wildcard'); +ok(! debarch_is('unknown', 'linux-any'), 'no match unknown on wildcard cpu'); +ok(! debarch_is('unknown', 'any-amd64'), 'no match unknown on wildcard os'); +ok(! debarch_is('amd64', 'unknown'), 'no match amd64 on unknown wildcard'); +ok(! debarch_is('amd64', 'unknown-any'), 'no match amd64 on unknown wildcard'); +ok(! debarch_is('amd64', 'any-unknown'), 'no match amd64 on unknown wildcard'); +ok(! debarch_is('amd64', 'linux-anyway'), 'no match amd64 on partial wildcard'); ok(debarch_is('unknown', 'any'), 'match unknown on global wildcard'); ok(debarch_is('linux-amd64', 'linux-any'), 'match implicit linux-amd64 on wildcard cpu'); ok(debarch_is('linux-amd64', 'any-amd64'), 'match implicit linux-amd64 on wildcard os'); @@ -138,16 +138,16 @@ foreach my $wildcard (sort keys %{$wildcards}) { } } -ok(!debarch_is_wildcard('unknown'), 'unknown is not a wildcard'); -ok(!debarch_is_wildcard('all'), 'all is not a wildcard'); -ok(!debarch_is_wildcard('amd64'), '<arch> is not a wildcard'); -ok(!debarch_is_wildcard('anyway'), 'anyway is not a wildcard'); -ok(!debarch_is_wildcard('foo-anyway-bar'), 'foo-anyway-bar is not a wildcard'); +ok(! debarch_is_wildcard('unknown'), 'unknown is not a wildcard'); +ok(! debarch_is_wildcard('all'), 'all is not a wildcard'); +ok(! debarch_is_wildcard('amd64'), '<arch> is not a wildcard'); +ok(! debarch_is_wildcard('anyway'), 'anyway is not a wildcard'); +ok(! debarch_is_wildcard('foo-anyway-bar'), 'foo-anyway-bar is not a wildcard'); -ok(!debarch_is_illegal('0'), ''); -ok(!debarch_is_illegal('a'), ''); -ok(!debarch_is_illegal('amd64'), ''); -ok(!debarch_is_illegal('!arm64'), ''); +ok(! debarch_is_illegal('0'), ''); +ok(! debarch_is_illegal('a'), ''); +ok(! debarch_is_illegal('amd64'), ''); +ok(! debarch_is_illegal('!arm64'), ''); ok(debarch_is_illegal('!amd64!arm'), ''); ok(debarch_is_illegal('arch%name'), ''); ok(debarch_is_illegal('-any'), ''); diff --git a/scripts/t/Dpkg_BuildEnv.t b/scripts/t/Dpkg_BuildEnv.t index 1bf54de09..611ab3c25 100644 --- a/scripts/t/Dpkg_BuildEnv.t +++ b/scripts/t/Dpkg_BuildEnv.t @@ -39,7 +39,7 @@ is(scalar Dpkg::BuildEnv::list_accessed(), 2, '2 accessed variables'); is(scalar Dpkg::BuildEnv::list_modified(), 1, '1 modified variable'); ok(Dpkg::BuildEnv::has('DPKG_TEST_VAR_A'), 'variables is present'); -ok(!Dpkg::BuildEnv::has('DPKG_TEST_VAR_Z'), 'variables is not present'); +ok(! Dpkg::BuildEnv::has('DPKG_TEST_VAR_Z'), 'variables is not present'); is(scalar Dpkg::BuildEnv::list_accessed(), 3, '2 accessed variables'); is(scalar Dpkg::BuildEnv::list_modified(), 1, '1 modified variable'); diff --git a/scripts/t/Dpkg_BuildFlags.t b/scripts/t/Dpkg_BuildFlags.t index c1aa9e547..011a50717 100644 --- a/scripts/t/Dpkg_BuildFlags.t +++ b/scripts/t/Dpkg_BuildFlags.t @@ -46,12 +46,12 @@ is($bf->get_origin('CPPFLAGS'), 'vendor', 'CPPFLAGS has a vendor origin'); $bf->set('DPKGFLAGS', '-Wflag -On -fsome', 'system'); is($bf->get('DPKGFLAGS'), '-Wflag -On -fsome', 'get flag'); is($bf->get_origin('DPKGFLAGS'), 'system', 'flag has a system origin'); -ok(!$bf->is_maintainer_modified('DPKGFLAGS'), 'set marked flag as non-maint modified'); +ok(! $bf->is_maintainer_modified('DPKGFLAGS'), 'set marked flag as non-maint modified'); $bf->strip('DPKGFLAGS', '-On', 'user', undef); is($bf->get('DPKGFLAGS'), '-Wflag -fsome', 'get stripped flag'); is($bf->get_origin('DPKGFLAGS'), 'user', 'flag has a user origin'); -ok(!$bf->is_maintainer_modified('DPKGFLAGS'), 'strip marked flag as non-maint modified'); +ok(! $bf->is_maintainer_modified('DPKGFLAGS'), 'strip marked flag as non-maint modified'); my @strip_tests = ( { @@ -91,7 +91,7 @@ foreach my $test (@strip_tests) { $bf->append('DPKGFLAGS', '-Wl,other', 'vendor', 0); is($bf->get('DPKGFLAGS'), '-Wflag -fsome -Wl,other', 'get appended flag'); is($bf->get_origin('DPKGFLAGS'), 'vendor', 'flag has a vendor origin'); -ok(!$bf->is_maintainer_modified('DPKGFLAGS'), 'append marked flag as non-maint modified'); +ok(! $bf->is_maintainer_modified('DPKGFLAGS'), 'append marked flag as non-maint modified'); $bf->prepend('DPKGFLAGS', '-Idir', 'env', 1); is($bf->get('DPKGFLAGS'), '-Idir -Wflag -fsome -Wl,other', 'get prepended flag'); diff --git a/scripts/t/Dpkg_BuildOptions.t b/scripts/t/Dpkg_BuildOptions.t index e3e43f02b..ae9866b00 100644 --- a/scripts/t/Dpkg_BuildOptions.t +++ b/scripts/t/Dpkg_BuildOptions.t @@ -37,7 +37,7 @@ ok($dbo->has('foonostripbar'), 'has foonostripbar'); is($dbo->get('foonostripbar'), undef, 'foonostripbar value'); ok($dbo->has('parallel'), 'has parallel'); is($dbo->get('parallel'), 3, 'parallel value'); -ok(!$dbo->has('bazNOCHECK'), 'not has bazNOCHECK'); +ok(! $dbo->has('bazNOCHECK'), 'not has bazNOCHECK'); $dbo->reset(); $dbo->merge('no opt no-strip parallel = 5 nocheck', 'test'); diff --git a/scripts/t/Dpkg_BuildTypes.t b/scripts/t/Dpkg_BuildTypes.t index 6c73703f4..070c31ef9 100644 --- a/scripts/t/Dpkg_BuildTypes.t +++ b/scripts/t/Dpkg_BuildTypes.t @@ -39,15 +39,15 @@ ok(build_is(BUILD_BINARY), 'build is binary'); set_build_type_from_options('source,all', '--build=source,all', no_check => 1); ok(build_is(BUILD_SOURCE | BUILD_ARCH_INDEP), 'build source,all is source,all'); -ok(!build_is(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all is not source,any'); +ok(! build_is(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all is not source,any'); ok(build_has_any(BUILD_SOURCE), 'build source,all has_any source'); ok(build_has_any(BUILD_ARCH_INDEP), 'build source,all has_any any'); ok(build_has_none(BUILD_DEFAULT), 'build source,all has_none default'); ok(build_has_none(BUILD_ARCH_DEP), 'build source,all has_none any'); -ok(!build_has_all(BUILD_BINARY), 'build source,all not has_all binary'); -ok(!build_has_all(BUILD_SOURCE | BUILD_ARCH_DEP), +ok(! build_has_all(BUILD_BINARY), 'build source,all not has_all binary'); +ok(! build_has_all(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all not has_all source,any'); -ok(!build_has_all(BUILD_FULL), 'build source,all has_all full'); +ok(! build_has_all(BUILD_FULL), 'build source,all has_all full'); set_build_type_from_targets('build-arch,build-indep', '--targets=build-arch,build-indep', no_check => 1); @@ -62,15 +62,15 @@ ok(build_is(BUILD_BINARY), 'build is binary from binary'); set_build_type_from_targets('clean,binary-indep', '--targets=clean,binary-indep', no_check => 1); ok(build_is(BUILD_SOURCE | BUILD_ARCH_INDEP), 'build source,all is source,all'); -ok(!build_is(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all is not source,any'); +ok(! build_is(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all is not source,any'); ok(build_has_any(BUILD_SOURCE), 'build source,all has_any source'); ok(build_has_any(BUILD_ARCH_INDEP), 'build source,all has_any any'); ok(build_has_none(BUILD_DEFAULT), 'build source,all has_none default'); ok(build_has_none(BUILD_ARCH_DEP), 'build source,all has_none any'); -ok(!build_has_all(BUILD_BINARY), 'build source,all not has_all binary'); -ok(!build_has_all(BUILD_SOURCE | BUILD_ARCH_DEP), +ok(! build_has_all(BUILD_BINARY), 'build source,all not has_all binary'); +ok(! build_has_all(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all not has_all source,any'); -ok(!build_has_all(BUILD_FULL), 'build source,all has_all full'); +ok(! build_has_all(BUILD_FULL), 'build source,all has_all full'); set_build_type(BUILD_BINARY, '--build=binary', no_check => 1); ok(build_is(BUILD_BINARY), 'build binary is binary'); diff --git a/scripts/t/Dpkg_Checksums.t b/scripts/t/Dpkg_Checksums.t index 101bf5992..cf7b5f3ce 100644 --- a/scripts/t/Dpkg_Checksums.t +++ b/scripts/t/Dpkg_Checksums.t @@ -121,7 +121,7 @@ test_checksums($ck); ok($ck->has_file('data-2'), 'To be removed file is present'); $ck->remove_file('data-2'); -ok(!$ck->has_file('data-2'), 'Remove file is not present'); +ok(! $ck->has_file('data-2'), 'Remove file is not present'); # Check add_from_control() my $ctrl; diff --git a/scripts/t/Dpkg_Control_Fields.t b/scripts/t/Dpkg_Control_Fields.t index f95aaafa9..7ad013fa5 100644 --- a/scripts/t/Dpkg_Control_Fields.t +++ b/scripts/t/Dpkg_Control_Fields.t @@ -479,7 +479,7 @@ is(field_get_default_value('Priority'), 'optional', is(field_capitalize('invented-field'), 'Invented-Field', 'Field Invented-Field capitalization'); -ok(!field_is_official('invented-field'), +ok(! field_is_official('invented-field'), 'Field Invented-Field is not official'); my %known_fields; @@ -512,7 +512,7 @@ foreach my $type (sort keys %fields) { ok(field_is_allowed_in($field, $type), "Field $field allowed for type $fields{$type}->{name}"); } else { - ok(!field_is_allowed_in($field, $type), + ok(! field_is_allowed_in($field, $type), "Field $field not allowed for type $fields{$type}->{name}"); } } diff --git a/scripts/t/Dpkg_Path.t b/scripts/t/Dpkg_Path.t index 81601517d..a14dbd99f 100644 --- a/scripts/t/Dpkg_Path.t +++ b/scripts/t/Dpkg_Path.t @@ -52,7 +52,7 @@ is(resolve_symlink("$tmpdir/here/cbis"), "$tmpdir/here/a/b/c", 'resolve_symlink' is(resolve_symlink("$tmpdir/tmp"), '/this/does/not/exist', 'resolve_symlink absolute'); is(resolve_symlink("$tmpdir/here"), $tmpdir, 'resolve_symlink .'); -ok(!check_files_are_the_same("$tmpdir/here", $tmpdir), 'Symlink is not the same!'); +ok(! check_files_are_the_same("$tmpdir/here", $tmpdir), 'Symlink is not the same!'); ok(check_files_are_the_same("$tmpdir/here/a", "$tmpdir/a"), 'Same directory'); sub gen_hier_travbase { diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t index 0d0914829..c7f18a405 100644 --- a/scripts/t/Dpkg_Shlibs.t +++ b/scripts/t/Dpkg_Shlibs.t @@ -93,16 +93,16 @@ is_deeply(\@librarypaths, [ qw( my $obj; $obj = load_objdump_obj('dbd-pg'); -ok(!$obj->is_public_library(), 'Pg.so is not a public library'); -ok(!$obj->is_executable(), 'Pg.so is not an executable'); +ok(! $obj->is_public_library(), 'Pg.so is not a public library'); +ok(! $obj->is_executable(), 'Pg.so is not an executable'); $obj = load_objdump_obj('ls'); -ok(!$obj->is_public_library(), 'ls is not a public library'); +ok(! $obj->is_public_library(), 'ls is not a public library'); ok($obj->is_executable(), 'ls is an executable'); my $sym = $obj->get_symbol('optarg@GLIBC_2.0'); ok($sym, 'optarg@GLIBC_2.0 exists'); -ok(!$sym->{defined}, 'R_*_COPY relocations are taken into account'); +ok(! $sym->{defined}, 'R_*_COPY relocations are taken into account'); # Non-regression test for #506139 $obj = load_objdump_obj('space'); @@ -516,7 +516,7 @@ is($io_data, # without versions and with visibility attribute) $obj = load_objdump_obj('glib-ia64'); ok($obj->is_public_library(), 'glib-ia64 is a public library'); -ok(!$obj->is_executable(), 'glib-ia64 is not an executable'); +ok(! $obj->is_executable(), 'glib-ia64 is not an executable'); $sym = $obj->get_symbol('IA__g_free'); is_deeply($sym, @@ -1051,7 +1051,7 @@ $sym_file->merge_symbols($obj, '100.MISSING'); $pat = $sym_file->lookup_pattern($sym, 'libpatterns.so.1'); @tmp = map { $_->{symbol}->get_symbolname() } $sym_file->get_lost_symbols($sym_file_dup); is_deeply(\@tmp, [], 'no LOST symbols when got rid of patterned optional symbol.'); -ok(!$pat->{deprecated}, 'there are still matches, pattern is not deprecated.'); +ok(! $pat->{deprecated}, 'there are still matches, pattern is not deprecated.'); # Get rid of all private symbols, the pattern should be deprecated. foreach my $tmp (@private_symnames) { @@ -1112,7 +1112,7 @@ is($pat->{minver}, '100.FOUND', is_deeply(\@tmp, [ $pat->get_symbolspec(1) ], 'Previously deprecated pattern with matches is NEW. Matches themselves are not NEW.'); foreach my $sym ($pat->get_pattern_matches()) { - ok(!$sym->{deprecated}, $sym->get_symbolname() . ': not deprecated'); + ok(! $sym->{deprecated}, $sym->get_symbolname() . ': not deprecated'); is($sym->{minver}, '100.FOUND', $sym->get_symbolname() . ': version bumped'); } diff --git a/scripts/t/Dpkg_Version.t b/scripts/t/Dpkg_Version.t index cb8541d12..e75ca0ca8 100644 --- a/scripts/t/Dpkg_Version.t +++ b/scripts/t/Dpkg_Version.t @@ -93,34 +93,34 @@ my $truth = { my $empty = Dpkg::Version->new(''); ok($empty eq '', "Dpkg::Version->new('') eq ''"); ok($empty->as_string() eq '', "Dpkg::Version->new('')->as_string() eq ''"); -ok(!$empty->is_valid(), 'empty version is invalid'); +ok(! $empty->is_valid(), 'empty version is invalid'); $empty = Dpkg::Version->new('-0'); ok($empty eq '', "Dpkg::Version->new('-0') eq '-0'"); ok($empty->as_string() eq '-0', "Dpkg::Version->new('-0')->as_string() eq '-0'"); -ok(!$empty->is_valid(), 'empty upstream version is invalid'); +ok(! $empty->is_valid(), 'empty upstream version is invalid'); $empty = Dpkg::Version->new('0:-0'); ok($empty eq '0:-0', "Dpkg::Version->new('0:-0') eq '0:-0'"); ok($empty->as_string() eq '0:-0', "Dpkg::Version->new('0:-0')->as_string() eq '0:-0'"); -ok(!$empty->is_valid(), 'empty upstream version with epoch is invalid'); +ok(! $empty->is_valid(), 'empty upstream version with epoch is invalid'); $empty = Dpkg::Version->new(':1.0'); ok($empty eq ':1.0', "Dpkg::Version->new(':1.0') eq ':1.0'"); ok($empty->as_string() eq ':1.0', "Dpkg::Version->new(':1.0')->as_string() eq ':1.0'"); -ok(!$empty->is_valid(), 'empty epoch is invalid'); +ok(! $empty->is_valid(), 'empty epoch is invalid'); $empty = Dpkg::Version->new('1.0-'); ok($empty eq '1.0-', "Dpkg::Version->new('1.0-') eq '1.0-'"); ok($empty->as_string() eq '1.0-', "Dpkg::Version->new('1.0-')->as_string() eq '1.0-'"); -ok(!$empty->is_valid(), 'empty revision is invalid'); +ok(! $empty->is_valid(), 'empty revision is invalid'); my $ver = Dpkg::Version->new('10a:5.2'); -ok(!$ver->is_valid(), 'bad epoch is invalid'); -ok(!$ver, 'bool eval of invalid leads to false'); +ok(! $ver->is_valid(), 'bad epoch is invalid'); +ok(! $ver, 'bool eval of invalid leads to false'); ok($ver eq '10a:5.2', 'invalid still same string 1/2'); $ver = Dpkg::Version->new('5.2@3-2'); ok($ver eq '5.2@3-2', 'invalid still same string 2/2'); -ok(!$ver->is_valid(), 'illegal character is invalid'); +ok(! $ver->is_valid(), 'illegal character is invalid'); $ver = Dpkg::Version->new('foo5.2'); -ok(!$ver->is_valid(), 'version does not start with digit 1/2'); +ok(! $ver->is_valid(), 'version does not start with digit 1/2'); $ver = Dpkg::Version->new('0:foo5.2'); -ok(!$ver->is_valid(), 'version does not start with digit 2/2'); +ok(! $ver->is_valid(), 'version does not start with digit 2/2'); # Native and non-native versions $ver = Dpkg::Version->new('1.0'); @@ -130,9 +130,9 @@ ok($ver->__is_native(), 'upstream version w/ epoch is native'); $ver = Dpkg::Version->new('1:1.0:1.0'); ok($ver->__is_native(), 'upstream version w/ epoch and colon is native'); $ver = Dpkg::Version->new('1.0-1'); -ok(!$ver->__is_native(), 'upstream version w/ revision is not native'); +ok(! $ver->__is_native(), 'upstream version w/ revision is not native'); $ver = Dpkg::Version->new('1.0-1.0-1'); -ok(!$ver->__is_native(), 'upstream version w/ dash and revision is not native'); +ok(! $ver->__is_native(), 'upstream version w/ dash and revision is not native'); # Comparisons foreach my $case (@tests) { @@ -157,13 +157,13 @@ foreach my $case (@tests) { ok(dpkg_vercmp($a, $op, $b), "dpkg --compare-versions -- $a $op $b => true"); } } else { - ok(!version_compare_relation($a, $norm_op, $b), "$a $op $b => false"); - ok(!obj_vercmp($va, $op, $vb), "Dpkg::Version($a) $op Dpkg::Version($b) => false"); + ok(! version_compare_relation($a, $norm_op, $b), "$a $op $b => false"); + ok(! obj_vercmp($va, $op, $vb), "Dpkg::Version($a) $op Dpkg::Version($b) => false"); SKIP: { skip 'dpkg not available', 1 if not $have_dpkg; - ok(!dpkg_vercmp($a, $op, $b), "dpkg --compare-versions -- $a $op $b => false"); + ok(! dpkg_vercmp($a, $op, $b), "dpkg --compare-versions -- $a $op $b => false"); } } } diff --git a/utils/t/update_alternatives.t b/utils/t/update_alternatives.t index 163a35fd6..b1708f964 100644 --- a/utils/t/update_alternatives.t +++ b/utils/t/update_alternatives.t @@ -253,7 +253,7 @@ sub check_link { sub check_no_link { my ($link, $msg) = @_; lstat($link); - ok(!-e _, "$msg: $link still exists."); + ok(! -e _, "$msg: $link still exists."); ok(1, 'fake test'); # Same number of tests as check_link } @@ -748,8 +748,8 @@ $choices[0]{slaves}[0]{path} = $old_path; cleanup(); system("touch $main_link $bindir/slave1"); install_choice(0); -ok(!-l $main_link, 'install preserves files that should be links'); -ok(!-l "$bindir/slave1", 'install preserves files that should be slave links'); +ok(! -l $main_link, 'install preserves files that should be links'); +ok(! -l "$bindir/slave1", 'install preserves files that should be slave links'); remove_choice(0); ok(-f $main_link, 'removal keeps real file installed as master link'); ok(-f "$bindir/slave1", 'removal keeps real files installed as slave links'); @@ -761,22 +761,22 @@ cleanup(); system("touch $main_link $bindir/slave2"); install_choice(0); install_choice(1); -ok(!-l $main_link, 'inactive install preserves files that should be links'); -ok(!-l "$bindir/slave2", 'inactive install preserves files that should be slave links'); +ok(! -l $main_link, 'inactive install preserves files that should be links'); +ok(! -l "$bindir/slave2", 'inactive install preserves files that should be slave links'); ok(-f $main_link, 'inactive install keeps real file installed as master link'); ok(-f "$bindir/slave2", 'inactive install keeps real files installed as slave links'); set_choice(1); -ok(!-l $main_link, 'manual switching preserves files that should be links'); -ok(!-l "$bindir/slave2", 'manual switching preserves files that should be slave links'); +ok(! -l $main_link, 'manual switching preserves files that should be links'); +ok(! -l "$bindir/slave2", 'manual switching preserves files that should be slave links'); ok(-f $main_link, 'manual switching keeps real file installed as master link'); ok(-f "$bindir/slave2", 'manual switching keeps real files installed as slave links'); remove_choice(1); -ok(!-l $main_link, 'auto switching preserves files that should be links'); -ok(!-l "$bindir/slave2", 'auto switching preserves files that should be slave links'); +ok(! -l $main_link, 'auto switching preserves files that should be links'); +ok(! -l "$bindir/slave2", 'auto switching preserves files that should be slave links'); ok(-f $main_link, 'auto switching keeps real file installed as master link'); ok(-f "$bindir/slave2", 'auto switching keeps real files installed as slave links'); remove_all_choices(params => [ '--force' ]); -ok(!-e "$bindir/slave2", 'forced removeall drops real files installed as slave links'); +ok(! -e "$bindir/slave2", 'forced removeall drops real files installed as slave links'); # test management of pre-existing files #3 cleanup(); @@ -784,17 +784,17 @@ system("touch $main_link $bindir/slave2"); install_choice(0); install_choice(1); remove_choice(0); -ok(!-l $main_link, 'removal + switching preserves files that should be links'); -ok(!-l "$bindir/slave2", 'removal + switching preserves files that should be slave links'); +ok(! -l $main_link, 'removal + switching preserves files that should be links'); +ok(! -l "$bindir/slave2", 'removal + switching preserves files that should be slave links'); ok(-f $main_link, 'removal + switching keeps real file installed as master link'); ok(-f "$bindir/slave2", 'removal + switching keeps real files installed as slave links'); install_choice(0); -ok(!-l $main_link, 'install + switching preserves files that should be links'); -ok(!-l "$bindir/slave2", 'install + switching preserves files that should be slave links'); +ok(! -l $main_link, 'install + switching preserves files that should be links'); +ok(! -l "$bindir/slave2", 'install + switching preserves files that should be slave links'); ok(-f $main_link, 'install + switching keeps real file installed as master link'); ok(-f "$bindir/slave2", 'install + switching keeps real files installed as slave links'); set_choice(1, params => [ '--force' ]); -ok(!-e "$bindir/slave2", 'forced switching w/o slave drops real files installed as slave links'); +ok(! -e "$bindir/slave2", 'forced switching w/o slave drops real files installed as slave links'); check_choice(1, 'manual', 'set --force replaces files with links'); # check disappearence of obsolete slaves (#916799) -- Dpkg.Org's dpkg

