diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-16 15:54:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-18 12:40:47 -0700 |
commit | 5b165f7a3b8ca561debd4920356ceeaa923fccfb (patch) | |
tree | f34e79ae241ed08d9ab6d956b1f7c8758b4de9ad /bin | |
parent | fb078c0fb7f275f802eb78531344ef848798646b (diff) | |
download | dotfiles-5b165f7a3b8ca561debd4920356ceeaa923fccfb.tar.gz |
attempt to replace normalise-mrconfig script w/ "include" directive
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bstraph.sh | 8 | ||||
-rwxr-xr-x | bin/debrel | 4 | ||||
-rwxr-xr-x | bin/git-dotfiles-update-master | 11 | ||||
-rwxr-xr-x | bin/locmaint | 1 | ||||
-rwxr-xr-x | bin/normalise-mrconfig | 13 |
5 files changed, 20 insertions, 17 deletions
diff --git a/bin/bstraph.sh b/bin/bstraph.sh index 4983b710..8123bb7d 100755 --- a/bin/bstraph.sh +++ b/bin/bstraph.sh @@ -10,7 +10,13 @@ set -e # ---- Perform the bootstrap -$HOME/src/dotfiles/bin/normalise-mrconfig +if ! [ -e "$HOME/.mrconfig" ]; then + cat >"$HOME/.mrconfig" <<EOF +# -*- mode: conf -*- + +include = cat ~/src/dotfiles/lib-src/mr/config +EOF +fi ( cd $HOME/src/dotfiles mr fixups @@ -34,8 +34,8 @@ dgit push-source "$@" git push --follow-tags # # if origin is not salsa, we might also want to push to salsa -# # (.mrconfig.in should contain `git remote add -f salsa -# # salsa:foo/bar` for this repo) +# # (~/src/dotfiles/lib-src/mr/config should contain +# # `git remote add -f salsa salsa:foo/bar` for this repo) # if git remote | grep -q salsa \ # && git branch --contains salsa/$branch \ # | grep -qE " $branch$"; then diff --git a/bin/git-dotfiles-update-master b/bin/git-dotfiles-update-master index 201c4731..0a3ac34d 100755 --- a/bin/git-dotfiles-update-master +++ b/bin/git-dotfiles-update-master @@ -42,3 +42,14 @@ else echo >&2 "uh oh, dotfiles remote head is not PGP-signed by Sean" exit 1 fi + +# Migrate old normalise-mrconfig setup + +perl -000 -i'' -wn \ + -e'/DO NOT EDIT THIS BLOCK; automatically updated/ or print' ~/.mrconfig + +line="include = cat ~/src/dotfiles/lib-src/mr/config" +grep -Fxq "$line" ~/.mrconfig \ + || printf "%s\n\n" \ + "# -*- mode: conf -*-" "$line" "$(sed -e1,2d ~/.mrconfig)" \ + >~/.mrconfig diff --git a/bin/locmaint b/bin/locmaint index 919d8c3a..9a7baa28 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -217,7 +217,6 @@ sub do_homedir { my ($skip_update) = @_; chdir; - normalise_mrconfig(); src_register_all(); # Check places where temporary files are stored diff --git a/bin/normalise-mrconfig b/bin/normalise-mrconfig deleted file mode 100755 index 41b3e7e8..00000000 --- a/bin/normalise-mrconfig +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env perl - -# normalise-mrconfig -- regenerate ~/.mrconfig -# -# This script must be as portable as possible (inc. its shebang). - -use strict; -use warnings; -use lib "$ENV{HOME}/src/dotfiles/perl5"; - -use Local::Homedir; - -exit normalise_mrconfig(); |