Skip to content

Commit

Permalink
[frr]: Fix the issue 'branch already exist' in frr package rebuilds (#…
Browse files Browse the repository at this point in the history
…3692)

Fixed Makefile of FRR. Before we had issues after #3589:

- When you want to rebuild frr with new changes you get error "branch frr/7.1 is already exist".
- When your patch list is empty stg undo gives an error
  • Loading branch information
pavel-shirshov authored and lguohan committed Nov 4, 2019
1 parent 4b59a43 commit d85777b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ SHELL = /bin/bash

MAIN_TARGET = $(FRR)
DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG)
SUFFIX = $(shell date +%Y%m%d\.%H%M%S)
FRR_BRANCH = frr/$(FRR_VERSION)
STG_BRANCH = stg_temp
STG_BRANCH = stg_temp.$(SUFFIX)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
Expand All @@ -15,11 +16,12 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series
tools/tarsource.sh -V -e '-sonic'
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
stg undo
stg undo || true
git clean -xfdf
git checkout $(FRR_BRANCH)
stg branch --delete $(STG_BRANCH)
git rev-parse --short HEAD | xargs git checkout
git checkout master
git branch -D $(FRR_BRANCH)
popd
mv $(DERIVED_TARGET) $* $(DEST)/
Expand Down

0 comments on commit d85777b

Please sign in to comment.