[interchange-cvs] interchange - racke modified 3 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu Feb 13 11:15:00 2003
User: racke
Date: 2003-02-13 16:14:42 GMT
Modified: . MANIFEST
Modified: debian rules
Added: dist/etc/jobs/i18n update_locales
Log:
update_locales job added
Revision Changes Path
2.89 +1 -0 interchange/MANIFEST
rev 2.89, prev_rev 2.88
Index: MANIFEST
===================================================================
RCS file: /anon_cvs/repository/interchange/MANIFEST,v
retrieving revision 2.88
retrieving revision 2.89
diff -u -r2.88 -r2.89
--- MANIFEST 12 Feb 2003 16:23:30 -0000 2.88
+++ MANIFEST 13 Feb 2003 16:14:42 -0000 2.89
@@ -252,6 +252,7 @@
dist/catalog_before.cfg
dist/error.log
dist/etc/.empty
+dist/etc/jobs/i18n/update_locales
dist/foundation/backup/.empty
dist/foundation/catalog.cfg
dist/foundation/config/additional_fields
2.17 +2 -0 interchange/debian/rules
rev 2.17, prev_rev 2.16
Index: rules
===================================================================
RCS file: /anon_cvs/repository/interchange/debian/rules,v
retrieving revision 2.16
retrieving revision 2.17
diff -u -r2.16 -r2.17
--- rules 28 Jan 2003 23:13:14 -0000 2.16
+++ rules 13 Feb 2003 16:14:42 -0000 2.17
@@ -78,6 +78,8 @@
# Create symbolic link for the configuration files. Makes
# more sense than script hacking.
ln -s /etc/interchange/interchange.cfg $(TMP)/usr/lib/interchange
+ mkdir -p $(TMP)/etc/interchange
+ mv $(TMP)/usr/lib/interchange/etc/jobs $(TMP)/etc/interchange/jobs
rm -r $(TMP)/usr/lib/interchange/etc
ln -s /etc/interchange $(TMP)/usr/lib/interchange/etc
# Setup wrapper and config script
1.1 interchange/dist/etc/jobs/i18n/update_locales
rev 1.1, prev_rev 1.0
Index: update_locales
===================================================================
[flag type=write tables=`$Config->{LocaleDatabase}`]
[perl tables=`$Config->{LocaleDatabase}`]
my ($pset, $pdir, $contents);
my (@locs);
my $db = $Db{$Config->{LocaleDatabase}};
# get all pages
$pset = $Tag->list_pages({arrayref => 1});
# get the relative page dir
if (index($Config->{PageDir}, "$Config->{VendRoot}/")) {
return "$Config->{PageDir} not relative to $Config->{VendRoot}.";
}
$pdir = substr($Config->{PageDir}, length($Config->{VendRoot}) + 1);
for (@$pset) {
# get contents of current page
$contents = $Tag->file("$pdir/$_$Config->{HTMLsuffix}");
# find [L ...]...[/L]
while ($contents =~ m:\[L(\s+(\w+)\s*)?\](.*?)\[/L\]:sg) {
push (@out, [$2 || $3, $3]);
}
# find [msg arg.0="..." arg.1="..."]...[/msg]
while ($contents =~ m:\[msg(\s+arg\.\d+=".*?")*\s*\](\s*[^\[].*?[^\]]\s*)\[/msg\]:gsi) {
push (@out, [$2, $2]);
}
}
for (@out) {
unless ($db->record_exists($_->[0])) {
Log ("No entry for $_->[0] in locale database");
$db->set_slice($_->[0], { en_US => $_->[1] });
}
}
[/perl]