Skip to content

Commit

Permalink
build: deprecate GLUON_BRANCH Make variable
Browse files Browse the repository at this point in the history
GLUON_AUTOUPDATER_BRANCH and GLUON_AUTOUPDATER_ENABLED should be set
separately now.
  • Loading branch information
neocturne committed Aug 15, 2020
1 parent d82ffb4 commit e6d3d15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ GLUON_RELEASE ?= $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site

GLUON_DEPRECATED ?= $(error GLUON_DEPRECATED not set. Please consult the documentation)

ifneq ($(GLUON_BRANCH),)
$(warning *** Warning: GLUON_BRANCH has been deprecated, please set GLUON_AUTOUPDATER_BRANCH and GLUON_AUTOUPDATER_ENABLED instead.)
GLUON_AUTOUPDATER_BRANCH ?= $(GLUON_BRANCH)
GLUON_AUTOUPDATER_ENABLED ?= 1
endif

GLUON_AUTOUPDATER_ENABLED ?= 0

# initialize (possibly already user set) directory variables
GLUON_TMPDIR ?= tmp
GLUON_OUTPUTDIR ?= output
Expand Down Expand Up @@ -58,7 +66,7 @@ endef
GLUON_VARS = \
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_AUTOREMOVE GLUON_DEBUG GLUON_MINIFY GLUON_DEPRECATED \
GLUON_DEVICES GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR GLUON_DEBUGDIR \
GLUON_SITEDIR GLUON_RELEASE GLUON_BRANCH GLUON_LANGS GLUON_BASE_FEEDS \
GLUON_SITEDIR GLUON_RELEASE GLUON_AUTOUPDATER_BRANCH GLUON_AUTOUPDATER_ENABLED GLUON_LANGS GLUON_BASE_FEEDS \
GLUON_TARGET BOARD SUBTARGET

unexport $(GLUON_VARS)
Expand Down Expand Up @@ -185,23 +193,23 @@ dirclean: FORCE

manifest: $(LUA) FORCE
@
[ '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
[ '$(GLUON_AUTOUPDATER_BRANCH)' ] || (echo 'Please set GLUON_AUTOUPDATER_BRANCH to create a manifest.'; false)
echo '$(GLUON_PRIORITY)' | grep -qE '^([0-9]*\.)?[0-9]+$$' || (echo 'Please specify a numeric value for GLUON_PRIORITY to create a manifest.'; false)
$(CheckExternal)

(
export $(GLUON_ENV)
echo 'BRANCH=$(GLUON_BRANCH)'
echo 'BRANCH=$(GLUON_AUTOUPDATER_BRANCH)'
echo "DATE=$$($(LUA) scripts/rfc3339date.lua)"
echo 'PRIORITY=$(GLUON_PRIORITY)'
echo
for target in $(GLUON_TARGETS); do
$(LUA) scripts/generate_manifest.lua "$$target"
done
) > 'tmp/$(GLUON_BRANCH).manifest.tmp'
) > 'tmp/$(GLUON_AUTOUPDATER_BRANCH).manifest.tmp'

mkdir -p '$(GLUON_IMAGEDIR)/sysupgrade'
mv 'tmp/$(GLUON_BRANCH).manifest.tmp' '$(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest'
mv 'tmp/$(GLUON_AUTOUPDATER_BRANCH).manifest.tmp' '$(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_AUTOUPDATER_BRANCH).manifest'

FORCE: ;

Expand Down
4 changes: 2 additions & 2 deletions targets/generic
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ assert(env.GLUON_LANGS)
config('GLUON_SITEDIR', env.GLUON_SITEDIR)
config('GLUON_RELEASE', env.GLUON_RELEASE)

try_config('GLUON_AUTOUPDATER_BRANCH', env.GLUON_BRANCH)
try_config('GLUON_AUTOUPDATER_ENABLED', env.GLUON_BRANCH ~= '')
try_config('GLUON_AUTOUPDATER_BRANCH', env.GLUON_AUTOUPDATER_BRANCH)
try_config('GLUON_AUTOUPDATER_ENABLED', istrue(env.GLUON_AUTOUPDATER_ENABLED))

for lang in string.gmatch(env.GLUON_LANGS, '%S+') do
try_config('GLUON_WEB_LANG_' .. lang, true)
Expand Down

0 comments on commit e6d3d15

Please sign in to comment.