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

[Git][ftp-team/dak][master] 2 commits: Prevent trailing commas from breaking dak rm logic



Title: GitLab

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

Commits:

  • cc816f42
    by Paul Tagliamonte at 2025-09-08T23:59:51-04:00
    Prevent trailing commas from breaking dak rm logic
    
    This is all documented in #1114691 in the BTS
    
    When we do a dak rm, dak will load the archive dependencies to detect
    breakage. It does this by SELECT-ing source_metadata (basically, the
    keys from a parsed deb822 dsc), source (the source version itself),
    and newest_src_association (newest source for a sutie).
    
    This means that sources containing both Build-Depends and
    Build-Depends-Indep, and the first value to be returned contains a
    trailing space, we wind up with two commas.
    
    I'm sure everyone's guessed by now, but just to spell it out, While
    "foo," is accepted by the Python apt_pkg module, "foo,, bar" is not.
    
    Since ",," is universally regarded as broken, we don't need to worry
    about multiple trailing commas, so a straight replace should solve this
    issue, even if it's a bit .... inelegant
    
  • a476780f
    by Joerg Jaspert at 2025-09-18T20:47:10+00:00
    Merge branch 'paultag/replace' into 'master'
    
    Prevent trailing commas from breaking dak rm logic
    
    See merge request ftp-team/dak!296

1 changed file:

Changes:

  • daklib/utils.py
    ... ... @@ -1308,7 +1308,7 @@ def check_reverse_depends(
    1308 1308
         }
    
    1309 1309
         statement = sql.text(
    
    1310 1310
             """
    
    1311
    -        SELECT s.source, string_agg(sm.value, ', ') as build_dep
    
    1311
    +        SELECT s.source, replace(string_agg(trim(sm.value), ', '), ',,', ',') as build_dep
    
    1312 1312
                FROM source s
    
    1313 1313
                JOIN source_metadata sm ON s.id = sm.src_id
    
    1314 1314
                WHERE s.id in
    


  • Reply to: