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

[Git][ftp-team/dak][deploy] 4 commits: fix(Changes): fix comparison when `Source` is missing



Title: GitLab

Joerg Jaspert pushed to branch deploy at Debian FTP Team / dak

Commits:

  • 971b4236
    by Ansgar at 2024-10-07T11:58:24+02:00
    fix(Changes): fix comparison when `Source` is missing
    
    Previously `__lt__` raised an exception:
    
    ```
    TypeError: '<' not supported between instances of 'NoneType' and 'str'
    ```
    
    Just use an empty string to avoid `None`. This is okay as the key is
    only used for sorting.
    
  • 436db756
    by Joerg Jaspert at 2024-10-30T23:56:25+01:00
    fix: if someone uploads way too many files, limit amount of processed changes
    
    currently hardcoded, could make it an option to p-u
    
  • fe414563
    by Joerg Jaspert at 2024-10-31T00:07:48+01:00
    Dont use numpy, use random.sample
    
  • 80f7328c
    by Joerg Jaspert at 2024-10-31T00:19:09+01:00
    Merge branch 'master' into deploy
    
    * master:
      Dont use numpy, use random.sample
      fix: if someone uploads way too many files, limit amount of processed changes
      fix(Changes): fix comparison when `Source` is missing
    

2 changed files:

Changes:

  • dak/process_upload.py
    ... ... @@ -576,6 +576,11 @@ def main():
    576 576
                 utils.warn("Directory provided so ignoring files given on command line")
    
    577 577
     
    
    578 578
             changes_files = utils.get_changes_files(cnf["Dinstall::Options::Directory"])
    
    579
    +        # FIXME: quick hack to NOT have p-u run for ages, if some binnmu fun uploads thousands of changes
    
    580
    +        # might want to make the number configurable at some point
    
    581
    +        if len(changes_files) > 200:
    
    582
    +            import random
    
    583
    +            changes_files = random.sample(changes_files, k=200)
    
    579 584
             Logger.log(["Using changes files from directory", cnf["Dinstall::Options::Directory"], len(changes_files)])
    
    580 585
         elif not len(changes_files) > 0:
    
    581 586
             utils.fubar("No changes files given and no directory specified")
    

  • daklib/upload.py
    ... ... @@ -401,7 +401,7 @@ class Changes:
    401 401
             to the filename (this should really never happen).
    
    402 402
             """
    
    403 403
             return (
    
    404
    -            self.changes.get('Source'),
    
    404
    +            self.changes.get('Source', ''),
    
    405 405
                 AptVersion(self.changes.get('Version', '')),
    
    406 406
                 not self.sourceful,
    
    407 407
                 self.filename
    


  • Reply to: