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 | |
parent | fb078c0fb7f275f802eb78531344ef848798646b (diff) | |
download | dotfiles-5b165f7a3b8ca561debd4920356ceeaa923fccfb.tar.gz |
attempt to replace normalise-mrconfig script w/ "include" directive
-rwxr-xr-x | archive/bin/normalise-mrconfig (renamed from bin/normalise-mrconfig) | 0 | ||||
-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 | ||||
-rw-r--r-- | lib-src/mr/config (renamed from .mrconfig.in) | 16 | ||||
-rw-r--r-- | perl5/Local/Homedir.pm | 12 |
7 files changed, 34 insertions, 18 deletions
diff --git a/bin/normalise-mrconfig b/archive/bin/normalise-mrconfig index 41b3e7e8..41b3e7e8 100755 --- a/bin/normalise-mrconfig +++ b/archive/bin/normalise-mrconfig 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/.mrconfig.in b/lib-src/mr/config index 7b973724..fd2519cb 100644 --- a/.mrconfig.in +++ b/lib-src/mr/config @@ -115,10 +115,7 @@ lib = src \ lib \ mnt \ - # lib/athena \ - # lib/backup \ local/mutt \ - # local/anacron/spool \ local/src \ local/bin \ local/big \ @@ -128,6 +125,9 @@ lib = local/tmp \ local/auth \ local/info + # lib/athena \ + # lib/backup \ + # local/anacron/spool \ chmod 700 local/auth # [ -L "src/build-area" ] || ln -s -T /tmp/debuild src/build-area [ -e "Downloads" ] || ln -s tmp Downloads @@ -228,8 +228,6 @@ fixups = if win32; then ( cd ~/src/dotfiles/bin && cmd "/C win32setup.bat" ) else - $HOME/src/dotfiles/bin/normalise-mrconfig - # homedir_mkdirs chmod -Rf u+rwX,go= $HOME/local/auth/* || true fi @@ -273,7 +271,7 @@ fixups = .gnupg/*.kbx \ .gnupg/private-keys-v1.d/*.key \ .ssh/id_* - + # git config push.default nothing git config remote.origin.gcrypt-publish-participants true git config remote.origin.gcrypt-participants 0x0F56D0553B6D411B @@ -281,10 +279,10 @@ fixups = git config annex.autocommit true # needed for `git annex sync` git config remote.origin.annex-ignore true git config unpushed-tags.ignore true - + # git config annex.gitaddtoannex false # see README git config annex.addunlocked true # see README - + # git config mrrepo.review-unused false autoci = @@ -316,7 +314,7 @@ fixups = git config unpushed-tags.ignore true git config annex.addunlocked true git config annex.synconlyannex true - + # # TODO Use git-annex-whereused to systematically drop old News/*. git config mrrepo.review-unused false diff --git a/perl5/Local/Homedir.pm b/perl5/Local/Homedir.pm index b20259b6..1ed0ce7a 100644 --- a/perl5/Local/Homedir.pm +++ b/perl5/Local/Homedir.pm @@ -90,11 +90,13 @@ sub blocks_from_file ($) { sub src_register_all { chdir; my @known_repos; - open my $fh, "<", ".mrconfig"; - while (<$fh>) { - if (/^\[(src\/.+)\]$/) { - push @known_repos, $ENV{HOME}."/$1"; - } + foreach my $f (".mrconfig", "src/dotfiles/lib-src/mr/config") { + open my $fh, "<", $f; + while (<$fh>) { + if (/^\[(src\/.+)\]$/) { + push @known_repos, $ENV{HOME}."/$1"; + } + } } find({wanted => sub { return unless is_repo($_); |