Fix EOL issues.
Set svn:eol-style=CRLF for all .bat files and everything in bootstrap/win/ Set svn:eol-style=LF for everything else. Also delete depot_tools/git_cl/ since it's not used anymore. Review URL: http://codereview.chromium.org/8055016 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103051 0039d316-1c4b-4281-b951-d872f2087c98experimental/szager/collated-output
parent
57dd5754e7
commit
70444a0907
@ -1,82 +1,82 @@
|
||||
# Copyright 2008-2009, Google Inc.
|
||||
|
||||
gclient is a tool for managing a modular checkout of source code
|
||||
from multiple source code repositories. It wraps underlying source
|
||||
code management commands to provide support for distributing tree
|
||||
updates, status commands, and diffs across multiple checked-out
|
||||
working directories.
|
||||
|
||||
|
||||
The gclient script is controlled by a ".gclient" file at the top
|
||||
of a directory tree which will contain source code from multiple
|
||||
locations. A ".gclient" file is a Python script that defines a list
|
||||
of "solutions" with the following format:
|
||||
|
||||
solutions = [
|
||||
{ "name" : "src",
|
||||
"url" : "svn://svnserver/component/trunk/src",
|
||||
"custom_deps" : {
|
||||
# To use the trunk of a component instead of what's in DEPS:
|
||||
#"component": "https://svnserver/component/trunk/",
|
||||
# To exclude a component from your working copy:
|
||||
#"data/really_large_component": None,
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
A "solution" is a collection of component pieces of software that will
|
||||
be checked out in a specific directory layout for building together.
|
||||
|
||||
Each entry in the "solutions" list is defined by a Python dictionary
|
||||
that contains the following items:
|
||||
|
||||
name
|
||||
The name of the directory in which the solution will be
|
||||
checked out.
|
||||
|
||||
url
|
||||
The URL from which this solution will be checked out.
|
||||
gclient expects that the checked-out solution will contain a
|
||||
file named "DEPS" that in turn defines the specific pieces
|
||||
that must be checked out to create the working directory
|
||||
layout for building and developing the solution's software.
|
||||
|
||||
deps_file
|
||||
A string containing just the filename (not a path) of the file
|
||||
in the solution dir to use as the list of dependencies.
|
||||
This tag is optional, and defaults to "DEPS".
|
||||
|
||||
custom_deps
|
||||
A dictionary containing optional custom overrides for entries
|
||||
in the solution's "DEPS" file. This can be used to have
|
||||
the local working directory *not* check out and update specific
|
||||
components, or to sync the local working-directory copy of a
|
||||
given component to a different specific revision, or a branch,
|
||||
or the head of a tree. It can also be used to append new entries
|
||||
that do not exist in the "DEPS" file.
|
||||
|
||||
Within each checked-out solution, gclient expects to find a file
|
||||
typically named "DEPS" (it actually uses the value of the 'deps_file'
|
||||
key above) which defines the different component pieces of software
|
||||
that must be checked out for the solution. The "DEPS" file is a
|
||||
Python script that defines a dictionary named "deps":
|
||||
|
||||
deps = {
|
||||
"src/outside" : "http://outside-server/trunk@1234",
|
||||
"src/component" : "svn://svnserver/component/trunk/src@77829",
|
||||
"src/relative" : "/trunk/src@77829",
|
||||
}
|
||||
|
||||
Each item in the "deps" dictionary consists of a key-value pair.
|
||||
The key is the directory into which the component will be checked
|
||||
out, relative to the directory containing the ".gclient" file.
|
||||
The value is the URL from which that directory will be checked out.
|
||||
If there is no address scheme (that is, no "http:" or "svn:" prefix),
|
||||
then the value must begin with a slash and is treated relative to the
|
||||
root of the solution's repository.
|
||||
|
||||
The URL typically contains a specific revision or change number (as
|
||||
appropriate for the underlying SCM system) to "freeze" the external
|
||||
software at a specific, known state. Alternatively, if there is no
|
||||
revision or change number, the URL will track the latest changes on the
|
||||
specific trunk or branch.
|
||||
# Copyright 2008-2009, Google Inc.
|
||||
|
||||
gclient is a tool for managing a modular checkout of source code
|
||||
from multiple source code repositories. It wraps underlying source
|
||||
code management commands to provide support for distributing tree
|
||||
updates, status commands, and diffs across multiple checked-out
|
||||
working directories.
|
||||
|
||||
|
||||
The gclient script is controlled by a ".gclient" file at the top
|
||||
of a directory tree which will contain source code from multiple
|
||||
locations. A ".gclient" file is a Python script that defines a list
|
||||
of "solutions" with the following format:
|
||||
|
||||
solutions = [
|
||||
{ "name" : "src",
|
||||
"url" : "svn://svnserver/component/trunk/src",
|
||||
"custom_deps" : {
|
||||
# To use the trunk of a component instead of what's in DEPS:
|
||||
#"component": "https://svnserver/component/trunk/",
|
||||
# To exclude a component from your working copy:
|
||||
#"data/really_large_component": None,
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
A "solution" is a collection of component pieces of software that will
|
||||
be checked out in a specific directory layout for building together.
|
||||
|
||||
Each entry in the "solutions" list is defined by a Python dictionary
|
||||
that contains the following items:
|
||||
|
||||
name
|
||||
The name of the directory in which the solution will be
|
||||
checked out.
|
||||
|
||||
url
|
||||
The URL from which this solution will be checked out.
|
||||
gclient expects that the checked-out solution will contain a
|
||||
file named "DEPS" that in turn defines the specific pieces
|
||||
that must be checked out to create the working directory
|
||||
layout for building and developing the solution's software.
|
||||
|
||||
deps_file
|
||||
A string containing just the filename (not a path) of the file
|
||||
in the solution dir to use as the list of dependencies.
|
||||
This tag is optional, and defaults to "DEPS".
|
||||
|
||||
custom_deps
|
||||
A dictionary containing optional custom overrides for entries
|
||||
in the solution's "DEPS" file. This can be used to have
|
||||
the local working directory *not* check out and update specific
|
||||
components, or to sync the local working-directory copy of a
|
||||
given component to a different specific revision, or a branch,
|
||||
or the head of a tree. It can also be used to append new entries
|
||||
that do not exist in the "DEPS" file.
|
||||
|
||||
Within each checked-out solution, gclient expects to find a file
|
||||
typically named "DEPS" (it actually uses the value of the 'deps_file'
|
||||
key above) which defines the different component pieces of software
|
||||
that must be checked out for the solution. The "DEPS" file is a
|
||||
Python script that defines a dictionary named "deps":
|
||||
|
||||
deps = {
|
||||
"src/outside" : "http://outside-server/trunk@1234",
|
||||
"src/component" : "svn://svnserver/component/trunk/src@77829",
|
||||
"src/relative" : "/trunk/src@77829",
|
||||
}
|
||||
|
||||
Each item in the "deps" dictionary consists of a key-value pair.
|
||||
The key is the directory into which the component will be checked
|
||||
out, relative to the directory containing the ".gclient" file.
|
||||
The value is the URL from which that directory will be checked out.
|
||||
If there is no address scheme (that is, no "http:" or "svn:" prefix),
|
||||
then the value must begin with a slash and is treated relative to the
|
||||
root of the solution's repository.
|
||||
|
||||
The URL typically contains a specific revision or change number (as
|
||||
appropriate for the underlying SCM system) to "freeze" the external
|
||||
software at a specific, known state. Alternatively, if there is no
|
||||
revision or change number, the URL will track the latest changes on the
|
||||
specific trunk or branch.
|
||||
|
@ -1,10 +1,10 @@
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
:: Synchronize the root directory before deferring control back up to it.
|
||||
call "%~dp0\update_depot_tools.bat"
|
||||
|
||||
:: Defer control.
|
||||
python "%~dp0\..\gclient.py" %*
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
:: Synchronize the root directory before deferring control back up to it.
|
||||
call "%~dp0\update_depot_tools.bat"
|
||||
|
||||
:: Defer control.
|
||||
python "%~dp0\..\gclient.py" %*
|
||||
|
@ -1,15 +1,15 @@
|
||||
@echo off
|
||||
:: Copyright (c) 2010 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.
|
||||
|
||||
:: This batch file will try to sync the root directory.
|
||||
|
||||
:: Shall skip automatic update?
|
||||
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF
|
||||
|
||||
:: We can't sync if ..\.svn\. doesn't exist.
|
||||
IF NOT EXIST "%~dp0..\.svn\." GOTO :EOF
|
||||
|
||||
:: Sync the .. directory to update the bootstrap at the same time.
|
||||
call svn -q up "%~dp0.."
|
||||
@echo off
|
||||
:: Copyright (c) 2010 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.
|
||||
|
||||
:: This batch file will try to sync the root directory.
|
||||
|
||||
:: Shall skip automatic update?
|
||||
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF
|
||||
|
||||
:: We can't sync if ..\.svn\. doesn't exist.
|
||||
IF NOT EXIST "%~dp0..\.svn\." GOTO :EOF
|
||||
|
||||
:: Sync the .. directory to update the bootstrap at the same time.
|
||||
call svn -q up "%~dp0.."
|
||||
|
@ -1,118 +1,118 @@
|
||||
// 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 Download(url, path, verbose) {
|
||||
if (verbose) {
|
||||
WScript.StdOut.Write(" * GET " + url + "...");
|
||||
}
|
||||
try {
|
||||
xml_http = new ActiveXObject("MSXML2.ServerXMLHTTP");
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": Cannot create Active-X object (" + e.description) + ").";
|
||||
WScript.Quit(1);
|
||||
}
|
||||
try {
|
||||
xml_http.open("GET", url, false);
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": invalid URL.");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var response_body = null;
|
||||
var size_description = "?";
|
||||
var file_size;
|
||||
try {
|
||||
xml_http.send(null);
|
||||
if (xml_http.status != 200) {
|
||||
WScript.StdOut.WriteLine("[-] HTTP " + xml_http.status + " " +
|
||||
xml_http.statusText);
|
||||
WScript.Quit(1);
|
||||
}
|
||||
response_body = xml_http.responseBody;
|
||||
size_description = xml_http.getResponseHeader("Content-Length");
|
||||
if (size_description != "") {
|
||||
file_size = parseInt(size_description)
|
||||
size_description = file_size.toBytes();
|
||||
} else {
|
||||
try {
|
||||
file_size = new Number(xml_http.responseText.length)
|
||||
size_description = file_size.toBytes();
|
||||
} catch(e) {
|
||||
size_description = "unknown size";
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": Cannot make HTTP request (" + e.description) + ")";
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
WScript.StdOut.WriteLine("ok (" + size_description + ").");
|
||||
WScript.StdOut.Write(" * Save " + path + "...");
|
||||
}
|
||||
|
||||
try {
|
||||
var adodb_stream = new ActiveXObject("ADODB.Stream");
|
||||
adodb_stream.Mode = 3; // ReadWrite
|
||||
adodb_stream.Type = 1; // 1= Binary
|
||||
adodb_stream.Open(); // Open the stream
|
||||
adodb_stream.Write(response_body); // Write the data
|
||||
adodb_stream.SaveToFile(path, 2); // Save to our destination
|
||||
adodb_stream.Close();
|
||||
} catch(e) {
|
||||
WScript.StdOut.WriteLine("[-] ADODB.Stream " + new Number(
|
||||
e.number).toHex() + ": Cannot save file (" + e.description + ")");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
if (typeof(file_size) != undefined) {
|
||||
var file_system_object = WScript.CreateObject("Scripting.FileSystemObject")
|
||||
var file = file_system_object.GetFile(path)
|
||||
if (file.Size < file_size) {
|
||||
WScript.StdOut.WriteLine("[-] File only partially downloaded.");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
}
|
||||
if (verbose) {
|
||||
WScript.StdOut.WriteLine("ok.");
|
||||
}
|
||||
}
|
||||
|
||||
// Utilities
|
||||
Number.prototype.isInt = function NumberIsInt() {
|
||||
return this % 1 == 0;
|
||||
};
|
||||
Number.prototype.toBytes = function NumberToBytes() {
|
||||
// Returns a "pretty" string representation of a number of bytes:
|
||||
var units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
||||
var unit = "bytes";
|
||||
var limit = 1;
|
||||
while(this > limit * 1100 && units.length > 0) {
|
||||
limit *= 1024;
|
||||
unit = units.shift();
|
||||
}
|
||||
return (Math.round(this * 100 / limit) / 100).toString() + " " + unit;
|
||||
};
|
||||
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 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 Download(url, path, verbose) {
|
||||
if (verbose) {
|
||||
WScript.StdOut.Write(" * GET " + url + "...");
|
||||
}
|
||||
try {
|
||||
xml_http = new ActiveXObject("MSXML2.ServerXMLHTTP");
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": Cannot create Active-X object (" + e.description) + ").";
|
||||
WScript.Quit(1);
|
||||
}
|
||||
try {
|
||||
xml_http.open("GET", url, false);
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": invalid URL.");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
var response_body = null;
|
||||
var size_description = "?";
|
||||
var file_size;
|
||||
try {
|
||||
xml_http.send(null);
|
||||
if (xml_http.status != 200) {
|
||||
WScript.StdOut.WriteLine("[-] HTTP " + xml_http.status + " " +
|
||||
xml_http.statusText);
|
||||
WScript.Quit(1);
|
||||
}
|
||||
response_body = xml_http.responseBody;
|
||||
size_description = xml_http.getResponseHeader("Content-Length");
|
||||
if (size_description != "") {
|
||||
file_size = parseInt(size_description)
|
||||
size_description = file_size.toBytes();
|
||||
} else {
|
||||
try {
|
||||
file_size = new Number(xml_http.responseText.length)
|
||||
size_description = file_size.toBytes();
|
||||
} catch(e) {
|
||||
size_description = "unknown size";
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
WScript.StdOut.WriteLine("[-] XMLHTTP " + new Number(e.number).toHex() +
|
||||
": Cannot make HTTP request (" + e.description) + ")";
|
||||
WScript.Quit(1);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
WScript.StdOut.WriteLine("ok (" + size_description + ").");
|
||||
WScript.StdOut.Write(" * Save " + path + "...");
|
||||
}
|
||||
|
||||
try {
|
||||
var adodb_stream = new ActiveXObject("ADODB.Stream");
|
||||
adodb_stream.Mode = 3; // ReadWrite
|
||||
adodb_stream.Type = 1; // 1= Binary
|
||||
adodb_stream.Open(); // Open the stream
|
||||
adodb_stream.Write(response_body); // Write the data
|
||||
adodb_stream.SaveToFile(path, 2); // Save to our destination
|
||||
adodb_stream.Close();
|
||||
} catch(e) {
|
||||
WScript.StdOut.WriteLine("[-] ADODB.Stream " + new Number(
|
||||
e.number).toHex() + ": Cannot save file (" + e.description + ")");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
if (typeof(file_size) != undefined) {
|
||||
var file_system_object = WScript.CreateObject("Scripting.FileSystemObject")
|
||||
var file = file_system_object.GetFile(path)
|
||||
if (file.Size < file_size) {
|
||||
WScript.StdOut.WriteLine("[-] File only partially downloaded.");
|
||||
WScript.Quit(1);
|
||||
}
|
||||
}
|
||||
if (verbose) {
|
||||
WScript.StdOut.WriteLine("ok.");
|
||||
}
|
||||
}
|
||||
|
||||
// Utilities
|
||||
Number.prototype.isInt = function NumberIsInt() {
|
||||
return this % 1 == 0;
|
||||
};
|
||||
Number.prototype.toBytes = function NumberToBytes() {
|
||||
// Returns a "pretty" string representation of a number of bytes:
|
||||
var units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
||||
var unit = "bytes";
|
||||
var limit = 1;
|
||||
while(this > limit * 1100 && units.length > 0) {
|
||||
limit *= 1024;
|
||||
unit = units.shift();
|
||||
}
|
||||
return (Math.round(this * 100 / limit) / 100).toString() + " " + unit;
|
||||
};
|
||||
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 get_file.js")
|
||||
} else {
|
||||
Download(WScript.Arguments(0), WScript.Arguments(1), false);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set PATH=%~dp0python_bin;%PATH%
|
||||
"%~dp0python_bin\python.exe" %*
|
||||
@echo off
|
||||
setlocal
|
||||
set PATH=%~dp0python_bin;%PATH%
|
||||
"%~dp0python_bin\python.exe" %*
|
||||
|
@ -1,4 +1,4 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set PATH=%~dp0svn_bin;%PATH%
|
||||
"%~dp0svn_bin\svn.exe" %*
|
||||
@echo off
|
||||
setlocal
|
||||
set PATH=%~dp0svn_bin;%PATH%
|
||||
"%~dp0svn_bin\svn.exe" %*
|
||||
|
@ -1,91 +1,91 @@
|
||||
// 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);
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
|
@ -1,144 +1,144 @@
|
||||
@echo off
|
||||
:: Copyright (c) 2011 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.
|
||||
|
||||
:: This script will try to find if svn and python are accessible and it not,
|
||||
:: it will try to download it and 'install' it in depot_tools.
|
||||
|
||||
:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
|
||||
:: returned.
|
||||
|
||||
set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools
|
||||
|
||||
:: Get absolute root directory (.js scripts don't handle relative paths well).
|
||||
pushd %~dp0..\..
|
||||
set WIN_TOOLS_ROOT_DIR=%CD%
|
||||
popd
|
||||
|
||||
if "%1" == "force" (
|
||||
set WIN_TOOLS_FORCE=1
|
||||
shift /1
|
||||
)
|
||||
|
||||
|
||||
:GIT_CHECK
|
||||
:: If the batch file exists, skip the git check.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\git.bat" goto :SVN_CHECK
|
||||
if "%GIT_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
|
||||
:: The normal initialization will happen here when we're ready to deploy.
|
||||
goto :SVN_CHECK
|
||||
|
||||
|
||||
:GIT_INSTALL
|
||||
echo Installing git (avg 1-2 min download) ...
|
||||
:: git is not accessible; check it out and create 'proxy' files.
|
||||
if exist "%~dp0git.zip" del "%~dp0git.zip"
|
||||
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git_bin.zip "%~dp0git.zip"
|
||||
if errorlevel 1 goto :GIT_FAIL
|
||||
:: Cleanup svn directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\git_bin"
|
||||
:: Will create git_bin\...
|
||||
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
|
||||
if errorlevel 1 goto :GIT_FAIL
|
||||
if not exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." goto :GIT_FAIL
|
||||
del "%~dp0git.zip"
|
||||
:: Create the batch files.
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
|
||||
:: Ensure autocrlf and filemode are set correctly.
|
||||
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
|
||||
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
|
||||
goto :SVN_CHECK
|
||||
|
||||
|
||||
:GIT_FAIL
|
||||
echo ... Failed to checkout git automatically.
|
||||
echo Please visit http://code.google.com/p/msysgit to download the latest git
|
||||
echo client before continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:SVN_CHECK
|
||||
:: If the batch file exists, skip the svn check.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
|
||||
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
|
||||
call svn --version 2>nul 1>nul
|
||||
if errorlevel 1 goto :SVN_INSTALL
|
||||
goto :PYTHON_CHECK
|
||||
|
||||
|
||||
:SVN_INSTALL
|
||||
echo Installing subversion ...
|
||||
:: svn is not accessible; check it out and create 'proxy' files.
|
||||
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
|
||||
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
|
||||
if errorlevel 1 goto :SVN_FAIL
|
||||
:: Cleanup svn directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
|
||||
:: Will create svn_bin\...
|
||||
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_bin\." goto :SVN_FAIL
|
||||
del "%~dp0svn.zip"
|
||||
:: Create the batch file.
|
||||
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
|
||||
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
|
||||
goto :PYTHON_CHECK
|
||||
|
||||
|
||||
:SVN_FAIL
|
||||
echo ... Failed to checkout svn automatically.
|
||||
echo Please visit http://subversion.tigris.org to download the latest subversion client
|
||||
echo before continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_CHECK
|
||||
:: If the batch file exists, skip the python check.
|
||||
set ERRORLEVEL=0
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
|
||||
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
|
||||
call python --version 2>nul 1>nul
|
||||
if errorlevel 1 goto :PYTHON_INSTALL
|
||||
|
||||
:: We are done.
|
||||
set ERRORLEVEL=0
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_INSTALL
|
||||
echo Installing python ...
|
||||
:: Cleanup python directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
|
||||
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
|
||||
if errorlevel 1 goto :PYTHON_FAIL
|
||||
:: Create the batch file.
|
||||
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
|
||||
set ERRORLEVEL=0
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_FAIL
|
||||
echo ... Failed to checkout python automatically.
|
||||
echo Please visit http://python.org to download the latest python 2.x client before
|
||||
echo continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:returncode
|
||||
set WIN_TOOLS_ROOT_URL=
|
||||
set WIN_TOOLS_ROOT_DIR=
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:END
|
||||
call :returncode %ERRORLEVEL%
|
||||
@echo off
|
||||
:: Copyright (c) 2011 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.
|
||||
|
||||
:: This script will try to find if svn and python are accessible and it not,
|
||||
:: it will try to download it and 'install' it in depot_tools.
|
||||
|
||||
:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
|
||||
:: returned.
|
||||
|
||||
set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools
|
||||
|
||||
:: Get absolute root directory (.js scripts don't handle relative paths well).
|
||||
pushd %~dp0..\..
|
||||
set WIN_TOOLS_ROOT_DIR=%CD%
|
||||
popd
|
||||
|
||||
if "%1" == "force" (
|
||||
set WIN_TOOLS_FORCE=1
|
||||
shift /1
|
||||
)
|
||||
|
||||
|
||||
:GIT_CHECK
|
||||
:: If the batch file exists, skip the git check.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\git.bat" goto :SVN_CHECK
|
||||
if "%GIT_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
|
||||
:: The normal initialization will happen here when we're ready to deploy.
|
||||
goto :SVN_CHECK
|
||||
|
||||
|
||||
:GIT_INSTALL
|
||||
echo Installing git (avg 1-2 min download) ...
|
||||
:: git is not accessible; check it out and create 'proxy' files.
|
||||
if exist "%~dp0git.zip" del "%~dp0git.zip"
|
||||
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git_bin.zip "%~dp0git.zip"
|
||||
if errorlevel 1 goto :GIT_FAIL
|
||||
:: Cleanup svn directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\git_bin"
|
||||
:: Will create git_bin\...
|
||||
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR%"
|
||||
if errorlevel 1 goto :GIT_FAIL
|
||||
if not exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." goto :GIT_FAIL
|
||||
del "%~dp0git.zip"
|
||||
:: Create the batch files.
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
|
||||
call copy /y "%WIN_TOOLS_ROOT_DIR%\git_bin\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
|
||||
:: Ensure autocrlf and filemode are set correctly.
|
||||
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
|
||||
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
|
||||
goto :SVN_CHECK
|
||||
|
||||
|
||||
:GIT_FAIL
|
||||
echo ... Failed to checkout git automatically.
|
||||
echo Please visit http://code.google.com/p/msysgit to download the latest git
|
||||
echo client before continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:SVN_CHECK
|
||||
:: If the batch file exists, skip the svn check.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK
|
||||
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
|
||||
call svn --version 2>nul 1>nul
|
||||
if errorlevel 1 goto :SVN_INSTALL
|
||||
goto :PYTHON_CHECK
|
||||
|
||||
|
||||
:SVN_INSTALL
|
||||
echo Installing subversion ...
|
||||
:: svn is not accessible; check it out and create 'proxy' files.
|
||||
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
|
||||
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
|
||||
if errorlevel 1 goto :SVN_FAIL
|
||||
:: Cleanup svn directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
|
||||
:: Will create svn_bin\...
|
||||
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_bin\." goto :SVN_FAIL
|
||||
del "%~dp0svn.zip"
|
||||
:: Create the batch file.
|
||||
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
|
||||
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
|
||||
goto :PYTHON_CHECK
|
||||
|
||||
|
||||
:SVN_FAIL
|
||||
echo ... Failed to checkout svn automatically.
|
||||
echo Please visit http://subversion.tigris.org to download the latest subversion client
|
||||
echo before continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_CHECK
|
||||
:: If the batch file exists, skip the python check.
|
||||
set ERRORLEVEL=0
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
|
||||
if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
|
||||
call python --version 2>nul 1>nul
|
||||
if errorlevel 1 goto :PYTHON_INSTALL
|
||||
|
||||
:: We are done.
|
||||
set ERRORLEVEL=0
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_INSTALL
|
||||
echo Installing python ...
|
||||
:: Cleanup python directory if it was existing.
|
||||
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
|
||||
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
|
||||
if errorlevel 1 goto :PYTHON_FAIL
|
||||
:: Create the batch file.
|
||||
call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
|
||||
set ERRORLEVEL=0
|
||||
goto :END
|
||||
|
||||
|
||||
:PYTHON_FAIL
|
||||
echo ... Failed to checkout python automatically.
|
||||
echo Please visit http://python.org to download the latest python 2.x client before
|
||||
echo continuing.
|
||||
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
|
||||
set ERRORLEVEL=1
|
||||
goto :END
|
||||
|
||||
|
||||
:returncode
|
||||
set WIN_TOOLS_ROOT_URL=
|
||||
set WIN_TOOLS_ROOT_DIR=
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:END
|
||||
call :returncode %ERRORLEVEL%
|
||||
|
@ -1,52 +1,52 @@
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
setlocal
|
||||
|
||||
:: This script will create a scheduled task to run chrome-update every day
|
||||
:: at the time you specify. This script expects to be live in
|
||||
:: depot_tools\latest.
|
||||
::
|
||||
:: Usage: this-script <time to run task> <path to chrome trunk>
|
||||
|
||||
set Out=%USERPROFILE%\chrome-update-task.bat
|
||||
set TaskTime=%1
|
||||
set Trunk=%~f2
|
||||
|
||||
if not exist "%Trunk%" (
|
||||
echo Usage: %~n0 ^<time^> ^<c:\path\to\chrome\trunk^>
|
||||
echo ^<time^> is the time in HH:MM:SS format at which to run the task.
|
||||
echo Example: %~n0 02:00:00 c:\src\chrome\trunk
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
if not exist "%Out%" goto CreateScript
|
||||
|
||||
echo WARNING: %Out% already exists.
|
||||
set Choice=
|
||||
set /P Choice=Overwrite file [Y/N]?
|
||||
if not "%Choice%"=="y" goto CreateTask
|
||||
|
||||
:CreateScript
|
||||
|
||||
echo.
|
||||
echo Creating %Out%
|
||||
|
||||
echo>"%Out%" @echo off
|
||||
echo>>"%Out%" "%~dp0chrome-update.bat" "%Trunk%" --solution chrome.sln --target Debug --build-dir src/chrome ^> "%Trunk%\chrome-update-results.txt"
|
||||
|
||||
:CreateTask
|
||||
|
||||
echo.
|
||||
echo ***********************************************************************
|
||||
echo Creating a Scheduled Task to run chrome-update each day at %TaskTime%.
|
||||
echo The batch file being run will live at %Out%.
|
||||
echo.
|
||||
echo WARNING: The password you enter will be displayed in cleartext.
|
||||
echo If you're paranoid, you can enter blank here and then fix the password
|
||||
echo by editing the scheduled task manually from the Control Panel.
|
||||
echo ***********************************************************************
|
||||
echo.
|
||||
schtasks /create /tn chrome-update /tr "\"%Out%\"" /sc daily /st %TaskTime%
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
setlocal
|
||||
|
||||
:: This script will create a scheduled task to run chrome-update every day
|
||||
:: at the time you specify. This script expects to be live in
|
||||
:: depot_tools\latest.
|
||||
::
|
||||
:: Usage: this-script <time to run task> <path to chrome trunk>
|
||||
|
||||
set Out=%USERPROFILE%\chrome-update-task.bat
|
||||
set TaskTime=%1
|
||||
set Trunk=%~f2
|
||||
|
||||
if not exist "%Trunk%" (
|
||||
echo Usage: %~n0 ^<time^> ^<c:\path\to\chrome\trunk^>
|
||||
echo ^<time^> is the time in HH:MM:SS format at which to run the task.
|
||||
echo Example: %~n0 02:00:00 c:\src\chrome\trunk
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
if not exist "%Out%" goto CreateScript
|
||||
|
||||
echo WARNING: %Out% already exists.
|
||||
set Choice=
|
||||
set /P Choice=Overwrite file [Y/N]?
|
||||
if not "%Choice%"=="y" goto CreateTask
|
||||
|
||||
:CreateScript
|
||||
|
||||
echo.
|
||||
echo Creating %Out%
|
||||
|
||||
echo>"%Out%" @echo off
|
||||
echo>>"%Out%" "%~dp0chrome-update.bat" "%Trunk%" --solution chrome.sln --target Debug --build-dir src/chrome ^> "%Trunk%\chrome-update-results.txt"
|
||||
|
||||
:CreateTask
|
||||
|
||||
echo.
|
||||
echo ***********************************************************************
|
||||
echo Creating a Scheduled Task to run chrome-update each day at %TaskTime%.
|
||||
echo The batch file being run will live at %Out%.
|
||||
echo.
|
||||
echo WARNING: The password you enter will be displayed in cleartext.
|
||||
echo If you're paranoid, you can enter blank here and then fix the password
|
||||
echo by editing the scheduled task manually from the Control Panel.
|
||||
echo ***********************************************************************
|
||||
echo.
|
||||
schtasks /create /tn chrome-update /tr "\"%Out%\"" /sc daily /st %TaskTime%
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0chrome-update.py" %*
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0chrome-update.py" %*
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0cpplint.py" %*
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0cpplint.py" %*
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0gcl.py" %*
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0gcl.py" %*
|
||||
|
@ -1,43 +1,43 @@
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
:: This file is a stub to sync .\bootstrap first and defer control to
|
||||
:: .\bootstrap\gclient.bat, which will sync back '.'. This is unless auto
|
||||
:: update is disabled, were gclient.py is directly called.
|
||||
setlocal
|
||||
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
|
||||
:: Will download svn and python.
|
||||
:: If you don't want to install the depot_tools version of these tools, remove
|
||||
:: the 'force' option on the next command. The tools won't be installed only if
|
||||
:: not already in the PATH environment variable.
|
||||
call "%~dp0bootstrap\win\win_tools.bat" force
|
||||
if errorlevel 1 goto :EOF
|
||||
|
||||
:: Shall skip automatic update?
|
||||
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :SKIP_UPDATE
|
||||
:: We can't sync if .\.svn\. doesn't exist.
|
||||
IF NOT EXIST "%~dp0.svn\." GOTO :SKIP_UPDATE
|
||||
|
||||
:: Sync the bootstrap directory.
|
||||
call svn up -q "%~dp0bootstrap"
|
||||
:: still continue even in case of error.
|
||||
goto :UPDATE
|
||||
|
||||
|
||||
:SKIP_UPDATE
|
||||
:: Don't bother to try to update any thing.
|
||||
python "%~dp0\gclient.py" %*
|
||||
goto :EOF
|
||||
|
||||
|
||||
:UPDATE
|
||||
:: Transfer control to ease the update process. The following lines won't be
|
||||
:: executed so don't add any! Specifically, don't use 'call' in the following
|
||||
:: line.
|
||||
"%~dp0bootstrap\gclient.bat" %*
|
||||
goto :EOF
|
||||
@echo off
|
||||
:: 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.
|
||||
|
||||
:: This file is a stub to sync .\bootstrap first and defer control to
|
||||
:: .\bootstrap\gclient.bat, which will sync back '.'. This is unless auto
|
||||
:: update is disabled, were gclient.py is directly called.
|
||||
setlocal
|
||||
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
|
||||
:: Will download svn and python.
|
||||
:: If you don't want to install the depot_tools version of these tools, remove
|
||||
:: the 'force' option on the next command. The tools won't be installed only if
|
||||
:: not already in the PATH environment variable.
|
||||
call "%~dp0bootstrap\win\win_tools.bat" force
|
||||
if errorlevel 1 goto :EOF
|
||||
|
||||
:: Shall skip automatic update?
|
||||
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :SKIP_UPDATE
|
||||
:: We can't sync if .\.svn\. doesn't exist.
|
||||
IF NOT EXIST "%~dp0.svn\." GOTO :SKIP_UPDATE
|
||||
|
||||
:: Sync the bootstrap directory.
|
||||
call svn up -q "%~dp0bootstrap"
|
||||
:: still continue even in case of error.
|
||||
goto :UPDATE
|
||||
|
||||
|
||||
:SKIP_UPDATE
|
||||
:: Don't bother to try to update any thing.
|
||||
python "%~dp0\gclient.py" %*
|
||||
goto :EOF
|
||||
|
||||
|
||||
:UPDATE
|
||||
:: Transfer control to ease the update process. The following lines won't be
|
||||
:: executed so don't add any! Specifically, don't use 'call' in the following
|
||||
:: line.
|
||||
"%~dp0bootstrap\gclient.bat" %*
|
||||
goto :EOF
|
||||
|
@ -1,23 +1,23 @@
|
||||
@echo off
|
||||
|
||||
|
||||
@rem We're in a submodule directory, look relative to the parent.
|
||||
call python "%cd%\..\third_party\scons\scons.py" "--site-dir=..\site_scons" %*
|
||||
goto omega
|
||||
|
||||
:srcdir
|
||||
call python "%cd%\third_party\scons\scons.py" --site-dir=site_scons %*
|
||||
goto omega
|
||||
|
||||
@rem Per the following page:
|
||||
@rem http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
|
||||
@rem Just calling "exit /b" passes back an exit code, but in a way
|
||||
@rem that does NOT get picked up correctly when executing the .bat
|
||||
@rem file from the Python subprocess module. Using "call" as the
|
||||
@rem last command in the .bat file makes it work as expected.
|
||||
|
||||
:returncode
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:omega
|
||||
call :returncode %ERRORLEVEL%
|
||||
@echo off
|
||||
|
||||
|
||||
@rem We're in a submodule directory, look relative to the parent.
|
||||
call python "%cd%\..\third_party\scons\scons.py" "--site-dir=..\site_scons" %*
|
||||
goto omega
|
||||
|
||||
:srcdir
|
||||
call python "%cd%\third_party\scons\scons.py" --site-dir=site_scons %*
|
||||
goto omega
|
||||
|
||||
@rem Per the following page:
|
||||
@rem http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
|
||||
@rem Just calling "exit /b" passes back an exit code, but in a way
|
||||
@rem that does NOT get picked up correctly when executing the .bat
|
||||
@rem file from the Python subprocess module. Using "call" as the
|
||||
@rem last command in the .bat file makes it work as expected.
|
||||
|
||||
:returncode
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:omega
|
||||
call :returncode %ERRORLEVEL%
|
||||
|
Loading…
Reference in New Issue