[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.7-19-gd11d4ab



The following commit has been merged in the master branch:
commit 5bcbffc62ceea47bd15a53146704a68953f89042
Author: Felix Geyer <debfx-pkg@fobos.de>
Date:   Wed May 23 14:57:18 2012 +0200

    Check icon sizes match within +/- 2px
    
    Only emit icon-size-and-directory-name-mismatch if the size differs by
    more than 2px
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/files b/checks/files
index 71a4232..a801adf 100644
--- a/checks/files
+++ b/checks/files
@@ -918,8 +918,8 @@ foreach my $file (@{$info->sorted_index}) {
         tag 'python-module-in-wrong-location', @correction if (@correction);
     }
 
-    if ($file =~ m,/icons/[^/]+/(\d+x\d+)/(?!animations/).*\.png$,) {
-        my $dsize = $1;
+    if ($file =~ m,/icons/[^/]+/(\d+)x(\d+)/(?!animations/).*\.png$,) {
+        my ($dwidth, $dheight) = ($1, $2);
         my $path;
         if ($index_info->{type} =~ m/^l/) {
             $path = resolve_pkg_path(dirname($file), $link);
@@ -928,9 +928,11 @@ foreach my $file (@{$info->sorted_index}) {
         }
         my $fileinfo = $info->file_info->{$path};
         if ($fileinfo && $fileinfo =~ m/,\s*(\d+)\s*x\s*(\d+)\s*,/) {
-            my $fsize = $1.'x'.$2;
-            tag 'icon-size-and-directory-name-mismatch', $file, $fsize
-                unless ($dsize eq $fsize);
+            my ($fwidth, $fheight) = ($1, $2);
+            my $width_delta = abs($dwidth - $fwidth);
+            my $height_delta = abs($dheight - $fheight);
+            tag 'icon-size-and-directory-name-mismatch', $file, $fwidth.'x'.$fheight
+                unless ($width_delta <= 2 && $height_delta <= 2);
         }
     }
 
diff --git a/t/tests/files-general/debian/debian/install b/t/tests/files-general/debian/debian/install
index 4ce9d68..4b2bbb1 100644
--- a/t/tests/files-general/debian/debian/install
+++ b/t/tests/files-general/debian/debian/install
@@ -1,6 +1,7 @@
 lintian-16x16.png usr/share/apps/lintian/icons/hicolor/22x22
 lintian-16x16.png usr/share/icons/hicolor/22x22/apps
 lintian-22x22.png usr/share/apps/lintian/icons/hicolor/22x22
+lintian-22x22.png usr/share/apps/lintian/icons/hicolor/20x20
 lintian-16x16.png usr/share/doc/lintian/
 lintian-22x22.png usr/share/games/icons/hicolor/22x22
 lintian-16x16.png usr/share/icons/hicolor/scalable/apps

-- 
Debian package checker


Reply to: