Хранилища Subversion ant

Редакция

Редакция 645 | Редакция 648 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 645 Редакция 646
Строка 598... Строка 598...
598
     * @param array $data
598
     * @param array $data
599
     * @return string
599
     * @return string
600
     */
600
     */
601
    public function showSourcesList($data) {
601
    public function showSourcesList($data) {
602
       //TODO Написать генератор sources.list
602
       //TODO Написать генератор sources.list
-
 
603
       // Извлекаем информацию о дистрибутиве и его версии
-
 
604
       $query  = "SELECT * FROM ".$this->prefix."distribution d ";
-
 
605
       $query .= "JOIN ".$this->prefix."version v ON v.version_id=d.version ";
-
 
606
       $query .= "JOIN ".$this->prefix."dtype t ON d.disttype=t.type_id ";
-
 
607
       $query .= "WHERE d.dist_id='".$data["dist_id"]."' AND d.version='".$data["version_id"]."'";
-
 
608
       $rq =& $this->db->query($query);
-
 
609
       $rq->fetchInto($dist);
-
 
610
-
 
611
       header("content-type: text/plain\n\n");
-
 
612
       $show = "# Список репозиториев для ".$this->secure->checkStr($dist["distname"],1)." ".$this->secure->checkStr($dist["version"],1)." ".$this->secure->checkStr($dist["vname"],1);
-
 
613
-
 
614
       // Извлекаем информацию о репозиториях и строим sources.list
-
 
615
       if ($dist["type"]=="deb") {
-
 
616
           // Базовый репозиторий
-
 
617
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
-
 
618
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
-
 
619
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
-
 
620
           $query .= "JOIN ".$this->prefix."repfolder f ON r.rfolder_id=p.rfolder_id ";
-
 
621
           $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_id ";
-
 
622
           $query .= "JOIN ".$this->prefix."rtype t ON r.rtype_id=t.rtype_id ";
-
 
623
           $query .= "JOIN ".$this->prefix."repscheme s ON r.scheme_id=s.scheme_id ";
-
 
624
           $query .= "WHERE v.version_id='".$data["version_id"]."' AND rtype_id='1'";
-
 
625
           $rq =& $this->db->query($query);
-
 
626
           $rq->fetchInto($base);
-
 
627
           // Формируем type proto://host/folder
-
 
628
           $show .= $this->secure->checkStr($dist["type"],1)." ".$this->secure->checkStr($dist["proto"],1).$this->secure->checkStr($dist["rhost"],1).$this->secure->checkStr($dist["rfolder"],1);
-
 
629
           $dvname = str_replace("{DIST}",$this->secure->checkStr($dist["vcodename"],1),$this->secure->checkStr($dist["scheme"],1));
-
 
630
           // Формируем distname
-
 
631
           $show .= " ".$dvname." ";
-
 
632
           // Формируем sections
-
 
633
           $query  = "SELECT * FROM ".$this->prefix."section s ";
-
 
634
           $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
-
 
635
           $query .= "WHERE r.rep_id='".$base["rep_id"]."' AND (";
-
 
636
           for($i=0;$i<count($data["section"]);$i++) {
-
 
637
               $query .= "sect_id='".$data["section"][$i]."' ";
-
 
638
               if ($i<count($data["section"])-1) {
-
 
639
                   $query .= " OR ";
-
 
640
               }
-
 
641
           }
-
 
642
           $query .= ")";
-
 
643
           $rq =& $this->db->query($query);
-
 
644
           while ($rq->fetchInto($sections)) {
-
 
645
               $show .= $sections["secname"]." ";
-
 
646
           }
-
 
647
           $show .= "\n";
-
 
648
-
 
649
       }
603
650
604
       return $show;
651
       return $show;
605
    }
652
    }
606
653
607
    /**
654
    /**