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=5778adb81fee53455d956cf7d7ecbe3f78b39d05

commit 5778adb81fee53455d956cf7d7ecbe3f78b39d05
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Sep 13 04:15:25 2025 +0200

    dselect: Use foreach loops instead of C-style loops in method scripts
    
    Changelog: internal
    Warned-by: perlcritic
    Fixes: ControlStructures::ProhibitCStyleForLoops
---
 dselect/methods/file/install.sh  | 2 +-
 dselect/methods/media/install.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dselect/methods/file/install.sh b/dselect/methods/file/install.sh
index 3190887b9..6d73adb3b 100755
--- a/dselect/methods/file/install.sh
+++ b/dselect/methods/file/install.sh
@@ -56,7 +56,7 @@ while true; do
        die "internal error - no package" if length($package) == 0;
        die "internal error - no filename" if not @filename;
        @invoke = (); $| = 1;
-       for ($i = 0; $i <= $#filename; $i++) {
+        foreach my $i (0 .. $#filename) {
                $ppart = $i+1;
                print "Looking for part $ppart of $package ... ";
                if (-f "$binaryprefix$filename[$i]") {
diff --git a/dselect/methods/media/install.sh b/dselect/methods/media/install.sh
index 133e2bb5d..4ff0f5249 100755
--- a/dselect/methods/media/install.sh
+++ b/dselect/methods/media/install.sh
@@ -110,7 +110,7 @@ INFO
                exit(1);
        }
        @invoke = (); $| =1;
-       for ($i = 0; $i <= $#filename; $i++) {
+        foreach my $i (0 .. $#filename) {
                $ppart = $i+1;
                print "Looking for part $ppart of $package ... ";
                if (-f "$binaryprefix$filename[$i]") {

-- 
Dpkg.Org's dpkg

Reply via email to