[DRE-commits] r2029 - in tools/ruby-pkg-tools/trunk: bin debian

terceiro-guest at alioth.debian.org terceiro-guest at alioth.debian.org
Sun Nov 4 18:16:41 UTC 2007


Author: terceiro-guest
Date: 2007-11-04 18:16:41 +0000 (Sun, 04 Nov 2007)
New Revision: 2029

Modified:
   tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
   tools/ruby-pkg-tools/trunk/debian/changelog
Log:
being nice to narrow terminals



Modified: tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources
===================================================================
--- tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources	2007-11-04 17:57:09 UTC (rev 2028)
+++ tools/ruby-pkg-tools/trunk/bin/pkg-ruby-get-sources	2007-11-04 18:16:41 UTC (rev 2029)
@@ -215,11 +215,21 @@
     http.request_get(uri.path) { |res|
       total = res.header.content_length
       current = 0
+      last_percent = 0
+      puts "Downloading #{tarball_url} ..."
+      puts "(each '.' means 5% of the download)"
       File.open(filename,'w') { |file|
         res.read_body { |part|
+
+          # update status
           current += part.length
-          print(format("\r[%3d%%] #{tarball_url}",((current * 100) / total)))
-          $stdout.flush
+          percent = ((current * 100) / total)
+          while last_percent < percent
+            last_percent += 5
+            print(".")
+            $stdout.flush
+          end
+
           file.write(part)
         }
         puts

Modified: tools/ruby-pkg-tools/trunk/debian/changelog
===================================================================
--- tools/ruby-pkg-tools/trunk/debian/changelog	2007-11-04 17:57:09 UTC (rev 2028)
+++ tools/ruby-pkg-tools/trunk/debian/changelog	2007-11-04 18:16:41 UTC (rev 2029)
@@ -3,9 +3,11 @@
   [ Antonio Terceiro ]
   * 1/class/ruby-setup-rb.mk: using --installdirs=std as setup.rb options, so
     everything is put in the right place upon installation (Closes: #420028)
+  * bin/pkg-ruby-get-sources: provide a better progress update information,
+    compatible with narrow terminals (Closes: #422536)
   * debian/control: new maintainer name and address for myself
 
- -- Antonio Terceiro <terceiro at softwarelivre.org>  Sun, 04 Nov 2007 13:17:41 -0300
+ -- Antonio Terceiro <terceiro at softwarelivre.org>  Sun, 04 Nov 2007 15:13:33 -0300
 
 ruby-pkg-tools (0.12) unstable; urgency=low
 




More information about the Pkg-ruby-extras-commits mailing list