summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-01-12 08:55:03 +0000
committerSean Whitton <spwhitton@spwhitton.name>2020-01-12 08:55:16 +0000
commita938559778202bc41a299c355910fd617408e29b (patch)
treed1d068935ab455702cb6ddc50d0af76b2a85ffb6
parentd18799aa7f6060574f2608608a1cae8c7be90e0a (diff)
downloaddotfiles-a938559778202bc41a299c355910fd617408e29b.tar.gz
implement skipping backing up annexes when not already on drive
-rwxr-xr-xbin/locmaint6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/locmaint b/bin/locmaint
index 3d0db834..20e8f9c3 100755
--- a/bin/locmaint
+++ b/bin/locmaint
@@ -95,7 +95,7 @@ our $check_for_extdrive = 0;
# desirable behaviour for some annexes, which is why we don't try to
# autodetect them
our @remote_annexes = (
- { origin => "athenag:annex.git", homedir => "lib/annex" },
+ { origin => "athenag:annex.git", homedir => "lib/annex", lazy => 1 },
{ origin => "athenag:annex19.git", homedir => "annex" },
{ origin => "athenag:libpriv.git", homedir => "lib/priv" },
{ origin => "athena:wikiannex", homedir => "lib/wikiannex" },
@@ -620,7 +620,8 @@ C<backup_repo()> should ensure it's available.
sub backup_repo {
my ($uri, $dest) = @_;
- my ($paired_annex) = map { catfile($ENV{HOME}, $_->{homedir}) }
+ my ($paired_annex, $lazy_paired_annex)
+ = map { (catfile($ENV{HOME}, $_->{homedir}), $_->{lazy} // 0) }
grep { $_->{origin} eq $uri } @remote_annexes;
$dest = "$dest.git" unless $dest =~ /\.git\z/;
@@ -654,6 +655,7 @@ sub backup_repo {
} else {
$clone_needed = 1;
}
+ return if $clone_needed and defined $paired_annex and $lazy_paired_annex;
if ($clone_needed) {
make_path($dest) unless -d $dest;
# bare repos don't get a reflog by default