[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kdesvn-build-1.10
From: Michael Pyne <mpyne () purinchu ! net>
Date: 2009-06-05 22:10:17
Message-ID: 1244239817.733013.4461.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 978068 by mpyne:
Remove ability to download tarball snapshots from kdesvn-build.kde.org, only KDE mirrors are used now
M +11 -125 kdesvn-build
--- branches/work/kdesvn-build-1.10/kdesvn-build #978067:978068
@@ -344,9 +344,6 @@
"stop-on-failure" => "",
"svn-server" => "svn://anonsvn.kde.org/home/kde",
"tag" => "",
- "tarball-host" => "kdesvn-build.kde.org", # Undocumented
- "tarball-path" => "/other", # Undocumented
- "tarball-revision-script" => "/other/module-revision.php", # Undocumented
}
);
@@ -1645,9 +1642,8 @@
}
# This subroutine is used to try and download a Subversion checkout snapshot
-# for a given module. For trunk modules, the KDE FTP repository is checked
-# first. For other modules or if not available from KDE FTP, the host
-# set by the tarball-host option (default kdesvn-build.kde.org) is checked.
+# for a given module. Modules that have branches or tags associated with them
+# are not attempted.
#
# If available the snapshot is downloaded and installed into the normal
# location for a kdesvn-build source checkout and already switched into the
@@ -1684,41 +1680,20 @@
my ($filename, $url, $dirName);
# If a trunk module, try to obtain from KDE FTP first.
- if ($branch eq 'trunk')
- {
- $filename = "$moduleName-svn.tar.bz2";
- $filename =~ tr{/}{-}; # Substitute - for /
- $dirName = $moduleName;
+ return 0 if ($branch ne 'trunk');
- if ($filename =~ /^(playground|extragear)-/)
- {
- $filename = "kde$filename"; # Conform to snapshot naming convention
- $dirName = "kde$moduleName";
- $dirName =~ s{/}{-}; # Substitute here too.
- }
+ $filename = "$moduleName-svn.tar.bz2";
+ $filename =~ tr{/}{-}; # Substitute - for /
+ $dirName = $moduleName;
- #$url = "ftp://ftp.kde.org/pub/kde/unstable/snapshots/$filename";
- $url = "http://download.kde.org/download.php?url=unstable/snapshots/$filename";
-
- if (download_module_snapshot($module, $filename, $url, $dirName))
- {
- return 1; # We're done.
- }
- }
-
- # No snapshot from KDE FTP, try the normal source.
- my $revision = tarball_snapshot_revision($module);
- my $tarballHost = get_option($module, 'tarball-host');
- my $snapshotPath = get_option($module, 'tarball-path');
-
- if ($revision <= 0)
+ if ($filename =~ /^(playground|extragear)-/)
{
- return 0; # No snapshot is available.
+ $filename = "kde$filename"; # Conform to snapshot naming convention
+ $dirName = "kde$moduleName";
+ $dirName =~ s{/}{-}; # Substitute here too.
}
- $filename = "$moduleName-$branch-svn-r$revision.tar.bz2";
- $url = "http://$tarballHost$snapshotPath/$filename";
- $dirName = "$moduleName-$branch-svn-r$revision";
+ $url = "http://download.kde.org/download.php?url=unstable/snapshots/$filename";
return download_module_snapshot($module, $filename, $url, $dirName);
}
@@ -1896,95 +1871,6 @@
return $module;
}
-# This subroutine contacts a remote web server (defined by the tarball-host
-# option) and calls a php script to determine if there is a tarball snapshot
-# available for the given module and branch. The revision number of the
-# snapshot is returned. 0 is returned if there is no revision available or
-# some other error occurred.
-#
-# First parameter: Module to query for.
-sub tarball_snapshot_revision
-{
- my $module = shift;
- my $tarballHost = get_option($module, "tarball-host");
- my $revisionScript = get_option($module, "tarball-revision-script");
- my $branch = get_option($module, 'branch');
- my $moduleName = moduleBaseName($module);
-
- whisper "Checking if snapshot available for g[$module]";
-
- if(pretending or not has_Net_HTTP())
- {
- return 0;
- }
-
- if (get_option($module, 'override-url'))
- {
- whisper "\tb[override-url] in effect for g[$module], snapshot not available.";
- return 0;
- }
-
- $branch = default_module_branch($module) if not $branch; # Use default value.
- debug "Looking up revision number for g[$module-$branch] from g[$tarballHost$revisionScript]";
-
- my $conn = Net::HTTP->new ('Host' => $tarballHost);
- if (not defined $conn)
- {
- error "Unable to connect to $tarballHost, snapshot check aborted.";
- error "\tError message: r[$!]";
- return 0;
- }
-
- # Send connection request
- $conn->write_request('GET' => "$revisionScript?module=$moduleName&branch=$branch",
- 'User-Agent' => "Mozilla/5.0 (compatible; kdesvn-build $versionNum)",
- );
-
- my ($code, $msg, %h) = $conn->read_response_headers();
-
- # Require HTTP success code.
- if (200 != $code)
- {
- debug "Server returned $code $msg";
- whisper "Error received from server: r[$code $msg]";
- return 0;
- }
-
- my ($buf, $result, $revision);
- $revision = '';
-
- while (1)
- {
- $result = $conn->read_entity_body($buf, 2048);
- if (not defined $result)
- {
- whisper "Error reading revision number from server: r[$!]";
- return 0;
- }
-
- last unless $result;
- $revision .= $buf;
- }
-
- # Response received should be in the form "Revision: <number>". Strip down
- # to the number part.
- chomp $revision;
- ($result) = ($revision =~ /^Revision:\s*(\d+)/);
-
- $conn->close;
-
- if ($result and $result > 0)
- {
- whisper "g[$module] is g[available] for rapid download.";
- return $result;
- }
- else
- {
- whisper "g[$module] is y[not available] for rapid download.";
- return 0;
- }
-}
-
# Perform a git clone to checkout the latest branch of either the official
# Qt Software Qt 4, or the KDE-Qt repository (essentially the old qt-copy
# with patches applied).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic