File: update_languages

package info (click to toggle)
phpbb3 3.0.7-PL1-4%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 58,756 kB
  • ctags: 28,744
  • sloc: php: 457,643; sql: 9,245; sh: 521; makefile: 59; perl: 32
file content (38 lines) | stat: -rwxr-xr-x 993 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl -w
use strict;

die "Must be executed in the 'debian' subdir" unless -d 'upstream';

`rm -f upstream/phpbb3_l10n-*.info`;

my @files;

open DOWNLOADS, "wget -q -O- http://www.phpbb.com/languages|";
while (<DOWNLOADS>) {
	m,www\.phpbb\.com/files/language_packs_30x/((?:lang|subsilver2|prosilver)_[^"]+\.tar\.gz),
		or next;
	push @files, $1;
}
close DOWNLOADS;

for (@files) {
	/([^_]+)_(.*)\.tar\.gz/;
# 	my $prefix = $1 eq "lang" ? "" : "phpbb3_l1On-";
	open INFO, "> upstream/phpbb3_l10n-$1-$2.info";
	my $target = $_;
	$target =~ s,_,/,;
# 	print INFO "Filename=$target\n";
# 	# Hack due to upstream bug
# 	s/.tar.gz/.tgz/ if /lang_esperanto.tar.gz/;
	my $url = "http://www.phpbb.com/files/language_packs_30x/$_";
	if ($url =~ m,[^a-z320/_.:],i) {
		die "Invalid character in language URL: $url\n";
	}
	print INFO "Url=$url\n";
	print INFO "Md5=".`wget -q -N -O- $url | md5sum | sed 's/ .*//'`;
	print INFO "Copyright=GPL-2\n";
	print INFO "Include=yes\n";
	close INFO;
}