Хранилища Subversion ant

Редакция

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

Редакция 672 Редакция 675
Строка 621... Строка 621...
621
           $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_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 ";
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 ";
623
           $query .= "JOIN ".$this->prefix."repscheme s ON r.scheme_id=s.scheme_id ";
624
           $query .= "WHERE v.version_id='".$data["version_id"]."' AND r.rtype_id='1'";
624
           $query .= "WHERE v.version_id='".$data["version_id"]."' AND r.rtype_id='1'";
625
           $rq =& $this->db->query($query);
625
           $rq =& $this->db->query($query);
-
 
626
           if ($rq->numRows()>0) {
626
           $rq->fetchInto($base);
627
                $rq->fetchInto($base);
627
           // Формируем type proto://host/folder
628
                // Формируем type proto://host/folder
628
           $show .= "# ".$this->secure->checkStr($base["repinfo"],1)."\n";
629
                $show .= "# ".$this->secure->checkStr($base["repinfo"],1)."\n";
629
           if ($base["repkey"]!="") {
630
                if ($base["repkey"]!="") {
630
                $show .= "# Установка ключа: ".$this->secure->checkStr($base["repkey"],1)."\n";
631
                    $show .= "# Установка ключа: ".$this->secure->checkStr($base["repkey"],1)."\n";
631
           }
632
                }
632
           $show .= $this->secure->checkStr($dist["type"],1)." ".$this->secure->checkStr($base["proto"],1).$this->secure->checkStr($base["rhost"],1).$this->secure->checkStr($base["rfolder"],1);
633
                $show .= $this->secure->checkStr($dist["type"],1)." ".$this->secure->checkStr($base["proto"],1).$this->secure->checkStr($base["rhost"],1).$this->secure->checkStr($base["rfolder"],1);
633
           $dvname = str_replace("{DIST}",$this->secure->checkStr($dist["vcodename"],1),$this->secure->checkStr($base["scheme"],1));
634
                $dvname = str_replace("{DIST}",$this->secure->checkStr($dist["vcodename"],1),$this->secure->checkStr($base["scheme"],1));
634
           // Формируем distname
635
                // Формируем distname
635
           $show .= " ".$dvname." ";
636
                $show .= " ".$dvname." ";
636
           // Формируем sections
637
                // Формируем sections
637
           $query  = "SELECT * FROM ".$this->prefix."section s ";
638
                $query  = "SELECT * FROM ".$this->prefix."section s ";
638
           $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
639
                $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
639
           $query .= "WHERE r.rep_id='".$base["rep_id"]."' AND (";
640
                $query .= "WHERE r.rep_id='".$base["rep_id"]."' AND (";
640
           for($i=0;$i<count($data["section"]);$i++) {
641
                for($i=0;$i<count($data["section"]);$i++) {
641
               $query .= "s.sect_id='".$data["section"][$i]."' ";
642
                    $query .= "s.sect_id='".$data["section"][$i]."' ";
642
               if ($i<count($data["section"])-1) {
643
                    if ($i<count($data["section"])-1) {
643
                   $query .= " OR ";
644
                        $query .= " OR ";
644
               }
645
                    }
645
           }
646
                }
646
           $query .= ")";
647
                $query .= ")";
647
           $rq =& $this->db->query($query);
648
                $rq =& $this->db->query($query);
648
           while ($rq->fetchInto($sections)) {
649
                while ($rq->fetchInto($sections)) {
649
               $show .= $sections["secname"]." ";
650
                    $show .= $sections["secname"]." ";
-
 
651
                }
-
 
652
                $show .= "\n\n";
650
           }
653
           }
651
           $show .= "\n\n";
-
 
652
654
653
           // Репозитории обновлений и третьих лиц
655
           // Репозитории обновлений и третьих лиц
654
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
656
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
655
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
657
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
656
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
658
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
Строка 665... Строка 667...
665
                        $query .= " OR ";
667
                        $query .= " OR ";
666
                    }
668
                    }
667
                }
669
                }
668
           $query .= ") ORDER BY r.rtype_id ASC";          
670
           $query .= ") ORDER BY r.rtype_id ASC";          
669
           $req =& $this->db->query($query);
671
           $req =& $this->db->query($query);
-
 
