rpms/autodownloader/devel autodownloader-0.2.0-check-existing-files.patch, NONE, 1.1 autodownloader-0.2.0-unknown-file-size.patch, NONE, 1.1 autodownloader.spec, 1.3, 1.4

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Thu Nov 29 18:27:32 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/autodownloader/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23378

Modified Files:
	autodownloader.spec 
Added Files:
	autodownloader-0.2.0-check-existing-files.patch 
	autodownloader-0.2.0-unknown-file-size.patch 
Log Message:
* Thu Nov 29 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.2.0-5
- Apply patch from Ivo Manca fixing the downloading of files with an
  unknown size, thanks!


autodownloader-0.2.0-check-existing-files.patch:

--- NEW FILE autodownloader-0.2.0-check-existing-files.patch ---
diff -up autodownloader-0.2.0/AutoDL.py.orig autodownloader-0.2.0/AutoDL.py
--- autodownloader-0.2.0/AutoDL.py.orig	2007-10-04 13:34:39.000000000 +0200
+++ autodownloader-0.2.0/AutoDL.py	2007-10-04 14:28:50.000000000 +0200
@@ -244,7 +244,8 @@ class Downloader:
 		fs.write(md5 + "  " + filename)
 		fs.close()
 
-		check_result = os.system("md5sum --status -c " + fname)
+		check_result = os.system("md5sum --status -c " + fname +
+						" 2> /dev/null")
 		os.remove(fname)
 
 		if check_result == 0:
@@ -256,6 +257,10 @@ class Downloader:
 		self.remaining_files = filelist
 		for x in filelist:
 			download_complete = False
+			
+			if self.md5_check(x['path'] + '/' + x['filename'], x['md5']):
+				self.remaining_files = self.remaining_files[1:]
+				download_complete = True
 
 			self.mirror_count = 0
 			self.mirror_total = len (x['urllist'])

autodownloader-0.2.0-unknown-file-size.patch:

--- NEW FILE autodownloader-0.2.0-unknown-file-size.patch ---
--- autodl/AutoDL.py	2007-11-26 12:31:17.000000000 +0100
+++ autodl/AutoDL.py.new	2007-11-26 12:34:25.000000000 +0100
@@ -235,7 +235,7 @@
 			raise Next_mirror
 
 		bytes = blocks * blocksize
-		if bytes >= filesize: return
+		if (filesize > 0) and (bytes >= filesize): return
 		self.caller.report_progress(bytes, filesize)
 
 	def md5_check(self, filename, md5):
@@ -406,18 +406,23 @@
 	
 	def report_progress(self, bytes, filesize):
 
-		percentage = (100.0 * bytes) / filesize
-		text_percent = "%s" % int (percentage)
-		text_filesize = "%s" % int (filesize/1024)
 		text_downloaded = "%s" % int (bytes/1024)
-
-		self.widgets['progressbar1'].set_text(text_percent + " %")
-		self.widgets['progressbar1'].set_fraction(percentage/100)
-		self.widgets['label13'].set_text(text_downloaded + " Kb / " + text_filesize + " Kb")
-		if percentage >= 99.5:
-			self.widgets['progressbar1'].set_fraction(1)
-			self.widgets['progressbar1'].set_text("100 %")
-			self.widgets['label13'].set_text(text_filesize + " Kb / " + text_filesize + " Kb")
+		if filesize > 0:
+			percentage = (100.0 * bytes) / filesize
+			text_percent = "%s" % int (percentage)
+			text_filesize = "%s" % int (filesize/1024)
+
+			self.widgets['progressbar1'].set_text(text_percent + " %")
+			self.widgets['progressbar1'].set_fraction(percentage/100)
+			self.widgets['label13'].set_text(text_downloaded + " Kb / " + text_filesize + " Kb")
+			if percentage >= 99.5:
+				self.widgets['progressbar1'].set_fraction(1)
+				self.widgets['progressbar1'].set_text("100 %")
+				self.widgets['label13'].set_text(text_filesize + " Kb / " + text_filesize + " Kb")
+		else:
+			self.widgets['progressbar1'].set_text("Unknown file size")
+			self.widgets['label13'].set_text(text_downloaded + " Kb / Unkown")
+			self.widgets['progressbar1'].pulse()
 
 		self.refresh()
 


Index: autodownloader.spec
===================================================================
RCS file: /cvs/extras/rpms/autodownloader/devel/autodownloader.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- autodownloader.spec	5 Aug 2007 18:37:05 -0000	1.3
+++ autodownloader.spec	29 Nov 2007 18:26:59 -0000	1.4
@@ -1,12 +1,14 @@
 Name:           autodownloader
 Version:        0.2.0
-Release:        3%{?dist}
+Release:        5%{?dist}
 Summary:        GUI-tool to automate the download of certain files
 License:        GPLv2+
 Group:          Applications/Internet
 URL:            http://sourceforge.net/projects/autodownloader
 Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 Patch0:         autodownloader-0.2.0-timeout.patch
+Patch1:         autodownloader-0.2.0-check-existing-files.patch
+Patch2:         autodownloader-0.2.0-unknown-file-size.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 Requires:       pygtk2-libglade
@@ -30,6 +32,8 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 
 %build
@@ -52,6 +56,14 @@
 
 
 %changelog
+* Thu Nov 29 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.2.0-5
+- Apply patch from Ivo Manca fixing the downloading of files with an
+  unknown size, thanks!
+
+* Thu Oct  4 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.2.0-4
+- Check if files exist (and have the correct md5sum) from a previous download
+  and skip downloading them (bz 309381)
+
 * Fri Aug  3 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.2.0-3
 - Update License tag for new Licensing Guidelines compliance
 




More information about the scm-commits mailing list