From dc3f1a95e6df8ee4fa891d546324176a3d563e61 Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Fri, 30 Jul 2021 00:28:59 +0000 Subject: [PATCH 1/2] [sonic-frr/Makefile]: Checkout gracefully if branch exists already. This is useful to avoid "branch exists" error while rebuild FRR. Signed-off-by: Praveen Chaudhary --- src/sonic-frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index 4bac1e42769d..01bfec49e85e 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -10,7 +10,7 @@ STG_BRANCH = stg_temp.$(SUFFIX) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr - git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) + git checkout $(FRR_BRANCH) || git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) stg branch --create $(STG_BRANCH) $(FRR_TAG) stg import -s ../patch/series tools/tarsource.sh -V -e '-sonic' From 8ff4d671b5c8ec759b7c9bc2e397d445997a46c0 Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Wed, 11 Aug 2021 10:13:05 -0700 Subject: [PATCH 2/2] Move checkout command as secondary. Signed-off-by: Praveen Chaudhary --- src/sonic-frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index 01bfec49e85e..45f37e52781e 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -10,7 +10,7 @@ STG_BRANCH = stg_temp.$(SUFFIX) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr - git checkout $(FRR_BRANCH) || git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) + git checkout -b $(FRR_BRANCH) origin/$(FRR_BRANCH) || git checkout $(FRR_BRANCH) stg branch --create $(STG_BRANCH) $(FRR_TAG) stg import -s ../patch/series tools/tarsource.sh -V -e '-sonic'