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=3cb1667e634a1177125603ef9e481d60114b2c7e

commit 3cb1667e634a1177125603ef9e481d60114b2c7e
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Dec 28 01:03:44 2022 +0100

    scripts: Cuddle else and elsif
    
    Changelog: internal
---
 scripts/Dpkg/Deps/Simple.pm | 44 +++++++++++++++++++++-----------------------
 scripts/dpkg-scansources.pl | 12 ++++--------
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/scripts/Dpkg/Deps/Simple.pm b/scripts/Dpkg/Deps/Simple.pm
index aa23e7da2..e6ed550b9 100644
--- a/scripts/Dpkg/Deps/Simple.pm
+++ b/scripts/Dpkg/Deps/Simple.pm
@@ -278,45 +278,43 @@ sub _arch_is_superset {
     my $p_arch_neg = defined $p and $p->[0] =~ /^!/;
     my $q_arch_neg = defined $q and $q->[0] =~ /^!/;
 
-    # If "p" has no arches, it is a superset of q and we should fall through
-    # to the version check.
     if (not defined $p) {
+        # If "p" has no arches, it is a superset of q and we should fall 
through
+        # to the version check.
         return 1;
-    }
-    # If q has no arches, it is a superset of p and there are no useful
-    # implications.
-    elsif (not defined $q) {
+    } elsif (not defined $q) {
+        # If q has no arches, it is a superset of p and there are no useful
+        # implications.
         return 0;
-    }
-    # Both have arches.  If neither are negated, we know nothing useful
-    # unless q is a subset of p.
-    elsif (not $p_arch_neg and not $q_arch_neg) {
+    } elsif (not $p_arch_neg and not $q_arch_neg) {
+        # Both have arches.  If neither are negated, we know nothing useful
+        # unless q is a subset of p.
+
         my %p_arches = map { $_ => 1 } @{$p};
         my $subset = 1;
         for my $arch (@{$q}) {
             $subset = 0 unless $p_arches{$arch};
         }
         return 0 unless $subset;
-    }
-    # If both are negated, we know nothing useful unless p is a subset of
-    # q (and therefore has fewer things excluded, and therefore is more
-    # general).
-    elsif ($p_arch_neg and $q_arch_neg) {
+    } elsif ($p_arch_neg and $q_arch_neg) {
+        # If both are negated, we know nothing useful unless p is a subset of
+        # q (and therefore has fewer things excluded, and therefore is more
+        # general).
+
         my %q_arches = map { $_ => 1 } @{$q};
         my $subset = 1;
         for my $arch (@{$p}) {
             $subset = 0 unless $q_arches{$arch};
         }
         return 0 unless $subset;
-    }
-    # If q is negated and p isn't, we'd need to know the full list of
-    # arches to know if there's any relationship, so bail.
-    elsif (not $p_arch_neg and $q_arch_neg) {
+    } elsif (not $p_arch_neg and $q_arch_neg) {
+        # If q is negated and p isn't, we'd need to know the full list of
+        # arches to know if there's any relationship, so bail.
         return 0;
-    }
-    # If p is negated and q isn't, q is a subset of p if none of the
-    # negated arches in p are present in q.
-    elsif ($p_arch_neg and not $q_arch_neg) {
+    } elsif ($p_arch_neg and not $q_arch_neg) {
+        # If p is negated and q isn't, q is a subset of p if none of the
+        # negated arches in p are present in q.
+
         my %q_arches = map { $_ => 1 } @{$q};
         my $subset = 1;
         for my $arch (@{$p}) {
diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl
index 465bb5b92..9c55a354b 100755
--- a/scripts/dpkg-scansources.pl
+++ b/scripts/dpkg-scansources.pl
@@ -126,12 +126,10 @@ sub load_override {
        $override{$package}[O_SECTION] = $section;
        if (!defined $maintainer) {
            # do nothing
-       }
-       elsif ($maintainer =~ /^(.*\S)\s*=>\s*(.*)$/) {
+        } elsif ($maintainer =~ /^(.*\S)\s*=>\s*(.*)$/) {
            $override{$package}[O_MAINT_FROM] = [split m{\s*//\s*}, $1];
            $override{$package}[O_MAINT_TO] = $2;
-       }
-       else {
+        } else {
            $override{$package}[O_MAINT_TO] = $maintainer;
        }
     }
@@ -145,8 +143,7 @@ sub load_src_override {
 
     if (defined $user_file) {
        $file = $user_file;
-    }
-    elsif (defined $regular_file) {
+    } elsif (defined $regular_file) {
         my $comp = compression_guess_from_filename($regular_file);
         if (defined($comp)) {
            $file = $regular_file;
@@ -156,8 +153,7 @@ sub load_src_override {
            $file = "$regular_file.src";
         }
         return unless -e $file;
-    }
-    else {
+    } else {
        return;
     }
 

-- 
Dpkg.Org's dpkg

Reply via email to