672
           if ($req->numRows()>0) {
670
           while ($req->fetchInto($updates)) {
673
                while ($req->fetchInto($updates)) {
671
                // Формируем type proto://host/folder
674
                    // Формируем type proto://host/folder
672
                $show .= "# ".$this->secure->checkStr($updates["repinfo"],1)."\n";
675
                    $show .= "# ".$this->secure->checkStr($updates["repinfo"],1)."\n";
673
                if ($updates["repkey"]!="") {
676
                    if ($updates["repkey"]!="") {
674
                    $show .= "# Установка ключа: ".$this->secure->checkStr($updates["repkey"],1)."\n";
677
                        $show .= "# Установка ключа: ".$this->secure->checkStr($updates["repkey"],1)."\n";
675
                }
678
                    }
676
                $show .= $this->secure->checkStr($dist["type"],1)." ".$this->secure->checkStr($updates["proto"],1).$this->secure->checkStr($updates["rhost"],1).$this->secure->checkStr($updates["rfolder"],1);
679
                    $show .= $this->secure->checkStr($dist["type"],1)." ".$this->secure->checkStr($updates["proto"],1).$this->secure->checkStr($updates["rhost"],1).$this->secure->checkStr($updates["rfolder"],1);
677
                $dvname = str_replace("{DIST}",$this->secure->checkStr($dist["vcodename"],1),$this->secure->checkStr($updates["scheme"],1));
680
                    $dvname = str_replace("{DIST}",$this->secure->checkStr($dist["vcodename"],1),$this->secure->checkStr($updates["scheme"],1));
678
                // Формируем distname
681
                    // Формируем distname
679
                $show .= " ".$dvname." ";
682
                    $show .= " ".$dvname." ";
680
                // Формируем sections
683
                    // Формируем sections
681
                $query  = "SELECT * FROM ".$this->prefix."section s ";
684
                    $query  = "SELECT * FROM ".$this->prefix."section s ";
682
                $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
685
                    $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
683
                $query .= "WHERE r.rep_id='".$updates["rep_id"]."'";
686
                    $query .= "WHERE r.rep_id='".$updates["rep_id"]."'";
684
                $rq =& $this->db->query($query);
687
                    $rq =& $this->db->query($query);
685
                while ($rq->fetchInto($sections)) {
688
                    while ($rq->fetchInto($sections)) {
686
                    $show .= $sections["secname"]." ";
689
                        $show .= $sections["secname"]." ";
-
 
690
                    }
-
 
691
                    $show .= "\n\n";
687
                }
692
                }
688
                $show .= "\n\n";
693
                $show .= "\n";
689
           }
694
           }
690
           $show .= "\n";
-
 
691
       } else {
695
       } else {
692
           // Базовый репозиторий
696
           // Базовый репозиторий
693
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
697
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
694
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
698
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
695
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
699
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
Строка 697... Строка 701...
697
           $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_id ";
701
           $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_id ";
698
           $query .= "JOIN ".$this->prefix."rtype t ON r.rtype_id=t.rtype_id ";
702
           $query .= "JOIN ".$this->prefix."rtype t ON r.rtype_id=t.rtype_id ";
699
           $query .= "JOIN ".$this->prefix."repscheme s ON r.scheme_id=s.scheme_id ";          
703
           $query .= "JOIN ".$this->prefix."repscheme s ON r.scheme_id=s.scheme_id ";          
700
           $query .= "WHERE v.version_id='".$data["version_id"]."' AND r.rtype_id='1'";
704
           $query .= "WHERE v.version_id='".$data["version_id"]."' AND r.rtype_id='1'";
701
           $rq =& $this->db->query($query);
705
           $rq =& $this->db->query($query);
-
 
706
           if ($rq->numRows()>0) {
702
           $rq->fetchInto($base);
707
                $rq->fetchInto($base);
703
           // Формируем type proto://host/folder
708
                // Формируем type proto://host/folder
704
           $show .= "# ".$this->secure->checkStr($base["repinfo"],1)."\n";
709
                $show .= "# ".$this->secure->checkStr($base["repinfo"],1)."\n";
705
           $show .= $this->secure->checkStr($dist["type"],1)." ";
710
                $show .= $this->secure->checkStr($dist["type"],1)." ";
706
           if ($base["sign_id"]!=0) {
711
                if ($base["sign_id"]!=0) {
707
               $query = "SELECT * FROM ".$this->prefix."signs WHERE sign_id='".$base["sign_id"]."'";
712
                    $query = "SELECT * FROM ".$this->prefix."signs WHERE sign_id='".$base["sign_id"]."'";
708
               $rq =& $this->db->query($query);
713
                    $rq =& $this->db->query($query);
709
               $rq->fetchInto($sign);
714
                    $rq->fetchInto($sign);
710
               $show .= "[".$this->secure->checkStr($sign["sname"],1)."] ";
715
                    $show .= "[".$this->secure->checkStr($sign["sname"],1)."] ";
711
           }
716
                }
712
           $show .= $this->secure->checkStr($base["proto"],1).$this->secure->checkStr($base["rhost"],1).$this->secure->checkStr($base["rfolder"],1)." ";
717
                $show .= $this->secure->checkStr($base["proto"],1).$this->secure->checkStr($base["rhost"],1).$this->secure->checkStr($base["rfolder"],1)." ";
713
           $show .= $this->secure->checkStr($base["scheme"],1)." ";
718
                $show .= $this->secure->checkStr($base["scheme"],1)." ";
714
719
715
           // Формируем sections
720
                // Формируем sections
716
           $query  = "SELECT * FROM ".$this->prefix."section s ";
721
                $query  = "SELECT * FROM ".$this->prefix."section s ";
717
           $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
722
                $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
718
           $query .= "WHERE r.rep_id='".$base["rep_id"]."' AND (";
723
                $query .= "WHERE r.rep_id='".$base["rep_id"]."' AND (";
719
           for($i=0;$i<count($data["section"]);$i++) {
724
                for($i=0;$i<count($data["section"]);$i++) {
720
               $query .= "s.sect_id='".$data["section"][$i]."' ";
725
                    $query .= "s.sect_id='".$data["section"][$i]."' ";
721
               if ($i<count($data["section"])-1) {
726
                    if ($i<count($data["section"])-1) {
722
                   $query .= " OR ";
727
                        $query .= " OR ";
723
               }
728
                    }
724
           }
729
                }
725
           $query .= ")";
730
                $query .= ")";
726
           $rq =& $this->db->query($query);
731
                $rq =& $this->db->query($query);
727
           while ($rq->fetchInto($sections)) {
732
                while ($rq->fetchInto($sections)) {
728
               $show .= $sections["secname"]." ";
733
                    $show .= $sections["secname"]." ";
-
 
734
                }
-
 
735
                $show .= "\n\n";
729
           }
736
           }
730
           $show .= "\n\n";
-
 
731
737
732
           // Репозитории обновлений и третьих лиц
738
           // Репозитории обновлений и третьих лиц
733
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
739
           $query  = "SELECT * FROM ".$this->prefix."repository r ";
734
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
740
           $query .= "JOIN ".$this->prefix."protos p ON r.proto_id=p.proto_id ";
735
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
741
           $query .= "JOIN ".$this->prefix."rephost h ON r.rhost_id=h.rhost_id ";
Строка 744... Строка 750...
744
                        $query .= " OR ";
750
                        $query .= " OR ";
745
                    }
