Make patch and update scripts a bit nicer
This commit is contained in:
parent
a6ae2786f3
commit
1b33134353
1
Makefile
1
Makefile
@ -21,6 +21,7 @@ export TOPDIR
|
|||||||
|
|
||||||
update: FORCE
|
update: FORCE
|
||||||
$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
|
$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
|
||||||
|
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
|
||||||
|
|
||||||
patch: FORCE
|
patch: FORCE
|
||||||
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
|
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
|
||||||
|
@ -7,8 +7,15 @@ shopt -s nullglob
|
|||||||
|
|
||||||
for module in $GLUON_MODULES; do
|
for module in $GLUON_MODULES; do
|
||||||
dir="$1"/$module
|
dir="$1"/$module
|
||||||
git -C $dir checkout -B patched base
|
git -C $dir checkout -B patching base
|
||||||
|
|
||||||
if [ -z "$1"/patches/$module/*.patch ]; then continue; fi
|
if [ -z "$1"/patches/$module/*.patch ]; then continue; fi
|
||||||
git -C "$dir" am "$1"/patches/$module/*.patch
|
git -C "$dir" am "$1"/patches/$module/*.patch || (
|
||||||
|
git -C "$dir" am --abort
|
||||||
|
git -C "$dir" checkout patched
|
||||||
|
git -C "$dir" branch -D patching
|
||||||
|
false
|
||||||
|
)
|
||||||
|
git -C "$dir" checkout -B patched
|
||||||
|
git -C "$dir" branch -d patching
|
||||||
done
|
done
|
||||||
|
@ -11,6 +11,7 @@ for module in $GLUON_MODULES; do
|
|||||||
eval repo=\${MODULE_${var}_REPO}
|
eval repo=\${MODULE_${var}_REPO}
|
||||||
eval commit=\${MODULE_${var}_COMMIT}
|
eval commit=\${MODULE_${var}_COMMIT}
|
||||||
git -C "$dir" init
|
git -C "$dir" init
|
||||||
git -C "$dir" fetch $repo
|
|
||||||
|
git -C "$dir" checkout $commit 2>/dev/null || git -C "$dir" fetch $repo
|
||||||
git -C "$dir" checkout -B base $commit
|
git -C "$dir" checkout -B base $commit
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user