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

[Git][ftp-team/dak][master] 4 commits: admin: Support extracting the codename + suite_name via s-cfg get



Title: GitLab

Ansgar pushed to branch master at Debian FTP Team / dak

Commits:

3 changed files:

Changes:

  • config/debian-security/cron.buildd
    ... ... @@ -21,17 +21,9 @@ trigger_wb() {
    21 21
         local send=
    
    22 22
     
    
    23 23
         case "${dist}" in
    
    24
    -        oldoldstable)
    
    25
    -            send=jessie
    
    26
    -            ;;
    
    27
    -        oldstable)
    
    28
    -            send=stretch
    
    29
    -            ;;
    
    30
    -        stable)
    
    31
    -            send=buster
    
    32
    -            ;;
    
    33
    -        testing-security)
    
    34
    -            send=bullseye
    
    24
    +        oldoldstable|oldstable|stable|testing-security)
    
    25
    +            send=$(dak admin suite-config get-value "${dist}" codename)
    
    26
    +            send=${send%-security}
    
    35 27
                 ;;
    
    36 28
             *)
    
    37 29
                 send=unknown
    

  • config/debian-security/daily.functions
    ... ... @@ -11,10 +11,9 @@ function fix_overrides() {
    11 11
     
    
    12 12
         for suite in oldoldstable oldstable stable testing; do
    
    13 13
             case $suite in
    
    14
    -            oldoldstable) override_suite=jessie ;;
    
    15
    -            oldstable) override_suite=stretch  ;;
    
    16
    -            stable)    override_suite=buster  ;;
    
    17
    -            testing)   override_suite=bullseye ;;
    
    14
    +            oldoldstable|oldstable|stable|testing)
    
    15
    +                override_suite=$(dak admin suite-config get-value "${suite}" codename)
    
    16
    +                ;;
    
    18 17
                 *) echo "Unknown suite type ($suite)"; exit 1;;
    
    19 18
             esac
    
    20 19
             for component in $components; do
    

  • dak/admin.py
    ... ... @@ -737,6 +737,7 @@ ALLOWED_SUITE_CONFIGS = {
    737 737
         'changelog_url': str,
    
    738 738
         # TODO: Create a validator/parser for this
    
    739 739
         'checksums': SUITE_CONFIG_READ_ONLY,
    
    740
    +    'codename': SUITE_CONFIG_READ_ONLY,
    
    740 741
         'description': str,
    
    741 742
         'include_long_description': utils.parse_boolean_from_user,
    
    742 743
         'indices_compression': SUITE_CONFIG_READ_ONLY,
    
    ... ... @@ -746,12 +747,13 @@ ALLOWED_SUITE_CONFIGS = {
    746 747
         'origin': str,
    
    747 748
         'priority': int,
    
    748 749
         'signingkeys': SUITE_CONFIG_READ_ONLY,
    
    750
    +    'suite_name': SUITE_CONFIG_READ_ONLY,
    
    749 751
         'untouchable': utils.parse_boolean_from_user,
    
    750 752
         'validtime': int,
    
    751 753
     }
    
    752 754
     
    
    753 755
     
    
    754
    -def __suite_config_get(d, args):
    
    756
    +def __suite_config_get(d, args, direct_value=False):
    
    755 757
         die_arglen(args, 4, "E: suite-config get needs the name of a configuration")
    
    756 758
         session = d.session()
    
    757 759
         suite_name = args[2]
    
    ... ... @@ -760,7 +762,10 @@ def __suite_config_get(d, args):
    760 762
             if arg not in ALLOWED_SUITE_CONFIGS:
    
    761 763
                 die("Unknown (or unsupported) suite configuration variable")
    
    762 764
             value = getattr(suite, arg)
    
    763
    -        print("%s=%s" % (arg, value))
    
    765
    +        if direct_value:
    
    766
    +            print(value)
    
    767
    +        else:
    
    768
    +            print("%s=%s" % (arg, value))
    
    764 769
     
    
    765 770
     
    
    766 771
     def __suite_config_set(d, args):
    
    ... ... @@ -823,8 +828,13 @@ def suite_config(command):
    823 828
         die_arglen(args, 2, "E: suite-config needs a command")
    
    824 829
         mode = args[1].lower()
    
    825 830
     
    
    826
    -    if mode == 'get':
    
    827
    -        __suite_config_get(d, args)
    
    831
    +    if mode in {'get', 'get-value'}:
    
    832
    +        direct_value = False
    
    833
    +        if mode == 'get-value':
    
    834
    +            direct_value = True
    
    835
    +            if len(args) > 4:
    
    836
    +                die("E: get-value must receive exactly one key to lookup")
    
    837
    +        __suite_config_get(d, args, direct_value=direct_value)
    
    828 838
         elif mode == 'set':
    
    829 839
             __suite_config_set(d, args)
    
    830 840
         elif mode == 'list':
    


  • Reply to: