From 7c91c592458b7532806ef75fe09146f82f085f3b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 30 Mar 2011 20:48:09 -0500 Subject: 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 Signed-off-by: Lukas Fleischer --- web/html/pkgsubmit.php | 17 ++++------------- web/html/rss.php | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'web/html') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 3eb60c5..1540c8a 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -311,16 +311,6 @@ if ($_COOKIE["AURSID"]): $q = "DELETE FROM PackageSources WHERE PackageID = " . $packageID; db_query($q, $dbh); - # If the package was a dummy, undummy it - if ($pdata['DummyPkg']) { - $q = sprintf( "UPDATE Packages SET DummyPkg = 0, SubmitterUID = %d, MaintainerUID = %d, SubmittedTS = UNIX_TIMESTAMP() WHERE ID = %d", - $uid, - $uid, - $packageID); - - db_query($q, $dbh); - } - # If a new category was chosen, change it to that if ($_POST['category'] > 1) { $q = sprintf( "UPDATE Packages SET CategoryID = %d WHERE ID = %d", @@ -366,7 +356,6 @@ if ($_COOKIE["AURSID"]): # Update package depends $depends = explode(" ", $new_pkgbuild['depends']); foreach ($depends as $dep) { - $q = "INSERT INTO PackageDepends (PackageID, DepPkgID, DepCondition) VALUES ("; $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep); $depcondition = str_replace($deppkgname, "", $dep); @@ -374,8 +363,10 @@ if ($_COOKIE["AURSID"]): break; } - $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); - $q .= $packageID . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; + $q = sprintf("INSERT INTO PackageDepends (PackageID, DepName, DepCondition) VALUES (%d, '%s', '%s')", + $packageID, + mysql_real_escape_string($deppkgname), + mysql_real_escape_string($depcondition)); db_query($q, $dbh); } diff --git a/web/html/rss.php b/web/html/rss.php index c9b87ec..cb0bf40 100644 --- a/web/html/rss.php +++ b/web/html/rss.php @@ -31,7 +31,6 @@ $rss->image = $image; #Get the latest packages and add items for them $dbh = db_connect(); $q = "SELECT * FROM Packages "; -$q.= "WHERE DummyPkg != 1 "; $q.= "ORDER BY SubmittedTS DESC "; $q.= "LIMIT 0 , 20"; $result = db_query($q, $dbh); -- cgit v1.2.3-70-g09d2