Release Jed 0.99.18-1
Paul Boekholt
p.boekholt at hetnet.nl
Thu May 18 20:18:44 UTC 2006
On Thu, 18 May 2006 19:27:52 +0200, Rafael Laboissiere <rafael at debian.org> said:
> jedstate has a mechanism for purging old entries that is different from
> that of gdbmrecent. As far as I understand, every time gdbmrecent.sl is
> loaded, it will purge entries in ~/.recent_db which are older than one
> week, that amount of time being hardcoded in the source.
Yes.
> jedstate comes with a program (/usr/bin/jedstate) which is used for
> purging the old entries, usually used as a cron job. This means that
> users can choose the age of the entries that should be purged. It would
> be interesting to make the cutoff date customizable in gdbmrecent. Do
> you think you can do it, Paul?
I'll add a customvariable for it.
> I still think that a conversion script is interesting, as a courtesy to
> our users who will upgrade to jed_0.99.18-1 and will have their jedstate
> package broken.
This script should do it.
#!/usr/local/bin/jed-script
require("gdbm");
define convert_db()
{
variable indb, outdb, key, value, v;
indb = gdbm_open(path_concat(getenv("HOME"), ".jedstate.db"), GDBM_READER, 0600);
if (indb == NULL)
verror(gdbm_error());
outdb = gdbm_open(path_concat(Jed_Home_Directory, "recent_db"), GDBM_WRCREAT, 0600);
if (outdb == NULL)
verror(gdbm_error());
foreach key, value (indb) using ("keys", "values")
{
v = strchop(value, '\t', 0);
outdb[key]=sprintf("%s:%s:%s", v[2], v[0], v[1]);
}
}
convert_db();
More information about the Pkg-jed-devel
mailing list