Skip to content
Snippets Groups Projects
Commit 52c33143 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

Merge branch 'master' of github.com:gonter/docu-tools

parents d1fd532c 095b1f7b
No related branches found
No related tags found
No related merge requests found
h2. File Format considerations
dead links are marked as dead links are marked as
<link:broken>text</link:broken> <link:broken>text</link:broken>
h2. Installation
h3. Ubuntu prerequisites
<pre>
apt-get install libxml-parser-perl libjson-perl
</pre>
...@@ -77,6 +77,8 @@ sub scan_dir ...@@ -77,6 +77,8 @@ sub scan_dir
my $quick= shift; # 0/undef: full scan my $quick= shift; # 0/undef: full scan
# 1: quick scan # 1: quick scan
print __LINE__, " scan_dir: quick=[$quick]\n";
$dir=~ s#/+$##; $dir=~ s#/+$##;
unless (opendir (DIR, $dir)) unless (opendir (DIR, $dir))
{ {
...@@ -90,7 +92,7 @@ sub scan_dir ...@@ -90,7 +92,7 @@ sub scan_dir
print "scan_dir: quick=[$quick]\n"; print "scan_dir: quick=[$quick]\n";
# print "rows: ", Dumper ($rows); # print "rows: ", Dumper ($rows);
%fnm= map { $_->{'fnm'} => $_ } @$rows; %fnm= map { $_->{'fnm'} => $_ } @$rows;
# print "fnm: ", Dumper (\%fnm); # print __LINE__, " fnm: ", Dumper (\%fnm);
} }
else else
{ {
...@@ -117,6 +119,7 @@ sub scan_dir ...@@ -117,6 +119,7 @@ sub scan_dir
if ($quick) if ($quick)
{ {
my $x_rec= $fnm{$fp}; my $x_rec= $fnm{$fp};
# print __LINE__, " fp=[$fp]\n";
delete ($fnm{$fp}); delete ($fnm{$fp});
if (defined ($x_rec)) if (defined ($x_rec))
...@@ -166,6 +169,7 @@ sub scan_dir ...@@ -166,6 +169,7 @@ sub scan_dir
closedir (DIR); closedir (DIR);
# TODO: list dropped files # TODO: list dropped files
print __LINE__, " fnm: ", Dumper (\%fnm);
foreach my $fp (keys %fnm) foreach my $fp (keys %fnm)
{ {
print "dropped: ", $fp, "\n"; print "dropped: ", $fp, "\n";
......
...@@ -51,6 +51,7 @@ print "find: where=[$where] pattern=[$pattern]\n"; ...@@ -51,6 +51,7 @@ print "find: where=[$where] pattern=[$pattern]\n";
@res; @res;
} }
# Note: there is also a Tomboy::Directoy::scan_dir()
sub scan_dir sub scan_dir
{ {
my $self= shift; my $self= shift;
......
...@@ -14,6 +14,7 @@ do stuff with Tomboy files ...@@ -14,6 +14,7 @@ do stuff with Tomboy files
=head1 OPTIONS =head1 OPTIONS
--note-path <dir>
-d <dir> ... full path of Tomboy notes directory -d <dir> ... full path of Tomboy notes directory
-e ... edit note (used with find) -e ... edit note (used with find)
...@@ -72,8 +73,13 @@ while (my $arg= shift (@ARGV)) ...@@ -72,8 +73,13 @@ while (my $arg= shift (@ARGV))
{ {
my ($op, $val)= split ('=', $1); my ($op, $val)= split ('=', $1);
print "op=[$op] val=[$val]\n"; print "op=[$op] val=[$val]\n";
if ($op eq 'note-path') { $note_dir= $val || shift(@ARGV); $note_dir_changed= 1; }
else
{
usage(); usage();
} }
}
elsif ($arg =~ /^-(.+)/) elsif ($arg =~ /^-(.+)/)
{ {
my @a= split ('', $1); my @a= split ('', $1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment