hello
[glcas.git] / plugins / repo.php
index 54f3557..27ae54c 100644 (file)
@@ -754,6 +754,39 @@ class GLCASRepo {
                                
                } else return false;
        }
+       
+       function getRepoDetailsApt($url)
+       {
+               $action1 = $url."/dists";
+               
+               // we just want to make sure it exists really
+               error_log("in repo details apt for $url");
+               if(!glcas_isRemoteDir($action1)) {
+                       //echo "I cant find any valid APT dists's at $url<br>";
+                       return false;
+               }
+               
+               // ok, now scan for ubuntu dists as
+               $kos = getKnownOSList();
+               
+               $repos = 0;
+               $existing_repo["isrepo"] = true;
+               foreach($kos["apt"] as $key => $val) {
+                       //echo "<br>$key, $val<br>";
+                       //echo "now check, $action1/$key";
+                       if(glcas_isRemoteDir($action1."/$key")) {
+                               $existing_repos["knownrepo"][$repos] = $key;
+                               $repos++;
+                               //echo "Found Distro $val<br>";
+                       }
+               }
+               $existing_repos["nrepos"] = $repos;
+               $existing_repos["distros"] = "Ubuntu, Debian";
+               
+               
+               return $existing_repos;
+
+       }
 
        function getRepoDetailsYum($url, $ismirrorlist=false)
        {