Link all the component manifests together at package time.

This commit is contained in:
Benjamin Smedberg 2010-06-29 18:19:09 -04:00
Родитель 973c7b2613
Коммит c170cab0db
4 изменённых файлов: 42 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,24 @@
import sys, os
manifestsdir, distdir = sys.argv[1:]
if not os.path.exists(manifestsdir):
print >>sys.stderr, "Warning: %s does not exist." % manifestsdir
sys.exit(0)
for name in os.listdir(manifestsdir):
manifestdir = os.path.join(manifestsdir, name)
if not os.path.isdir(manifestdir):
continue
manifestfile = os.path.join(distdir, 'components', name + '.manifest')
outfd = open(manifestfile, 'a')
for name in os.listdir(manifestdir):
infd = open(os.path.join(manifestdir, name))
print >>outfd, "# %s" % name
outfd.write(infd.read())
print >>outfd
infd.close()
outfd.close()

Просмотреть файл

@ -380,6 +380,7 @@ ifdef MOZ_PKG_MANIFEST
"$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
$(PERL) $(MOZILLA_DIR)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components -v -x "$(XPIDL_LINK)"
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py $(DIST)/manifests $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)
else # !MOZ_PKG_MANIFEST
ifeq ($(MOZ_PKG_FORMAT),DMG)
ifndef STAGE_SDK

Просмотреть файл

@ -230,7 +230,15 @@ sub do_copyfile
# set the destination path, if alternate destination given, use it.
if ($flat) {
if ($srcsuffix eq ".xpt" && $srcpath =~ m|/components/$|) {
if ($srcsuffix eq ".manifest" && $srcpath =~ m|/components/$|) {
if ($component eq "") {
die ("Manifest file was not part of a component.");
}
$destpathcomp = "$srcdir/manifests/$component";
$altdest = "$srcname$srcsuffix";
}
elsif ($srcsuffix eq ".xpt" && $srcpath =~ m|/components/$|) {
if ($component eq "") {
die ("XPT file was not part of a component.");
}

Просмотреть файл

@ -133,13 +133,15 @@ foreach my $component (@xptdirs) {
# merge .xpt files into one if we found any in the dir
if ( scalar(@xptfiles) ) {
my ($merged, $fmerged);
my ($merged, $fmerged, $manifest);
if ($finaldir ne "") {
$merged = "$finaldir/$component.xpt";
$manifest = "$finaldir/$component.manifest";
}
else {
$fmerged = "$destdir/$component/$bindir"."components/$component.xpt";
$merged = $fmerged.".new";
$manifest = "$destdir/$component/$bindir"."components/$component.manifest";
}
my @realxptfiles;
@ -160,6 +162,11 @@ foreach my $component (@xptdirs) {
($debug >= 4) && print "$cmdline\n";
system($cmdline) == 0 || die ("'$cmdline' failed");
print "Manifest file: $manifest";
open MANIFEST, '>>', $manifest;
print MANIFEST "interfaces $component.xpt\n";
close MANIFEST;
if ($finaldir eq "") {
# remove old .xpt files in the component directory.
($debug >= 2) && print "Deleting individual xpt files.\n";