Update translate scripts to work with git.
Replace update script operating on an svn checkout to work on a git repository.
Update links to point to gitweb instead of viewvc. Currently disables ignoring
specific commit.
diff --git a/fixlang.php b/fixlang.php
index fd4b5f1..cb2bc9e 100644
--- a/fixlang.php
+++ b/fixlang.php
@@ -75,7 +75,7 @@
echo <<<MOO
Copyright by individual Rockbox contributors
See
-http://svn.rockbox.org/viewvc.cgi/trunk/apps/lang/$langname.lang?view=log
+http://git.rockbox.org/?p=rockbox.git;a=history;f=apps/lang/$langname.lang;hb=HEAD
for details.
May be distributed under the terms of the GNU GPL version 2 or later
diff --git a/submit.php b/submit.php
index b099839..769fc95 100644
--- a/submit.php
+++ b/submit.php
@@ -32,7 +32,7 @@
$original = parselangfile(sprintf("apps/lang/%s.lang.update", $_REQUEST['lang']));
$english = parselangfile("apps/lang/english.lang");
print("Copyright by individual Rockbox contributors\n");
- printf("See\nhttp://svn.rockbox.org/viewvc.cgi/trunk/apps/lang/%s.lang?view=log\nfor details.\n", $_REQUEST['lang']);
+ printf("See\nhttp://git.rockbox.org/?p=rockbox.git;a=history;f=apps/lang/%s.lang;hb=HEAD\nfor details.\n", $_REQUEST['lang']);
print("May be distributed under the terms of the GNU GPL version 2 or later\n");
print("This file generated by http://translate.rockbox.org/\n\n");
printf("This translation was based on SVN revision %d of the original.\n\n", $langs[$_REQUEST['lang']]);
diff --git a/templates/frontpage.tpl b/templates/frontpage.tpl
index 093c4b8..a0638b5 100644
--- a/templates/frontpage.tpl
+++ b/templates/frontpage.tpl
@@ -63,7 +63,7 @@
{/if}
</td>
<td>
- <a href='http://svn.rockbox.org/viewvc.cgi?view=rev&revision={$language.last_update_rev}' title='{$language.last_update|date_format:"%c"}'>
+ <a href='http://git.rockbox.org/?p=rockbox.git;a=commit;h={$language.last_update_rev}' title='{$language.last_update|date_format:"%c"}'>
{$language.last_update|simple_timesince}
</a>
</td>
diff --git a/update.php b/update.php
index b9471bf..2bf13e8 100755
--- a/update.php
+++ b/update.php
@@ -28,11 +28,8 @@
function update_langs() {
chmod('rockbox/apps/lang', 0777); // Make sure the web server can write temp files
$cmds = <<<END
-/usr/bin/svn cleanup rockbox/apps/lang
-/usr/bin/svn update rockbox/apps/lang
-/usr/bin/svn cleanup rockbox/tools/
-/usr/bin/svn update rockbox/tools/genlang
-/usr/bin/svn update rockbox/fonts
+cd rockbox && /usr/bin/git checkout -f
+cd rockbox && /usr/bin/git pull
END;
foreach(explode("\n", $cmds) as $cmd) {
print("$ ".$cmd."\n");
@@ -43,9 +40,8 @@
$fp = fopen(VERSIONS, 'w');
foreach(glob('rockbox/apps/lang/*.lang') as $lang) {
- $xmlstr = shell_exec(sprintf("svn info --xml %s", $lang));
- list($retval, $xml, $stderr) = new SimpleXMLElement($xmlstr);
- $line = sprintf("%s:%d\n", basename($lang, '.lang'), $xml->entry->commit->attributes()->revision[0]);
+ $gitstr = shell_exec(sprintf("git log --pretty=%%h -1 %s", $lang));
+ $line = sprintf("%s:%s\n", basename($lang, '.lang'), $gitstr);
fwrite($fp, $line);
}
fclose($fp);
@@ -93,8 +89,8 @@
$retries = 0;
while ($retries < 5) {
try {
- $xmlstr = shell_exec(sprintf("svn log --xml rockbox/apps/lang/%s.lang", $lang));
- $xml = new SimpleXMLElement($xmlstr);
+ $gitstr = shell_exec(sprintf("cd rockbox && git log --pretty=%%h,%%at -50 apps/lang/%s.lang", $lang));
+ $line = sprintf("%s:%s\n", basename($lang, '.lang'), $gitstr);
$retries = 100;
}
catch (Exception $e) {
@@ -103,21 +99,18 @@
if ($retries > 5) die("Cannot succeed :(");
}
}
- $ignorerevs = explode("\n", file_get_contents('ignoredrevs.list'));
- foreach($xml->logentry as $logentry) {
- $rev = (string) $logentry['revision'];
- preg_match('@([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\.[0-9]*(.*)@', $logentry->date, $matches);
- $date = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
- switch($matches[7]) {
- case 'Z':
- $date += date("Z", $date);
- break;
- }
- if (!in_array($rev, $ignorerevs)) {
- return array($rev, $date);
- }
- }
- return array(0, 0);
+ // FIXME: ignorerevs.list / ignorehash.list doesn't work correctly right now.
+ list($rev, $date) = explode(",", trim($gitstr));
+ return array($rev, $date);
+ //$ignorehash = explode("\n", file_get_contents('ignoredhash.list'));
+ //foreach(explode('\n', $gitstr) as $logentry) {
+ // list($rev, $date) = explode(",", trim($gitstr));
+ // if(!in_array($rev, $ignorehash)) {
+ // echo("aaa");
+ // return array($rev, $date);
+ // }
+ //}
+ //return array(0, 0);
}
function update_flags() {