~ubuntu-branches/ubuntu/karmic/seamonkey/karmic

« back to all changes in this revision

Viewing changes to debian/patches/35_zip_cache.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin, Fabien Tassin
  • Date: 2007-12-02 19:27:42 UTC
  • Revision ID: james.westby@ubuntu.com-20071202192742-llg1mzf5cg021i7y
Tags: 1.1.6+nobinonly-0ubuntu1
[ Fabien Tassin ]
* Remove unused patches:
  - drop debian/patches/20_visibility.dpatch,
    debian/patches/28_ppc64_build.dpatch,
    debian/patches/38_unsupported_arch_build.dpatch,
    debian/patches/80_calendar_locale.dpatch,
    debian/patches/82_prefs_ubuntu.dpatch
* Migrate from dpatch to quilt
  - update debian/control: build-depends on quilt
  - debian/rules: update patching rules
  - drop debian/patches/80_config.dpatch: done by quilt
  - rename and update debian/patches/00list => debian/patches/series
  - rename and update debian/patches/*.dpatch => debian/patches/*.patch
* Fix unclean distclean leaving dist/ behind
  - update debian/patches/60_distclean.patch
* Migrate to CDBS
  - update debian/rules and debian/control
* Revert the Iceape unbranding to Seamonkey
  - drop debian/patches/80_app_name.patch and update
    debian/patches/series
  - update debian/patches/82_prefs.patch and
    debian/patches/99_configure.patch
  - drop iceape's icons:
    - update debian/rules
    - drop debian/extras/iceape* and debian/extras/Throbber*
    - drop debian/extras/license.txt
    - update wording
    - update debian/copyright  
  - rename packages to seamonkey-*
    - update debian/control
    - rename debian/iceape-*.{dirs,install,links,postinst,postrm,preinst}
      to debian/seamonkey-*.{dirs,install,links,postinst,postrm,preinst}
    - rename debian/iceape-*.{menu,mime,manpages}
      to debian/seamonkey-*.{menu,mime,manpages}
  - rename and update debian/menu_dir/iceape-*.desktop to
    debian/menu_dir/seamonkey-*.desktop
  - rename and update debian/{iceape.cfg,iceaperc,iceape-runner} to
    debian/{seamonkey.cfg,seamonkeyrc,seamonkey-runner}
  - update debian/about_debian.js, debian/base.js and debian/homepagereset.js
* Drop leftovers from calendar
  - drop debian/iceape-calendar.*
  - drop debian/extras/calendar.svg
  - drop debian/menu_dir/iceape-calendar.desktop
  - update debian/control
* Clean-up
  - drop debian/README.source (no longer useful)
  - drop debian/mozconfig (leftover from previous commit)
* Drop debian/patches/81_free_art_improvements.patch (was part of
  the unbranding)
  - update debian/patches/series
* Make seamonkey build at last
  - fix FTBFS with new libnss (since bz399589 landed)
    - add debian/patches/11_bz399589_fix_missing_symbol_with_new_nss.patch
    - update debian/patches/series
  - fix another FTBFS with libnss (caused by bad linking order with libcrmf)
    - add debian/patches/12_fix_ftbfs_with_nss.patch
    - update debian/patches/99_configure.patch
    - update debian/patches/series
  - fix bad syntax for --enable-extensions
    - update debian/rules
  - fix FTBFS with dh_install needing DEB_DH_INSTALL_SOURCEDIR
    - update debian/rules
  - fix install of additionnal searchplugins
    - update debian/rules
  - don't install hicolor icons (we don't have any)
    - update debian/seamonkey-browser.install
* Install libnssckbi.so in seamonkey-browser and drop other libnss links
  - update debian/rules and debian/seamonkey-browser.links
* Fix broken chrome.d files and clean-up install rules
  - update debian/rules
  - update debian/seamonkey-browser.{install,dirs}
  - update debian/seamonkey-chatzilla.install
  - update debian/seamonkey-dom-inspector.install
  - update debian/seamonkey-mailnews.install
* Update bug link and README to point Seamonkey toward Ubuntu 
  - update debian/about_debian.js
  - debian/README.Debian
* Fix FTBFS on amd64 (don't depend on arch indep rules for binary
  packages
  - update debian/rules
  - update debian/seamonkey-browser.install
  - update debian/seamonkey-chatzilla.install
  - update debian/seamonkey-dom-inspector.install
  - update debian/seamonkey-mailnews.install
* Update to upstream release 1.1.6 (from 1.1.4)
  - update debian/control
  - Security fixes provided by 1.1.5:
    MFSA 2007-36, MFSA 2007-35, MFSA 2007-34, MFSA 2007-33, MFSA 2007-32,
    MFSA 2007-31, MFSA 2007-30, MFSA 2007-29 and MFSA 2007-28.
* Update diverged patches:
  - update debian/patches/35_theme_switch.patch
  - debian/patches/38_kbsd.patch
  - debian/patches/68_mips_performance.patch
  - debian/patches/99_configure.patch
* Update Maintainer to Ubuntu Mozilla Team
  - update debian/control
* Conflicts/Replaces iceape
  - update debian/control
* Fix nss links not installed where CDBS would have done it
  - update debian/rules
* Remove bin-only files from upstream tarball using debian/remove.binonly.sh.
  Add a nobinonly target in debian/rules to clean up the current tarball,
  preserve logs in mozilla/REMOVED+nobinonly.txt.
  - rename and update debian/remove.nonfree => debian/remove.binonly.sh
  - update debian/rules
* Fix desktop files to make desktop-file-validate happy
  - update debian/menu_dir/*.desktop
* Disable all desktop files except seamonkey.desktop, using the icon
  from branding (instead of the old style Mozilla one)
  - update debian/menu_dir/*.desktop
  - update debian/rules
* Add dummy packages for migration of iceape and mozilla packages:
  mozilla, mozilla-browser, mozilla-dev, mozilla-mailnews, mozilla-chatzilla,
  mozilla-psm, mozilla-dom-inspector, mozilla-js-debugger, mozilla-calendar,
  iceape, iceape-browser, iceape-gnome-support, iceape-dev, iceape-dbg,
  iceape-mailnews, iceape-chatzilla, iceape-calendar and iceape-dom-inspector
  - update debian/control
* Merge DSP settings from previously installed /etc/iceape/iceaperc or
  /etc/mozilla/mozillarc into /etc/seamonkey/seamonkeyrc
  - update debian/seamonkey-browser.preinst
* Remove leftovers from iceape packages
  - add debian/iceape-browser.postrm
  - add debian/iceape-browser.preinst
* Re-install /etc/seamonkey files previously disabled
  - update debian/seamonkey-browser.install
* Add missing 'upgrade' target to preinst script
  - update debian/iceape-browser.preinst
* Exclude CVS stuff when doing nobinonly tarballs
  - update debian/rules
* Fix a recent FTBFS in hardy where gtk+ is no longer bringing
  some X libs in build-deps
  - add debian/patches/13_bz344818_att264996.patch
  - update debian/patches/99_configure.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
---
 
2
 modules/libjar/nsJAR.cpp |   12 +++++++++++-
 
3
 modules/libjar/nsJAR.h   |    5 +++++
 
4
 2 files changed, 16 insertions(+), 1 deletion(-)
 
5
 
 
6
## 35_zip_cache.patch converted from dpatch file initially by Mike Hommey <glandium@debian.org>
 
7
#
 
8
# Invalidate cache for a zip file that got modified. It will prevent
 
9
# corruption of the XUL FastLoad cache when upgrade is performed
 
10
# while an instance of the application is running. bz#368428.
 
11
 
 
12
Index: iceape-1.1.4/modules/libjar/nsJAR.cpp
 
13
===================================================================
 
14
--- iceape-1.1.4.orig/modules/libjar/nsJAR.cpp
 
15
+++ iceape-1.1.4/modules/libjar/nsJAR.cpp
 
16
@@ -209,16 +209,17 @@
 
17
 //----------------------------------------------
 
18
 // nsIZipReader implementation
 
19
 //----------------------------------------------
 
20
 
 
21
 NS_IMETHODIMP
 
22
 nsJAR::Init(nsIFile* zipFile)
 
23
 {
 
24
   mZipFile = zipFile;
 
25
+  zipFile->GetLastModifiedTime(&mMtime);
 
26
   mLock = PR_NewLock();
 
27
   return mLock ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 
28
 }
 
29
 
 
30
 NS_IMETHODIMP
 
31
 nsJAR::GetFile(nsIFile* *result)
 
32
 {
 
33
   *result = mZipFile;
 
34
@@ -1211,25 +1212,34 @@
 
35
 #ifdef ZIP_CACHE_HIT_RATE
 
36
   mZipCacheLookups++;
 
37
 #endif
 
38
 
 
39
   nsCAutoString path;
 
40
   rv = zipFile->GetNativePath(path);
 
41
   if (NS_FAILED(rv)) return rv;
 
42
 
 
43
+  PRInt64 Mtime;
 
44
+  rv = zipFile->GetLastModifiedTime(&Mtime);
 
45
+  if (NS_FAILED(rv)) return rv;
 
46
+
 
47
   nsCStringKey key(path);
 
48
   nsJAR* zip = NS_STATIC_CAST(nsJAR*, NS_STATIC_CAST(nsIZipReader*,mZips.Get(&key))); // AddRefs
 
49
-  if (zip) {
 
50
+  if (zip && LL_EQ(Mtime, zip->GetMtime())) {
 
51
 #ifdef ZIP_CACHE_HIT_RATE
 
52
     mZipCacheHits++;
 
53
 #endif
 
54
     zip->ClearReleaseTime();
 
55
   }
 
56
   else {
 
57
+    if (zip) {
 
58
+      lock.unlock();
 
59
+      mZips.Remove(&key);
 
60
+      lock.lock();
 
61
+    }
 
62
     zip = new nsJAR();
 
63
     if (zip == nsnull)
 
64
         return NS_ERROR_OUT_OF_MEMORY;
 
65
     NS_ADDREF(zip);
 
66
     zip->SetZipReaderCache(this);
 
67
 
 
68
     rv = zip->Init(zipFile);
 
69
     if (NS_FAILED(rv)) {
 
70
Index: iceape-1.1.4/modules/libjar/nsJAR.h
 
71
===================================================================
 
72
--- iceape-1.1.4.orig/modules/libjar/nsJAR.h
 
73
+++ iceape-1.1.4/modules/libjar/nsJAR.h
 
74
@@ -112,30 +112,35 @@
 
75
     void ClearReleaseTime() {
 
76
       mReleaseTime = PR_INTERVAL_NO_TIMEOUT;
 
77
     }
 
78
     
 
79
     void SetZipReaderCache(nsZipReaderCache* cache) {
 
80
       mCache = cache;
 
81
     }
 
82
 
 
83
+    PRInt64 GetMtime() {
 
84
+      return mMtime;
 
85
+    }
 
86
+
 
87
     PRFileDesc* OpenFile();
 
88
   protected:
 
89
     //-- Private data members
 
90
     nsCOMPtr<nsIFile>        mZipFile;        // The zip/jar file on disk
 
91
     nsZipArchive             mZip;            // The underlying zip archive
 
92
     nsObjectHashtable        mManifestData;   // Stores metadata for each entry
 
93
     PRBool                   mParsedManifest; // True if manifest has been parsed
 
94
     nsCOMPtr<nsIPrincipal>   mPrincipal;      // The entity which signed this file
 
95
     PRInt16                  mGlobalStatus;   // Global signature verification status
 
96
     PRIntervalTime           mReleaseTime;    // used by nsZipReaderCache for flushing entries
 
97
     nsZipReaderCache*        mCache;          // if cached, this points to the cache it's contained in
 
98
        PRLock*                                  mLock; 
 
99
     PRInt32                  mTotalItemsInManifest;
 
100
     PRFileDesc*              mFd;
 
101
+    PRInt64                  mMtime;
 
102
     
 
103
     //-- Private functions
 
104
     nsresult ParseManifest(nsISignatureVerifier* verifier);
 
105
     void     ReportError(const char* aFilename, PRInt16 errorCode);
 
106
     nsresult LoadEntry(const char* aFilename, char** aBuf, 
 
107
                        PRUint32* aBufLen = nsnull);
 
108
     PRInt32  ReadLine(const char** src); 
 
109
     nsresult ParseOneFile(nsISignatureVerifier* verifier,