Changeset dca7ab2 in rtems-source-builder


Ignore:
Timestamp:
Mar 26, 2017, 2:19:18 AM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11
Children:
4b69a14
Parents:
97b4399
Message:

sb: Add the release_path key to the version section in the VERSION file.

A release can specify a custom releaase URL path.

Closes #2952.

Location:
source-builder/sb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/download.py

    r97b4399 rdca7ab2  
    296296            'cvs':  _cvs_parser,
    297297            'file': _file_parser }
     298
     299def set_release_path(release_path, macros):
     300    if release_path is None:
     301        release_path = '%{rtems_release_url}/%{rsb_version}/sources'
     302    macros.define('release_path', release_path)
    298303
    299304def parse_url(url, pathkey, config, opts):
     
    576581    url_bases = opts.urls()
    577582    try:
    578         rtems_release_url_value = config.macros.expand('%{rtems_release_url}/%{rsb_version}/sources')
     583        rtems_release_url_value = config.macros.expand('%{release_path}')
    579584    except:
    580585        rtems_release_url_value = None
  • source-builder/sb/options.py

    r97b4399 rdca7ab2  
    642642
    643643    #
    644     # Load the release hashes
     644    # Load the release settings
    645645    #
    646     version.load_release_hashes(o.defaults)
     646    version.load_release_settings(o.defaults)
    647647
    648648    return o
  • source-builder/sb/version.py

    r97b4399 rdca7ab2  
    2727import sys
    2828
     29import download
    2930import error
    3031import git
     
    5657                import ConfigParser as configparser
    5758            v = configparser.SafeConfigParser()
    58             v.read(path.join(ver, 'VERSION'))
     59            try:
     60                v.read(path.join(ver, 'VERSION'))
     61            except:
     62                raise error.general('Invalid VERSION file')
    5963            return v
    6064    return None
     
    6569    v = _load_released_version_config()
    6670    if v is not None:
    67         _version_str = v.get('version', 'release')
     71        try:
     72            _version_str = v.get('version', 'release')
     73        except:
     74            raise error.general('Invalid VERSION file')
    6875        _released = True
    6976    return _released
     
    95102    return _version_str
    96103
    97 def load_release_hashes(macros):
    98     def hash_error(msg):
     104def load_release_settings(macros):
     105    def setting_error(msg):
    99106        raise error.general(msg)
    100107
     
    106113            except:
    107114                hashes = []
     115            try:
     116                release_path = v.get('version', 'release_path', raw = True)
     117            except:
     118                release_path = None
    108119            for hash in hashes:
    109120                hs = hash[1].split()
    110121                if len(hs) != 2:
    111122                    raise error.general('invalid release hash in VERSION')
    112                 sources.hash((hs[0], hash[0], hs[1]), macros, hash_error)
     123                sources.hash((hs[0], hash[0], hs[1]), macros, setting_error)
     124            download.set_release_path(release_path, macros)
    113125
    114126def version():
Note: See TracChangeset for help on using the changeset viewer.