751
                    }
746
                }
752
                }
747
           $query .= ") ORDER BY r.rtype_id ASC";
753
           $query .= ") ORDER BY r.rtype_id ASC";
748
           $req =& $this->db->query($query);
754
           $req =& $this->db->query($query);
-
 
755
           if ($req->numRows()>0) {
749
           while ($req->fetchInto($updates)) {
756
                while ($req->fetchInto($updates)) {
750
                // Формируем type proto://host/folder
757
                    // Формируем type proto://host/folder
751
                $show .= "# ".$this->secure->checkStr($updates["repinfo"],1)."\n";
758
                    $show .= "# ".$this->secure->checkStr($updates["repinfo"],1)."\n";
752
                $show .= $this->secure->checkStr($dist["type"],1)." ";
759
                    $show .= $this->secure->checkStr($dist["type"],1)." ";
753
                if ($updates["sign_id"]!=0) {
760
                    if ($updates["sign_id"]!=0) {
754
                    $query = "SELECT * FROM ".$this->prefix."signs WHERE sign_id='".$base["sign_id"]."'";
761
                        $query = "SELECT * FROM ".$this->prefix."signs WHERE sign_id='".$base["sign_id"]."'";
755
                    $rqs =& $this->db->query($query);
762
                        $rqs =& $this->db->query($query);
756
                    $rqs->fetchInto($sign);
763
                        $rqs->fetchInto($sign);
757
                    $show .= "[".$this->secure->checkStr($sign["sname"],1)."] ";
764
                        $show .= "[".$this->secure->checkStr($sign["sname"],1)."] ";
758
                }
765
                    }
759
                $show .= $this->secure->checkStr($updates["proto"],1).$this->secure->checkStr($updates["rhost"],1).$this->secure->checkStr($updates["rfolder"],1)." ";
766
                    $show .= $this->secure->checkStr($updates["proto"],1).$this->secure->checkStr($updates["rhost"],1).$this->secure->checkStr($updates["rfolder"],1)." ";
760
                $show .= $this->secure->checkStr($updates["scheme"],1)." ";
767
                    $show .= $this->secure->checkStr($updates["scheme"],1)." ";
761
                // Формируем sections
768
                    // Формируем sections
762
                $query  = "SELECT * FROM ".$this->prefix."section s ";
769
                    $query  = "SELECT * FROM ".$this->prefix."section s ";
763
                $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
770
                    $query .= "JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id ";
764
                $query .= "WHERE r.rep_id='".$updates["rep_id"]."'";
771
                    $query .= "WHERE r.rep_id='".$updates["rep_id"]."'";
765
                $rq =& $this->db->query($query);
772
                    $rq =& $this->db->query($query);
766
                while ($rq->fetchInto($sections)) {
773
                    while ($rq->fetchInto($sections)) {
767
                    $show .= $sections["secname"]." ";
774
                        $show .= $sections["secname"]." ";
-
 
775
                    }
-
 
776
                    $show .= "\n\n";
768
                }
777
                }
769
                $show .= "\n\n";
778
                $show .= "\n";
770
           }
779
           }
771
           $show .= "\n";
-
 
772
       }
780
       }
773
781
774
       $HTTPHeader1 = "Content-length: ".strlen($show);
782
       $HTTPHeader1 = "Content-length: ".strlen($show);
775
       $HTTPHeader2 = "Content-disposition: attachment; filename=sources.list\n\n";
783
       $HTTPHeader2 = "Content-disposition: attachment; filename=sources.list\n\n";
776
784