From 8ac70b82acf74e409cfacdfd0c9c59ca0b0bc6e7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 3 May 2018 21:54:50 +0200 Subject: packages/: show to-be-deleted flag --- packages/index.php | 42 +++++++++++++++++++++++++++++++++++++++--- packages/pkginfo.php | 23 ++++++++++++++++++++--- 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/packages/index.php b/packages/index.php index c0f4921..53bfb1d 100644 --- a/packages/index.php +++ b/packages/index.php @@ -3,7 +3,7 @@ include "lib/mysql.php"; include "lib/style.php"; - foreach (array("bugs","sort") as $expected_param) + foreach (array("bugs","sort","del") as $expected_param) if (! isset($_GET[$expected_param])) $_GET[$expected_param] = ""; @@ -49,6 +49,11 @@ if ($_GET["bugs"] == "No Bugs") $filter .= " AND NOT `binary_packages`.`has_issues`"; + if ($_GET["del"] == "To Be Deleted") + $filter .= " AND `binary_packages`.`is_to_be_deleted`"; + if ($_GET["del"] == "Not To Be Deleted") + $filter .= " AND NOT `binary_packages`.`is_to_be_deleted`"; + if (isset($_GET["q"])) { $exact_filter = " AND `binary_packages`.`pkgname` = from_base64(\"".base64_encode($_GET["q"])."\")"; $fuzzy_filter = " AND `binary_packages`.`pkgname` LIKE from_base64(\"".base64_encode("%".$_GET["q"]."%")."\")"; @@ -78,7 +83,8 @@ "`binary_packages`.`sub_pkgrel`) AS `version`," . "IF(`binary_packages`.`has_issues`,1,0) AS `has_issues`," . "`build_assignments`.`return_date` AS `build_date`," . - "`binary_packages`.`last_moved` AS `move_date`" . + "`binary_packages`.`last_moved` AS `move_date`," . + "IF(`binary_packages`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`" . $query ); $exact_matches = array(); @@ -120,6 +126,11 @@ "title" => "last update", "label" => "Last Updated", "mysql" => "IFNULL(`binary_packages`.`last_moved`,\"00-00-0000 00:00:00\")" + ), + "del" => array( + "title" => "to be deleted", + "label" => "Delete", + "mysql" => "`binary_packages`.`is_to_be_deleted`" ) ); @@ -162,7 +173,8 @@ "`binary_packages`.`sub_pkgrel`) AS `version`," . "IF(`binary_packages`.`has_issues`,1,0) AS `has_issues`," . "`build_assignments`.`return_date` AS `build_date`," . - "`binary_packages`.`last_moved` AS `move_date`" . + "`binary_packages`.`last_moved` AS `move_date`," . + "IF(`binary_packages`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`" . $query . " LIMIT " . (($page-1)*100) . ", 100" ); @@ -211,6 +223,14 @@ print " "; print "\n"; print " \n"; + print " \n"; + print " "; + if ($row["is_to_be_deleted"]) + print "to be deleted"; + else + print " "; + print "\n"; + print " \n"; print " \n"; if ($oddity == "odd" ) $oddity = "even"; @@ -323,6 +343,22 @@ if (isset($_GET["q"])) print " selected=\"selected\""; print ">" . $label . "\n"; } +?> + + +
+
diff --git a/packages/pkginfo.php b/packages/pkginfo.php index fb0a992..c7539e5 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -77,7 +77,8 @@ "CONCAT(\"\\\"\",`install_target_providers`.`id`,\"\\\": \",\"{\\n\"," . "\" \\\"repo\\\": \\\"\",`repositories`.`name`,\"\\\",\\n\"," . "\" \\\"arch\\\": \\\"\",`architectures`.`name`,\"\\\",\\n\"," . - "\" \\\"pkgname\\\": \\\"\",`binary_packages`.`pkgname`,\"\\\"\\n\"," . + "\" \\\"pkgname\\\": \\\"\",`binary_packages`.`pkgname`,\"\\\",\\n\"," . + "\" \\\"is_to_be_deleted\\\": \\\"\",IF(`binary_packages`.`is_to_be_deleted`,\"1\",\"0\"),\"\\\"\\n\"," . "\"}\"" . ")) AS `deps`," . "`install_targets`.`name` AS `install_target`" . @@ -166,7 +167,8 @@ "`repositories`.`name` AS `repo`," . "`repositories`.`is_on_master_mirror`," . "`architectures`.`name` AS `arch`," . - "`binary_packages`.`pkgname`" . + "`binary_packages`.`pkgname`," . + "IF(`binary_packages`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`" . " FROM `install_target_providers`" . " JOIN `install_targets` ON `install_targets`.`id`=`install_target_providers`.`install_target`" . " AND `install_targets`.`name` NOT IN (\"base\",\"base-devel\")" . @@ -211,6 +213,7 @@ $mysql_result = mysql_run_query( "SELECT " . "`binary_packages`.`pkgname` AS `pkgname`," . + "IF(`binary_packages`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`," . "`repositories`.`name` AS `repo`," . "`repositories`.`is_on_master_mirror`," . "`architectures`.`name` AS `arch`," . @@ -333,7 +336,11 @@ if (count($elsewhere)>0) { print " "; } + if ($subst["is_to_be_deleted"]) + print ""; print $subst["pkgname"] . "-" . $subst["version"] . " [" . $subst["repo"] . "] (" . $subst["arch"] . ")"; + if ($subst["is_to_be_deleted"]) + print ""; if ($subst["is_on_master_mirror"]) print "\n"; print " \n"; @@ -462,7 +469,13 @@ if (count($elsewhere)>0) { print ", "; $first = false; print "".$d_p["pkgname"].""; + print "title=\"View package details for ".$d_p["pkgname"]."\">"; + if ($d_p["is_to_be_deleted"]) + print ""; + print $d_p["pkgname"]; + if ($d_p["is_to_be_deleted"]) + print ""; + print ""; } if ($virtual_dep) print ")"; @@ -490,7 +503,11 @@ if (count($elsewhere)>0) { print ""; } + if ($dep["is_to_be_deleted"]) + print ""; print $dep["pkgname"]; + if ($dep["is_to_be_deleted"]) + print ""; if ($dep["repo"] != $content["repo"]) print " [" . $dep["repo"] . "]"; if ($dep["is_on_master_mirror"]=="1") -- cgit v1.2.3-70-g09d2