$hash = shell_exec("git --git-dir=/home/git/".$_GET["p"]." rev-list -n 1 --pretty='format:%h' --header master | grep '^[0-9a-f]*$'");
$con= shell_exec('git --git-dir=/home/git/'.$_GET["p"].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
if(!$hash){
- echo "<p>".$_GET["p"].": No Download available</p>";
+ echo "No Download available";
}else{
$name=substr($_GET["p"],0,strlen($_GET["p"])-4);
if(file_exists("/usr/share/gitweb/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz")) {
- echo "<p>".$_GET["p"].": Download <a href='http://git.nexus-irc.de/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz'>git-".substr($con, 0, -1)."-".substr($hash, 0, -1)."</a></p>";
+ echo "<a href='http://git.nexus-irc.de/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz'>git-".substr($con, 0, -1)."-".substr($hash, 0, -1)." (tar.gz)</a>";
} else {
- echo "<p>".$_GET["p"].": No Download available (<a href='http://git.nexus-irc.de/git_download.php?build2=".$_GET["p"]."'>Build snapshot</a>)</p>";
+ echo "No Download available (<a href='http://git.nexus-irc.de/git_download.php?build2=".$_GET["p"]."'>Build snapshot</a>)";
+ }
+ }
+ }else{
+ echo "unknown project";
+ }
+}elseif(isset($_GET['git'])){
+ if(file_exists("/home/git/".$_GET['git'])){
+ $hash = shell_exec("git --git-dir=/home/git/".$_GET["git"]." rev-list -n 1 --pretty='format:%h' --header master | grep '^[0-9a-f]*$'");
+ $con= shell_exec('git --git-dir=/home/git/'.$_GET["git"].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
+ if(!$hash){
+ echo "<p>".$_GET["git"].": No Download available</p>";
+ }else{
+ $name=substr($_GET["git"],0,strlen($_GET["git"])-4);
+ if(file_exists("/usr/share/gitweb/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz")) {
+ echo "<p><a href='http://git.nexus-irc.de/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz'>git-".substr($con, 0, -1)."-".substr($hash, 0, -1)." (tar.gz)</a></p>";
+ } else {
+ echo "<p>No Download available (<a href='http://git.nexus-irc.de/git_download.php?build3=".$_GET["git"]."'>Build snapshot</a>)</p>";
}
}
}else{
if(file_exists("/home/git/".$_GET['build2'])){
$name=substr($_GET['build2'],0,strlen($_GET['build2'])-4);
if(file_exists("/usr/share/gitweb/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz")) {
- echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?p='.$_GET['build2'].';a=download"> ';
+ echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?p='.$_GET['build2'].';a=summary"> ';
}else{
$hash = shell_exec("git --git-dir=/home/git/".$_GET['build2']." rev-list -n 1 --pretty='format:%h' --header master | grep '^[0-9a-f]*$'");
$con= shell_exec('git --git-dir=/home/git/'.$_GET['build2'].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
$b = shell_exec("cd /usr/share/gitweb/dl/; git clone git://git.nexus-irc.de/".$_GET['build2']);
$c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz ".$name);
$d = shell_exec("rm -r /usr/share/gitweb/dl/".$name);
- echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?p='.$_GET['build2'].';a=download"> ';
+ echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?p='.$_GET['build2'].';a=summary"> ';
+ }
+ }else{
+ echo "unknown project";
+ }
+}elseif(isset($_GET['build3'])){
+ if(file_exists("/home/git/".$_GET['build3'])){
+ $name=substr($_GET['build3'],0,strlen($_GET['build3'])-4);
+ if(file_exists("/usr/share/gitweb/dl/".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz")) {
+ echo '<meta http-equiv="refresh" content="0; URL=http://stats.nexus-irc.de/"> ';
+ }else{
+ $hash = shell_exec("git --git-dir=/home/git/".$_GET['build3']." rev-list -n 1 --pretty='format:%h' --header master | grep '^[0-9a-f]*$'");
+ $con= shell_exec('git --git-dir=/home/git/'.$_GET['build3'].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
+ $b = shell_exec("cd /usr/share/gitweb/dl/; git clone git://git.nexus-irc.de/".$_GET['build3']);
+ $c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-git-".substr($con, 0, -1)."-".substr($hash, 0, -1).".tar.gz ".$name);
+ $d = shell_exec("rm -r /usr/share/gitweb/dl/".$name);
+ echo '<meta http-equiv="refresh" content="0; URL=http://stats.nexus-irc.de/"> ';
}
}else{
echo "unknown project";
"project_index" => \&git_project_index,
"project_index2" => \&git_project_index2,
"download" => \&git_download,
- "downloads" => \&git_downloads,
"bugtracker" => \&git_project_bugtracker,
);
if (!defined($actions{$action})) {
die_error(400, "Unknown action");
}
- if ($action !~ m/^(?:opml|project_list|project_index2|project_index|downloads)$/ &&
+ if ($action !~ m/^(?:opml|project_list|project_index2|project_index|download)$/ &&
!$project) {
die_error(400, "Project needed");
}
-class => $feed_class}, "OPML") . " ";
print $cgi->a({-href => href(project=>undef, action=>"project_index"),
-class => $feed_class}, "TXT") . " ";
- print $cgi->a({-href => href(project=>undef, action=>"downloads"),
+ print $cgi->a({-href => href(project=>undef, action=>"download"),
-class => $feed_class2}, "Downloads") . "\n";
}
print "</div>\n"; # class="page_footer"
my ($current, $suppress, $head, $treehead, $treebase, $extra) = @_;
$extra = '' if !defined $extra; # pager or formats
- my @navs = qw(summary bugtracker shortlog log commit commitdiff tree download);
+ my @navs = qw(summary bugtracker shortlog log commit commitdiff tree);
if ($suppress) {
@navs = grep { $_ ne $suppress } @navs;
}
#$cgi->a({-href => href(project=>$pr->{'path'}, action=>"bugtrack")}, "bugtrack") . " | " .
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " .
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"tree")}, "tree") . " | " .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"download")}, "download") .
+ $cgi->a({-href => href(project=>$pr->{'path'}, action=>"tree")}, "tree") .
($pr->{'forks'} ? " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "forks") : '') .
"</td>\n" .
"</tr>\n";
print "<table class=\"shortlog\" cellspacing=\"0\" cellpadding=\"0\">\n";
my $alternate = 1;
my $head = git_get_head_hash($project);
+ my $graph_hash;
if (defined $allrefs && $allrefs == 1) {
- $hash = "all";
+ $graph_hash = "all";
}
if (!defined $hash) {
$hash = $head;
}
+ if(!defined $graph_hash) {
+ $graph_hash = $hash;
+ }
if (!defined $page) {
$page = 0;
}
my $graph_rand = int(rand(99999));
print "<tr class=\"header\">\n";
- print "<td colspan=\"2\"><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=header\" /></td>\n";
+ print "<td colspan=\"2\"><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$graph_hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=header\" /></td>\n";
print "<td valign=\"bottom\"><b>Author</b></td>\n";
print "<td valign=\"bottom\"><b>Commit</b></td>\n";
print "<td></td>\n";
}
$alternate ^= 1;
# git_summary() used print "<td><i>$co{'age_string'}</i></td>\n" .
- print "<td><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=".$commit."\" /></td>";
+ print "<td><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$graph_hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=".$commit."\" /></td>";
print "<td class=\"". age_class($co{'age'}) . "\" title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
format_author_html('td', \%co, 10) . "<td>";
print format_subject_html($co{'title'}, $co{'title_short'},
print "$path\n";
}
}
-sub git_downloads {
+sub git_download {
my $dl = get("http://git.nexus-irc.de/git_download.php");
git_header_html();
print "<div class=\"title\">Downloads</div>\n";
git_footer_html();
}
-sub git_download {
- my $dl1 = get("http://git.nexus-irc.de/git_download.php?p=".$project);
- my %co = parse_commit("HEAD");
- my $head = $co{'id'};
- git_header_html();
- git_print_page_nav('download','', $head);
- print "<div class=\"title\">Download</div>\n";
- print $dl1;
- git_footer_html();
-}
-
sub git_project_bugtracker {
my $descr = git_get_project_description($project) || "none";
my $bugtrack = get("http://git.nexus-irc.de/git_bugtrack.php?p=".$project);
my $owner = git_get_project_owner($project);
my $version = get("http://git.nexus-irc.de/git_version.php?git=".$project);
+ my $download = get("http://git.nexus-irc.de/git_download.php?p=".$project);
my $refs = git_get_references();
# These get_*_list functions return one more to allow us to see if
$url_tag = "";
}
print "<tr id=\"metadata_owner\"><td>version</td><td>" . esc_html($version) . "</td></tr>\n";
+ print "<tr id=\"metadata_owner\"><td>download</td><td>" . $download . "</td></tr>\n";
# Tag cloud
my $show_ctags = gitweb_check_feature('ctags');
if ($show_ctags) {