diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-30 20:48:09 -0500 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-04-03 22:59:32 +0200 |
commit | 7c91c592458b7532806ef75fe09146f82f085f3b (patch) | |
tree | b2fa71032464ec0f2c3fe286c3bd629d18b6fa4f /web/template | |
parent | 1f252eba64acf18719bd514a7a4464ca18f4c1cb (diff) |
Remove Dummy Package concept
Instead, we just store dependencies directly in the PackageDepends
table. Since we don't use this info anywhere besides the package details
page, there is little value in precalculating what is in the AUR vs.
what is not.
An upgrade path is provided via several SQL statements in the UPGRADING
document. There should be no user-visible change from this, but the DB
schema gets a bit more sane and we no longer have loads of junk packages
in our tables that are never shown to the end user. This should also
help the MySQL query planner in several cases as we no longer have to be
careful to exclude dummy packages on every query.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/pkg_details.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 1a1e611..ef2ba73 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -101,24 +101,22 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[ </p> <?php - # $deps[0] = array('id','name', 'dummy'); $deps = package_dependencies($row["ID"]); - $requiredby = package_required($row["ID"]); + $requiredby = package_required($row["Name"]); if (count($deps) > 0 || count($requiredby) > 0) { echo '<p>'; } if (count($deps) > 0) { - echo "<span class='boxSoftTitle'><span class='f3'>". __("Dependencies")."</span></span>"; while (list($k, $darr) = each($deps)) { - if ($darr[2] == 0) { - # $darr[3] is the DepCondition - echo " <a href='packages.php?ID=".$darr[0]."'>".$darr[1].$darr[3]."</a>"; + # darr: (DepName, DepCondition, PackageID), where ID is NULL if it didn't exist + if (!is_null($darr[2])) { + echo " <a href='packages.php?ID=".$darr[2]."'>".$darr[0].$darr[1]."</a>"; } else { - echo " <a href='http://www.archlinux.org/packages/?q=".$darr[1]."'>".$darr[1].$darr[3]."</a>"; + echo " <a href='http://www.archlinux.org/packages/?q=".$darr[0]."'>".$darr[0].$darr[1]."</a>"; } } @@ -128,17 +126,12 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[ } if (count($requiredby) > 0) { - echo "<span class='boxSoftTitle'><span class='f3'>". __("Required by")."</span></span>"; while (list($k, $darr) = each($requiredby)) { - if ($darr[2] == 0) { - echo " <a href='packages.php?ID=".$darr[0]."'>".$darr[1]."</a>"; - } else { - print "<a href='http://www.archlinux.org/packages/?q=".$darr[1]."'>".$darr[1]."</a>"; - } + # darr: (PackageName, PackageID) + echo " <a href='packages.php?ID=".$darr[1]."'>".$darr[0]."</a>"; } - } if (count($deps) > 0 || count($requiredby) > 0) { |