Changeset 4ed4a32


Ignore:
Timestamp:
05/01/2021 07:22:06 AM (3 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, legacy, trunk
Children:
2ac2fc5
Parents:
b3825c3
Message:

Allow using any branch/tag in BLFS Makefile

Still WIP because of the *_TREE names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/Makefile

    rb3825c3 r4ed4a32  
    5757endef
    5858
     59# Git locations and branches
    5960LFS-GIT = git://git.linuxfromscratch.org/lfs.git
     61LFS-BRANCH = trunk
    6062GIT = git://git.linuxfromscratch.org/blfs.git
     63BLFS-BRANCH = trunk
    6164
    6265ALLXML := $(filter-out $(RENDERTMP)/%, \
     
    179182all: update $(BOOK_XML)
    180183
     184# If in detached head state, "git pull" returns an error, so switch back to
     185# trunk before updating, and switch back to the branch/tag afterwards
    181186update: $(BLFS_XML) $(LFS_XML)
    182187        @echo Updating the book sources
    183         $(Q)cd $(LFS_XML) && git pull
    184         $(Q)cd $(BLFS_XML) && git pull
     188        $(Q)cd $(LFS_XML) && \
     189        if [ $(LFS-BRANCH) != trunk ]; then git switch -; fi && \
     190        git pull && \
     191        git checkout $(LFS-BRANCH)
     192        $(Q)cd $(BLFS_XML) && \
     193        if [ $(BLFS-BRANCH) != trunk ]; then git switch -; fi && \
     194        git pull && \
     195        git checkout $(BLFS-BRANCH)
    185196
    186197$(LFS_XML):
    187198        @echo Getting the LFS book sources...
    188199        $(Q)git clone $(LFS-GIT) $@
     200        if [ $(LFS-BRANCH) != trunk ]; then \
     201            cd $@ && \
     202            git checkout $(LFS-BRANCH); \
     203        fi
    189204
    190205$(BLFS_XML):
    191206        @echo Getting the BLFS book sources...
    192207        $(Q)git clone $(GIT) $@
     208        if [ $(BLFS-BRANCH) != trunk ]; then \
     209            cd $@ && \
     210            git checkout $(BLFS-BRANCH); \
     211        fi
    193212
    194213# Clean up
Note: See TracChangeset for help on using the changeset viewer.