From 5036d7a7172055a24ae9fa493e37998b725966eb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 12 Apr 2018 10:28:31 +0200 Subject: move buildmaster stuff to separate directory --- buildmaster/to-delete.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 buildmaster/to-delete.php (limited to 'buildmaster/to-delete.php') diff --git a/buildmaster/to-delete.php b/buildmaster/to-delete.php new file mode 100644 index 0000000..dfa5a39 --- /dev/null +++ b/buildmaster/to-delete.php @@ -0,0 +1,61 @@ + + +List of packages to be deleted + + + +connect_error) { + die("Connection failed: " . $mysql->connect_error); +} + +$result = $mysql -> query( + "SELECT " . + "`repositories`.`name` AS `repo`," . + "`binary_packages`.`pkgname`," . + "`binary_packages`.`epoch`," . + "`binary_packages`.`pkgver`," . + "`binary_packages`.`pkgrel`," . + "`binary_packages`.`sub_pkgrel`," . + "`architectures`.`name` AS `arch` " . + "FROM `binary_packages` " . + "JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id` " . + "JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` " . + "WHERE `binary_packages`.`is_to_be_deleted` " . + "AND NOT `repositories`.`name` IN (\"build-support\",\"build-list\",\"deletion-list\")" +); +if ($result -> num_rows > 0) { + + $count = 0; + + while ($row = $result->fetch_assoc()) { + $rows[$count] = + $row["repo"] . "/" . + $row["pkgname"] . "-"; + if ($row["epoch"] != "0") + $rows[$count] = + $rows[$count] . + $row["epoch"] . ":"; + $rows[$count] = + $rows[$count] . + $row["pkgver"] . "-" . + $row["pkgrel"] . "." . + $row["sub_pkgrel"] . "-" . + $row["arch"] . ".pkg.tar.xz"; + $count++; + } + + sort($rows); + + foreach ($rows as $row) { + print $row."
\n"; + } +} else { + print "No packages are to be deleted.\n"; +} + +?> + + -- cgit v1.2.3-70-g09d2