portdb: improved 'localrepo' function and added 'version' variable to index.php

This commit is contained in:
Jose V Beneyto 2013-02-05 13:21:18 +01:00
parent 82337d86d4
commit 566f9f455e

View File

@ -1,5 +1,7 @@
<?php
$version = "3.0";
require('DB.php');
$dbhandle = "sqlite:////home/crux/public_html/local/portdb.db";
@ -15,8 +17,8 @@ function sanitize($str) {
}
function localrepo($name) {
if (is_dir("/home/crux/git-to-rsync-working-copy/crux-2.7/{$name}")) {
return "http://crux.nu/ports/crux-2.7/{$name}/";
if (is_dir("/home/crux/git-to-rsync-working-copy/crux-".$version."/{$name}")) {
return "http://crux.nu/ports/crux-".$version."/{$name}/";
}
else {
return "";