Marcel Telka
2024-03-06 535814cd4895ee35e7b35461cdd5f196b9ddc159
prep-patch.mk: refresh-patches should propagate gpatch and quilt failures

1 files modified
20 ■■■■■ changed files
make-rules/prep-patch.mk 20 ●●●●● patch | view | raw | blame | history
make-rules/prep-patch.mk
@@ -107,15 +107,19 @@
    for p in $(PATCHES) ; do \
        echo $$p ; \
    done | $(TAC) | while read p ; do \
        $(GPATCH) -d $(SOURCE_DIR) --strip=$(PATCH_LEVEL) --reverse < $$p ; \
        $(GPATCH) -d $(SOURCE_DIR) --strip=$(PATCH_LEVEL) --reverse < $$p \
        && continue ; \
        exit 1 ; \
    done
    # Make sure the series file does not exist
    $(RM) $(COMPONENT_DIR)/$(PATCH_DIR)/series
    # Apply and refresh patches, then unapply them
    cd $(SOURCE_DIR) ; for p in $(PATCHES) ; do \
        QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) import --quiltrc /dev/null "../$$p" ; \
        QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) push --quiltrc /dev/null -q ; \
        QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) refresh --quiltrc /dev/null -p 1 --no-timestamps --no-index ; \
        QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) import --quiltrc /dev/null "../$$p" \
        && QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) push --quiltrc /dev/null -q \
        && QUILT_PATCHES=../$(PATCH_DIR) $(QUILT) refresh --quiltrc /dev/null -p 1 --no-timestamps --no-index \
        && continue ; \
        exit 1 ; \
    done ; \
    [ ! -e $(COMPONENT_DIR)/$(PATCH_DIR)/series ] || QUILT_PATCHES=../$(PATCH_DIR) quilt pop --quiltrc /dev/null -a -q
    # cleanup
@@ -123,9 +127,11 @@
    $(RM) $(COMPONENT_DIR)/$(PATCH_DIR)/series
    # Apply and refresh patches again to get the desired patch format
    for p in $(PATCHES) ; do \
        QUILT_PATCHES=$(PATCH_DIR) $(QUILT) import --quiltrc /dev/null -p 0 "$$p" ; \
        QUILT_PATCHES=$(PATCH_DIR) $(QUILT) push --quiltrc /dev/null -q ; \
        QUILT_PATCHES=$(PATCH_DIR) $(QUILT) refresh --quiltrc /dev/null -p 0 --no-timestamps --no-index ; \
        QUILT_PATCHES=$(PATCH_DIR) $(QUILT) import --quiltrc /dev/null -p 0 "$$p" \
        && QUILT_PATCHES=$(PATCH_DIR) $(QUILT) push --quiltrc /dev/null -q \
        && QUILT_PATCHES=$(PATCH_DIR) $(QUILT) refresh --quiltrc /dev/null -p 0 --no-timestamps --no-index \
        && continue ; \
        exit 1 ; \
    done
    # final cleanup
    $(RM) -r $(COMPONENT_DIR)/.pc