Bug 300136 - Full update archives should contain removal instructions, part 1 - automatically create a list of files/directories to remove (and synchronize that list with the install.js list of files to remove) r=darin

This commit is contained in:
bsmedberg%covad.net 2005-09-15 18:09:56 +00:00
parent dfec80f51c
commit c798a330a8
7 changed files with 110 additions and 52 deletions

View File

@ -55,6 +55,8 @@ NO_PKG_FILES = \
include $(topsrcdir)/config/rules.mk
MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
ifdef BUILD_STATIC_LIBS
ifeq (WINNT,$(OS_ARCH))
MOZ_PKG_MANIFEST_P = $(srcdir)/windows/packages-static
@ -83,7 +85,7 @@ endif
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
installer:
installer: removed-files
ifdef INSTALLER_DIR
$(MAKE) -C $(INSTALLER_DIR)
endif

View File

@ -0,0 +1,31 @@
chrome/US.jar
chrome/en-win.jar
chrome/help.jar
chrome/chrome.rdf
chrome/installed-chrome.txt
chrome/app-chrome.manifest
chrome/overlayinfo/
components/compreg.dat
components/xpti.dat
components/nsBackgroundUpdateService.js
defaults/pref/all.js
defaults/pref/security-prefs.js
defaults/pref/winpref.js
defaults/pref/xpinstall.js
defaults/pref/bug307259.js
defaults/profile/US/
searchplugins/dictionary.src
searchplugins/dictionary.png
defaults/pref/bug259708.js
components/autocomplete.xpt
@DLL_PREFIX@zlib@DLL_SUFFIX@
components/component.reg
components/compreg.dat
components/xpti.dat
components/xptitemp.dat

View File

@ -59,7 +59,6 @@ INSTALLER_FILES = \
config.it \
abe.jst \
adt.jst \
browser.jst \
chatzilla.jst \
editor.jst \
inspector.jst \
@ -81,8 +80,12 @@ include $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/installer/windows/charset.m
installer:
$(NSINSTALL) -D instgen
$(PERL) $(topsrcdir)/toolkit/mozapps/installer/make-installjsremoves.pl ../removed-files > instgen/removed-files.js
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) instgen
iconv -f UTF-8 -t $(WIN_INSTALLER_CHARSET) $(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer/installer.inc > instgen/installer.inc
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) \
-Iinstgen/removed-files.js \
$(srcdir)/browser.jst > instgen/browser.jst
$(EXIT_ON_ERROR) \
for i in $(PP_LOCALIZED_FILES); do \
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) -Iinstgen/installer.inc $(srcdir)/$$i > instgen/$$i; \

View File

@ -1,41 +1,3 @@
function upgradeCleanup()
{
// Remove Chrome directory cruft
deleteThisFile("Chrome", "US.jar");
deleteThisFile("Chrome", "en-win.jar");
deleteThisFile("Chrome", "help.jar");
deleteThisFile("Chrome", "chrome.rdf");
deleteThisFile("Chrome", "installed-chrome.txt");
deleteThisFile("Chrome", "app-chrome.manifest");
deleteThisFolder("Chrome", "overlayinfo");
// Remove defunct components
deleteThisFile("Components", "compreg.dat");
deleteThisFile("Components", "xpti.dat");
deleteThisFile("Components", "nsBackgroundUpdateService.js");
// Remove defunct defaults files.
deleteThisFile("Program", "defaults/pref/all.js");
deleteThisFile("Program", "defaults/pref/security-prefs.js");
deleteThisFile("Program", "defaults/pref/winpref.js");
deleteThisFile("Program", "defaults/pref/xpinstall.js");
deleteThisFile("Program", "defaults/pref/bug307259.js");
deleteThisFolder("Program", "defaults/profile/US");
// Delete dictionary.com search plugin
deleteThisFile("Program", "searchplugins/dictionary.src");
deleteThisFile("Program", "searchplugins/dictionary.png");
// These files are related to app patches and will interfere with the
// UA/app version strings if we do not remove them.
deleteThisFile("Program", "defaults/pref/bug259708.js");
// Remove non-linked xpt files for rev'd interfaces; this prevents a
// conflict if you had previously installed a zip build in the app directory.
deleteThisFile("Components", "autocomplete.xpt");
}
function copyFlashXPT()
{
/*
@ -138,7 +100,7 @@ if(verifyDiskSpace(fProgram, srDest))
{
setPackageFolder(fProgram);
upgradeCleanup();
removeOldFiles();
err = addDirectory("",
"$Version$",
"bin", // dir name in jar to extract

View File

@ -1,12 +1,3 @@
function upgradeCleanup()
{
deleteThisFile("Program", "zlib.dll");
deleteThisFile("Program", "component.reg");
deleteThisFile("Components", "compreg.dat");
deleteThisFile("Components", "xpti.dat");
deleteThisFile("Components", "xptitemp.dat");
}
// main
var srDest;
var err;
@ -38,7 +29,6 @@ if(verifyDiskSpace(fProgram, srDest))
{
setPackageFolder(fProgram);
upgradeCleanup();
err = addDirectory("",
"$Version$",
"bin", // dir name in jar to extract

View File

@ -0,0 +1,59 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Firefox installer build scripts.
#
# The Initial Developer of the Original Code is
# Benjamin Smedberg <benjamin@smedbergs.us>
#
# Portions created by the Initial Developer are Copyright (C) 2005
# the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Read a removed-files manifest and create a set of
# deleteThisFile/deleteThisFolder instructions suitable for an install.js
# script. This simply processes <> to stdout.
print "function removeOldFiles() {\n";
while (<>) {
m|^\s*(\S+)\s*$|;
my $file = $1;
next if ($file eq "");
if ($file =~ m|/$|) {
chop $file;
print " deleteThisFolder(\"Program\", \"$file\");\n";
}
else {
print " deleteThisFile(\"Program\", \"$file\");\n";
}
}
print "}\n";

View File

@ -209,6 +209,15 @@ ifndef PACKAGER_NO_LIBS
libs:: $(PACKAGE)
endif
DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX)
ifdef MOZ_PKG_REMOVALS
MOZ_PKG_REMOVALS_GEN = removed-files
$(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in
$(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN)
endif
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
ifdef USE_SHORT_LIBNAME
@ -236,7 +245,7 @@ else
PKGCP_OS = unix
endif
$(PACKAGE): $(MOZILLA_BIN) $(MOZ_PKG_MANIFEST)
$(PACKAGE): $(MOZILLA_BIN) $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN)
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
# NOTE: this must be a tar now that dist links into the tree so that we
# do not strip the binaries actually in the tree.
@ -285,8 +294,10 @@ endif
@echo "Removing unpackaged files..."
ifeq ($(MOZ_PKG_FORMAT),DMG)
cd $(DIST)/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS; rm -rf $(NO_PKG_FILES)
$(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS
else
cd $(DIST)/$(MOZ_PKG_APPNAME); rm -rf $(NO_PKG_FILES)
$(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(MOZ_PKG_APPNAME)
endif
@echo "Compressing..."
cd $(DIST); $(MAKE_PACKAGE)