-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
umpf: add new flag to insert 'Upstream-Status: Pending' lines to all …
…patches Starting with the mickledore release, the upstream status is required for all patches in Yocto. Add a new flag "upstreamstatus" to handle this. If set to "insert", "Upstream-Status: Pending" is added to the commit message of all patches during "umpf tag". Signed-off-by: Michael Olbrich <[email protected]>
- Loading branch information
1 parent
ee2ec1b
commit e13c6c3
Showing
4 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# umpf-base: base | ||
# umpf-flags: upstreamstatus=insert | ||
# umpf-name: name | ||
# umpf-version: name/20221209-2 | ||
# umpf-topic: a | ||
# umpf-hashinfo: f46ed0419d2c31ed10f978cc461e0d1ae4b3b426 | ||
# umpf-topic-range: d306da785d874c09b89264d3f71632bc14bfe51f..121863a14e5f5430eea076205d50d668aeb66aa3 | ||
# umpf-topic: b | ||
# umpf-hashinfo: 3755a03cf640725df1aeb13789cba87154a47b04 | ||
# umpf-topic-range: 121863a14e5f5430eea076205d50d668aeb66aa3..83884ac6f3420eb1b1c98628b64dc1a77b6c1136 | ||
# umpf-end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
# | ||
# Test creating an umpf tag from an umpf build with "umpf tag". | ||
# | ||
|
||
umpf tag umpf-build --version=2 --remote=origin --base=base --name=name --flags upstreamstatus=insert | ||
|
||
git log --format=%B -n 1 | grep "^# umpf-" > series.tag | ||
diff -u ${TEST_DIR}/series-upstreamstatus-v2.ref series.tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,12 +82,18 @@ GIT_DIR="${GIT_DIR:-.git}" | |
STATE="${GIT_DIR}/umpf" | ||
|
||
### flags #### | ||
SUPPORTED_FLAGS=("extraversion") | ||
SUPPORTED_FLAGS=("extraversion" "upstreamstatus") | ||
|
||
declare -A flag_extraversion | ||
|
||
flag_extraversion[val]="replace" | ||
flag_extraversion[values]="replace conflictfree" | ||
|
||
declare -A flag_upstreamstatus | ||
|
||
flag_upstreamstatus[val]="none" | ||
flag_upstreamstatus[values]="none insert" | ||
|
||
############## | ||
|
||
info() { | ||
|
@@ -1105,7 +1111,30 @@ rebase_branch() { | |
committerdate="$(${GIT} log -1 --format=%cd --date=raw "$(<"${STATE}/base")")" | ||
fi | ||
if ! FILTER_BRANCH_SQUELCH_WARNING=1 "${GIT}" filter-branch -f --env-filter "GIT_COMMITTER_DATE='$committerdate'; GIT_COMMITTER_NAME=umpf; [email protected]" "$(<"${STATE}/prev_head").."; then | ||
declare -a msg_filter | ||
if [ "${flag_upstreamstatus[val]}" = "insert" ]; then | ||
msg_filter=( | ||
--msg-filter | ||
"awk ' | ||
/^Upstream-Status:/ { | ||
done=1 | ||
} | ||
/^[^\s]*-by:/ { | ||
if (!done) { | ||
print \"Upstream-Status: Pending\n\" | ||
done=1 | ||
} | ||
} | ||
{ | ||
print \$0 | ||
} | ||
END { | ||
if (!done) | ||
print \"\nUpstream-Status: Pending\" | ||
}'" ) | ||
fi | ||
if ! FILTER_BRANCH_SQUELCH_WARNING=1 "${GIT}" filter-branch -f "${msg_filter[@]}" --env-filter "GIT_COMMITTER_DATE='$committerdate'; GIT_COMMITTER_NAME=umpf; [email protected]" "$(<"${STATE}/prev_head").."; then | ||
bailout "rewrite for reproducible commit-ish failed." | ||
fi | ||
echo "# umpf-topic-range: $(<"${STATE}/prev_head")..$(${GIT} rev-parse HEAD)" >&${series_out} | ||
|
@@ -1233,7 +1262,13 @@ rebase_end() { | |
fi | ||
if ! ${GIT} diff-index --cached --quiet HEAD --; then | ||
local tagname="$(<"${STATE}/tag")" | ||
${GIT} commit --no-verify -m "Release ${tagname}" | ||
local extra_message | ||
if [ "${flag_upstreamstatus[val]}" = "insert" ]; then | ||
extra_message=" | ||
Upstream-Status: Inappropriate [autogenerated]" | ||
fi | ||
${GIT} commit --no-verify -m "Release ${tagname}${extra_message}" | ||
echo "# umpf-release: ${tagname}" >&${series_out} | ||
echo "# umpf-topic-range: $(<"${STATE}/prev_head")..$(${GIT} rev-parse HEAD)" >&${series_out} | ||
fi | ||
|
@@ -1428,6 +1463,11 @@ run_format_patch() { | |
done | ||
if ${BB}; then | ||
cp "${STATE}/series.next" "${PATCH_DIR}/series.inc" | ||
if [ "${flag_upstreamstatus[val]}" != "insert" ]; then | ||
info | ||
info "Note: Patches are created without Upstream-Status!" | ||
info | ||
fi | ||
elif ${NIX}; then | ||
cp "${STATE}/series.next" "${PATCH_DIR}/series.nix" | ||
else | ||
|