Skip to content

Commit

Permalink
Merge pull request #39 from rohieb/fopa-bb-umpf-version
Browse files Browse the repository at this point in the history
format-patch: correctly set UMPF_VERSION with --bb
  • Loading branch information
michaelolbrich authored Mar 16, 2024
2 parents 48d63ec + 919b0e0 commit 7402e07
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/series-format-patch-bb.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# umpf-base: base
# umpf-name: name
# umpf-version: name/20221209-1
# umpf-version: name/20240314-2
# umpf-topic: a
# umpf-hashinfo: f46ed0419d2c31ed10f978cc461e0d1ae4b3b426
# umpf-topic-range: d306da785d874c09b89264d3f71632bc14bfe51f..b2b9f854952b0be84ba2472f236783d09bfa6561
Expand All @@ -14,6 +14,6 @@ SRC_URI += "\
file://patches/0101-b1.patch \
"
UMPF_BASE = "base"
UMPF_VERSION = "20221209-1"
UMPF_VERSION = "20240314-2"
PV = "${UMPF_BASE}-${UMPF_VERSION}"
# umpf-end
2 changes: 2 additions & 0 deletions tests/test-git/info/refs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ f46ed0419d2c31ed10f978cc461e0d1ae4b3b426 refs/heads/a
d306da785d874c09b89264d3f71632bc14bfe51f refs/heads/master
d306da785d874c09b89264d3f71632bc14bfe51f refs/tags/base
9f80efc9c56cd60aa8059a2e599ae4a0e5611521 refs/tags/name/20221209-1
cafa4a9cf5da347772533d93fc33040b5d961978 refs/tags/name/20240314-2
a815789db19080f83c2fe01a8fdf41e8172eb33e refs/tags/name/20240314-2^{}
402a5929b9e015d35a6b07e4632c5c1a26d0e782 refs/tags/umpf-build
c42a48897afca146023190ae073373e4d491807e refs/tags/umpf-merge
9f80efc9c56cd60aa8059a2e599ae4a0e5611521 refs/tags/umpf-tag
Binary file modified tests/test-git/objects/info/commit-graph
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test-git/objects/info/packs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
P pack-1ba3875ef90f58e563d875a54cff75687436a9b0.pack
P pack-308eb06292fe3f86a68fa9e5d6a98201d268f7f9.pack

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/test-git/packed-refs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ f46ed0419d2c31ed10f978cc461e0d1ae4b3b426 refs/heads/a
d306da785d874c09b89264d3f71632bc14bfe51f refs/heads/master
d306da785d874c09b89264d3f71632bc14bfe51f refs/tags/base
9f80efc9c56cd60aa8059a2e599ae4a0e5611521 refs/tags/name/20221209-1
cafa4a9cf5da347772533d93fc33040b5d961978 refs/tags/name/20240314-2
^a815789db19080f83c2fe01a8fdf41e8172eb33e
402a5929b9e015d35a6b07e4632c5c1a26d0e782 refs/tags/umpf-build
c42a48897afca146023190ae073373e4d491807e refs/tags/umpf-merge
9f80efc9c56cd60aa8059a2e599ae4a0e5611521 refs/tags/umpf-tag
2 changes: 1 addition & 1 deletion tests/umpf-format-patch-bb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Test creating a Yocto compatible patchset with "umpf format-patch --bb".
#

umpf format-patch umpf-tag --bb --patchdir=patches
umpf format-patch name/20240314-2 --bb --patchdir=patches

diff -u ${TEST_DIR}/series-format-patch-bb.ref patches/series.inc
6 changes: 5 additions & 1 deletion umpf
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ parse() {
test -n "${content}" || bailout "${cmd} line without value"
if ${STABLE}; then
local name="$(<"${STATE}/name")"
local version="$(sed "s;${name}/\([0-9]\{8\}\)-.*;\1${VERSION_SEPARATOR}${VERSION};" <<< "${content}")"
local version="$(sed "s;${name}/\([0-9]\{8\}\)${VERSION_SEPARATOR}.*;\1${VERSION_SEPARATOR}${VERSION};" <<< "${content}")"
local tagname="${name}/${version}"
echo "${version}" > "${STATE}/version"
echo "${tagname}" > "${STATE}/tag"
Expand Down Expand Up @@ -1360,6 +1360,10 @@ format_patch_name() {
}
format_patch_version() {
local name="$(<"${STATE}/name")"
local version="${content#${name}/}"
echo "${version}" > "${STATE}/version"
echo "${content}" > "${STATE}/tag"
echo "$line" >&${series_out}
if ${NIX}; then
echo "[" >&${series_out}
Expand Down

0 comments on commit 7402e07

Please sign in to comment.