Compare commits
1 Commits
feature_te
...
tags/Pre-X
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
428ec0ae9d |
5
mozilla/modules/libjar/MANIFEST
Normal file
5
mozilla/modules/libjar/MANIFEST
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
zipfile.h
|
||||
36
mozilla/modules/libjar/Makefile.in
Normal file
36
mozilla/modules/libjar/Makefile.in
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = jar
|
||||
LIBRARY_NAME = jar$(VERSION_NUMBER)
|
||||
|
||||
CPPSRCS = \
|
||||
nsZipArchive.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = zipfile.h
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
BIN
mozilla/modules/libjar/macbuild/libjar.mcp
Normal file
BIN
mozilla/modules/libjar/macbuild/libjar.mcp
Normal file
Binary file not shown.
2
mozilla/modules/libjar/macbuild/libjar.toc
Normal file
2
mozilla/modules/libjar/macbuild/libjar.toc
Normal file
@@ -0,0 +1,2 @@
|
||||
# target: libjarDebug.shlb
|
||||
mozilla/modules/libjar/nsZipArchive.cpp
|
||||
67
mozilla/modules/libjar/makefile.win
Normal file
67
mozilla/modules/libjar/makefile.win
Normal file
@@ -0,0 +1,67 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (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/NPL/
|
||||
#
|
||||
# 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 Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DIRS=standalone
|
||||
|
||||
MODULE=jar
|
||||
DEPTH=..\..
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
|
||||
DLLNAME=jar$(VERSION_NUMBER)
|
||||
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
MAPFILE=$(DLLNAME).map
|
||||
|
||||
EXPORTS=zipfile.h
|
||||
|
||||
OBJS=.\$(OBJDIR)\nsZipArchive.obj
|
||||
|
||||
LINCS= \
|
||||
-I$(XPDIST)\public\nspr \
|
||||
-I$(XPDIST)\public\raptor \
|
||||
-I$(XPDIST)\public\xpcom \
|
||||
-I$(XPDIST)\public\zlib \
|
||||
-I$(XPDIST)\public\network \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\zlib.lib \
|
||||
$(DIST)\lib\xplib.lib \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
$(RM) $(OBJS)
|
||||
$(RM) $(DIST)\bin\$(DLLNAME).dll
|
||||
$(RM) $(DIST)\lib\$(DLLNAME).lib
|
||||
|
||||
795
mozilla/modules/libjar/nsZipArchive.cpp
Normal file
795
mozilla/modules/libjar/nsZipArchive.cpp
Normal file
@@ -0,0 +1,795 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (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/NPL/
|
||||
*
|
||||
* 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 Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module implements a simple archive extractor for the PKZIP format.
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "nscore.h"
|
||||
#include "prmem.h"
|
||||
#include "prio.h"
|
||||
#include "plstr.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#include "xp_regexp.h"
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
#include "zipfile.h"
|
||||
#include "zipstruct.h"
|
||||
#include "nsZipArchive.h"
|
||||
|
||||
|
||||
static PRUint16 xtoint(unsigned char *ii);
|
||||
static PRUint32 xtolong(unsigned char *ll);
|
||||
|
||||
|
||||
/*---------------------------------------------
|
||||
* C API wrapper for nsZipArchive
|
||||
*--------------------------------------------*/
|
||||
|
||||
/**
|
||||
* ZIP_OpenArchive
|
||||
*
|
||||
* opens the named zip/jar archive and returns a handle that
|
||||
* represents the archive in other ZIP_ calls.
|
||||
*
|
||||
* @param zipname archive filename
|
||||
* @param hZip receives handle if archive opened OK
|
||||
* @return status code
|
||||
*/
|
||||
PR_PUBLIC_API(PRInt32) ZIP_OpenArchive( const char * zipname, void** hZip )
|
||||
{
|
||||
PRInt32 status;
|
||||
|
||||
/*--- error check args ---*/
|
||||
if ( hZip == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
/*--- NULL output to prevent use by bozos who don't check errors ---*/
|
||||
*hZip = NULL;
|
||||
|
||||
/*--- create and open the archive ---*/
|
||||
nsZipArchive* zip = new nsZipArchive();
|
||||
if ( zip == NULL )
|
||||
return ZIP_ERR_MEMORY;
|
||||
|
||||
status = zip->OpenArchive(zipname);
|
||||
|
||||
if ( status == ZIP_OK )
|
||||
*hZip = NS_STATIC_CAST(void*,zip);
|
||||
else
|
||||
delete zip;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ZIP_CloseArchive
|
||||
*
|
||||
* closes zip archive and frees memory
|
||||
* @param hZip handle obtained from ZIP_OpenArchive
|
||||
* @return status code
|
||||
*/
|
||||
PR_PUBLIC_API(PRInt32) ZIP_CloseArchive( void** hZip )
|
||||
{
|
||||
/*--- error check args ---*/
|
||||
if ( hZip == NULL || *hZip == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
nsZipArchive* zip = NS_STATIC_CAST(nsZipArchive*,*hZip);
|
||||
if ( zip->kMagic != ZIP_MAGIC )
|
||||
return ZIP_ERR_PARAM; /* whatever it is isn't one of ours! */
|
||||
|
||||
/*--- close the archive ---*/
|
||||
*hZip = NULL;
|
||||
delete zip;
|
||||
|
||||
return ZIP_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ZIP_ExtractFile
|
||||
*
|
||||
* extracts named file from an opened archive
|
||||
*
|
||||
* @param hZip handle obtained from ZIP_OpenArchive
|
||||
* @param filename name of file in archive
|
||||
* @param outname filename to extract to
|
||||
*/
|
||||
PR_PUBLIC_API(PRInt32) ZIP_ExtractFile( void* hZip, const char * filename, const char * outname )
|
||||
{
|
||||
/*--- error check args ---*/
|
||||
if ( hZip == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
nsZipArchive* zip = NS_STATIC_CAST(nsZipArchive*,hZip);
|
||||
if ( zip->kMagic != ZIP_MAGIC )
|
||||
return ZIP_ERR_PARAM; /* whatever it is isn't one of ours! */
|
||||
|
||||
/*--- extract the file ---*/
|
||||
return zip->ExtractFile( filename, outname );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ZIP_FindInit
|
||||
*
|
||||
* Initializes an enumeration of files in the archive
|
||||
*
|
||||
* @param hZip handle obtained from ZIP_OpenArchive
|
||||
* @param pattern regexp to match files in archive, the usual shell expressions.
|
||||
* NULL pattern also matches all files, faster than "*"
|
||||
*/
|
||||
PR_EXTERN(PRInt32) ZIP_FindInit( void* hZip, const char * pattern )
|
||||
{
|
||||
/*--- error check args ---*/
|
||||
if ( hZip == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
nsZipArchive* zip = NS_STATIC_CAST(nsZipArchive*,hZip);
|
||||
if ( zip->kMagic != ZIP_MAGIC )
|
||||
return ZIP_ERR_PARAM; /* whatever it is isn't one of ours! */
|
||||
|
||||
/*--- initialize the pattern search ---*/
|
||||
return zip->FindInit( pattern );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ZIP_FindInit
|
||||
*
|
||||
* Puts the next name in the passed buffer. Returns ZIP_ERR_SMALLBUF when
|
||||
* the name is too large for the buffer, and ZIP_ERR_FNF when there are no
|
||||
* more files that match the pattern
|
||||
*
|
||||
* @param hZip handle obtained from ZIP_OpenArchive
|
||||
* @param outbuf buffer to receive next filename
|
||||
* @param bufsize size of allocated buffer
|
||||
*/
|
||||
PR_EXTERN(PRInt32) ZIP_FindNext( void* hZip, char * outbuf, PRUint16 bufsize )
|
||||
{
|
||||
/*--- error check args ---*/
|
||||
if ( hZip == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
nsZipArchive* zip = NS_STATIC_CAST(nsZipArchive*,hZip);
|
||||
if ( zip->kMagic != ZIP_MAGIC )
|
||||
return ZIP_ERR_PARAM; /* whatever it is isn't one of ours! */
|
||||
|
||||
/*--- return next filename file ---*/
|
||||
return zip->FindNext( outbuf, bufsize );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//***********************************************************
|
||||
// nsZipArchive -- public methods
|
||||
//***********************************************************
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::OpenArchive
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::OpenArchive( const char * aArchiveName )
|
||||
{
|
||||
//-- validate arguments
|
||||
if ( aArchiveName == NULL || *aArchiveName == '\0')
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
//-- not allowed to do two opens on the same object!
|
||||
if ( mFd != NULL )
|
||||
return ZIP_ERR_GENERAL;
|
||||
|
||||
//-- open the physical file
|
||||
mFd = PR_Open( aArchiveName, PR_RDONLY, 0 );
|
||||
if ( mFd == NULL )
|
||||
return ZIP_ERR_DISK;
|
||||
|
||||
//-- get table of contents for archive
|
||||
return BuildFileList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::ExtractFile
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::ExtractFile(const char* aFilename, const char* aOutname)
|
||||
{
|
||||
//-- sanity check arguments
|
||||
if ( aFilename == NULL || aOutname == NULL )
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
//-- find file information
|
||||
const nsZipItem* item = GetFileItem( aFilename );
|
||||
if ( item == NULL )
|
||||
return ZIP_ERR_FNF;
|
||||
|
||||
//-- extract the file using appropriate method
|
||||
switch( item->compression )
|
||||
{
|
||||
case STORED:
|
||||
return CopyItemToDisk( item, aOutname );
|
||||
|
||||
case DEFLATED:
|
||||
return InflateItemToDisk( item, aOutname );
|
||||
|
||||
default:
|
||||
//-- unsupported compression type
|
||||
return ZIP_ERR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::FindInit
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::FindInit( const char * aPattern )
|
||||
{
|
||||
// validate the pattern
|
||||
if ( aPattern != NULL )
|
||||
switch (XP_RegExpValid( (char*)aPattern ))
|
||||
{
|
||||
case INVALID_SXP:
|
||||
return ZIP_ERR_PARAM;
|
||||
|
||||
case NON_SXP:
|
||||
mPatternIsRegExp = PR_FALSE;
|
||||
break;
|
||||
|
||||
case VALID_SXP:
|
||||
mPatternIsRegExp = PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
// unexpected/undoc'ed return value
|
||||
PR_ASSERT( PR_FALSE );
|
||||
return ZIP_ERR_GENERAL;
|
||||
}
|
||||
|
||||
// clear the old pattern
|
||||
if ( mPattern != NULL )
|
||||
{
|
||||
PL_strfree( mPattern );
|
||||
mPattern = NULL;
|
||||
}
|
||||
|
||||
// re-initialize pattern state
|
||||
mPatternSlot = 0;
|
||||
mPatternItem = NULL;
|
||||
if ( aPattern != NULL )
|
||||
mPattern = PL_strdup( aPattern );
|
||||
|
||||
return ZIP_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::FindNext
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::FindNext( char * aBuf, PRUint16 aSize )
|
||||
{
|
||||
PRInt32 status;
|
||||
PRBool found = PR_FALSE;
|
||||
PRUint32 slot = mPatternSlot;
|
||||
nsZipItem* item = mPatternItem;
|
||||
|
||||
// we start from last match, look for next
|
||||
while ( slot < ZIP_TABSIZE && !found )
|
||||
{
|
||||
if ( item != NULL )
|
||||
item = item->next; // move to next in current chain
|
||||
else
|
||||
item = mFiles[slot]; // starting a new slot
|
||||
|
||||
if ( item == NULL )
|
||||
{ // no more in this chain, move to next slot
|
||||
++slot;
|
||||
continue;
|
||||
}
|
||||
else if ( mPattern == NULL )
|
||||
found = PR_TRUE; // always match
|
||||
else if ( mPatternIsRegExp )
|
||||
found = XP_RegExpMatch( item->name, mPattern, PR_FALSE );
|
||||
else
|
||||
found = ( PL_strcmp( item->name, mPattern ) == 0 );
|
||||
}
|
||||
|
||||
if ( found )
|
||||
{
|
||||
if ( aSize > item->namelen )
|
||||
{
|
||||
PL_strcpy( aBuf, item->name );
|
||||
status = ZIP_OK;
|
||||
}
|
||||
else
|
||||
status = ZIP_ERR_SMALLBUF;
|
||||
}
|
||||
else
|
||||
status = ZIP_ERR_FNF;
|
||||
|
||||
// save state for next Find. For 'smallbuf' we give user another chance
|
||||
if ( status != ZIP_ERR_SMALLBUF )
|
||||
{
|
||||
mPatternSlot = slot;
|
||||
mPatternItem = item;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//***********************************************************
|
||||
// nsZipArchive -- private implementation
|
||||
//***********************************************************
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::BuildFileList
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::BuildFileList()
|
||||
{
|
||||
PRInt32 status = ZIP_OK;
|
||||
PRUint32 sig = 0L;
|
||||
PRUint32 namelen, extralen;
|
||||
PRUint16 hash;
|
||||
|
||||
ZipLocal Local;
|
||||
|
||||
nsZipItem* item;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// read the local file headers.
|
||||
//
|
||||
// What we *should* be doing is reading the central directory at the end,
|
||||
// all in one place. We'll have to change this eventually since the local
|
||||
// headers don't have the mode information we need for Unix files.
|
||||
//-----------------------------------------------------------------------
|
||||
PRInt32 pos = 0L;
|
||||
while ( status == ZIP_OK )
|
||||
{
|
||||
if ( PR_Seek( mFd, pos, PR_SEEK_SET ) != (PRInt32)pos )
|
||||
{
|
||||
//-- couldn't seek to next position
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( PR_Read( mFd, (char*)&Local, sizeof(ZipLocal) ) != sizeof(ZipLocal) )
|
||||
{
|
||||
//-- file ends prematurely
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
break;
|
||||
}
|
||||
|
||||
//-- make sure we're processing a local header
|
||||
sig = xtolong( Local.signature );
|
||||
if ( sig == CENTRALSIG )
|
||||
{
|
||||
// we're onto the next section
|
||||
break;
|
||||
}
|
||||
else if ( sig != LOCALSIG )
|
||||
{
|
||||
//-- otherwise expected to find a local header
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
break;
|
||||
}
|
||||
|
||||
namelen = xtoint( Local.filename_len );
|
||||
extralen = xtoint( Local.extrafield_len );
|
||||
|
||||
item = new nsZipItem();
|
||||
if ( item != NULL )
|
||||
{
|
||||
item->name = new char[namelen+1];
|
||||
|
||||
if ( item->name != NULL )
|
||||
{
|
||||
if ( PR_Read( mFd, item->name, namelen ) == (PRInt32)namelen )
|
||||
{
|
||||
item->name[namelen] = 0;
|
||||
item->namelen = namelen;
|
||||
|
||||
item->headerloc = pos;
|
||||
item->offset = pos + sizeof(ZipLocal) + namelen + extralen;
|
||||
item->compression = xtoint( Local.method );
|
||||
item->size = xtolong( Local.size );
|
||||
item->realsize = xtolong( Local.orglen );
|
||||
item->crc32 = xtolong( Local.crc32 );
|
||||
|
||||
//-- add item to file table
|
||||
hash = HashName( item->name );
|
||||
item->next = mFiles[hash];
|
||||
mFiles[hash] = item;
|
||||
|
||||
pos = item->offset + item->size;
|
||||
}
|
||||
else
|
||||
{
|
||||
//-- file is truncated
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//-- couldn't allocate for the filename
|
||||
status = ZIP_ERR_MEMORY;
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//-- couldn't create a nsZipItem
|
||||
status = ZIP_ERR_MEMORY;
|
||||
}
|
||||
} /* while reading local headers */
|
||||
|
||||
//-------------------------------------------------------
|
||||
// we don't care about the rest of the file (until we
|
||||
// fix this to read the central directory instead)
|
||||
//-------------------------------------------------------
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::CopyItemToDisk
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::CopyItemToDisk( const nsZipItem* aItem, const char* aOutname )
|
||||
{
|
||||
PRInt32 status = ZIP_OK;
|
||||
PRUint32 chunk, pos, size;
|
||||
PRFileDesc* fOut = NULL;
|
||||
|
||||
PR_ASSERT( aItem != NULL && aOutname != NULL );
|
||||
|
||||
char* buf = (char*)PR_Malloc(ZIP_BUFLEN);
|
||||
if ( buf == NULL )
|
||||
return ZIP_ERR_MEMORY;
|
||||
|
||||
//-- find start of file in archive
|
||||
if ( PR_Seek( mFd, aItem->offset, PR_SEEK_SET ) != (PRInt32)aItem->offset )
|
||||
{
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//-- open output file
|
||||
fOut = PR_Open( aOutname, PR_WRONLY | PR_CREATE_FILE, 0644);
|
||||
if ( fOut == NULL )
|
||||
{
|
||||
status = ZIP_ERR_DISK;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//-- copy chunks until file is done
|
||||
size = aItem->size;
|
||||
for ( pos=0; pos < size; pos += chunk )
|
||||
{
|
||||
chunk = (pos+ZIP_BUFLEN <= size) ? ZIP_BUFLEN : size - pos;
|
||||
|
||||
if ( PR_Read( mFd, buf, chunk ) != (PRInt32)chunk )
|
||||
{
|
||||
//-- unexpected end of data in archive
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( PR_Write( fOut, buf, chunk ) < (PRInt32)chunk )
|
||||
{
|
||||
//-- Couldn't write all the data (disk full?)
|
||||
status = ZIP_ERR_DISK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if ( fOut != NULL )
|
||||
PR_Close( fOut );
|
||||
|
||||
PR_FREEIF( buf );
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::GetFileItem
|
||||
//---------------------------------------------
|
||||
const nsZipItem* nsZipArchive::GetFileItem( const char * aFilename )
|
||||
{
|
||||
PR_ASSERT( aFilename != NULL );
|
||||
|
||||
nsZipItem* item = mFiles[ HashName(aFilename) ];
|
||||
|
||||
for ( ; item != NULL; item = item->next )
|
||||
{
|
||||
if ( 0 == PL_strcmp( aFilename, item->name ) )
|
||||
break; //-- found it
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::HashName
|
||||
//---------------------------------------------
|
||||
PRUint16 nsZipArchive::HashName( const char* aName )
|
||||
{
|
||||
PRUint16 val = 0;
|
||||
PRUint8* c;
|
||||
|
||||
PR_ASSERT( aName != NULL );
|
||||
|
||||
for ( c = (PRUint8*)aName; *c != 0; c++ ) {
|
||||
val = val*37 + *c;
|
||||
}
|
||||
|
||||
return (val % ZIP_TABSIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::InflateItemToDisk
|
||||
//---------------------------------------------
|
||||
PRInt32 nsZipArchive::InflateItemToDisk( const nsZipItem* aItem, const char* aOutname )
|
||||
{
|
||||
PRInt32 status = ZIP_OK;
|
||||
PRUint32 chunk, inpos, outpos, size;
|
||||
PRFileDesc* fOut = NULL;
|
||||
z_stream zs;
|
||||
int zerr;
|
||||
PRBool bInflating = PR_FALSE;
|
||||
|
||||
PR_ASSERT( aItem != NULL && aOutname != NULL );
|
||||
|
||||
//-- allocate deflation buffers
|
||||
Bytef *inbuf = (Bytef*)PR_Malloc(ZIP_BUFLEN);
|
||||
Bytef *outbuf = (Bytef*)PR_Malloc(ZIP_BUFLEN);
|
||||
if ( inbuf == NULL || outbuf == NULL )
|
||||
{
|
||||
status = ZIP_ERR_MEMORY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//-- find start of file in archive
|
||||
if ( PR_Seek( mFd, aItem->offset, PR_SEEK_SET ) != (PRInt32)aItem->offset )
|
||||
{
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//-- open output file
|
||||
fOut = PR_Open( aOutname, PR_WRONLY | PR_CREATE_FILE, 0644);
|
||||
if ( fOut == NULL )
|
||||
{
|
||||
status = ZIP_ERR_DISK;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//-- set up the inflate
|
||||
memset( &zs, 0, sizeof(zs) );
|
||||
zerr = inflateInit2( &zs, -MAX_WBITS );
|
||||
if ( zerr != Z_OK )
|
||||
{
|
||||
status = ZIP_ERR_GENERAL;
|
||||
goto cleanup;
|
||||
}
|
||||
bInflating = PR_TRUE;
|
||||
|
||||
|
||||
//-- inflate loop
|
||||
size = aItem->size;
|
||||
outpos = inpos = 0;
|
||||
zs.next_out = outbuf;
|
||||
zs.avail_out = ZIP_BUFLEN;
|
||||
while ( zerr == Z_OK )
|
||||
{
|
||||
if ( zs.avail_in == 0 && zs.total_in < size )
|
||||
{
|
||||
//-- no data to inflate yet still more in file:
|
||||
//-- read another chunk of compressed data
|
||||
|
||||
inpos = zs.total_in; // input position
|
||||
chunk = ( inpos + ZIP_BUFLEN <= size ) ? ZIP_BUFLEN : size - inpos;
|
||||
|
||||
if ( PR_Read( mFd, inbuf, chunk ) != (PRInt32)chunk )
|
||||
{
|
||||
//-- unexpected end of data
|
||||
status = ZIP_ERR_CORRUPT;
|
||||
break;
|
||||
}
|
||||
zs.next_in = inbuf;
|
||||
zs.avail_in = ZIP_BUFLEN;
|
||||
}
|
||||
|
||||
if ( zs.avail_out == 0 )
|
||||
{
|
||||
//-- write inflated buffer to disk and make space
|
||||
if ( PR_Write( fOut, outbuf, ZIP_BUFLEN ) < ZIP_BUFLEN )
|
||||
{
|
||||
//-- Couldn't write all the data (disk full?)
|
||||
status = ZIP_ERR_DISK;
|
||||
break;
|
||||
}
|
||||
outpos = zs.total_out;
|
||||
|
||||
zs.next_out = outbuf;
|
||||
zs.avail_out = chunk;
|
||||
}
|
||||
|
||||
zerr = inflate( &zs, Z_PARTIAL_FLUSH );
|
||||
|
||||
} // while
|
||||
|
||||
//-- write last inflated bit to disk
|
||||
if ( zerr == Z_STREAM_END && outpos < zs.total_out )
|
||||
{
|
||||
chunk = zs.total_out - outpos;
|
||||
if ( PR_Write( fOut, outbuf, chunk ) < (PRInt32)chunk )
|
||||
{
|
||||
status = ZIP_ERR_DISK;
|
||||
}
|
||||
}
|
||||
|
||||
//-- convert zlib error to return value
|
||||
if ( status == ZIP_OK && zerr != Z_OK && zerr != Z_STREAM_END )
|
||||
{
|
||||
status = (zerr == Z_MEM_ERROR) ? ZIP_ERR_MEMORY : ZIP_ERR_CORRUPT;
|
||||
}
|
||||
|
||||
//-- if found no errors make sure we've converted the whole thing
|
||||
PR_ASSERT( status != ZIP_OK || zs.total_in == aItem->size );
|
||||
PR_ASSERT( status != ZIP_OK || zs.total_out == aItem->realsize );
|
||||
|
||||
cleanup:
|
||||
if ( bInflating )
|
||||
{
|
||||
//-- free zlib internal state
|
||||
inflateEnd( &zs );
|
||||
}
|
||||
|
||||
if ( fOut != NULL )
|
||||
PR_Close( fOut );
|
||||
|
||||
PR_FREEIF( inbuf );
|
||||
PR_FREEIF( outbuf );
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------
|
||||
// nsZipArchive constructor and destructor
|
||||
//------------------------------------------
|
||||
|
||||
nsZipArchive::nsZipArchive()
|
||||
: kMagic(ZIP_MAGIC), mFd(NULL), mPattern(NULL),
|
||||
mPatternSlot(ZIP_TABSIZE), mPatternItem(NULL)
|
||||
{
|
||||
// initialize the table to NULL
|
||||
for ( int i = 0; i < ZIP_TABSIZE; ++i) {
|
||||
mFiles[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
nsZipArchive::~nsZipArchive()
|
||||
{
|
||||
// close the file if open
|
||||
if ( mFd != NULL ) {
|
||||
PR_Close(mFd);
|
||||
}
|
||||
|
||||
// delete nsZipItems in table
|
||||
nsZipItem* pItem;
|
||||
for ( int i = 0; i < ZIP_TABSIZE; ++i)
|
||||
{
|
||||
pItem = mFiles[i];
|
||||
while ( pItem != NULL )
|
||||
{
|
||||
mFiles[i] = pItem->next;
|
||||
delete pItem;
|
||||
pItem = mFiles[i];
|
||||
}
|
||||
}
|
||||
|
||||
if ( mPattern != NULL ) {
|
||||
PL_strfree(mPattern);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------
|
||||
// nsZipItem constructor and destructor
|
||||
//------------------------------------------
|
||||
|
||||
nsZipItem::nsZipItem() : name(NULL),next(NULL) {}
|
||||
|
||||
nsZipItem::~nsZipItem()
|
||||
{
|
||||
if (name != NULL )
|
||||
delete [] name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------
|
||||
// helper functions
|
||||
//------------------------------------------
|
||||
|
||||
/*
|
||||
* x t o i n t
|
||||
*
|
||||
* Converts a two byte ugly endianed integer
|
||||
* to our platform's integer.
|
||||
*/
|
||||
static PRUint16 xtoint (unsigned char *ii)
|
||||
{
|
||||
return (PRUint16) (ii [0]) | ((PRUint16) ii [1] << 8);
|
||||
}
|
||||
|
||||
/*
|
||||
* x t o l o n g
|
||||
*
|
||||
* Converts a four byte ugly endianed integer
|
||||
* to our platform's integer.
|
||||
*/
|
||||
static PRUint32 xtolong (unsigned char *ll)
|
||||
{
|
||||
PRUint32 ret;
|
||||
|
||||
ret = (
|
||||
(((PRUint32) ll [0]) << 0) |
|
||||
(((PRUint32) ll [1]) << 8) |
|
||||
(((PRUint32) ll [2]) << 16) |
|
||||
(((PRUint32) ll [3]) << 24)
|
||||
);
|
||||
|
||||
return ret;
|
||||
}
|
||||
126
mozilla/modules/libjar/nsZipArchive.h
Normal file
126
mozilla/modules/libjar/nsZipArchive.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (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/NPL/
|
||||
*
|
||||
* 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 Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
#define ZIP_MAGIC 0x5F5A4950L /* "_ZIP" */
|
||||
#define ZIP_TABSIZE 256
|
||||
#define ZIP_BUFLEN 32767
|
||||
|
||||
/**
|
||||
* nsZipItem -- a helper class for nsZipArchive
|
||||
*
|
||||
* each nsZipItem represents one file in the archive and all the
|
||||
* information needed to manipulate it.
|
||||
*/
|
||||
class nsZipItem
|
||||
{
|
||||
public:
|
||||
char* name;
|
||||
PRUint32 namelen;
|
||||
|
||||
PRUint32 offset;
|
||||
PRUint32 headerloc;
|
||||
PRUint16 compression;
|
||||
PRUint32 size;
|
||||
PRUint32 realsize;
|
||||
PRUint32 crc32;
|
||||
|
||||
nsZipItem* next;
|
||||
|
||||
nsZipItem();
|
||||
~nsZipItem();
|
||||
|
||||
private:
|
||||
//-- prevent copies and assignments
|
||||
nsZipItem& operator=(const nsZipItem& rhs);
|
||||
nsZipItem(const nsZipItem& rhs);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* nsZipArchive -- a class for reading the PKZIP file format.
|
||||
*
|
||||
*/
|
||||
class nsZipArchive
|
||||
{
|
||||
public:
|
||||
/** cookie used to validate supposed objects passed from C code */
|
||||
const PRInt32 kMagic;
|
||||
|
||||
/** constructing does not open the archive. See OpenArchive() */
|
||||
nsZipArchive();
|
||||
|
||||
/** destructing the object closes the archive */
|
||||
~nsZipArchive();
|
||||
|
||||
/**
|
||||
* OpenArchive
|
||||
*
|
||||
* It's an error to call this more than once on the same nsZipArchive
|
||||
* object. If we were allowed to use exceptions this would have been
|
||||
* part of the constructor
|
||||
*
|
||||
* @param aArchiveName full pathname of archive
|
||||
* @return status code
|
||||
*/
|
||||
PRInt32 OpenArchive( const char * aArchiveName );
|
||||
|
||||
/**
|
||||
* ExtractFile
|
||||
*
|
||||
* @param aFilename name of file in archive to extract
|
||||
* @param aOutname where to extract on disk
|
||||
* @return status code
|
||||
*/
|
||||
PRInt32 ExtractFile( const char * aFilename, const char * aOutname );
|
||||
|
||||
PRInt32 FindInit( const char * aPattern );
|
||||
PRInt32 FindNext( char * aBuf, PRUint16 aSize );
|
||||
|
||||
private:
|
||||
//--- private members ---
|
||||
|
||||
PRFileDesc *mFd;
|
||||
|
||||
nsZipItem* mFiles[ZIP_TABSIZE];
|
||||
|
||||
char* mPattern;
|
||||
PRUint16 mPatternSlot;
|
||||
nsZipItem* mPatternItem;
|
||||
PRBool mPatternIsRegExp;
|
||||
|
||||
//--- private methods ---
|
||||
|
||||
nsZipArchive& operator=(const nsZipArchive& rhs); // prevent assignments
|
||||
nsZipArchive(const nsZipArchive& rhs); // prevent copies
|
||||
|
||||
PRInt32 BuildFileList();
|
||||
PRInt32 CopyItemToDisk( const nsZipItem* aItem, const char* aOutname );
|
||||
const nsZipItem* GetFileItem( const char * aFilename );
|
||||
PRUint16 HashName( const char* aName );
|
||||
PRInt32 InflateItemToDisk( const nsZipItem* aItem, const char* aOutname );
|
||||
};
|
||||
|
||||
66
mozilla/modules/libjar/standalone/makefile.win
Normal file
66
mozilla/modules/libjar/standalone/makefile.win
Normal file
@@ -0,0 +1,66 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (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/NPL/
|
||||
#
|
||||
# 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 Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
MODULE=jar
|
||||
DEPTH=..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
|
||||
LIBRARY=$(OBJDIR)\jar_s.lib
|
||||
|
||||
OBJS=.\$(OBJDIR)\nsZipArchive.obj
|
||||
|
||||
LCFLAGS=-DSTANDALONE
|
||||
|
||||
LINCS= \
|
||||
-I$(XPDIST)\public\nspr \
|
||||
-I$(XPDIST)\public\raptor \
|
||||
-I$(XPDIST)\public\xpcom \
|
||||
-I$(XPDIST)\public\zlib \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\zlib.lib \
|
||||
$(DIST)\lib\xplib.lib \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
docopy:
|
||||
$(MAKE_INSTALL) ..\nsZip*.* .
|
||||
$(MAKE_INSTALL) ..\zip*.* .
|
||||
|
||||
export:: docopy
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\jar_s.lib $(DIST)\lib
|
||||
$(RM) *.h *.cpp
|
||||
|
||||
clobber::
|
||||
$(RM) $(OBJS)
|
||||
$(RM) $(DIST)\lib\jar_s.lib
|
||||
|
||||
85
mozilla/modules/libjar/zipfile.h
Normal file
85
mozilla/modules/libjar/zipfile.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (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/NPL/
|
||||
*
|
||||
* 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 Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _zipfile_h
|
||||
#define _zipfile_h
|
||||
/*
|
||||
* This module implements a simple archive extractor for the PKZIP format.
|
||||
*
|
||||
* All functions return a status/error code, and have an opaque hZip argument
|
||||
* that represents an open archive.
|
||||
*
|
||||
* Currently only compression mode 8 (or none) is supported.
|
||||
*/
|
||||
#include "prtypes.h"
|
||||
|
||||
|
||||
#define ZIP_OK 0
|
||||
#define ZIP_ERR_GENERAL -1
|
||||
#define ZIP_ERR_MEMORY -2
|
||||
#define ZIP_ERR_DISK -3
|
||||
#define ZIP_ERR_CORRUPT -4
|
||||
#define ZIP_ERR_PARAM -5
|
||||
#define ZIP_ERR_FNF -6
|
||||
#define ZIP_ERR_UNSUPPORTED -7
|
||||
#define ZIP_ERR_SMALLBUF -8
|
||||
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
/* Open and close the archive
|
||||
*
|
||||
* If successful OpenArchive returns a handle in the hZip parameter
|
||||
* that must be passed to all subsequent operations on the archive
|
||||
*/
|
||||
PR_EXTERN(PRInt32) ZIP_OpenArchive( const char * zipname, void** hZip );
|
||||
PR_EXTERN(PRInt32) ZIP_CloseArchive( void** hZip );
|
||||
|
||||
|
||||
/* Extract the named file in the archive to disk.
|
||||
* This function will happily overwrite an existing Outfile if it can.
|
||||
* It's up to the caller to detect or move it out of the way if it's important.
|
||||
*/
|
||||
PR_EXTERN(PRInt32) ZIP_ExtractFile( void* hZip, const char * filename, const char * outname );
|
||||
|
||||
|
||||
/* Functions to list the files contained in the archive
|
||||
*
|
||||
* FindInit() initializes the search with the pattern, then FindNext() is
|
||||
* called to get the matching filenames if any.
|
||||
*
|
||||
* a NULL pattern will find all the files in the archive, otherwise the
|
||||
* pattern must be a shell regexp type pattern.
|
||||
*
|
||||
* if a matching filename is too small for the passed buffer FindNext()
|
||||
* will return ZIP_ERR_SMALLBUF. When no more matches can be found in
|
||||
* the archive it will return ZIP_ERR_FNF
|
||||
*/
|
||||
PR_EXTERN(PRInt32) ZIP_FindInit( void* hZip, const char * pattern );
|
||||
PR_EXTERN(PRInt32) ZIP_FindNext( void* hZip, char * outbuf, PRUint16 bufsize );
|
||||
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* _zipfile_h */
|
||||
100
mozilla/modules/libjar/zipstruct.h
Normal file
100
mozilla/modules/libjar/zipstruct.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (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/NPL/
|
||||
*
|
||||
* 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 Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _zipstruct_h
|
||||
#define _zipstruct_h
|
||||
|
||||
|
||||
/*
|
||||
* Certain constants and structures for
|
||||
* the Phil Katz ZIP archive format.
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct ZipLocal_
|
||||
{
|
||||
unsigned char signature [4];
|
||||
unsigned char word [2];
|
||||
unsigned char bitflag [2];
|
||||
unsigned char method [2];
|
||||
unsigned char time [2];
|
||||
unsigned char date [2];
|
||||
unsigned char crc32 [4];
|
||||
unsigned char size [4];
|
||||
unsigned char orglen [4];
|
||||
unsigned char filename_len [2];
|
||||
unsigned char extrafield_len [2];
|
||||
} ZipLocal;
|
||||
|
||||
typedef struct ZipCentral_
|
||||
{
|
||||
char signature [4];
|
||||
char version_made_by [2];
|
||||
char version [2];
|
||||
char bitflag [2];
|
||||
char method [2];
|
||||
char time [2];
|
||||
char date [2];
|
||||
char crc32 [4];
|
||||
char size [4];
|
||||
char orglen [4];
|
||||
char filename_len [2];
|
||||
char extrafield_len [2];
|
||||
char commentfield_len [2];
|
||||
char diskstart_number [2];
|
||||
char internal_attributes [2];
|
||||
char external_attributes [4];
|
||||
char localhdr_offset [4];
|
||||
} ZipCentral;
|
||||
|
||||
typedef struct ZipEnd_
|
||||
{
|
||||
char signature [4];
|
||||
char disk_nr [2];
|
||||
char start_central_dir [2];
|
||||
char total_entries_disk [2];
|
||||
char total_entries_archive [2];
|
||||
char central_dir_size [4];
|
||||
char offset_central_dir [4];
|
||||
char commentfield_len [2];
|
||||
} ZipEnd;
|
||||
|
||||
/* signatures */
|
||||
#define LOCALSIG 0x04034B50l
|
||||
#define CENTRALSIG 0x02014B50l
|
||||
#define ENDSIG 0x06054B50l
|
||||
|
||||
/* compression methods */
|
||||
#define STORED 0
|
||||
#define SHRUNK 1
|
||||
#define REDUCED1 2
|
||||
#define REDUCED2 3
|
||||
#define REDUCED3 4
|
||||
#define REDUCED4 5
|
||||
#define IMPLODED 6
|
||||
#define TOKENIZED 7
|
||||
#define DEFLATED 8
|
||||
|
||||
|
||||
#endif /* _zipstruct_h */
|
||||
@@ -1,6 +0,0 @@
|
||||
# List clobbering rationale in this file. Please include bug numbers whenever possible.
|
||||
- 20070619: and now libxul is back on again
|
||||
- 20070618: clobbering for bug 345517 (enable libxul), after it was backed out for Mac
|
||||
- 20070612: clobbering for bug 345517 (enable libxul). Again, after fixing mozconfig
|
||||
- 20070612: clobbering for bug 345517 (enable libxul)
|
||||
- 20070529: CLOBBER to get symbols uploaded for the first time
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xservex11.build.mozilla.org
|
||||
## uname: Darwin bm-xserve11.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
. $topsrcdir/build/macosx/universal/mozconfig
|
||||
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j4"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging mozilla/tools/codesighs"
|
||||
mk_add_options MOZ_CO_PROJECT="browser"
|
||||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build/universal
|
||||
mk_add_options MOZ_MAKE_FLAGS="MOZ_ENABLE_NEW_TEXT_FRAME=1"
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize="-O2 -g"
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_app_options ppc --enable-prebinding
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
|
||||
ac_add_options --enable-codesighs
|
||||
@@ -1,257 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xservex11.build.mozilla.org
|
||||
## uname: Darwin bm-xserve11.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{NO_EM_RESTART} = "1";
|
||||
$ENV{DYLD_NO_FIX_PREBINDING} = "1";
|
||||
$ENV{LD_PREBIND_ALLOW_OVERLAP} = "1";
|
||||
$ENV{CVS_RSH} = "ssh";
|
||||
|
||||
$MacUniversalBinary = 1;
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = 'Minefield';
|
||||
$VendorName = "";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
#$JavaTest = 0;
|
||||
#$ViewerTest = 0;
|
||||
#$BloatTest = 0; # warren memory bloat test
|
||||
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
#$DomToTextConversionTest = 0;
|
||||
#$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
#$MailBloatTest = 0;
|
||||
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 1; # Tp
|
||||
$LayoutPerformanceLocalTest = 0; # Tp2
|
||||
$DHTMLPerformanceTest = 1; # Tdhtml
|
||||
#$QATest = 0;
|
||||
$XULWindowOpenTest = 1; # Txul
|
||||
$StartupPerformanceTest = 1; # Ts
|
||||
|
||||
$TestsPhoneHome = 1; # Should test report back to server?
|
||||
|
||||
$GraphNameOverride = 'xserve11.build.mozilla.org_TextFrame';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
#$pageload_server = "spider"; # localhost
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
$AliveTestTimeout = 10;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
#$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceLocalTestTimeout = 1200; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 15; # seconds
|
||||
#$XULWindowOpenTestTimeout = 150; # seconds
|
||||
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
#$Make = 'gmake'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
#$blat = 'c:/nstools/bin/blat';
|
||||
#$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
$moz_cvsroot = ":ext:cltbld\@cvs.mozilla.org:/cvsroot";
|
||||
#$moz_cvsroot = "/builds/cvs.hourly/cvsroot";
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = '../build/universal';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'TextFrame';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
$BuildTree = 'MozillaExperimental';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox-bin';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
#$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
#$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "4";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
#$ssh_user = "cltbld";
|
||||
#$ssh_server = "stage.mozilla.org";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental/textframe";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental/textframe";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = "build-announce\@mozilla.org";
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 0;
|
||||
$archive = 1;
|
||||
#$push_raw_xpis = 1;
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "Darwin_Universal-gcc3";
|
||||
$update_hash = "md5";
|
||||
$update_filehost = "ftp.mozilla.org";
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 0;
|
||||
$crashreporter_pushsymbols = 0;
|
||||
$ENV{SYMBOL_SERVER_HOST} = 'stage.mozilla.org';
|
||||
$ENV{SYMBOL_SERVER_USER} = 'ffxbld';
|
||||
$ENV{SYMBOL_SERVER_PATH} = '/mnt/netapp/breakpad/symbols_ffx/';
|
||||
$ENV{SYMBOL_SERVER_SSH_KEY} = "$ENV{HOME}/.ssh/ffxbld_dsa";
|
||||
$ENV{MOZ_SYMBOLS_EXTRA_BUILDID} = 'textframe';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
@@ -1,5 +0,0 @@
|
||||
# List clobbering rationale in this file. Please include bug numbers whenever possible.
|
||||
- 2007/06/12: clobbering for bug 345517 (enable libxul). Again, after fixing mozconfig
|
||||
- 2007/06/12: clobbering for bug 345517 (enable libxul)
|
||||
- 2007/05/28: clobbering for bug 382141 to get symbols uploaded
|
||||
- 2007/05/22: clobbering a win32 trunk build to test aus2 migration (see http://wiki.mozilla.org/WeeklyUpdates/2007-05-21#Build and http://weblogs.mozillazine.org/preed/2007/05/aus2s_a_movin_can_you_help_us.html)
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
## hostname: fxexp-win32-tbox
|
||||
## uname: CYGWIN_NT-5.2 fx-win32-tbox 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
|
||||
#
|
||||
|
||||
# . $topsrcdir/browser/config/mozconfig
|
||||
|
||||
mk_add_options MOZ_CO_PROJECT=browser
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j5"
|
||||
mk_add_options MOZ_MAKE_FLAGS="MOZ_ENABLE_NEW_TEXT_FRAME=1"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging"
|
||||
mk_add_options MOZ_PACKAGE_NSIS=1
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
# ac_add_options --enable-codesighs
|
||||
ac_add_options --disable-tests
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
ac_add_options --enable-default-toolkit=cairo-windows
|
||||
ac_add_options --enable-update-packaging
|
||||
@@ -1,253 +0,0 @@
|
||||
#
|
||||
## hostname: fx-win32-tbox
|
||||
## uname: CYGWIN_NT-5.2 fx-win32-tbox 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{MOZ_INSTALLER_USE_7ZIP} = '1';
|
||||
$ENV{NO_EM_RESTART} = '1';
|
||||
$ENV{MOZ_PACKAGE_NSIS} = '1';
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Firefox";
|
||||
$VendorName = "Mozilla";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
$JavaTest = 0;
|
||||
$ViewerTest = 0;
|
||||
$BloatTest = 0; # warren memory bloat test
|
||||
$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
$DomToTextConversionTest = 0;
|
||||
$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
$MailBloatTest = 0;
|
||||
$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
$NeckoUnitTest = 0;
|
||||
$RenderPerformanceTest = 0; # Tgfx
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
$GraphNameOverride = 'fx-win32-tbox';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
#$AliveTestTimeout = 30;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 800; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 20; # seconds
|
||||
#$XULWindowOpenTestTimeout = 90; # seconds
|
||||
#$NeckoUnitTestTimeout = 30; # seconds
|
||||
$RenderPerformanceTestTimeout = 1800; # seconds
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'make'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
$blat = 'd:/moztools/bin/blat';
|
||||
$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
#XXX: this breaks talkback currently
|
||||
#$ObjDir = 'fx-trunk';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'TextFrame';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
#$BuildTree = 'MozillaTest';
|
||||
$BuildTree = 'MozillaExperimental';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox.exe';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "7";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
#$ssh_user = "cltbld";
|
||||
#$ssh_server = "stage.mozilla.org";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental/textframe";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental/textframe";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = 'build-announce@mozilla.org';
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 1;
|
||||
$archive = 1;
|
||||
$push_raw_xpis = 1;
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "WINNT_x86-msvc";
|
||||
$update_hash = "sha1";
|
||||
$update_filehost = "ftp.mozilla.org";
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 0;
|
||||
$crashreporter_pushsymbols = 0;
|
||||
$ENV{SYMBOL_SERVER_HOST} = 'stage.mozilla.org';
|
||||
$ENV{SYMBOL_SERVER_USER} = 'ffxbld';
|
||||
$ENV{SYMBOL_SERVER_PATH} = '/mnt/netapp/breakpad/symbols_ffx/';
|
||||
$ENV{SYMBOL_SERVER_SSH_KEY} = "$ENV{HOME}/.ssh/ffxbld_dsa";
|
||||
$ENV{MOZ_SYMBOLS_EXTRA_BUILDID} = 'textframe';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
Reference in New Issue
Block a user