Changeset d3fa158 in rtems-source-builder


Ignore:
Timestamp:
Mar 10, 2016, 5:19:58 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.9, master
Children:
84238b9
Parents:
62f76d98
git-author:
Chris Johns <chrisj@…> (03/10/16 05:19:58)
git-committer:
Chris Johns <chrisj@…> (03/10/16 05:32:49)
Message:

sb: Add a download option --with-release-url/--without-release-url.

The default without the option is to prepend the release URL to the URL
list to download from the RTEMS FTP site first if the RSB is released. This
option can force the RTEMS FTP to be tried first when not a release,
or you can supply a different URL to download from or you can request
no RTEMS URL is tried first. Eg:

--with-release-url
--with-release-url=file://opt/local/cache
--without-release-url

Move the RTEMS release URL to the default.mc file. Change the URL
to the RTEMS FTP server and do not use the https method of access.

The option's with_arg call was cleaned up to make sense.

Remove the log's raw output of an extra space.

Some download error message formating was cleaned up.

Closes #2636.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • rtems/config/rtems-urls.bset

    r62f76d98 rd3fa158  
    1414%define rtems_newlib_patches   %{rtems_git_tools}/newlib
    1515%define rtems_gdb_patches      %{rtems_git_tools}/gdb
    16 
    17 #
    18 # Releases paths on the FTP server.
    19 #
    20 %define rtems_release_url https://ftp.rtems.org/pub/rtems/releases/%{rtems_version}
  • source-builder/defaults.mc

    r62f76d98 rd3fa158  
    5454_build:              triplet, required, ''
    5555_target:             none,    optional, ''
     56
     57# RTEMS release URL
     58rtems_release_url:   none,    none,     'ftp://ftp.rtems.org/pub/rtems/releases/%{rtems_version}'
    5659
    5760# The user
  • source-builder/sb/download.py

    r62f76d98 rd3fa158  
    337337        _last_percent = 200.0
    338338        _last_msg = ''
    339         _wipe_output = False
     339        _have_status_output = False
    340340        try:
    341341            try:
     
    368368                        log.stdout_raw('%s%s' % (_msg, ' ' * extras + '\b' * extras))
    369369                        _last_msg = _msg
     370                        _have_status_output = True
    370371                    _chunk = _in.read(_chunk_size)
    371372                    if not _chunk:
     
    373374                    _out.write(_chunk)
    374375                    _have += len(_chunk)
    375                 if _wipe_output:
    376                     log.stdout_raw('\r%s\r' % (' ' * len(_last_msg)))
    377                 else:
    378                     log.stdout_raw('\n')
     376                log.stdout_raw('\n\r')
    379377            except:
    380                 log.stdout_raw('\n')
     378                if _have_status_output:
     379                    log.stdout_raw('\n\r')
    381380                raise
    382381        except IOError as err:
     
    558557    #
    559558    # Check if a URL has been provided on the command line. If the package is
    560     # release push to the start the RTEMS URL.
     559    # released push to the start the RTEMS URL unless overrided by the command
     560    # line option --with-release-url. The variant --without-release-url can
     561    # override the released check.
    561562    #
    562563    url_bases = opts.urls()
     564    rtems_release_url_value = config.macros.expand('%{rtems_release_url}/%{rsb_version}/sources')
     565    rtems_release_url = None
    563566    if version.released():
    564         rtems_release_url = config.macros.expand('%{rtems_release_url}/%{rsb_version}/sources')
     567        rtems_release_url = rtems_release_url_value
     568    with_rel_url = opts.with_arg('release-url')
     569    if with_rel_url[0] == 'with_release-url':
     570        if with_rel_url[1] == 'yes':
     571            rtems_release_url = rtems_release_url_value
     572        elif with_rel_url[1] == 'no':
     573            pass
     574        else:
     575            rtems_release_url = with_rel_url[1]
     576    elif with_rel_url[0] == 'without_release-url' and with_rel_url[1] == 'no':
     577        rtems_release_url = rtems_release_url_value
     578    if rtems_release_url is not None:
    565579        log.trace('release url: %s' % (rtems_release_url))
    566580        #
  • source-builder/sb/log.py

    r62f76d98 rd3fa158  
    6363
    6464def stdout_raw(text = os.linesep):
    65     print(text, end=' ')
     65    print(text, end = '')
    6666    sys.stdout.flush()
    6767
  • source-builder/sb/options.py

    r62f76d98 rd3fa158  
    461461        return self.parse_args(arg)
    462462
    463     def with_arg(self, label):
     463    def with_arg(self, label, default = 'not-found'):
     464        # the default if there is no option for without.
     465        result = default
    464466        for pre in ['with', 'without']:
    465467            arg_str = '--%s-%s' % (pre, label)
     
    472474                    result = arg[1]
    473475                break
    474             if pre == 'with':
    475                 result = 'yes'
    476             else:
    477                 result = 'no'
    478476        return [arg_label, result]
    479477
Note: See TracChangeset for help on using the changeset viewer.