Revision d8cfd3f9
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
scripts/create_tags_file.pl | ||
---|---|---|
1 |
#!/usr/bin/perl |
|
2 |
# |
|
3 |
######################################################## |
|
4 |
# |
|
5 |
# This script creates a 'tags' file in the style of ctags |
|
6 |
# out of the SL/ modules. |
|
7 |
# Tags file is usable in some editors (vim, joe, emacs, ...). |
|
8 |
# See your editors documentation for more information. |
|
9 |
# |
|
10 |
# (c) Udo Spallek, Aachen |
|
11 |
# Licenced under GNU/GPL. |
|
12 |
# |
|
13 |
######################################################## |
|
14 |
|
|
15 |
use Perl::Tags; |
|
16 |
use IO::Dir; |
|
17 |
use Data::Dumper; |
|
18 |
|
|
19 |
use strict; |
|
20 |
use warnings FATAL =>'all'; |
|
21 |
use diagnostics; |
|
22 |
|
|
23 |
use Getopt::Long; |
|
24 |
|
|
25 |
my $parse_SL = 1; |
|
26 |
my $parse_binmozilla = 0; |
|
27 |
GetOptions("sl!" => \$parse_SL, |
|
28 |
"pm!" => \$parse_SL, |
|
29 |
"binmozilla!" => \$parse_binmozilla, |
|
30 |
"pl!" => \$parse_binmozilla, |
|
31 |
); |
|
32 |
|
|
33 |
my @files = (); |
|
34 |
push @files, grep { /\.pm$/ && s{^}{SL/}gxms } IO::Dir->new("SL/")->read() if $parse_SL; |
|
35 |
push @files, grep { /\.pl$/ && s{^}{bin/mozilla/}gxms} IO::Dir->new("bin/mozilla/")->read() if $parse_binmozilla; |
|
36 |
|
|
37 |
#map { s{^}{SL\/}gxms } @files; |
|
38 |
|
|
39 |
#print Dumper(@files); |
|
40 |
|
|
41 |
#__END__ |
|
42 |
my $naive_tagger = Perl::Tags::Naive->new( max_level=>1 ); |
|
43 |
$naive_tagger->process( |
|
44 |
files => [@files], |
|
45 |
refresh=>1 |
|
46 |
); |
|
47 |
|
|
48 |
my $tagsfile="tags"; |
|
49 |
|
|
50 |
# of course, it may not even output, for example, if there's nothing new to process |
|
51 |
$naive_tagger->output( outfile => $tagsfile ); |
|
52 |
|
|
53 |
|
|
54 |
1; |
scripts/pl2tmpl.pl | ||
---|---|---|
1 |
#!/usr/local/bin/perl -pli.orig |
|
2 |
|
|
3 |
# |
|
4 |
# perlcode -> template converter |
|
5 |
# |
|
6 |
# there's ugly perl generated html in your xy.pl? |
|
7 |
# no problem. copy&paste it into a separate html file, remove 'qq|' and '|;' and use this script to fix most of the rest. |
|
8 |
# |
|
9 |
# use: perl pl2tmpl.pl <file> |
|
10 |
# |
|
11 |
# will save the original file as file.orig |
|
12 |
# |
|
13 |
|
|
14 |
s/\$form->\{(?:"([^}]+)"|([^}]+))\}/[% $+ %]/g; |
|
15 |
s/\| \s* \. \s* \$locale->text \( ' ([^']+) ' \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg; |
|
16 |
s/\| \s* \. \s* \$locale->text \( " ([^"]+) " \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg; |
scripts/spawn_oo.pl | ||
---|---|---|
1 |
#!/usr/bin/perl |
|
2 |
|
|
3 |
BEGIN { |
|
4 |
unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). |
|
5 |
push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. |
|
6 |
} |
|
7 |
|
|
8 |
use DBI; |
|
9 |
use Data::Dumper; |
|
10 |
|
|
11 |
use SL::LXDebug; |
|
12 |
|
|
13 |
use SL::Form; |
|
14 |
use SL::Template; |
|
15 |
|
|
16 |
$sendmail = "| /usr/sbin/sendmail -t"; |
|
17 |
|
|
18 |
$| = 1; |
|
19 |
|
|
20 |
$lxdebug = LXDebug->new(); |
|
21 |
|
|
22 |
$form = new Form; |
|
23 |
$form->{"script"} = "oe.pl"; |
|
24 |
|
|
25 |
$ENV{'HOME'} = getcwd() . "/$userspath"; |
|
26 |
|
|
27 |
my $template = SL::Template::create(type => 'OpenDocument', file_name => '', form => $form, myconfig => \%myconfig, userspath => $userspath); |
|
28 |
|
|
29 |
if (@ARGV && ($ARGV[0] eq "-r")) { |
|
30 |
system("ps auxww | " . |
|
31 |
"grep -v awk | " . |
|
32 |
"awk '/^www-data.*(soffice|Xvfb)/ { print \$2 }' | " . |
|
33 |
"xargs -r kill"); |
|
34 |
sleep(10); |
|
35 |
} |
|
36 |
|
|
37 |
exit(1) unless ($template->spawn_xvfb()); |
|
38 |
exit(2) unless ($template->spawn_openoffice()); |
|
39 |
exit(0); |
scripts/templ2t8.pl | ||
---|---|---|
1 |
#!/usr/bin/perl -pli.orig |
|
2 |
|
|
3 |
# |
|
4 |
# template converter -> T8 converter |
|
5 |
# |
|
6 |
# wanna get rid of those <translate> tags? |
|
7 |
# no problem. use this script to fix most it. |
|
8 |
# |
|
9 |
# use: perl tmpl2t8.pl <file> |
|
10 |
# |
|
11 |
# will save the original file as file.orig |
|
12 |
# |
|
13 |
s/$/[% USE T8 %]/ if $. == 1; |
|
14 |
s/<translate>([^<]+)<\/translate>/[%- '$1' | \$T8 %]/xg; |
Auch abrufbar als: Unified diff
scripts: nicht mehr benötigte/funktionierende Scripte entfernt
• create_tags_file.pl: das alte tags-Format wird eigentlich nicht mehr
verwendet; wenn dann etags oder GNU global.
• spawn_oo.pl: lange veraltet; soffice heißt das Programm schon lange
nicht mehr; funktioniert nicht; unzulänglicher Test, ob Prozess läuft
• templ2t8.pl: Konvertierung vom alten Template-System wird schon lange
nicht mehr benötigt
• pl2tmpl.pl: dito