[jhalfs] 08/14: BLFS/Makefile: Don't run git checkout if {B,}LFS-BRANCH is empty

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

commit 1242857a75d91b099a6af90b8626a6c0d99bd016
Author: Pierre Labastie <[email protected]>
AuthorDate: Wed Mar 30 22:33:08 2022 +0200

    BLFS/Makefile: Don't run git checkout if {B,}LFS-BRANCH is empty
    
    Fix also the order of checkout trunk and checkout $(...-BRANCH)
---
 BLFS/Makefile | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/BLFS/Makefile b/BLFS/Makefile
index 6ed9c61..590bfa3 100644
--- a/BLFS/Makefile
+++ b/BLFS/Makefile
@@ -191,31 +191,38 @@ all: update $(BOOK_XML)
 # trunk before updating, and switch back to the branch/tag afterwards
 update: $(BLFS_XML) $(LFS_XML)
 	@echo Updating the book sources
+ifneq (,$(LFS-BRANCH))
 	$(Q)cd $(LFS_XML) && \
-	if [ $(LFS-BRANCH) != trunk ]; then git switch -; fi && \
+	git checkout trunk && \
 	git pull && \
-	git checkout $(LFS-BRANCH)
+	if [ $(LFS-BRANCH) != trunk ]; then git checkout $(LFS-BRANCH); fi
+endif
+ifneq (,$(BLFS-BRANCH))
 	$(Q)cd $(BLFS_XML) && \
-        if [ $(BLFS-BRANCH) != trunk ]; then git switch -; fi && \
+        git checkout trunk && \
         git pull && \
-        git checkout $(BLFS-BRANCH)
+        if [ $(BLFS-BRANCH) != trunk ]; then git checkout $(BLFS-BRANCH); fi
+endif
 
 $(LFS_XML):
 	@echo Getting the LFS book sources...
 	$(Q)git clone $(LFS-GIT) $@
+ifneq (,$(LFS-BRANCH))
 	if [ $(LFS-BRANCH) != trunk ]; then \
 	    cd $@ && \
 	    git checkout $(LFS-BRANCH); \
 	fi
+endif
 
 $(BLFS_XML):
 	@echo Getting the BLFS book sources...
 	$(Q)git clone $(GIT) $@
+ifneq (,$(BLFS-BRANCH))
 	$(Q)if [ $(BLFS-BRANCH) != trunk ]; then \
 	    cd $@ && \
 	    git checkout $(BLFS-BRANCH); \
 	fi
-
+endif
 # Clean up
 
 clean:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.