diff --git a/Makefile b/Makefile index 1cc4e36..974ffd8 100644 --- a/Makefile +++ b/Makefile @@ -1,66 +1,7 @@ -# Copyright (C) 2016-2017 Jonas Bernoulli -# -# Author: Jonas Bernoulli -# License: GPL v3 +-include lib/borg/borg.mk -EMACS ?= emacs - -.PHONY: all help build build-init quick bootstrap clean -.FORCE: - -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 +bootstrap-borg: + @git submodule--helper clone --name borg --path lib/borg \ + --url git@github.com:emacscollective/borg.git + @cd lib/borg; git symbolic-ref HEAD refs/heads/master + @cd lib/borg; git reset --hard HEAD diff --git a/bin/borg-bootstrap b/bin/borg-bootstrap deleted file mode 100755 index a47033b..0000000 --- a/bin/borg-bootstrap +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2016-2017 Jonas Bernoulli -# -# Author: Jonas Bernoulli -# License: GPL v3 - -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 diff --git a/lib/borg b/lib/borg index 4b908fd..8399ec8 160000 --- a/lib/borg +++ b/lib/borg @@ -1 +1 @@ -Subproject commit 4b908fd5b43dd9e48b3580b87cc77c4b65939f08 +Subproject commit 8399ec8f10204df92d5192823bb9bdeae7a4e3bc