endef
define Quilt/RefreshDir
- mkdir -p $(2)
- -rm -f $(2)/* 2>/dev/null >/dev/null
- @( \
+ -rm -rf $(2) 2>/dev/null >/dev/null
+ [ -f $(1)/.quilt_no_patch ] || mkdir -p $(2)
+ @[ -f $(1)/.quilt_no_patch ] || { \
for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \
$(CP) -v "$(1)/patches/$$$$patch" $(2); \
done; \
- )
+ }
+ @-rm -f $(1)/.quilt_no_patch 2>/dev/null >/dev/null;
endef
define Quilt/Refresh/Host
}
@[ -f "$(1)/patches/series" ] || { \
echo "The source directory contains no quilt patches."; \
- false; \
+ touch $(1)/patches/series $(1)/.quilt_no_patch; \
}
@[ -n "$$$$(ls $(1)/patches/series)" -o \
"$$$$(cat $(1)/patches/series | $(MKHASH) md5)" = "$$(sort $(1)/patches/series | $(MKHASH) md5)" ] || { \
}
$(3)refresh: $(3)quilt-check
- @cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null
- @cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
- QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
- done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null
+ @[ -f $(1)/.quilt_no_patch ] || { \
+ cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \
+ while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
+ QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
+ done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null; \
+ }
$(Quilt/Refresh/$(4))
$(3)update: $(3)quilt-check