'', 'added' => 'added', 'removed' => 'removed'); $actions = array('' => ''); $archs = array('all' => 'all'); $result = mysql_run_query( "SELECT DISTINCT `architectures`.`name` FROM `architectures`" . mysql_join_architectures_repositories() . " WHERE `repositories`.`is_on_master_mirror`" . " ORDER BY `name`" ); while ($row = $result -> fetch_assoc()) $archs[$row['name']] = $row['name']; $repos = array('' => ''); $result = mysql_run_query( "SELECT DISTINCT `repositories`.`name` FROM `repositories` WHERE `repositories`.`is_on_master_mirror` ORDER BY `name`" ); while ($row = $result -> fetch_assoc()) $repos[$row['name']] = $row['name']; if (count($uri_parts) > 0 && array_key_exists($uri_parts[0], $actions)) { $action = $uri_parts[0]; array_splice( $uri_parts, 0, 1 ); } else $action = ''; if (count($uri_parts) > 0) { if (!array_key_exists($uri_parts[0], $archs)) throw_http_error(501, "Not Implemented", implode('/',$uri_parts)); $arch = $uri_parts[0]; array_splice( $uri_parts, 0, 1 ); } else $arch = ''; if (count($uri_parts) > 0) { if (!array_key_exists($uri_parts[0], $repos)) throw_http_error(501, "Not Implemented", implode('/',$uri_parts)); $repo = $uri_parts[0]; array_splice( $uri_parts, 0, 1 ); } else $repo = ''; if (count($uri_parts) != 0) throw_http_error(501, "Not Implemented", implode('/',$uri_parts)); # $result = mysql_run_query( # TODO # ); print ""; print ""; print ""; print "Arch Linux 32: "; switch ($action) { case '': print "Recent package updates"; break; case 'added': print "Recent added packages"; break; case 'removes': print "Recent removed packages"; break; } if ($arch != 'all') print " (" . $arch; if ($repo != '') print " [" . $repo . "]"; if ($arch != '') print ")"; print ""; print ""; print "https://archlinux32.org/packages/"; print ""; print ""; switch ($action) { case '': print "Recently updated packages in the Arch Linux 32 package repositories"; break; case 'added': print "Recently added packages to the Arch Linux 32 package repositories"; break; case 'removes': print "Recently removed packages from the Arch Linux 32 package repositories"; break; } if ($arch != 'all') print " for the " . $arch . " architecture (including 'any' packages)"; else print " for all architectures"; if ($repo != '') print " for the " . $repo . " repository"; print ""; print ""; print ""; print ""; print "en-us"; print ""; print ""; # TODO print ""; foreach ($packages as $package) { print ""; print ""; print $package['pkgname']; if (array_key_exists('epoch',$package)) print $package['epoch'] . ":"; print $package['pkgver'] . "-" . $package['pkgrel']; if (!$package['sub_pkgrel_omitted']) print '.' . $package['sub_pkgrel']; pinrt ' ' . $package['architecture']; print ""; # TODO print ""; } print ""; print ""; die(); } throw_http_error(501, "Not Implemented");