[Pkg-ruby-extras-maintainers] r215 - in tools/ruby-pkg-tools/trunk:
bin debian man
Thierry Reding
beatle-guest at costa.debian.org
Thu Jan 5 00:18:19 UTC 2006
Author: beatle-guest
Date: 2006-01-05 00:18:18 +0000 (Thu, 05 Jan 2006)
New Revision: 215
Modified:
tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
tools/ruby-pkg-tools/trunk/debian/changelog
tools/ruby-pkg-tools/trunk/man/pkg-ruby-get-sources.1
Log:
* pkg-ruby-get-sources now uses the `open-uri' package so that sources files can
also be retrieved from remote hosts.
* By default, pkg-ruby-get-sources will try to download the sources file from
`http://pkg-ruby-extras.alioth.debian.org/sources' and will use
`/usr/share/ruby-pkg-tools/pkg-ruby-extras.sources' as fallback.
This is useful because in the current situation, everytime a new package is
added, or an existing package gets a new upstream version, the ruby-pkg-tools
package needs a new upload.
Modified: tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
===================================================================
--- tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources 2006-01-05 00:10:08 UTC (rev 214)
+++ tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources 2006-01-05 00:18:18 UTC (rev 215)
@@ -24,8 +24,10 @@
require 'net/http'
require 'yaml'
require 'getoptlong'
+require 'open-uri'
$sources_file = "/usr/share/ruby-pkg-tools/pkg-ruby-extras.sources"
+$sources_url = "http://pkg-ruby-extras.alioth.debian.org/sources"
$target_directory = "../tarballs"
$verbose = false
$list_available = false
@@ -76,14 +78,9 @@
end
puts "I: Running in verbose mode" if $verbose
-puts "I: Reading sources from #{$sources_file}" if $verbose
+puts "I: Reading sources from #{$sources_url}, #{$sources_file}" if $verbose
puts "I: Downloading files to #{$target_directory}" if $verbose
-if (! File.exists?($sources_file))
- puts "E: #{$sources_file} should exist."
- exit 1
-end
-
if (!$list_available and ! (File.directory?($target_directory) and File.writable?($target_directory)))
puts "E: #{$target_directory} should be a valid writable directory."
exit 1
@@ -111,8 +108,22 @@
}
end
-sources = YAML::load_file($sources_file)
+begin
+ print "I: Trying to open #{$sources_url}... " if $verbose
+ sources = open($sources_url) { |io| YAML::load(io) }
+rescue
+ puts "failed" if $verbose
+ begin
+ print "I: Trying to open #{$sources_file}... " if $verbose
+ sources = open($sources_file) { |io| YAML::load(io) }
+ rescue
+ puts "failed" if $verbose
+ exit 2
+ end
+end
+puts "done" if $verbose
+
# only list available packages
if $list_available
sources.each { |package,versions|
@@ -151,3 +162,6 @@
puts "E: Package #{package} is not available (in #{$sources_file})"
exit 2
end
+
+# vim: sts=2 ts=2 et
+
Modified: tools/ruby-pkg-tools/trunk/debian/changelog
===================================================================
--- tools/ruby-pkg-tools/trunk/debian/changelog 2006-01-05 00:10:08 UTC (rev 214)
+++ tools/ruby-pkg-tools/trunk/debian/changelog 2006-01-05 00:18:18 UTC (rev 215)
@@ -3,8 +3,16 @@
[ Marc Dequènes (Duck) ]
* Fixed CDBS class for 'simple packages' case.
- -- Marc Dequènes (Duck) <Duck at DuckCorp.org> Thu, 5 Jan 2006 00:31:10 +0100
+ [ Thierry Reding ]
+ * pkg-ruby-get-sources:
+ + Now defaults to using the sources file at the URL
+ `http://pkg-ruby-extras.alioth.debian.org/sources'. The file at
+ `/usr/share/ruby-pkg-tools/pkg-ruby-extras.sources' is used as
+ fallback.
+ + The `--sources' switch can now also handle HTTP, HTTPS and FTP URLs.
+ -- Thierry Reding <thierry at doppeltgemoppelt.de> Thu, 5 Jan 2006 00:47:21 +0100
+
ruby-pkg-tools (0.5) unstable; urgency=low
[ Esteban Manchado Velázquez ]
Modified: tools/ruby-pkg-tools/trunk/man/pkg-ruby-get-sources.1
===================================================================
--- tools/ruby-pkg-tools/trunk/man/pkg-ruby-get-sources.1 2006-01-05 00:10:08 UTC (rev 214)
+++ tools/ruby-pkg-tools/trunk/man/pkg-ruby-get-sources.1 2006-01-05 00:18:18 UTC (rev 215)
@@ -16,6 +16,7 @@
.TP
\fB-s\fR, \fB\-\-sources=FILE\fR
Indicates the FILE to be used as list of sources (defaults to /usr/share/ruby\-pkg\-tools/pkg\-ruby\-extras.sources).
+This option also works with HTTP, HTTPS or FTP URLs.
.TP
\fB-t\fR, \fB\-\-target\-directory=DIR\fR
Directory DIR to put downloaded tarballs in (defaults to ../tarballs).
More information about the pkg-ruby-extras-maintainers
mailing list