return false;
}
+function glcas_fileExists($url)
+{
+ $fp = fopen($url, "r");
+ //error_og("did file_get_contents on $url");
+ $retval = false;
+ foreach($http_response_header as $key => $val) {
+ //error_log("got header of $key for $val");
+ if(preg_match("/.*HTTP\/.*200.*/", $val)) {
+ //echo "is true\n";
+
+ $retval = true;
+ }
+ }
+ fclose($fp);
+ return $retval;
+}
+
function glcas_startInstaller()
{
global $WEB_ROOT_FS, $BASE_URL;
{
$myRep = new GLCASRepo($this->config);
+ $kos = getKnownOSList();
+
$wasyum = false;
$wasapt = false;
if($_REQUEST["repotype"] == "yumbase") {
$extratext = "";
$provides = "";
if($glt["nrepos"] > 0) {
- $kos = getKnownOSList();
+
foreach($glt["knownrepo"] as $key => $val) {
$reponame = $kos["apt"][$val];
//echo "Fount a repo, $val which is $reponame<br>";
$version = $glt["versions"];
$archs = $glt["arch"];
+ echo "<pre>";
+ print_r($glt);
+ echo "</pre>";
+
echo "<form method=\"post\" action=\"?action=addrepoapt\">";
echo "<input type=\"hidden\" name=\"repourl\" value=\"$repourl\">";
echo "<input type=\"hidden\" name=\"distro\" value=\"$distros\">";
echo "<tr><td>Description</td><td><input type=\"text\" name=\"desc\" value=\"APT Repo$extratext\"></td>";
// TODO change this "provides" bit with a bit that allows us to choose which versions
// of ubuntu will be made available from the ones we found
- echo "<tr><td>Provides</td><td><textarea name=\"provides\" rows=\"".$glt["nrepos"]."\" cols=\"100\">$provides</textarea></td></tr>";
+ echo "<tr><td>Provides (tick those you wish to BLOCK)</td><td>";
+ foreach($glt["knownrepo"] as $key => $val) {
+ $reponame = $kos["apt"][$val["name"]];
+ $a = "";
+ $b = "";
+ if($glt["knownrepo"][$key]["i386"]) $a = "i386";
+ if($glt["knownrepo"][$key]["amd64"]) $b = "x86_64";
+ if($a != "" && $b != "") $archs = "$a/$b";
+ else $archs = "$a$b";
+ echo "<input type=\"checkbox\" name=\"$val\"> $reponame ($archs)<br>";
+ }
+
+ echo "</td></tr>";
+ //echo "<tr><td>Provides</td><td><textarea name=\"provides\" rows=\"".$glt["nrepos"]."\" cols=\"100\">$provides</textarea></td></tr>";
echo "<tr><td>Short URL</td><td><input type=\"text\" name=\"shorturl\"></td></tr>";
echo "<tr><td>URL Prefix (blank for none)</td><td><input type=\"text\" name=\"prefix\"></td></tr>";
echo "<tr><td>Expire time for Meta Data</td><td><input type=\"text\" name=\"expiretime\" value=\"3\"> days</td></tr>";
// ubuntu bit for apt
- $kos["apt"]["hardy"] = "Hardy Heron (8.04)";
- $kos["apt"]["hardy-backports"] = "Hardy Heron (8.04) Backports";
- $kos["apt"]["hardy-proposed"] = "Hardy Heron (8.04) Proposed";
- $kos["apt"]["hardy-security"] = "Hardy Heron (8.04) Security";
- $kos["apt"]["hardy-updates"] = "Hardy Heron (8.04) Updates";
+ // TODO uncomment these ones out of testing
+ /*$kos["apt"]["hardy"] = "Hardy Heron (8.04 LTS)";
+ $kos["apt"]["hardy-backports"] = "Hardy Heron (8.04 LTS) Backports";
+ $kos["apt"]["hardy-proposed"] = "Hardy Heron (8.04 LTS) Proposed";
+ $kos["apt"]["hardy-security"] = "Hardy Heron (8.04 LTS) Security";
+ $kos["apt"]["hardy-updates"] = "Hardy Heron (8.04 LTS) Updates";
$kos["apt"]["karmic"] = "Karmic Koala (9.10)";
$kos["apt"]["karmic-backports"] = "Karmic Koala (9.10) Backports";
$kos["apt"]["karmic-proposed"] = "Karmic Koala (9.10) Proposed";
$kos["apt"]["maverick-backports"] = "Maverick Meerkat (10.10) Backports";
$kos["apt"]["maverick-proposed"] = "Maverick Meerkat (10.10) Proposed";
$kos["apt"]["maverick-security"] = "Maverick Meerkat (10.10) Security";
- $kos["apt"]["maverick-updates"] = "Maverick Meerkat (10.10) Updates";
+ $kos["apt"]["maverick-updates"] = "Maverick Meerkat (10.10) Updates";*/
$kos["apt"]["natty"] = "Natty Narwhal (11.04)";
$kos["apt"]["natty-backports"] = "Natty Narwhal (11.04) Backports";
$kos["apt"]["natty-proposed"] = "Natty Narwhal (11.04) Proposed";
$kos["apt"]["natty-security"] = "Natty Narwhal (11.04) Security";
$kos["apt"]["natty-updates"] = "Natty Narwhal (11.04) Updates";
- $kos["apt"]["oneiric"] = "Oneiric Ocelot (11.10)";
+ /*$kos["apt"]["oneiric"] = "Oneiric Ocelot (11.10)";
$kos["apt"]["oneiric-backports"] = "Oneiric Ocelot (11.10) Backports";
$kos["apt"]["oneiric-proposed"] = "Oneiric Ocelot (11.10) Proposed";
$kos["apt"]["oneiric-security"] = "Oneiric Ocelot (11.10) Security";
$kos["apt"]["squeeze"] = "Debian Squeeze";
$kos["apt"]["wheezy"] = "Debian Wheezy";
$kos["apt"]["stable"] = "Debian Stable";
- $kos["apt"]["unstable"] = "Debian Unstable";
+ $kos["apt"]["unstable"] = "Debian Unstable";*/
//echo "<br>$key, $val<br>";
//echo "now check, $action1/$key";
if(glcas_isRemoteDir($action1."/$key")) {
- $existing_repos["knownrepo"][$repos] = $key;
- $repos++;
+ $existing_repos["knownrepo"][$repos]["name"] = $key;
//echo "Found Distro $val<br>";
+ if(glcas_fileExists($action1."/$key/Contents-amd64.gz")) $existing_repos["knownrepo"][$repos]["amd64"] = true;
+ else $existing_repos["knownrepo"][$repos]["amd64"] = false;
+ if(glcas_fileExists($action1."/$key/Contents-i386.gz")) $existing_repos["knownrepo"][$repos]["i386"] = true;
+ else $existing_repos["knownrepo"][$repos]["i386"] = false;
+ $repos++;
+
}
}
$existing_repos["nrepos"] = $repos;