shithub: mkarchive

Download patch

ref: dd867674a58ff8fbf291a8d403d1d3c7f9d5da68
parent: 011e0854c8a6c7d948d4a38791ce9e02178e2927
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Sep 25 17:26:07 EDT 2014

Store all writable data within the same directory.

--- a/mkarchive.py
+++ b/mkarchive.py
@@ -7,7 +7,7 @@
 import distutils.dir_util
 
 p = argparse.ArgumentParser(description = 'Generate a mail archive')
-p.add_argument('-o', '--outdir', metavar='outdir', help='generate archive under this user')
+p.add_argument('-o', '--outdir', metavar='outdir', help='generate archive under this directory')
 p.add_argument('-m', '--mlmmjdir', metavar='listdir', help='generate archives for this list')
 p.add_argument('-M', '--mhonarc', metavar='mhonarc', default='/usr/bin/mhonarc', help='path to mhonarc binary')
 p.add_argument('-c', '--configdir', metavar='mhonarc', help='path to mhonarc config dir')
@@ -36,7 +36,7 @@
 
 def addmail(lst):
     listdir = os.path.join(opts.outdir, lst)
-    lastadded = os.path.join(listdir, '.lastindex')
+    lastadded = os.path.join(outdir, lst, '.lastindex')
     lastindex = 0
     if os.access(lastadded, os.R_OK):
         with open(lastadded, 'r') as f: