if(file_exists("/usr/share/gitweb/dl/".$name."-".substr($hash, 0, -1).".tar.gz")) {
echo "<a href='http://git.nexus-irc.de/dl/".$name."-".substr($hash, 0, -1).".tar.gz'>".$name."-".substr($hash, 0, -1)." (tar.gz)</a>";
} else {
- echo "No Download available (<a href='http://git.nexus-irc.de/git_download.php?build2=".$_GET["p"]."'>Build snapshot</a>)";
+ echo "No Download available (<a href='http://git.nexus-irc.de/git_download.php?build=".$_GET["p"]."'>Build snapshot</a>)";
}
}
}else{
if(file_exists("/usr/share/gitweb/dl/".$name."-".substr($hash, 0, -1).".tar.gz")) {
echo "<p><a href='http://git.nexus-irc.de/dl/".$name."-".substr($hash, 0, -1).".tar.gz'>".$name."-".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>";
+ echo "<p>No Download available (<a href='http://git.nexus-irc.de/git_download.php?build=".$_GET["git"]."'>Build snapshot</a>)</p>";
}
}
}else{
$con= shell_exec('git --git-dir=/home/git/'.$_GET['build'].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
$name=substr($_GET['build'],0,strlen($_GET['build'])-4);
if(file_exists("/usr/share/gitweb/dl/".$name."-".substr($hash, 0, -1).".tar.gz")) {
- echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?a=download"> ';
+ echo '<meta http-equiv="refresh" content="0; URL='.$_SERVER['HTTP_REFERER'].'"> ';
}else{
$b = shell_exec("cd /usr/share/gitweb/dl; git clone git://git.nexus-irc.de/".$_GET['build']);
$c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-".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/?a=download"> ';
+ echo '<meta http-equiv="refresh" content="0; URL='.$_SERVER['HTTP_REFERER'].'"> ';
}
}else{
echo "unknown project";
}
-}elseif(isset($_GET['build2'])){
+}elseif(isset($_GET['build2']) && isset($_GET['h'])){
if(file_exists("/home/git/".$_GET['build2'])){
- $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"');
$name=substr($_GET['build2'],0,strlen($_GET['build2'])-4);
- if(file_exists("/usr/share/gitweb/dl/".$name."-".substr($hash, 0, -1).".tar.gz")) {
- echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/?p='.$_GET['build2'].';a=summary"> ';
- }else{
- $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."-".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=summary"> ';
- }
- }else{
- echo "unknown project";
- }
-}elseif(isset($_GET['build3'])){
- if(file_exists("/home/git/".$_GET['build3'])){
- $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"');
- $name=substr($_GET['build3'],0,strlen($_GET['build3'])-4);
- if(file_exists("/usr/share/gitweb/dl/".$name."-".substr($hash, 0, -1).".tar.gz")) {
- echo '<meta http-equiv="refresh" content="0; URL=http://stats.nexus-irc.de/"> ';
- }else{
- $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."-".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";
- }
-}elseif(isset($_GET['build4']) && isset($_GET['h'])){
- if(file_exists("/home/git/".$_GET['build4'])){
- $name=substr($_GET['build4'],0,strlen($_GET['build4'])-4);
if(strtolower($_GET['h']) == "head") {
$hash = shell_exec("git --git-dir=/home/git/".$_GET['p']." rev-list -n 1 --pretty='format:%h' --header master | grep '^[0-9a-f]*$'");
}else{
$hash = substr($_GET['h'], 0, 7);
}
if(file_exists("/usr/share/gitweb/dl/".$name."-".$hash.".tar.gz")) {
- echo '<meta http-equiv="refresh" content="0; URL=http://git.nexus-irc.de/dl/'.$name.'-'.$hash.'.tar.gz">';
- echo '<a href="javascript:history.go(-1)">zurück</a>';
+ header("Content-Type: application/x-gzip");
+ header("Content-Disposition: attachment; filename=".$name."-".$hash.".tar.gz");
+ readfile("/usr/share/gitweb/dl/".$name."-".$hash.".tar.gz");
}else{
- $b = shell_exec("cd /usr/share/gitweb/dl/; git clone git://git.nexus-irc.de/".$_GET['build4']);
+ $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/".$name."/; git reset ".$_GET['h']);
$c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-".$hash.".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/dl/'.$name.'-'.$hash.'.tar.gz">';
- echo '<a href="javascript:history.go(-1)">zurück</a>';
+ header("Content-Type: application/x-gzip");
+ header("Content-Disposition: attachment; filename=".$name."-".$hash.".tar.gz");
+ readfile("/usr/share/gitweb/dl/".$name."-".$hash.".tar.gz");
}
}else{
echo "unknown project";
$cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " .
$cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " .
$cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree"). " | " .
- "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build4=".$project.";h=".$commit."'>snapshot</a>";
+ "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build2=".$project.";h=".$commit."'>snapshot</a>";
print "</td>\n" .
"</tr>\n";
my $snapshot_links = "1";
if (defined $snapshot_links) {
# FIXME: Should be available when we have no hash base as well.
- push @views_nav, "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build4=".$project.";h=".$hash."'>snapshot</a>";
+ push @views_nav, "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build2=".$project.";h=".$hash."'>snapshot</a>";
}
git_print_page_nav('tree','', $hash_base, undef, undef,
join(' | ', @views_nav));
"tree");
my $snapshot_links = "1";
if (defined $snapshot_links) {
- print " | " . "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build4=".$project.";h=".$hash."'>snapshot</a>";
+ print " | " . "<a title='in format: tar.gz' href='http://git.nexus-irc.de/git_download.php?build2=".$project.";h=".$hash."'>snapshot</a>";
}
print "</td>" .
"</tr>\n";