Make the delete function remove package bases

Deleting a single package without deleting the whole package base makes
no sense. Comments and votes are already stored on a per-package basis,
making this a straightforward extension.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-04-04 23:10:38 +02:00
parent 45bd1b34f1
commit b558572a2e
2 changed files with 58 additions and 32 deletions

View file

@ -72,13 +72,13 @@ if (check_token()) {
} elseif (current_action("do_Delete")) {
if (isset($_POST['confirm_Delete'])) {
if (!isset($_POST['merge_Into']) || empty($_POST['merge_Into'])) {
list($ret, $output) = pkg_delete($atype, $ids, NULL);
list($ret, $output) = pkg_delete($atype, pkgbase_from_pkgid($ids), NULL);
unset($_GET['ID']);
}
else {
$mergepkgid = pkgid_from_name($_POST['merge_Into']);
if ($mergepkgid) {
list($ret, $output) = pkg_delete($atype, $ids, $mergepkgid);
$merge_base_id = pkgbase_from_name($_POST['merge_Into']);
if ($merge_base_id) {
list($ret, $output) = pkg_delete($atype, pkgbase_from_pkgid($ids), $merge_base_id);
unset($_GET['ID']);
}
else {