diff options
-rwxr-xr-x | .local/bin/sync-pull.pl | 37 | ||||
-rwxr-xr-x | .local/bin/sync-push.pl | 42 | ||||
-rwxr-xr-x | .local/bin/unixize | 33 |
3 files changed, 17 insertions, 95 deletions
diff --git a/.local/bin/sync-pull.pl b/.local/bin/sync-pull.pl deleted file mode 100755 index ba65901..0000000 --- a/.local/bin/sync-pull.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use warnings; - -sub main -{ - my $i; - - print "Check...\n"; - $i = 0; - while (system('/bin/pgrep', 'newsboat') == 0) { - print "newsboat running, exiting..."; - exit 1; - } - system( - '/usr/local/bin/rsync', - '-a', - '-e', - 'ssh', - 'root@207.246.81.115:/root/sync/newsboat/cache.db', - '/home/jozan/.local/share/newsboat/cache.db' - ); - system( - '/usr/local/bin/rsync', - '-a', - '-e', - 'ssh', - 'root@207.246.81.115:/root/sync/abook/addressbook', - '/home/jozan/.abook/addressbook' - ); - exit 0; -} - -main(); - -__END__ diff --git a/.local/bin/sync-push.pl b/.local/bin/sync-push.pl deleted file mode 100755 index 91b9e83..0000000 --- a/.local/bin/sync-push.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/local/bin/perl - -use strict; -use warnings; - -sub main -{ - my $i; - - print "Check...\n"; - $i = 0; - while (system('/bin/pgrep', 'newsboat') == 0) { - sleep 5; - $i += 1; - print "Waiting...\n"; - if ($i == 12) { - print "Too long, exiting...\n"; - exit 1; - } - } - system( - '/usr/local/bin/rsync', - '-a', - '-e', - 'ssh', - '/home/jozan/.local/share/newsboat/cache.db', - 'root@207.246.81.115:/root/sync/newsboat/cache.db' - ); - system( - '/usr/local/bin/rsync', - '-a', - '-e', - 'ssh', - '/home/jozan/.abook/addressbook', - 'root@207.246.81.115:/root/sync/abook/addressbook' - ); - exit 0; -} - -main(); - -__END__ diff --git a/.local/bin/unixize b/.local/bin/unixize index 4f03c14..0e05c74 100755 --- a/.local/bin/unixize +++ b/.local/bin/unixize @@ -17,6 +17,9 @@ sub get_og_files return @og_files; } +use constant { + C_O => '', +}; sub unixize_file_names { my @og_files = @_; @@ -30,21 +33,19 @@ sub unixize_file_names $_ =~ s/ /_/g; $_ =~ s/c\+\+/cxx/g; $_ =~ s/C\+\+/CXX/g; - $_ =~ s/[áàåâä]/a/g; - $_ =~ s/[ÁÀÅÂÄ]/A/g; - $_ =~ s/æ/ae/g; - $_ =~ s/Æ/AE/g; - $_ =~ s/ç/c/g; - $_ =~ s/Ç/C/g; - $_ =~ s/[éèêë]/e/g; - $_ =~ s/[ÉÈÊË]/E/g; -ï -î -ì - $_ =~ s/ô/o/g; - $_ =~ s/Ô/O/g; - $_ =~ s/ö/o/g; - $_ =~ s/Ö/O/g; + $_ =~ s/[\x83\x84\x85\x86]/a/g; # âäàå + # $_ =~ s/[ÁÀÅÂÄ]/A/g; + $_ =~ s/\x91/ae/g; # æ + $_ =~ s/\x92/AE/g; # Æ + $_ =~ s/\x87/c/g; # ç + $_ =~ s/\x80/C/g; # Ç + # $_ =~ s/[éèêë]/e/g; + # $_ =~ s/[ÉÈÊË]/E/g; + # $_ =~ s/[ïîì]/i/g; + # $_ =~ s/[ÏÎÌ]/I/g; + # $_ =~ s/[ôöò]/o/g; + $_ =~ s/[\x93\x94\x95]/o/g; # ôöò + # $_ =~ s/[ÿ]/y/g; $_ =~ s/ü/u/g; $_ =~ s/Ü/U/g; $_ =~ s/[^A-Za-z0-9\._]+//g; @@ -71,7 +72,7 @@ sub main chdir('../'); } next if (-e $files[1]); - mv($files[0], $files[1]) or print STDERR $! . "\n"; + # mv($files[0], $files[1]) or print STDERR $! . "\n"; print "'". $files[0] . "' -> '" . $files[1] . "'\n"; } return; |