Skip to content

Commit

Permalink
[#47/%20869] build: (minor) frr keeps changing after build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic-builder OSSO committed Nov 22, 2024
1 parent 6f8a713 commit 612f206
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,27 @@ export DEBEMAIL := [email protected]
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
pushd ./frr
git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) || git checkout $(FRR_BRANCH)
ifeq ($(CROSS_BUILD_ENVIRON), y)
git reset --hard
endif
stg branch --create $(STG_BRANCH) $(FRR_TAG)
git fetch --all

oldbranch=$$(git describe --always)
if ! git checkout $(FRR_BRANCH)-sonic; then
git checkout -b $(FRR_BRANCH)-sonic origin/$(FRR_BRANCH)
fi
git clean -xdf
git reset --hard origin/$(FRR_BRANCH)
git branch --list 'stg_temp.*' | sed -e '/^[*] /d' | xargs --no-run-if-empty git branch -D

stg branch --create $(STG_BRANCH)-sonic $(FRR_TAG)
stg import -s ../patch/series

gbp dch --ignore-branch --new-version=$(FRR_VERSION)-sonic-$(FRR_SUBVERSION) --dch-opt="--force-bad-version" --commit --git-author

ifeq ($(CROSS_BUILD_ENVIRON), y)
CFLAGS="-I $$CROSS_PERL_CORE_PATH" dpkg-buildpackage -rfakeroot -b -d -us -uc -Ppkg.frr.nortrlib -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
else
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
endif
stg undo || true
git clean -xfdf
git checkout $(FRR_BRANCH)
stg branch --delete --force $(STG_BRANCH)
git rev-parse --short HEAD | xargs git checkout
ifeq ($(CROSS_BUILD_ENVIRON), y)
git reset --hard
endif
git checkout master
git branch -D $(FRR_BRANCH)
git checkout "$$oldbranch"
popd
mv $(DERIVED_TARGET) $* $(DEST)/

Expand Down

0 comments on commit 612f206

Please sign in to comment.