summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-07-15 14:35:44 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-07-15 15:34:47 -0700
commit29c37dba62d23eafb021e9ae16112294d8651af7 (patch)
tree7774e1a16f44ae13c2c1d4506c03bd66fd6065fc /bin
parent7e2153ccac98df619ecde41b29878606b10c82b2 (diff)
downloaddotfiles-29c37dba62d23eafb021e9ae16112294d8651af7.tar.gz
tidy up to-mbox and from-mbox scripts
Additionally, archive-fmail-to-annex creates ~/.fmail/annex if missing, and expand-annex-to-fmail creates ~/.fmail/annex/.expanded before trying to create files under that directory.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/expand-annex-mboxes33
1 files changed, 0 insertions, 33 deletions
diff --git a/bin/expand-annex-mboxes b/bin/expand-annex-mboxes
deleted file mode 100755
index 7800f021..00000000
--- a/bin/expand-annex-mboxes
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-
-use 5.028;
-use strict;
-use warnings;
-use lib "$ENV{HOME}/src/dotfiles/perl5";
-
-use Fcntl qw(LOCK_EX LOCK_NB);
-use File::Path qw(make_path);
-use File::Spec::Functions qw(splitpath);
-use Local::Homedir::Mail qw(expand_mbox);
-
-# CONFIG
-
-our $mboxes = "$ENV{HOME}/annex/mail";
-our $expanded = "$ENV{HOME}/.fmail/annex";
-
-# CODE
-
-# flock ourselves to ensure that only one copy of this script is ever running
-open our $us, "<", $0 or die $!;
-exit 0 unless glob "$mboxes/*.gz" and flock $us, LOCK_EX|LOCK_NB;
-
-make_path($expanded);
-open my $touch_fh, '>', "$expanded/.duplicity-ignore";
-close $touch_fh;
-
-foreach my $mbox (glob "$mboxes/*.gz") {
- # $mbox might be a dangling symlink on this machine
- next unless -e $mbox;
-
- expand_mbox($mbox, $expanded);
-}