Skip to content

Commit

Permalink
lfopenbmc: add script to apply a repo commit to yocto tree
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
  • Loading branch information
williamspatrick committed Apr 6, 2022
1 parent 5f79c9a commit df180ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions env/20_all/lfopenbmc.zsh
Expand Up @@ -11,3 +11,16 @@ function gerrit-origin() {
function gerrit-maint() {
$(wd path obmcsrc)/openbmc-tools/maintainers/obmc-gerrit reviewers $*
}

function lf-obmc-apply() {
local REPONAME=$(git remote get-url origin | sed "s#.*://[^/]*/##")
local COMMIT=$(git rev-parse HEAD)

local LFREPO=$(wd path lfopenbmc)
local FILES=$(git -C "$LFREPO" grep -lE "git://.*/$REPONAME(.git)?;")
for f in $FILES; do
echo "Applying to $LFREPO/$f"
sed -i "s/;branch=[^;]*/;nobranch=1/" "$LFREPO/$f"
sed -i "s/SRCREV = .*/SRCREV = \"$COMMIT\"/" "$LFREPO/$f"
done
}

0 comments on commit df180ac

Please sign in to comment.