From ad264c7033afdb30a189fc7453e443bf33679554 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 6 Feb 2013 10:54:00 +0400 Subject: [PATCH] fixed mp-commit and its use Now this is ugly: instead of commoditizing the repetitive code the result ended up working differently by creating several repositories for the target subdirs instead of the single one for the generated subprofile as a whole. This results in .disk/profile.tgz being basically useless in every image since c4311108ea2e61b495d83a55fb1e40aabf6c92b9. --- bin/mp-commit | 8 +++++++- lib/profile.mk | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/mp-commit b/bin/mp-commit index 6c88a446..6933953e 100755 --- a/bin/mp-commit +++ b/bin/mp-commit @@ -3,13 +3,19 @@ . shell-error +INIT= +if [ "$1" = "-i" ]; then + INIT=yes + shift +fi + [ -d "$1" ] || fatal "$1 is not an existing directory" if type -t git >&/dev/null && pushd "$1" >/dev/null; then if [ -z "$(git config --global user.name)" ]; then exit 0 fi - if [ ! -d .git ]; then + if [ -n "$INIT" -a ! -d .git ]; then git init -q || fatal "git init failed" fi if [ -n "$(git status -s)" ]; then diff --git a/lib/profile.mk b/lib/profile.mk index 049805cb..ffa62f8a 100644 --- a/lib/profile.mk +++ b/lib/profile.mk @@ -65,7 +65,7 @@ profile/init: distclean fi >&2; \ exit 1; \ fi; \ - mp-commit "$(BUILDDIR)" "derivative profile initialized"; \ + mp-commit -i "$(BUILDDIR)" "derivative profile initialized"; \ if [ -w . ]; then \ rm -f "$(SYMLINK)" && \ ln -s "$(BUILDDIR)" "$(SYMLINK)" && \