[firmware-free] 17/19: check_upstream.py: Reimplement check for unpackaged firmware

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun May 22 22:54:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository firmware-free.

commit 48bbd5768221baebdeb752f2a985ca8e9ec2de92
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Oct 18 06:01:34 2015 +0100

    check_upstream.py: Reimplement check for unpackaged firmware
    
    Now that we use an upstream tarball, checking for the presence of a
    file isn't enough - we need to compare with the configuration.
    
    [bwh: Cherry-picked from firmware-nonfree commit
     1030a0b2f909690c4884ad7c85950ba3c8913a13]
---
 debian/bin/check_upstream.py | 19 +++++++++++++------
 debian/changelog             |  1 +
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/debian/bin/check_upstream.py b/debian/bin/check_upstream.py
index bc8db3c..606addb 100755
--- a/debian/bin/check_upstream.py
+++ b/debian/bin/check_upstream.py
@@ -52,6 +52,10 @@ def main(source_dir='.'):
     over_dirs = ['debian/config/' + package for
                  package in config['base',]['packages']]
     exclusions = config['upstream',]['exclude']
+    packaged_files = {}
+    for package in config['base',]['packages']:
+        for filename in config['base', package]['files']:
+            packaged_files[filename] = package
 
     for section in FirmwareWhence(open(os.path.join(source_dir, 'WHENCE'))):
         dist_state = check_section(section)
@@ -59,9 +63,15 @@ def main(source_dir='.'):
             if dist_state == DistState.free:
                 if not any(fnmatch.fnmatch(file_info.binary, exclusion)
                            for exclusion in exclusions):
-                    update_file(source_dir, over_dirs, file_info.binary)
-                    for source in file_info.source:
-                        update_file(source_dir, over_dirs, source)
+                    if file_info.binary in packaged_files:
+                        update_file(source_dir, over_dirs, file_info.binary)
+                        for source in file_info.source:
+                            update_file(source_dir, over_dirs, source)
+                    elif os.path.isfile(filename):
+                        print('I: %s is not included in any binary package' %
+                              file_info.binary)
+                    else:
+                        print('I: %s: could be added' % file_info.binary)
             elif dist_state == DistState.non_free:
                 if os.path.isfile(file_info.binary):
                     print('W: %s appears to be non-free' %
@@ -80,9 +90,6 @@ def update_file(source_dir, over_dirs, filename):
                 if not filecmp.cmp(source_file, over_file, True):
                     print('I: %s: changed' % filename)
                 return
-    if not os.path.isfile(filename):
-        print('I: %s: could be added' % filename)
-        return
 
 if __name__ == '__main__':
     main(*sys.argv[1:])
diff --git a/debian/changelog b/debian/changelog
index 1b28a66..ea85328 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ firmware-free (20130117-1) UNRELEASED; urgency=medium
   * check_upstream.py: Report possibly non-free or undistributable files that
     are not excluded
   * check_upstream.py: Recognise GPLv3 and GPL dual-licenced files
+  * check_upstream.py: Reimplement check for unpackaged firmware
 
  -- Ben Hutchings <ben at decadent.org.uk>  Sun, 16 Aug 2015 18:43:29 +0200
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/firmware-free.git



More information about the Kernel-svn-changes mailing list