diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-08-24 14:42:07 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-08-24 14:48:15 -0700 |
commit | 3cde077c984c3ba453f7f83254fa268524e3dc00 (patch) | |
tree | 5e0d47f24cf6c995f51e43709b33bbe8fce17daf /bin/locmaint | |
parent | fa03c3cb6c0c0e399539871be6990b7d819176a2 (diff) | |
download | dotfiles-3cde077c984c3ba453f7f83254fa268524e3dc00.tar.gz |
backup repos from salsa
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-x | bin/locmaint | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bin/locmaint b/bin/locmaint index 09edb428..7f99d6cc 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -344,12 +344,25 @@ sub do_coldbkup { backup_repo($_->{uri}, catfile($gitbk, "athena_gcrypt", $_->{dir})) for @gcrypt_repos; - # misc. repos to be backed up (inc. salsa) - # TODO read from ~/doc/conf/salsarepos URIs of the form - # https://host/foo/bar/baz and backup to $gitbk/salsa/foo/bar/baz - { ... } + # repos from Debian's salsa + mkdir catfile($gitbk, "salsa"); + if (open my $fh, + '<', catfile($ENV{HOME}, "doc", "conf", "coldbkup", "salsa")) { + while (<$fh>) { + m|^https://salsa\.debian\.org/(.+)$| or next; + my $uri = $&; + my $dest = $1; + $uri .= "/" if $uri =~ /\.git\z/; + $uri .= ".git/" unless /\.git\/\z/; + backup_repo($uri, catfile($gitbk, "salsa", $dest)); + } + } else { + say_bold + ("WARNING: not backing up salsa repos: couldn't read list of repos"); + get_ack(); + } - # If I have repos to backup at some point, could create + # If I have other repos to backup at some point, could create # ~/doc/conf/otherrepos.csv which specifies URIs and dests (the # latter possibly abbreviated in some way) } |