rpms/comix/F-8 comix-3.6.4-tmpfile.patch, 1.1, 1.2 comix.spec, 1.11, 1.12
Mamoru Tasaka (mtasaka)
fedora-extras-commits at redhat.com
Wed Apr 2 16:34:34 UTC 2008
Author: mtasaka
Update of /cvs/extras/rpms/comix/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16544/F-8
Modified Files:
comix-3.6.4-tmpfile.patch comix.spec
Log Message:
More fix
comix-3.6.4-tmpfile.patch:
Index: comix-3.6.4-tmpfile.patch
===================================================================
RCS file: /cvs/extras/rpms/comix/F-8/comix-3.6.4-tmpfile.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- comix-3.6.4-tmpfile.patch 2 Apr 2008 14:41:00 -0000 1.1
+++ comix-3.6.4-tmpfile.patch 2 Apr 2008 16:33:49 -0000 1.2
@@ -1,5 +1,5 @@
---- comix-3.6.4/comix.tmpdir 2008-04-02 21:17:54.000000000 +0900
-+++ comix-3.6.4/comix 2008-04-02 23:32:50.000000000 +0900
+--- comix-3.6.4/comix.tmpfile 2008-04-03 01:23:35.000000000 +0900
++++ comix-3.6.4/comix 2008-04-03 01:23:35.000000000 +0900
@@ -47,6 +47,8 @@
import subprocess
import string
@@ -79,3 +79,85 @@
break
dir_number += 1
+--- comix-3.6.4/mime/comicthumb.tmpfile 2008-04-03 01:23:35.000000000 +0900
++++ comix-3.6.4/mime/comicthumb 2008-04-03 01:29:52.000000000 +0900
+@@ -24,6 +24,7 @@
+ import shutil
+
+ import subprocess
++import tempfile
+
+ try:
+ import Image
+@@ -51,9 +52,13 @@
+ sys.exit(1)
+
+ # temp directory needed for multiple archives
+-if not os.path.exists('/tmp/comicthumb/'):
+- os.makedirs('/tmp/comicthumb/')
+- os.chmod('/tmp/comicthumb/', 0700)
++#if not os.path.exists('/tmp/comicthumb/'):
++# os.makedirs('/tmp/comicthumb/')
++# os.chmod('/tmp/comicthumb/', 0700)
++_tmp_dir = tempfile.mkdtemp(prefix='comixthumb', suffix=os.sep,
++ dir = '/tmp')
++_tmp_dir += "/"
++
+
+ # return the first image in the list
+ def first_image (filelist):
+@@ -104,10 +109,10 @@
+ else:
+ subarchive = first_archive(zipfiles)
+ if subarchive:
+- output = open("/tmp/comicthumb/archive%d" % (depth), "wb")
++ output = open( _tmp_dir + "archive%d" % (depth), "wb")
+ output.write(zip.read(subarchive))
+ output.close()
+- return get_image("/tmp/comicthumb/archive%d" % (depth),
++ return get_image( _tmp_dir + "archive%d" % (depth),
+ depth + 1)
+ elif tarfile.is_tarfile(compressed_file):
+ TYPE = TYPE or 'cbt'
+@@ -122,10 +127,10 @@
+ else:
+ subarchive = first_archive(tarfiles)
+ if subarchive:
+- output = open("/tmp/comicthumb/archive%d" % (depth), "wb")
++ output = open( _tmp_dir + "archive%d" % (depth), "wb")
+ output.write(tar.extractfile(subarchive).read())
+ output.close()
+- return get_image("/tmp/comicthumb/archive%d" % (depth),
++ return get_image( _tmp_dir + "archive%d" % (depth),
+ depth + 1)
+ elif open(compressed_file, 'rb').read(4) == 'Rar!':
+ TYPE = TYPE or 'cbr'
+@@ -159,7 +164,7 @@
+ if subarchive:
+ #os.popen('%s p -inul -- "%s" "%s" > "/tmp/comicthumb/archive%d"'
+ #% (rar, compressed_file, subarchive, depth), "r")
+- filen = "/tmp/comicthumb/archive%d"%(depth)
++ filen = _tmp_dir + "archive%d"%(depth)
+ try:
+ os.remove(filen)
+ except:
+@@ -170,7 +175,7 @@
+ [rar, 'p', '-inul', '--', compressed_file, subarchive],
+ stdout = fdp).wait()
+ fp.close()
+- return get_image("/tmp/comicthumb/archive%d" % (depth),
++ return get_image( _tmp_dir + "archive%d" % (depth),
+ depth + 1)
+ return picture
+
+@@ -226,8 +231,8 @@
+ exit_flag = 1
+
+ # remove tempory stuff
+-if os.path.isdir('/tmp/comicthumb/'):
+- shutil.rmtree('/tmp/comicthumb/')
++if os.path.isdir(_tmp_dir):
++ shutil.rmtree(_tmp_dir)
+
+ # and exit
+ sys.exit(exit_flag)
Index: comix.spec
===================================================================
RCS file: /cvs/extras/rpms/comix/F-8/comix.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- comix.spec 2 Apr 2008 14:41:00 -0000 1.11
+++ comix.spec 2 Apr 2008 16:33:49 -0000 1.12
@@ -1,6 +1,6 @@
Name: comix
Version: 3.6.4
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: A user-friendly, customizable image viewer
Group: Amusements/Graphics
@@ -136,7 +136,7 @@
%changelog
-* Wed Apr 2 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 3.6.4-5
+* Thu Apr 3 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 3.6.4-6
- Second patch for bug 430635
Use tempfile.mkdtemp() for multiple user race condition
More information about the fedora-extras-commits
mailing list