generic-poky/bitbake/lib/bb/fetch2
Ulf Magnusson c3f630df52 bitbake: bitbake: fetch2: Make SRCREV_FORMAT name substitution safer
The implementation of SRCREV_FORMAT has at least two issues:

 1. Given two names "foo" and "foobar" and SRCREV_FORMAT = "foo_foobar",
    "foo" might currently get substituted twice, and "foobar" not at
    all.

 2. If the revision substitued for some name happens to contain another
    name as a substring, then that substring might incorrectly get
    replaced.

Fix both issues by sorting the names with the longest ones first and
replacing all names at once with a regular expression. This was inspired
by
http://stackoverflow.com/questions/6116978/python-replace-multiple-strings.

(Bitbake rev: 8e6a893cb7f13ea14051fc40c6c9baf41aa47fee)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15 12:15:07 +01:00
..
__init__.py bitbake: bitbake: fetch2: Make SRCREV_FORMAT name substitution safer 2016-09-15 12:15:07 +01:00
bzr.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
clearcase.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
cvs.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
git.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
gitannex.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
gitsm.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
hg.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
local.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
npm.py bitbake: fetch2/npm: don't download same URL multiple times 2016-09-15 12:15:07 +01:00
osc.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
perforce.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
repo.py bitbake: fetch2: preserve current working directory 2016-08-20 16:08:59 +01:00
sftp.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
ssh.py bitbake: bitbake: Convert to python 3 2016-06-02 08:24:02 +01:00
svn.py bitbake: bb.fetch2.svn: correctly pass workdir when fetching 2016-09-02 18:09:50 +01:00
wget.py bitbake: wget: allow basic http auth for SSTATE_MIRRORS 2016-09-02 18:09:49 +01:00