Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/style.php42
-rw-r--r--packages/differences.php111
2 files changed, 144 insertions, 9 deletions
diff --git a/lib/style.php b/lib/style.php
index ee40d10..547e350 100644
--- a/lib/style.php
+++ b/lib/style.php
@@ -98,15 +98,10 @@ $difflist_sorts = array(
"label" => "i686 Version",
"mysql" => "`i686_version`"
),
- "i486_repo" => array(
- "title" => "i486 repository",
- "label" => "i486 Repository",
- "mysql" => "`i486_repo`"
- ),
- "i686_repo" => array(
- "title" => "i686 repository",
- "label" => "i686 Repository",
- "mysql" => "`i686_repo`"
+ "repo" => array(
+ "title" => "repository",
+ "label" => "Repository",
+ "mysql" => "`repo`"
),
"i486_last_moved" => array(
"title" => "i486 last updated",
@@ -120,6 +115,35 @@ $difflist_sorts = array(
)
);
+$difflist_print_columns = array(
+ 'name' => array('$pkgname'),
+ 'i486_version' => array(
+ '"<a href="/packages/i486/',
+ '$repository',
+ '"/',
+ '$pkgname',
+ '"/">',
+ '$i486_font_pre',
+ '$i486_version',
+ '$i486_font_post',
+ '"</a>'
+ ),
+ 'i686_version' => array(
+ '"<a href="/packages/i686/',
+ '$repository',
+ '"/',
+ '$pkgname',
+ '"/">',
+ '$i686_font_pre',
+ '$i686_version',
+ '$i686_font_post',
+ '"</a>'
+ ),
+ 'repository' => array('$repository'),
+ 'i486_move_date' => array('$i486_move_date'),
+ 'i686_move_date' => array('$i686_move_date')
+);
+
$grouplist_sorts = array(
"arch" => array(
"title" => "architecture",
diff --git a/packages/differences.php b/packages/differences.php
new file mode 100644
index 0000000..e861a63
--- /dev/null
+++ b/packages/differences.php
@@ -0,0 +1,111 @@
+<?php
+
+require_once "init.php";
+
+require_once BASE . "/lib/style.php";
+require_once BASE . "/lib/mysql.php";
+
+$uri_parts = explode('/', $_SERVER['REQUEST_URI']);
+
+if ($uri_parts[0] != '' || $uri_parts[1] != 'packages' || $uri_parts[2] != 'differences')
+ throw_http_error(422, 'Unprocessable Entity');
+
+$options = '';
+
+$last = array_pop($uri_parts);
+if (substr($last, 0, 1) == '?') {
+ $options = $last;
+ $last = array_pop($uri_parts);
+}
+if ($last != '')
+ array_push($uri_parts, $last);
+
+array_splice(
+ $uri_parts,
+ 0, 3
+);
+
+if (count($uri_parts) != 0)
+ throw_http_error(422, 'Unprocessable Entity');
+
+$sort = '';
+if (array_key_exists('sort', $_GET)) {
+ $criterium = $_GET['sort'];
+ if (
+ array_key_exists($criterium, $difflist_sorts) &&
+ array_key_exists('mysql', $difflist_sorts[$criterium])
+ )
+ $sort = $difflist_sorts[$criterium]['mysql'] . ',';
+ elseif (substr($criterium, 0, 1) == '-') {
+ $criterium = substr($criterium, 1);
+ if (
+ array_key_exists($criterium, $difflist_sorts) &&
+ array_key_exists('mysql', $difflist_sorts[$criterium])
+ )
+ $sort = $difflist_sorts[$criterium]['mysql'] . ' DESC,';
+ }
+}
+
+$result = mysql_run_query(
+ 'SELECT ' .
+ '`bp_i486`.`pkgname`,' .
+ mysql_query_package_version('bp_i486') . ' AS `i486_version`,' .
+ mysql_query_package_version('bp_i686') . ' AS `i686_version`,' .
+ '`r_i486`.`name` AS `repository`,' .
+ 'MAX(`bpir_i486`.`last_moved`) AS `i486_last_moved`,' .
+ 'MAX(`bpir_i686`.`last_moved`) AS `i686_last_moved`,' .
+ 'IF(' .
+ '`v_i486`.`order`<`v_i686`.`order`' .
+ ' OR `v_i486`.`order`=`v_i686`.`order`' .
+ ' AND `bp_i486`.`pkgrel`<`bp_i686`.`pkgrel`' .
+ ',1,0) AS `i486_is_oldest`' .
+ ' FROM `binary_packages` AS `bp_i486`' .
+ mysql_join_binary_packages_binary_packages_in_repositories('bp_i486', 'bpir_i486') .
+ mysql_join_binary_packages_in_repositories_repositories('bpir_i486', 'r_i486') .
+ ' AND `r_i486`.`is_on_master_mirror`' .
+ mysql_join_repositories_architectures('r_i486', 'ra_i486') .
+ ' AND `ra_i486`.`name`="i486"' .
+ ' JOIN `binary_packages` AS `bp_i686`' .
+ ' ON `bp_i486`.`pkgname`=`bp_i686`.`pkgname`' .
+ mysql_join_binary_packages_binary_packages_in_repositories('bp_i686', 'bpir_i686') .
+ mysql_join_binary_packages_in_repositories_repositories('bpir_i686', 'r_i686') .
+ ' AND `r_i686`.`is_on_master_mirror`' .
+ ' AND `r_i486`.`stability`=`r_i686`.`stability`' .
+ mysql_join_repositories_architectures('r_i686', 'ra_i686') .
+ ' AND `ra_i686`.`name`="i686"' .
+ ' JOIN `versions` as `v_i486`' .
+ ' ON `v_i486`.`epoch`=`bp_i486`.`epoch`' .
+ ' AND `v_i486`.`version`=`bp_i486`.`pkgver`' .
+ ' JOIN `versions` as `v_i686`' .
+ ' ON `v_i686`.`epoch`=`bp_i686`.`epoch`' .
+ ' AND `v_i686`.`version`=`bp_i686`.`pkgver`' .
+ ' WHERE `bp_i486`.`epoch`!=`bp_i686`.`epoch`' .
+ ' OR `bp_i486`.`pkgver`!=`bp_i686`.`pkgver`' .
+ ' OR `bp_i486`.`pkgrel`!=`bp_i686`.`pkgrel`' .
+ ' GROUP BY CONCAT(`r_i486`.`stability`, "-", `bp_i486`.`pkgname`)' .
+ ' ORDER BY ' . $sort . '`r_i486`.`stability`,`bp_i486`.`pkgname`'
+);
+$differences = array();
+while ($row = $result -> fetch_assoc()) {
+ $row['i486_move_date'] = substr($row['i486_last_moved'], 0, 10);
+ $row['i686_move_date'] = substr($row['i686_last_moved'], 0, 10);
+ if ($row['i486_is_oldest']) {
+ $row['i486_font_pre'] = '<font color="#ff0000">';
+ $row['i486_font_post'] = '</font>';
+ $row['i686_font_pre'] = '';
+ $row['i686_font_post'] = '';
+ } else {
+ $row['i486_font_pre'] = '';
+ $row['i486_font_post'] = '';
+ $row['i686_font_pre'] = '<font color="#ff0000">';
+ $row['i686_font_post'] = '</font>';
+ }
+ $differences[] = $row;
+}
+
+print_header('Package Differences Reports');
+print " <div class=\"box\">\n";
+print " <h2>Architecture Differences Between Packages</h2>\n";
+print_listing($differences, true, 'diff');
+print " </div>\n";
+print_footer();