[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-extras-commits
Subject:    smani pushed to devscripts (f21). "Fix licensecheck incorrectly detecting mime strings such as text/
From:       notifications () fedoraproject ! org
Date:       2015-07-31 22:06:42
Message-ID: 20150731220642.A461361C494D () bastion01 ! phx2 ! fedoraproject ! org
[Download RAW message or body]

From 81b2b4bba40c521e1812613d1bc20829b136f560 Mon Sep 17 00:00:00 2001
From: Sandro Mani <manisandro@gmail.com>
Date: Sat, 1 Aug 2015 00:05:29 +0200
Subject: Fix licensecheck incorrectly detecting mime strings such as
 text/x-c++ as a binary file (#1249227)


diff --git a/devscripts.spec b/devscripts.spec
index 95a272a..9a9aba4 100644
--- a/devscripts.spec
+++ b/devscripts.spec
@@ -1,6 +1,6 @@
 Name:           devscripts
 Version:        2.15.6
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Scripts for Debian Package maintainers
 
 License:        GPLv2+
@@ -12,6 +12,8 @@ Patch0:         devscripts_docbook.patch
 Patch1:         devscripts_install-layout.patch
 # Install some additional man pages
 Patch2:         devscripts_install-man.patch
+# Fix licensecheck incorrectly detecting mime strings such as text/x-c++ as a binary \
file +Patch3:         devscripts_licensecheck.patch
 
 # rpmdevtools < 8.4 bundled some of the scripts provided by this package
 Conflicts:      rpmdevtools < 8.4
@@ -108,6 +110,7 @@ This package contains the following subset of the devscripts \
scripts:  %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
@@ -159,6 +162,9 @@ ln -s %{_mandir}/man1/pts-subscribe.1.gz \
%{buildroot}%{_mandir}/man1/pts-unsubsc  
 
 %changelog
+* Sat Aug 01 2015 Sandro Mani <manisandro@gmail.com> - 2.15.6-2
+- Fix licensecheck incorrectly detecting mime strings such as text/x-c++ as a binary \
file (#1249227) +
 * Wed Jul 29 2015 Sandro Mani <manisandro@gmail.com> - 2.15.6-1
 - Update to 2.15.6
 
diff --git a/devscripts_licensecheck.patch b/devscripts_licensecheck.patch
index 0a7fbf7..0beabab 100644
--- a/devscripts_licensecheck.patch
+++ b/devscripts_licensecheck.patch
@@ -1,23 +1,12 @@
-diff -rupN devscripts-2.15.5/scripts/licensecheck.pl \
                devscripts-2.15.5-new/scripts/licensecheck.pl
---- devscripts-2.15.5/scripts/licensecheck.pl	2015-06-11 05:14:09.000000000 +0200
-+++ devscripts-2.15.5-new/scripts/licensecheck.pl	2015-07-09 19:49:18.917819318 \
                +0200
-@@ -321,13 +321,15 @@ while (@files) {
-     my %copyrights;
- 
+diff -rupN devscripts-2.15.6/scripts/licensecheck.pl \
devscripts-2.15.6-new/scripts/licensecheck.pl +--- \
devscripts-2.15.6/scripts/licensecheck.pl	2015-07-28 05:15:12.000000000 +0200 ++++ \
devscripts-2.15.6-new/scripts/licensecheck.pl	2015-08-01 00:02:21.376875372 +0200 +@@ \
                -323,7 +323,7 @@ while (@files) {
      # Encode::Guess does not work well, use good old file command to get file \
                encoding
--    my $mime = `file -bi $file`;
-+    my $mime = `file --brief --mime --dereference $file`;
+     my $mime = `file --brief --mime --dereference $file`;
      my $charset ;
--    if ($mime =~ /charset=([\w-]+)/) {
--        $charset = $1;
-+    if ($mime =~ m!text/\w+; charset=([\w-]+)!) {
-+	$charset = $1;
+-    if ($mime =~ m!(?:text/[\w-]+|application/xml); charset=([\w-]+)!) {
++    if ($mime =~ m!(?:text/[\w-\+]+|application/xml); charset=([\w-]+)!) {
+ 	$charset = $1;
      }
      else {
--        die "can't find charset of $file\n";
-+	chomp $mime;
-+	warn "$0 warning: cannot parse file '$file' with mime type '$mime'\n";
-+	next;
-     }
- 
-     open (my $F, '<' ,$file) or die "Unable to access $file\n";
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/devscripts.git/commit/?h=f21&id=81b2b4bba40c521e1812613d1bc20829b136f560



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic