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

[Git][ftp-team/dak][master] pass filename instead of file descriptor to `DebFile`



Title: GitLab

Ansgar pushed to branch master at Debian FTP Team / dak

Commits:

3 changed files:

Changes:

  • dak/examine_package.py
    ... ... @@ -256,13 +256,12 @@ def read_control(filename):
    256 256
         maintainer = ''
    
    257 257
         arch = ''
    
    258 258
     
    
    259
    -    with open(filename) as deb_file:
    
    260
    -        try:
    
    261
    -            extracts = utils.deb_extract_control(deb_file)
    
    262
    -            control = apt_pkg.TagSection(extracts)
    
    263
    -        except:
    
    264
    -            print(formatted_text("can't parse control info"))
    
    265
    -            raise
    
    259
    +    try:
    
    260
    +        extracts = utils.deb_extract_control(filename)
    
    261
    +        control = apt_pkg.TagSection(extracts)
    
    262
    +    except:
    
    263
    +        print(formatted_text("can't parse control info"))
    
    264
    +        raise
    
    266 265
     
    
    267 266
         control_keys = list(control.keys())
    
    268 267
     
    

  • daklib/dbconn.py
    ... ... @@ -431,8 +431,7 @@ class DBBinary(ORMObject):
    431 431
             '''
    
    432 432
             from . import utils
    
    433 433
             fullpath = self.poolfile.fullpath
    
    434
    -        with open(fullpath, 'r') as deb_file:
    
    435
    -            return utils.deb_extract_control(deb_file)
    
    434
    +        return utils.deb_extract_control(fullpath)
    
    436 435
     
    
    437 436
         def read_control_fields(self):
    
    438 437
             '''
    

  • daklib/utils.py
    ... ... @@ -934,9 +934,9 @@ def parse_wnpp_bug_file(file="/srv/ftp-master.debian.org/scripts/masterfiles/wnp
    934 934
     ################################################################################
    
    935 935
     
    
    936 936
     
    
    937
    -def deb_extract_control(fh):
    
    937
    +def deb_extract_control(path):
    
    938 938
         """extract DEBIAN/control from a binary package"""
    
    939
    -    return apt_inst.DebFile(fh).control.extractdata("control")
    
    939
    +    return apt_inst.DebFile(path).control.extractdata("control")
    
    940 940
     
    
    941 941
     ################################################################################
    
    942 942
     
    


  • Reply to: