Skip to content

Commit

Permalink
Make module scripts use GLUONDIR and GLUON_SITEDIR
Browse files Browse the repository at this point in the history
This fixes `make update` not working correctly when GLUON_SITEDIR is set
manually.
  • Loading branch information
neocturne committed Jan 11, 2015
1 parent 334858f commit 8cfd64d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ export GLUON_TARGET


update: FORCE
$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
$(GLUONDIR)/scripts/update.sh
$(GLUONDIR)/scripts/patch.sh

patch: FORCE
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
$(GLUONDIR)/scripts/patch.sh

unpatch: FORCE
$(GLUONDIR)/scripts/unpatch.sh $(GLUONDIR)
$(GLUONDIR)/scripts/unpatch.sh

update-patches: FORCE
$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
$(GLUONDIR)/scripts/update-patches.sh $(GLUONDIR)
$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
$(GLUONDIR)/scripts/update.sh
$(GLUONDIR)/scripts/update-patches.sh
$(GLUONDIR)/scripts/patch.sh

-include $(TOPDIR)/include/host.mk

Expand Down
4 changes: 2 additions & 2 deletions scripts/modules.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. "$1"/modules
[ ! -f "$1"/site/modules ] || . "$1"/site/modules
. "$GLUONDIR"/modules
[ ! -f "$GLUON_SITEDIR"/site/modules ] || . "$GLUON_SITEDIR"/site/modules

GLUON_MODULES=openwrt

Expand Down
8 changes: 4 additions & 4 deletions scripts/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
set -e
shopt -s nullglob

. "$1"/scripts/modules.sh
. "$GLUONDIR"/scripts/modules.sh

for module in $GLUON_MODULES; do
cd "$1"/$module
cd "$GLUONDIR"/$module
git checkout -B patching base

if [ "$(echo "$1"/patches/$module/*.patch)" ]; then
git am --whitespace=nowarn "$1"/patches/$module/*.patch || (
if [ "$(echo "$GLUONDIR"/patches/$module/*.patch)" ]; then
git am --whitespace=nowarn "$GLUONDIR"/patches/$module/*.patch || (
git am --abort
git checkout patched
git branch -D patching
Expand Down
4 changes: 2 additions & 2 deletions scripts/unpatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -e

. "$1"/scripts/modules.sh
. "$GLUONDIR"/scripts/modules.sh

for module in $GLUON_MODULES; do
cd "$1"/$module
cd "$GLUONDIR"/$module
git checkout base
done
10 changes: 5 additions & 5 deletions scripts/update-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
set -e
shopt -s nullglob

. "$1"/scripts/modules.sh
. "$GLUONDIR"/scripts/modules.sh

for module in $GLUON_MODULES; do
rm -f "$1"/patches/$module/*.patch
mkdir -p "$1"/patches/$module
rm -f "$GLUONDIR"/patches/$module/*.patch
mkdir -p "$GLUONDIR"/patches/$module

cd "$1"/$module
cd "$GLUONDIR"/$module

n=0
for commit in $(git rev-list --reverse --no-merges base..patched); do
let n=n+1
git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$1"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch"
git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$GLUONDIR"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch"
done
done
6 changes: 3 additions & 3 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

set -e

. "$1"/scripts/modules.sh
. "$GLUONDIR"/scripts/modules.sh

for module in $GLUON_MODULES; do
var=$(echo $module | tr '[:lower:]/' '[:upper:]_')
eval repo=\${${var}_REPO}
eval branch=\${${var}_BRANCH}
eval commit=\${${var}_COMMIT}

mkdir -p "$1"/$module
cd "$1"/$module
mkdir -p "$GLUONDIR"/$module
cd "$GLUONDIR"/$module
git init

git checkout $commit 2>/dev/null || git fetch $repo $branch
Expand Down

0 comments on commit 8cfd64d

Please sign in to comment.