forked from altcloud/mkimage-profiles
avoid "nothing to commit" in build.log
Typical (to-be-refactored when having settled down) "cd/git .../cd -" sequences are tweaked to safeguard against changing back without having actually changed to, just in case. features.in/Makefile left with pushd/popd due to its three-level diving course (which somewhat asks to be refactores in functions either but is intrinsically somewhat complex OTOH).
This commit is contained in:
parent
d5a5941f96
commit
7919df829c
@ -27,6 +27,7 @@ include $(BUILDDIR)/distcfg.mk
|
|||||||
### {image-,}scripts.d/ get rsynced twice :-/
|
### {image-,}scripts.d/ get rsynced twice :-/
|
||||||
### still we don't want the trimmed-down case
|
### still we don't want the trimmed-down case
|
||||||
|
|
||||||
|
### sorry for somewhat complicated and overly long lines
|
||||||
all:
|
all:
|
||||||
@echo "** starting feature configuration"
|
@echo "** starting feature configuration"
|
||||||
@if [ -n "$(GLOBAL_DEBUG)" ]; then \
|
@if [ -n "$(GLOBAL_DEBUG)" ]; then \
|
||||||
@ -47,32 +48,38 @@ all:
|
|||||||
rsync -qab "$$dir/" "$$destdir/"; \
|
rsync -qab "$$dir/" "$$destdir/"; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ -d "tagged/$$dir" ]; then \
|
if [ -d "tagged/$$dir" ]; then \
|
||||||
pushd "tagged/$$dir" && \
|
if pushd "tagged/$$dir"; then \
|
||||||
echo "$$feat && ($$src || $$dst)" \
|
echo "$$feat && ($$src || $$dst)" \
|
||||||
| tags2lists . \
|
| tags2lists . \
|
||||||
| xargs -r cp -v -pLt "$$destdir" --; \
|
| xargs -r cp -v -pLt "$$destdir" --; \
|
||||||
popd; \
|
popd; \
|
||||||
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done; \
|
||||||
type -t git >&/dev/null && \
|
if type -t git >&/dev/null && \
|
||||||
pushd "$(BUILDDIR)/$$dst/" && \
|
pushd "$(BUILDDIR)/$$dst/"; then \
|
||||||
git add . && \
|
test -n "`git status -s`" && \
|
||||||
if [ -n "$$dst" ]; then \
|
git add . && \
|
||||||
the="$$sub subprofile"; \
|
if [ -n "$$dst" ]; then \
|
||||||
else \
|
the="$$sub subprofile"; \
|
||||||
the="toplevel"; \
|
else \
|
||||||
|
the="toplevel"; \
|
||||||
|
fi && \
|
||||||
|
git commit -qam "$$feat feature ($$the part)"; \
|
||||||
|
popd; \
|
||||||
fi; \
|
fi; \
|
||||||
git commit -qam "$$feat feature ($$the part)" ||:; \
|
|
||||||
popd; \
|
|
||||||
done; \
|
done; \
|
||||||
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
|
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
|
||||||
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
|
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
|
||||||
type -t git >&/dev/null && \
|
if type -t git >&/dev/null && \
|
||||||
pushd "$(BUILDDIR)/" && \
|
pushd "$(BUILDDIR)/"; then \
|
||||||
git add . && \
|
if test -n "`git status -s`"; then \
|
||||||
git commit -qam "$$feat feature generation complete" ||:; \
|
git add . && \
|
||||||
popd; \
|
git commit -qam "$$feat feature generation complete"; \
|
||||||
|
fi; \
|
||||||
|
popd; \
|
||||||
|
fi; \
|
||||||
popd; \
|
popd; \
|
||||||
done
|
done
|
||||||
@find "$(BUILDDIR)/" -name '*~' \
|
@find "$(BUILDDIR)/" -name '*~' \
|
||||||
|
@ -13,11 +13,13 @@ all: $(GLOBAL_DEBUG)
|
|||||||
@if [ -n "$(MAIN_GROUPS)" ]; then \
|
@if [ -n "$(MAIN_GROUPS)" ]; then \
|
||||||
mkdir -p $(TARGET) && \
|
mkdir -p $(TARGET) && \
|
||||||
cp -at $(TARGET) -- $(addsuffix .directory,$(MAIN_GROUPS)); \
|
cp -at $(TARGET) -- $(addsuffix .directory,$(MAIN_GROUPS)); \
|
||||||
type -t git >&/dev/null && \
|
if type -t git >&/dev/null && cd $(TARGET); then \
|
||||||
cd $(TARGET) && \
|
if [ -n "`git status -s`" ]; then \
|
||||||
git add . && \
|
git add . && \
|
||||||
git commit -qam "requested $(SUFFIX) copied over"; \
|
git commit -qam "requested $(SUFFIX) copied over"; \
|
||||||
cd - >&/dev/null; \
|
fi; \
|
||||||
|
cd - >&/dev/null; \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
|
@ -38,10 +38,12 @@ all: $(TARGET) $(GLOBAL_DEBUG)
|
|||||||
@if [ -n "$(MAIN_GROUPS)" ]; then \
|
@if [ -n "$(MAIN_GROUPS)" ]; then \
|
||||||
cp -at $(TARGET) -- $(MAIN_GROUPS); \
|
cp -at $(TARGET) -- $(MAIN_GROUPS); \
|
||||||
fi
|
fi
|
||||||
@if type -t git >&/dev/null; then \
|
@if type -t git >&/dev/null && cd $(TARGET); then \
|
||||||
cd $(TARGET) && \
|
if [ -n "`git status -s`" ]; then \
|
||||||
git add . && \
|
git add . && \
|
||||||
git commit -qam "requested $(SUFFIX) copied over"; \
|
git commit -qam "requested $(SUFFIX) copied over"; \
|
||||||
|
fi; \
|
||||||
|
cd - >&/dev/null; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# do beforehand as foreach gets expanded before recipe execution
|
# do beforehand as foreach gets expanded before recipe execution
|
||||||
|
@ -13,12 +13,14 @@ all:
|
|||||||
src="$${sub%/*}" && \
|
src="$${sub%/*}" && \
|
||||||
dst="$${sub#*/}" && \
|
dst="$${sub#*/}" && \
|
||||||
neq="$${src#$$dst}" && \
|
neq="$${src#$$dst}" && \
|
||||||
rsync -a "$$src/" "$(BUILDDIR)/$$dst/" && \
|
rsync -qa "$$src/" "$(BUILDDIR)/$$dst/" && \
|
||||||
type -t git >&/dev/null && \
|
if type -t git >&/dev/null && cd "$(BUILDDIR)/$$dst/"; then \
|
||||||
cd "$(BUILDDIR)/$$dst/" && \
|
if [ -n "`git status -s`" ]; then \
|
||||||
git add . && \
|
git add . && \
|
||||||
git commit -qam "$$dst subprofile initialized$${neq:+ (using $$src)}"; \
|
git commit -qam "$$dst subprofile initialized$${neq:+ (using $$src)}"; \
|
||||||
cd - >&/dev/null; \
|
fi; \
|
||||||
|
cd - >&/dev/null; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user