rpms/sugar-toolkit/OLPC-3 8674.patch, NONE, 1.1 sugar-toolkit.spec, 1.25, 1.26
C. Scott Ananian
cscott at fedoraproject.org
Mon Sep 29 04:44:15 UTC 2008
Author: cscott
Update of /cvs/pkgs/rpms/sugar-toolkit/OLPC-3
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5345
Modified Files:
sugar-toolkit.spec
Added Files:
8674.patch
Log Message:
Rebuild with fix for #8674.
8674.patch:
--- NEW FILE 8674.patch ---
commit 2a10f318e393ba97cb2341bbde0015b7483fbc6d
Author: C. Scott Ananian <cscott at laptop.org>
Date: Fri Sep 26 00:47:35 2008 -0400
Trac #8674: sanity-check bundle root; don't delete install_root on failure.
The software updater was deleting ~/Activities when it encountered a bad
bundle. Two separate issues: we didn't sanity check the bundle root to
ensure it wasn't '.' or '..' or something crazy like that, and our "clean
up on failure" code was deleting the install_root instead of the activity
root (!). This was a regression introduced by the fix for #7733 in
commit db2d1c42e2481d6dbc15405840ac23e46eab7318 (0.82.2).
diff --git a/src/sugar/bundle/bundle.py b/src/sugar/bundle/bundle.py
index 0319b9e..e9bd9f8 100644
--- a/src/sugar/bundle/bundle.py
+++ b/src/sugar/bundle/bundle.py
@@ -86,6 +86,9 @@ class Bundle:
del file_names[0]
self._zip_root_dir = file_names[0].split('/')[0]
+ if self._zip_root_dir.startswith('.'):
+ raise MalformedBundleException(
+ 'root directory starts with .')
if self._unzipped_extension is not None:
(name_, ext) = os.path.splitext(self._zip_root_dir)
if ext != self._unzipped_extension:
@@ -162,7 +165,8 @@ class Bundle:
if os.spawnlp(os.P_WAIT, 'unzip', 'unzip', '-o', self._path,
'-x', 'mimetype', '-d', install_dir):
# clean up install dir after failure
- shutil.rmtree(install_dir, ignore_errors=True)
+ shutil.rmtree(os.path.join(install_dir, self._zip_root_dir),
+ ignore_errors=True)
# indicate failure.
raise ZipExtractException
Index: sugar-toolkit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/sugar-toolkit/OLPC-3/sugar-toolkit.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- sugar-toolkit.spec 24 Sep 2008 22:53:16 -0000 1.25
+++ sugar-toolkit.spec 29 Sep 2008 04:43:44 -0000 1.26
@@ -6,7 +6,7 @@
Summary: Sugar toolkit
Name: sugar-toolkit
Version: 0.82.11
-Release: 3%{?dist}
+Release: 4%{?dist}
#Release: 2.%{alphatag}%{?dist}
URL: http://wiki.laptop.org/go/Sugar
# git clone git://dev.laptop.org/sugar
@@ -20,6 +20,7 @@
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: localedir.patch
+Patch2: 8674.patch
BuildRequires: pkgconfig
BuildRequires: pygtk2-devel
@@ -47,6 +48,7 @@
%setup -q
%patch1 -p1 -b .localedir
+%patch2 -p1 -b .8674
%build
%configure
@@ -70,6 +72,9 @@
%{_sysconfdir}/rpm/macros.sugar
%changelog
+* Mon Sep 29 2008 C. Scott Ananian <cscott at laptop.org> - 0.82.11-4
+- #8674 don't delete ~/Activities on bundle install failure
+
* Wed Sep 24 2008 Marco Pesenti Gritti <mpg at redhat.com> - 0.82.11-3
- Apply the patch with -p1
More information about the fedora-extras-commits
mailing list