diff --git a/Changelog b/Changelog index 8e4470d..88ea4e4 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +1.3.11: +FIXED: NOTEDB::pwsafe3 contained the old python stuff in delete code. +================================================================================ 1.3.10: FIXED: the YAML export/import change were missing too. grml... FIXED: NOTEDB::general backend fixed loading Config::General diff --git a/NOTEDB.pm b/NOTEDB.pm index 8c2854a..6317010 100644 --- a/NOTEDB.pm +++ b/NOTEDB.pm @@ -10,7 +10,7 @@ package NOTEDB; use Exporter (); use vars qw(@ISA @EXPORT $crypt_supported); -$NOTEDB::VERSION = "1.33"; +$NOTEDB::VERSION = "1.34"; BEGIN { # make sure, it works, otherwise encryption diff --git a/NOTEDB/pwsafe3.pm b/NOTEDB/pwsafe3.pm index 31237e0..acb12d9 100644 --- a/NOTEDB/pwsafe3.pm +++ b/NOTEDB/pwsafe3.pm @@ -3,7 +3,7 @@ package NOTEDB::pwsafe3; -$NOTEDB::pwsafe3::VERSION = "1.00"; +$NOTEDB::pwsafe3::VERSION = "1.01"; use strict; use Data::Dumper; @@ -228,22 +228,31 @@ sub set_new { sub set_del { my($this, $num) = @_; + my $uuid = $this->_getuuid($num); + if(! $uuid) { + print "Note $num does not exist!\n"; + return; + } + my $fh = new FileHandle "<$this->{dbname}" or die "could not open $this->{dbname}\n"; flock $fh, LOCK_EX; my $key = $this->_getpass(); eval { - my $vault = new Vault($key, $this->{dbname}); - $vault->delrecord($this->_getuuid($num)); - - $vault->write_to_file($this->{dbname}, $key); + my $vault = new Crypt::PWSafe3(password => $key, file => $this->{dbname}); + delete $vault->{record}->{$uuid}; + $vault->markmodified(); + $vault->save(); }; if ($@) { print "Exception caught:\n$@\n"; exit 1; } - flock $fh, LOCK_UN; - $fh->close(); + + eval { + flock $fh, LOCK_UN; + $fh->close(); + }; # finally re-read the db, so that we always have the latest data $this->_retrieve($key); diff --git a/README b/README index e585346..b2cb662 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -note 1.3.10 by Thomas Linden, 02/09/2012 +note 1.3.11 by Thomas Linden, 02/10/2012 ======================================= Introduction diff --git a/bin/note b/bin/note index 021309c..7721b1f 100755 --- a/bin/note +++ b/bin/note @@ -141,7 +141,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc"); $USER = getlogin || getpwuid($<); chomp $USER; $TOPIC = 1; -$version = "1.3.10"; +$version = "1.3.11"; $CurDepth = 1; # the current depth inside the topic "directory" structure... $maxlen = "auto"; $timelen = 22;