[Pkg-ruby-extras-maintainers] r801 - tools/ruby-pkg-tools/trunk/bin

Esteban Manchado Velázquez zoso at costa.debian.org
Fri Aug 25 21:59:23 UTC 2006


Author: zoso
Date: 2006-08-25 21:59:21 +0000 (Fri, 25 Aug 2006)
New Revision: 801

Modified:
   tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
Log:
- Re-add sources file support, for weird upstream packages


Modified: tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
===================================================================
--- tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources	2006-08-25 14:02:16 UTC (rev 800)
+++ tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources	2006-08-25 21:59:21 UTC (rev 801)
@@ -27,6 +27,8 @@
 require 'open-uri'
 require 'rexml/document'
 
+$sources_file = "/usr/share/ruby-pkg-tools/pkg-ruby-extras.sources"
+$sources_url = "http://pkg-ruby-extras.alioth.debian.org/pkg-ruby-extras.sources"
 $watch_file = 'debian/watch'
 $target_directory = "../tarballs"
 $verbose = false
@@ -49,6 +51,7 @@
 )
 
 help = {
+  "--sources" => "indicates the sources file (defaults to #{$sources_file})",
   "--target-directory" => "indicates where to put downloaded tarballs (defaults to #{$target_directory})",
   "--verbose" => "display verbose information while running",
   "--list-available" => "does not download any file; only list available packages and versions",
@@ -71,6 +74,8 @@
     case opt
       when '--verbose'
         $verbose = true
+      when '--sources'
+        $sources_file = val
       when '--target-directory'
         $target_directory = val
       when '--help'
@@ -92,6 +97,7 @@
 end
 
 info_msg("Running in verbose mode") if $verbose
+info_msg("Reading sources from #{$sources_url}, #{$sources_file}") if $verbose
 info_msg("Downloading files to #{$target_directory}") if $verbose
 
 if (!$list_available and ! (File.directory?($target_directory) and File.writable?($target_directory)))
@@ -284,6 +290,28 @@
   end
 end
 
+# Try to get the source URL from a sources file
+[ $sources_file, $sources_url ].each { |file|
+  sources = get_available_sources(file)
+  if (sources) then
+    if $list_available then
+      list_packages(sources)
+    else
+      if sources[package] then
+        if sources[package][version] then
+          tarball = sources[package][version]
+          break
+        else
+          error_msg("#{package}'s version #{version} is not available (in #{file}).")
+        end
+      else
+        error_msg("Package #{package} is not available (in #{file}).")
+        next
+      end
+    end
+  end
+}
+
 # don't go beyond here if all we wanted to do was list available packages
 exit if $list_available
 




More information about the pkg-ruby-extras-maintainers mailing list