Commit 66256354 authored by maruel@chromium.org's avatar maruel@chromium.org

Add unzip.js instead of using 7za.exe. It greatly reduces the depot_tools.zip size.

Review URL: http://codereview.chromium.org/99233

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@14970 0039d316-1c4b-4281-b951-d872f2087c98
parent e105d8d0
This diff is collapsed.
7-Zip Command line version
~~~~~~~~~~~~~~~~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2009 Igor Pavlov.
7za.exe is distributed under the GNU LGPL license
Notes:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7-Zip Command line version 4.65
-------------------------------
7-Zip is a file archiver with high compression ratio.
7za.exe is a standalone command line version of 7-Zip.
7-Zip Copyright (C) 1999-2009 Igor Pavlov.
Features of 7za.exe:
- High compression ratio in new 7z format
- Supported formats:
- Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
- Unpacking only: Z
- Highest compression ratio for ZIP and GZIP formats.
- Fast compression and decompression
- Strong AES-256 encryption in 7z and ZIP formats.
7za.exe is a free software distributed under the GNU LGPL.
Read license.txt for more information.
Source code of 7za.exe and 7-Zip can be found at
http://www.7-zip.org/
7za.exe can work in Windows 95/98/ME/NT/2000/XP/2003/Vista.
There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD,
FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS:
http://p7zip.sourceforge.net/
This distributive packet contains the following files:
7za.exe - 7-Zip standalone command line version.
readme.txt - This file.
copying.txt - GNU LGPL license.
license.txt - License information.
7-zip.chm - User's Manual in HTML Help format.
---
End of document
......@@ -112,7 +112,7 @@ Number.prototype.toHex = function NumberToHex(length) {
};
if (WScript.Arguments.length != 2) {
WScript.StdOut.Write("Incorrect arguments to download.js")
WScript.StdOut.Write("Incorrect arguments to get_file.js")
} else {
Download(WScript.Arguments(0), WScript.Arguments(1), false);
}
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function Unzip(file, path, verbose) {
if (verbose) {
WScript.StdOut.Write(" * UNZIP " + file);
}
var shell_app;
var fso;
try {
shell_app = new ActiveXObject("Shell.Application");
fso = new ActiveXObject("Scripting.FileSystemObject");
} catch (e) {
WScript.StdOut.WriteLine("[-] OBJECTS " + new Number(e.number).toHex() +
": Cannot create Active-X object (" + e.description) + ").";
WScript.Quit(1);
}
// shell_app.Namespace() doesn't work with relative paths.
//current_dir = fso.GetFolder('.').Path + '\\'
//path = current_dir + path
//file = current_dir + file
var out;
var zip;
try {
if (!fso.FolderExists(path)) {
fso.CreateFolder(path);
}
out = shell_app.Namespace(path);
} catch (e) {
WScript.StdOut.WriteLine("[-] SHELL.APPLICATION " +
new Number(e.number).toHex() +
": Failed to open output directory.");
WScript.Quit(1);
}
if (!out) {
WScript.StdOut.WriteLine("[-] SHELL.APPLICATION : Failed to open output directory.");
WScript.Quit(1);
}
try {
zip = shell_app.Namespace(file);
} catch (e) {
WScript.StdOut.WriteLine("[-] SHELL.APPLICATION " +
new Number(e.number).toHex() +
": Failed to open zip file.");
WScript.Quit(1);
}
if (!zip) {
WScript.StdOut.WriteLine("[-] SHELL.APPLICATION " +
": Failed to open zip file.");
WScript.Quit(1);
}
try {
out.CopyHere(zip.Items());
} catch (e) {
WScript.StdOut.WriteLine("[-] SHELL.APPLICATION " +
new Number(e.number).toHex() +
": Failed to extract.");
WScript.Quit(1);
}
if (verbose) {
WScript.StdOut.WriteLine("ok.");
}
}
// Utilities
Number.prototype.isInt = function NumberIsInt() {
return this % 1 == 0;
};
Number.prototype.toHex = function NumberToHex(length) {
if (arguments.length == 0) length = 1;
if (typeof(length) != "number" && !(length instanceof Number)) {
throw Exception("Length must be a positive integer larger than 0.",
TypeError, 0);
}
if (length < 1 || !length.isInt()) {
throw Exception("Length must be a positive integer larger than 0.",
"RangeError", 0);
}
var result = (this + (this < 0 ? 0x100000000 : 0)).toString(16);
while (result.length < length) result = "0" + result;
return result;
};
if (WScript.Arguments.length != 2) {
WScript.StdOut.Write("Incorrect arguments to unzip.js")
} else {
Unzip(WScript.Arguments(0), WScript.Arguments(1), false);
}
......@@ -24,13 +24,12 @@ goto :PYTHON_CHECK
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.7z" del "%~dp0svn.7z"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_win_client.7z "%~dp0svn.7z"
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_win_client.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
echo call "%~dp07za" x -y "%~dp0svn.7z" -o"%WIN_TOOLS_ROOT_DIR%" 1>nul
call "%~dp07za" x -y "%~dp0svn.7z" -o"%WIN_TOOLS_ROOT_DIR%" 1>nul
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn\." goto :SVN_FAIL
del "%~dp0svn.7z"
del "%~dp0svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
goto :PYTHON_CHECK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment