Commit Graph

17 Commits

Author SHA1 Message Date
Gyorgy Sarvari
157d2fede2
gitpkgv.bbclass: inspect repository in UNPACKDIR
When BB_GIT_SHALLOW = "1" is used, the unpacked gir repository doesn't
exist in the download folder, and the class isn't able to inspect the
details of the repository.

Instead inspect the repository it the UNPACKDIR.

Beside this, since BitBake fetcher performs an actual initial shallow
clone of the repository when this feature is enabled, it is not possible
to determine the exact number of commits. Add a warning about this.

Reported-by: WXbet <WXbet@proton.me>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-08-18 07:50:01 -07:00
Hains van den Bosch
4e47dbbc6e
gitpkgv.bbclass: Fix broken git revison
The revision dictionary was built with keys from names list in Bitbake(setup_revisions()).
See:
https://git.openembedded.org/bitbake/commit/?id=2515fbd10824005fa7f34e87706000c079920366

And used to build names list in gitpkgv.bbclass in the old situation, see:
https://git.openembedded.org/meta-openembedded/commit/?id=2920d4909236106e1a36d56b3b20762a308ba3d4

Use name variable to build names list instead of revision variable.
Use append() now name variable is a string.

Old ipk file name:
enigma2_3.13+git3_1_3_0_9_c_7_0_a_4_f_a_6_9_d_6_7_0_1_7_b_b_9_f_7_f_4_d_d_9_d_6_1_0_a_8_c_3_d_20+31309c70a4-r0_dm920.ipk

New ipk file name:
enigma2_3.13+git21834+31309c70+31309c70a4-r0_dm920.ipk

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-03-22 09:58:08 -07:00
Richard Purdie
2920d49092
gitpkgver: Update to match bitbake fetcher changes
The bitbake fetcher dropped support for multiple revisions on a single
url. Update the gitpkgver code to match.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-03-20 09:04:50 -07:00
Martin Jansa
3482f8973e
gitpkgv.bbclass: adjust the example in comment a bit
* the first example isn't very useful anymore since:
  SRCPV is deferred now from PV to PKGV since:
  https://git.openembedded.org/openembedded-core/commit/?h=nanbield&id=a8e7b0f932b9ea69b3a218fca18041676c65aba0

* but keep it in the bbclass in case someone is still using it
  for whatever reason (the version with tag still makes some sense)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
2024-02-09 09:52:12 -08:00
Khem Raj
5d33d2c530 gitpkgv: Fix python deprecation warning
Fixes
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13

pipes is an alias for shlex therefore switch to using shlex

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-03 16:26:17 -07:00
Peter Kjellerstedt
b51af6b5b7 gitpkgv.bbclass: Add support for extending the supported tag formats
Introduce GITPKGV_TAG_REGEXP (which defaults to "v(\d.*)") to support
dropping other unwanted parts of the found tags than just a leading
"v". Any matching groups in the regexp will be concatenated to yield
the final version.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-17 15:44:06 -08:00
niko.mauno@vaisala.com
e2c5249680 gitpkgv.bbclass: Support also lightweight tags
When checking for commit specific tags during GITPKGVTAG resolution, use
additional '--tags' and '--exact-match' options for 'git describe'
command.

This changes the behaviour so that in case an annotated tag does not
exist for the particular commit, then the latest lightweight
(non-annotated) tag is used instead, in case that commit has at least
one such tag.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-19 23:33:03 -08:00
niko.mauno@vaisala.com
6e3ba47f8c gitpkgv.bbclass: Use --git-dir option
Avoid redundant shell working directory change by resorting to
'--git-dir' option for git command instead.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-19 23:33:03 -08:00
S. Lockwood-Childs
ace4a93016 gitpkgv.bbclass: fix versioning with multiple repos
gitpkgv class is supposed to use SRCREV_FORMAT variable to define
how to smoosh together revision info from multiple repos that are
used in a single recipe. It is incorrectly repeating the rev hash
for the first repo instead of including the rev from each listed repo.

Example:

  SRC_URI = "git://some-server/purple.git;destsuffix=git/purple;name=purple"
  SRC_URI += "git://other-server/blue.git;destsuffix=git/blue;name=blue"
  SRCREV_purple = "${AUTOREV}"
  SRCREV_blue = "${AUTOREV}"
  SRCREV_FORMAT = "purple_blue"

Suppose gitpkgv calculates "67+ea121ea" for purple repo,
and "123+feef001" for blue repo. This should result in a
package version with them joined together like so:

"67+ea121ea_123+feef001"

It didn't. Instead the git hash part for the first repo got repeated:

"67+ea121ea_123+ea121ea"

Fix this by looking in the right place for the git revisions of 2nd
(and following) repos when assembling the full version string.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-02-22 13:16:48 +01:00
Joshua Lock
efd3696e70 remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
2016-12-02 09:16:17 +01:00
Clemens Lang
aedcb852ed gitpkgv: Fix $GITPKV for a single named git source
Recipes that fetch from a single git source, assign a name to this
source and do not set SRCREV_FORMAT to this name will always get
a GITPKGV value of "default", which causes version-going-backwards QA
errors.

Fix this by automatically determining a suitable SRCREV_FORMAT from the
SRC_URI if none is set explicitly. This code does not run for multiple
git sources, because bitbake's fetcher enforces setting SRCREV_FORMAT
when multiple version-controlled sources are used.

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-09-05 13:30:50 +02:00
Richard Purdie
55cb2ec6db gitkpkgv: Ensure files are closed
This avoids warnings with python 3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-06-08 14:55:26 +02:00
Daniel Adolfsson
22004e5281 gitpkgv.bbclass: Add support for gitsm:// url type
When using "gitsm://", for projects using submodules, instead of "git://", gitpkgv does not work.

The limitation is synthetic, this patch simply adds gitsm as an allowed url type.

Signed-off-by: Daniel Adolfsson <daniel.adolfsson@bluetest.se>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2015-12-18 12:39:50 +01:00
Enrico Scholz
1b5e1c9551 gitpkgv.bbclass: cache GITPKGV result
gitpkgv runs the 'git rev-list | wc -l' several times when processing a
package using GITPKGV.  This takes ages for packages like the linux
kernel which has a) a large repository and b) lots of subpackages.

This patch caches the result of 'git rev-list' and uses it on the next
run.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2013-01-18 10:49:44 +01:00
Paul Eggleton
3a30c56238 Replace bb.data.* with d.*
Used sed expression given here:

http://lists.linuxtogo.org/pipermail/openembedded-core/2011-November/012373.html

Plus an additional expression for .expand. Full expression is:

sed \
-e 's:bb.data.\(setVar([^,]*,[^,]*\), \([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,]*,[^,]*,[^,]*\), \([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,]*\), \([^, ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,]*,[^,]*\), \([^, ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,]*,[^,]*\), \([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,]*\), \([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(expand([^,]*\), \([^ )]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

Some minor correction in systemd.bbclass was needed for some expressions
that didn't quite match the regex in the desired way; additionally a few
instances were manually changed.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-10-28 14:32:06 +00:00
Otavio Salvador
9a9bc6e47d gitpkgv: add support SRCREV_FORMAT
In case of multiple GIT repositories are used, SRCREV_FORMAT will be
respected while filling it with the proper GIT information to each
revision.

This new feature needed heavy changes in the code so basically it was
a rewrote version that keeps compatibility with previous usage.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
2011-09-04 09:18:55 +02:00
Martin Jansa
89500c583e recipes,classes: import a lot of recipes from meta-shr
* tested on shr-lite-image for om-gta02 and nokia900 (with meta-shr layer)
2011-04-10 14:43:41 +02:00