Changeset 78e7f6a in rtems-source-builder


Ignore:
Timestamp:
Mar 26, 2017, 2:19:18 AM (2 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
902119e
Parents:
4e5b7fd
git-author:
Chris Johns <chrisj@…> (03/26/17 02:19:18)
git-committer:
Chris Johns <chrisj@…> (03/26/17 02:38:18)
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

    r4e5b7fd r78e7f6a  
    301301            'cvs':  _cvs_parser,
    302302            'file': _file_parser }
     303
     304def set_release_path(release_path, macros):
     305    if release_path is None:
     306        release_path = '%{rtems_release_url}/%{rsb_version}/sources'
     307    macros.define('release_path', release_path)
    303308
    304309def parse_url(url, pathkey, config, opts, file_override = None):
     
    592597    url_bases = opts.urls()
    593598    try:
    594         rtems_release_url_value = config.macros.expand('%{rtems_release_url}/%{rsb_version}/sources')
     599        rtems_release_url_value = config.macros.expand('%{release_path}')
    595600    except:
    596601        rtems_release_url_value = None
  • source-builder/sb/options.py

    r4e5b7fd r78e7f6a  
    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

    r4e5b7fd r78e7f6a  
    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.