Хранилища Subversion ant

Редакция

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

Редакция 194 Редакция 196
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 * Project:     Ant: sources.list generator
4
 * Project:     Ant: sources.list generator
5
 * File:        classic.php
5
 * File:        classic.php
6
 *
6
 *
7
 * This application is free software; you can redistribute it and/or
7
 * This application is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
11
 *
12
 * This application is distributed in the hope that it will be useful,
12
 * This application is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
15
 * Lesser General Public License for more details.
16
 *
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library; if not, write to the Free Software
18
 * License along with this library; if not, write to the Free Software
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 *
20
 *
21
 */
21
 */
22
22
23
23
24
require_once dirname(__FILE__)."/lib/init.php";
24
require_once dirname(__FILE__)."/lib/init.php";
25
$status = abs(intval($_GET["step"]));
25
$status = abs(intval($_GET["step"]));
26
$dist   = abs(intval($_GET["d"]));
26
$dist   = abs(intval($_GET["d"]));
27
$vers   = abs(intval($_GET["v"]));
27
$vers   = abs(intval($_GET["v"]));
28
28
29
$query =& $db->query("SELECT * FROM distribution");
29
$query =& $db->query("SELECT * FROM distribution");
30
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
30
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
31
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".stripslashes($data["distua"])."'>".stripslashes($data["distname"])."</span></p>\n";
31
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".stripslashes($data["distua"])."'>".stripslashes($data["distname"])."</span></p>\n";
32
}
32
}
33
33
34
if (!isset($status)) { $status = 0; };
34
if (!isset($status)) { $status = 0; };
35
35
36
if (isset($dist)) {
36
if (isset($dist)) {
37
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
37
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
38
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
38
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
39
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
39
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
40
                if ($version["vname"]!="") {
40
                if ($version["vname"]!="") {
41
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
41
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
42
                } else {
42
                } else {
43
                        $distname = "";
43
                        $distname = "";
44
                }
44
                }
45
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".stripslashes($version["distua"])."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."</span></p>\n";
45
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".stripslashes($version["distua"])."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."</span></p>\n";
46
        }
46
        }
47
}
47
}
48
48
49
if ($status==2)
49
if ($status==2)
50
{
50
{
51
        $repos=$core->getAddsRepList($dist,$vers,$db);
51
        $repos=$core->getAddsRepList($dist,$vers,$db);
52
        $repos.='<input type="checkbox" name="mainreps"  value="no"><b>НЕ включать основные репозитории</b>';
-
 
53
}
52
}
54
53
55
if ($status==3) {
54
if ($status==3) {
56
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
55
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
57
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
56
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
58
57
59
        $distname = "";
58
        $distname = "";
60
        if ($infodist["vname"]!="") {
59
        if ($infodist["vname"]!="") {
61
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
60
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
62
        }
61
        }
63
        $info = "<h2>Доступные репозитории для <em class='".stripslashes($infodist["distua"])."-em'>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em></h2>";
62
        $info = "<h2>Доступные репозитории для <em class='".stripslashes($infodist["distua"])."-em'>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em></h2>";
64
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
63
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
65
        $result .= $core->getRepList($dist,$vers,$db);
64
        $result .= $core->getRepList($dist,$vers,$db);
66
        $result .= "</pre>";
65
        $result .= "</pre>";
67
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
66
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
68
}
67
}
69
68
70
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
69
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
71
$smarty->assign('status',$status);
70
$smarty->assign('status',$status);
72
$smarty->assign('linux',$linux);
71
$smarty->assign('linux',$linux);
73
$smarty->assign('repos',$repos);
72
$smarty->assign('repos',$repos);
74
$smarty->assign('version',$distvers);
73
$smarty->assign('version',$distvers);
75
$smarty->assign('result',$result);
74
$smarty->assign('result',$result);
76
$smarty->assign('antversion',$core->getSetting('version',$db));
75
$smarty->assign('antversion',$core->getSetting('version',$db));
77
$smarty->assign('title',$core->getSetting('codename',$db));
76
$smarty->assign('title',$core->getSetting('codename',$db));
78
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
77
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
79
$smarty->assign('style',$core->getCSSList($db));
78
$smarty->assign('style',$core->getCSSList($db));
80
79
81
$smarty->display('classic.tpl');
80
$smarty->display('classic.tpl');
82
81
83
?>
82
?>
84
 
83