Редакция 471 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 471 | Редакция 480 | ||
---|---|---|---|
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd"> |
- | |
2 | <html lang="ru"> |
- | |
3 | <head> |
- | |
4 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> |
- | |
5 | <title>Генератор sources.list для apt.niX-FILES</title> |
- | |
6 | </head> |
- | |
7 | <body bgcolor="#F7F7F7"> |
- | |
8 | - | ||
9 | <h1>sources.list</h1> |
- | |
10 | - | ||
11 | <?php
|
1 | <?php
|
12 | 2 | ||
- | 3 | include "inc/header.htm"; |
|
- | 4 | ||
13 | require_once 'DB.php'; |
5 | require_once 'DB.php'; |
14 | 6 | ||
15 | $dsn = 'sqlite:///apt.db?mode=0777'; |
7 | $dsn = 'sqlite:///apt.db?mode=0777'; |
16 | 8 | ||
17 | $db_apt =& DB::connect($dsn); |
9 | $db_apt =& DB::connect($dsn); |
18 | if (PEAR::isError($db_apt)) { |
10 | if (PEAR::isError($db_apt)) { |
19 | die($db_apt->getMessage()); |
11 | die($db_apt->getMessage()); |
20 | }
|
12 | }
|
21 | 13 | ||
22 | $dsn = 'sqlite:///set.db?mode=0777'; |
14 | $dsn = 'sqlite:///set.db?mode=0777'; |
23 | 15 | ||
24 | $db_set =& DB::connect($dsn); |
16 | $db_set =& DB::connect($dsn); |
25 | if (PEAR::isError($db_set)) { |
17 | if (PEAR::isError($db_set)) { |
26 | die($db_set->getMessage()); |
18 | die($db_set->getMessage()); |
27 | }
|
19 | }
|
28 | 20 | ||
- | 21 | <h1>sources.list</h1> |
|
- | 22 | ||
29 | $distr = abs(intval($_GET["d"])); |
23 | $distr = abs(intval($_GET["d"])); |
30 | 24 | ||
31 | if($distr==0) { |
25 | if($distr==0) { |
32 | $reps =& $db_apt->query("SELECT * FROM reps"); |
26 | $reps =& $db_apt->query("SELECT * FROM reps"); |
33 | while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) { |
27 | while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) { |
34 | $dists =& $db_apt->query("SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id=".$info_reps['id']); |
28 | $dists =& $db_apt->query("SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id=".$info_reps['id']); |
35 | echo "# ".$info_reps['rep']."<br>"; |
29 | echo "# ".$info_reps['rep']."<br>"; |
36 | while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) { |
30 | while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) { |
37 | echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist']; |
31 | echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist']; |
38 | $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']); |
32 | $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']); |
39 | while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) { |
33 | while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) { |
40 | echo " ".$info_sects['sects.sect']; |
34 | echo " ".$info_sects['sects.sect']; |
41 | }
|
35 | }
|
42 | echo "<br>"; |
36 | echo "<br>"; |
43 | }
|
37 | }
|
44 | }
|
38 | }
|
45 | }
|
39 | }
|
46 | else { |
40 | else { |
47 | $codename =& $db_set->getOne("SELECT codename FROM vers WHERE id=".$distr); |
41 | $codename =& $db_set->getOne("SELECT codename FROM vers WHERE id=".$distr); |
48 | 42 | ||
49 | $reps =& $db_apt->query("SELECT * FROM reps"); |
43 | $reps =& $db_apt->query("SELECT * FROM reps"); |
50 | while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) { |
44 | while ($reps->fetchInto($info_reps,DB_FETCHMODE_ASSOC)) { |
51 | $dists =& $db_apt->query('SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id='.$info_reps['id'].' AND dists.dist LIKE "'.$codename.'%"'); |
45 | $dists =& $db_apt->query('SELECT * FROM reps2dists JOIN dists ON reps2dists.dist_id=dists.id WHERE rep_id='.$info_reps['id'].' AND dists.dist LIKE "'.$codename.'%"'); |
52 | if ($dists->numRows()!=0) echo "# ".$info_reps['rep']."<br>"; |
46 | if ($dists->numRows()!=0) echo "# ".$info_reps['rep']."<br>"; |
53 | while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) { |
47 | while ($dists->fetchInto($info_dists,DB_FETCHMODE_ASSOC)) { |
54 | echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist']; |
48 | echo " http://apt.nix-files.org.ru/".$info_reps['rep']." ".$info_dists['dists.dist']; |
55 | $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']); |
49 | $sects =& $db_apt->query("SELECT * FROM reps2dists2sects JOIN sects ON reps2dists2sects.sect_id=sects.id WHERE reps2dists_id==".$info_dists['reps2dists.id']); |
56 | while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) { |
50 | while ($sects->fetchInto($info_sects,DB_FETCHMODE_ASSOC)) { |
57 | echo " ".$info_sects['sects.sect']; |
51 | echo " ".$info_sects['sects.sect']; |
58 | }
|
52 | }
|
59 | echo "<br>"; |
53 | echo "<br>"; |
60 | }
|
54 | }
|
61 | }
|
55 | }
|
62 | }
|
56 | }
|
63 | 57 | ||
64 | //$query =& $dba->query("SET NAMES utf8");
|
58 | //$query =& $dba->query("SET NAMES utf8");
|
65 | 59 | ||
66 | ?>
|
- | |
- | 60 | include "inc/footer.htm"; |
|
67 | 61 | ||
68 | </body> |
- | |
69 | </html> |
- | |
70 | 62 | ?>
|
|
- | 63 |