summaryrefslogtreecommitdiffstats
path: root/zoom.php
blob: f3c8bf874e6752c2390d8a5a159941e02fe4678c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php

require "config.inc.php";
if (!isset($_GET['rpm'])) {
   die("missing arg.");
}
$name = $_GET['rpm'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>Packages in Fedora</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                <link rel="stylesheet" type="text/css" media="screen" href="css/rpmphp.css"/>
		<!--<link rel="stylesheet" type="text/css" media="print" href="css/rpmphp-print.css">-->
		<link rel="shortcut icon" href="images/favicon.ico"/>
		<link rel="icon" href="images/favicon.ico"/>
	</head>

	<body>
		<div id="wrapper">
<?php
include '_header.php';
?>
			<div id="fedora-content">
				<div id="ariane">
					<p>You are here: </p>
					<ul>
						<li><a href="./">Reports home</a></li>
						<li><a href="#">Package detail</a></li>
					</ul>
				</div>
<?php
if (!$name) {
   echo "<h1>Enter a package name</h1>\n";
} else {
   try {
      $db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);

      $sql = "SELECT rpm.*
         FROM rpm
         INNER JOIN repo ON (repo.main=rpm.repo_main AND repo.sub=rpm.repo_sub)
         WHERE rpm.name='$name'
         ORDER BY repo.id DESC";
      $resrpm = $db->query($sql);
      $rpm = ($resrpm ? $resrpm->fetchObject() : false);

      $sql = "SELECT * FROM upstream WHERE name = '$name'";
      $resup=$db->query($sql);
      $up = ($resup ? $resup->fetchObject() : false);

      $sql = "SELECT * FROM acls WHERE name = '$name'";
      $resown=$db->query($sql);
      $owner = ($resown ? $resown->fetchObject() : false);

      if (!$rpm) {
         echo "<h1>$name not found</h1>\n";
      } else {
         echo "<h1>Package: $name</h1>\n";
         echo "<table id=\"upstream\">\n";
         echo "<caption>Upstream info</caption>\n";
         $i=0;

         if ($rpm->summary) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Summary: </th><td><strong>". $rpm->summary . "</strong></td></tr>\n";
         } else if ($owner->summary) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Summary: </th><td><strong>". $owner->summary . "</strong></td></tr>\n";
         }
         if ($rpm->url) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "URL: </th><td><strong><a href='".$rpm->url."'>". $rpm->url . "</a></strong></td></tr>\n";
         }
         if ($up && $up->type) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Type: </th><td><strong>". $up->type . "</strong></td></tr>\n";
         }
         if ($up && $up->channel) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Channel: </th><td><strong>". $up->channel . "</strong></td></tr>\n";
         }
         if ($up && $up->stable) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Stable version: </th><td><strong>". $up->stable . "</strong></td></tr>\n";
         }
         if ($up && $up->unstable && $up->stable!=$up->unstable) {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
            echo "Unstable version: </th><td><strong>". $up->unstable . "</strong>";
            if ($up->state) {
               echo " (". $up->state . ")\n";
            }
            echo "</td></tr>\n";
         }
         if ($owner && $owner->owner) {
            echo "<tr class=\"".($i%2 ? 'odd' : 'even')."\"><th>"; $i++;
            echo "Owner: </th><td><strong>". $owner->owner . "</strong>";
            if ($owner->cc) {
               echo " (". $owner->cc . ")\n";
            }
            echo "</td></tr>\n";
         }
         echo "<tr class=\"".($i%2 ? 'odd' : 'even')."\"><th>ViewVC: </th>"; $i++;
         echo "<td><a href=\"http://cvs.fedoraproject.org/viewvc/rpms/$name/\">http://cvs.fedoraproject.org/viewvc/rpms/$name/</a>";
         echo "</td></tr>\n";

         echo "</table>";

         echo "<table id=\"list-packages\">\n";
         echo "<caption>Packages available in Fedora Repositories</caption>\n";
         $prev=false;
         do {
            echo "<tr class='".($i%2 ? 'odd' : 'even')."'>"; $i++;
            echo "<td><strong>".($rpm->repo_main==$prev ? "&nbsp;" : $prev=$rpm->repo_main)."</strong></td>";
            echo "<td>".$rpm->repo_sub."</td>";
            echo "<td>".($rpm->epoch ? $rpm->epoch.":" : "").$rpm->ver."-".$rpm->rel."</td>";
            echo "</tr>\n";
         } while ($rpm = $resrpm->fetchObject());
         echo "</table>";
      }
   }
   catch(PDOException $e) {
      printf("%s ERREUR : %s\n", date("r"),  $e->getMessage());
   }
}
?>


        <!-- document END -->
        </div>

		<!-- content END -->
<?php
include '_footer.php';
?>
		</div>
	</body>
</html>