Emacs.g: Move Makefile and borg-bootstrap into borg package

In the borg repository these files are renamed to "borg.mk" and
"borg.sh" and modified slightly.  Add a new "Makefile" here.  It
defines one simple target `borg-bootstrap', which is required to
make "borg.mk" and "borg.sh" available during bootstrap and sources
"borg.mk" for all the other targets it used to define.  The target
defined here is fairly simple and hopefully won't have to be updated
often, but independent configurations still have integrate a copy of
this file, because we cannot bootstrap out of thin air and `git
submodule' isn't up to the task yet.

Update borg to v2.0.0-20-g8399ec8
This commit is contained in:
Jonas Bernoulli 2018-01-11 11:43:27 +01:00
parent e532228c30
commit 492ccd5441
3 changed files with 7 additions and 148 deletions

View File

@ -1,66 +1,7 @@
# Copyright (C) 2016-2017 Jonas Bernoulli -include lib/borg/borg.mk
#
# Author: Jonas Bernoulli <jonas@bernoul.li>
# License: GPL v3 <https://www.gnu.org/licenses/gpl-3.0.txt>
EMACS ?= emacs bootstrap-borg:
@git submodule--helper clone --name borg --path lib/borg \
.PHONY: all help build build-init quick bootstrap clean --url git@github.com:emacscollective/borg.git
.FORCE: @cd lib/borg; git symbolic-ref HEAD refs/heads/master
@cd lib/borg; git reset --hard HEAD
all: build
SILENCIO = --load subr-x
SILENCIO += --eval "(put 'if-let 'byte-obsolete-info nil)"
SILENCIO += --eval "(put 'when-let 'byte-obsolete-info nil)"
SILENCIO += --eval "(fset 'original-message (symbol-function 'message))"
SILENCIO += --eval "(fset 'message\
(lambda (format &rest args)\
(unless (equal format \"pcase-memoize: equal first branch, yet different\")\
(apply 'original-message format args))))"
help:
$(info )
$(info make [all|build] = rebuild all drones and init files)
$(info make quick = rebuild most drones and init files)
$(info make lib/DRONE = rebuild DRONE)
$(info make build-init = rebuild init files)
$(info make bootstrap = bootstrap collective or new drones)
$(info make clean = remove all *.elc and *-autoloads.el)
@printf "\n"
build:
@rm -f init.elc
@$(EMACS) -Q --batch -L lib/borg --load borg $(SILENCIO) \
--funcall borg-initialize \
--funcall borg-batch-rebuild 2>&1
build-init:
@rm -f init.elc
@$(EMACS) -Q --batch -L lib/borg --load borg \
--funcall borg-initialize \
--funcall borg-batch-rebuild-init 2>&1
quick:
@rm -f init.elc
@$(EMACS) -Q --batch -L lib/borg --load borg $(SILENCIO) \
--funcall borg-initialize \
--eval '(borg-batch-rebuild t)' 2>&1
lib/%: .FORCE
@$(EMACS) -Q --batch -L lib/borg --load borg $(SILENCIO) \
--funcall borg-initialize \
--eval '(borg-build "$(@F)")' 2>&1
bootstrap:
@printf "\n=== Running 'git submodule init' ===\n\n"
@git submodule init
@printf "\n=== Running 'bin/borg-bootstrap' ===\n"
@bin/borg-bootstrap
@printf "\n=== Running 'make build' ===\n\n"
@make build
clean:
@find lib -name '*-autoloads.el' -exec rm '{}' ';'
@find lib -name '*.elc' -exec rm '{}' ';'
@rm -f init.elc

View File

@ -1,82 +0,0 @@
#!/bin/sh
# Copyright (C) 2016-2017 Jonas Bernoulli
#
# Author: Jonas Bernoulli <jonas@bernoul.li>
# License: GPL v3 <https://www.gnu.org/licenses/gpl-3.0.txt>
hive_remote=$(git config -f .gitmodules borg.collective)
push_remote=$(git config -f .gitmodules borg.pushDefault)
toplevel=$(git rev-parse --show-toplevel)
test -n "$toplevel" || exit 2
cd "$toplevel"
git submodule--helper list |
while read mode sha1 stage path
do
if test -e "$path" && ! test -e "$path"/.git
then
name=$(git submodule--helper name "$path")
echo "\n--- [$name] ---\n"
git submodule--helper clone \
--name "$name" \
--path "$path" \
--url $(git config -f .gitmodules submodule."$name".url)
git config -f .gitmodules --get-all submodule."$name".remote |
while read remote remote_url
do
if ! test -e "$path"/.git
then
git submodule--helper clone \
--name "$name" \
--path "$path" \
--url "$remote_url" &&
git remote rename origin "$remote"
else
cd "$path"
git remote add "$remote" "$remote_url"
git fetch "$remote"
cd "$toplevel"
fi
if test -e "$path"/.git
then
cd "$path"
if test "$remote" = "$hive_remote"
then
if test -e "$toplevel/.hive-maint"
then
git config remote.pushDefault "$remote"
else
branch=$(git rev-parse --abbrev-ref HEAD)
test -n "$branch" &&
git config branch.master.remote "$remote"
fi
elif test "$remote" = "$push_remote"
then
git config remote.pushDefault "$remote"
fi
cd "$toplevel"
fi
done
if test -e "$path"/.git
then
cd "$path"
if ! git reset --hard "$sha1"
then
echo >&2 "futile: Checkout of '$sha1' into submodule path '$path' failed"
git reset --hard HEAD
exit 1
fi
cd "$toplevel"
else
echo >&2 "futile: Clone of any remote into submodule path '$path' failed"
exit 1
fi
fi
done

@ -1 +1 @@
Subproject commit 4b908fd5b43dd9e48b3580b87cc77c4b65939f08 Subproject commit 8399ec8f10204df92d5192823bb9bdeae7a4e3bc