diff options
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/index.php | 14 | ||||
-rw-r--r-- | web/html/pkgsubmit.php | 39 |
2 files changed, 37 insertions, 16 deletions
diff --git a/web/html/index.php b/web/html/index.php index e05b555..95989f5 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -143,12 +143,12 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { case "/css/aur.css": case "/css/archnavbar/archnavbar.css": header("Content-Type: text/css"); - include "./$path"; + readfile("./$path"); break; case "/css/archnavbar/archlogo.gif": case "/images/new.png": header("Content-Type: image/png"); - include "./$path"; + readfile("./$path"); break; case "/css/archnavbar/archlogo.png": case "/images/AUR-logo-80.png": @@ -158,11 +158,17 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { case "/images/titlelogo.png": case "/images/x.png": header("Content-Type: image/png"); - include "./$path"; + readfile("./$path"); break; case "/js/bootstrap-typeahead.min.js": header("Content-Type: application/javascript"); - include "./$path"; + readfile("./$path"); + break; + case "/packages.gz": + case "/pkgbase.gz": + header("Content-Type: text/plain"); + header("Content-Encoding: gzip"); + readfile("./$path"); break; default: header("HTTP/1.0 404 Not Found"); diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index a11fb5b..8cecd67 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -137,6 +137,13 @@ if ($uid): continue; } list($key, $value) = explode(' = ', $line, 2); + $tokens = explode('_', $key, 2); + $key = $tokens[0]; + if (count($tokens) > 1) { + $arch = $tokens[1]; + } else { + $arch = NULL; + } switch ($key) { case 'pkgbase': case 'pkgname': @@ -169,7 +176,8 @@ if ($uid): break; case 'license': case 'groups': - case 'source': + $section_info[$key][] = $value; + break; case 'depends': case 'makedepends': case 'checkdepends': @@ -177,7 +185,8 @@ if ($uid): case 'conflicts': case 'provides': case 'replaces': - $section_info[$key][] = $value; + case 'source': + $section_info[$key][$arch][] = $value; break; } } @@ -354,23 +363,29 @@ if ($uid): } foreach (array('depends', 'makedepends', 'checkdepends', 'optdepends') as $deptype) { - foreach ($pi[$deptype] as $dep) { - $deppkgname = preg_replace("/(<|=|>).*/", "", $dep); - $depcondition = str_replace($deppkgname, "", $dep); - pkg_add_dep($pkgid, $deptype, $deppkgname, $depcondition); + foreach ($pi[$deptype] as $deparch => $depgrp) { + foreach ($depgrp as $dep) { + $deppkgname = preg_replace("/(<|=|>).*/", "", $dep); + $depcondition = str_replace($deppkgname, "", $dep); + pkg_add_dep($pkgid, $deptype, $deppkgname, $depcondition, $deparch); + } } } foreach (array('conflicts', 'provides', 'replaces') as $reltype) { - foreach ($pi[$reltype] as $rel) { - $relpkgname = preg_replace("/(<|=|>).*/", "", $rel); - $relcondition = str_replace($relpkgname, "", $rel); - pkg_add_rel($pkgid, $reltype, $relpkgname, $relcondition); + foreach ($pi[$reltype] as $relarch => $relgrp) { + foreach ($relgrp as $rel) { + $relpkgname = preg_replace("/(<|=|>).*/", "", $rel); + $relcondition = str_replace($relpkgname, "", $rel); + pkg_add_rel($pkgid, $reltype, $relpkgname, $relcondition, $relarch); + } } } - foreach ($pi['source'] as $src) { - pkg_add_src($pkgid, $src); + foreach ($pi['source'] as $srcarch => $srcgrp) { + foreach ($srcgrp as $src) { + pkg_add_src($pkgid, $src, $srcarch); + } } } |