mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Remove: ensurePackageUpToDate() from common.jake
Some unused code in common.jake that had referred to tusk. Has not been used in years.
This commit is contained in:
-83
@@ -33,89 +33,6 @@ SYSTEM.args.slice(1).forEach(function(arg)
|
||||
requiresSudo = true;
|
||||
});
|
||||
|
||||
function ensurePackageUpToDate(packageName, requiredVersion, options)
|
||||
{
|
||||
return;
|
||||
|
||||
options = options || {};
|
||||
|
||||
var packageInfo = require("narwhal/packages").catalog[packageName];
|
||||
if (!packageInfo)
|
||||
{
|
||||
if (options.optional)
|
||||
return;
|
||||
|
||||
print("You are missing package \"" + packageName + "\", version " + requiredVersion + " or later. Please install using \"tusk install "+ packageName +"\" and re-run jake");
|
||||
OS.exit(1);
|
||||
}
|
||||
|
||||
var version = packageInfo.version;
|
||||
if (typeof version === "string")
|
||||
version = version.split(".");
|
||||
|
||||
if (typeof requiredVersion === "string")
|
||||
requiredVersion = requiredVersion.split(".");
|
||||
|
||||
if (version && UTIL.compare(version, requiredVersion) !== -1)
|
||||
return;
|
||||
|
||||
print("Your copy of " + packageName + " is out of date (" + (version || ["0"]).join(".") + " installed, " + requiredVersion.join(".") + " required).");
|
||||
|
||||
if (!options.noupdate)
|
||||
{
|
||||
print("Update? Existing package will be overwritten. yes or no:");
|
||||
|
||||
if (!SYSTEM.env["CAPP_AUTO_UPGRADE"] && system.stdin.readLine() !== "yes\n")
|
||||
{
|
||||
print("Jake aborted.");
|
||||
OS.exit(1);
|
||||
}
|
||||
|
||||
if (requiresSudo)
|
||||
{
|
||||
if (OS.system(["sudo", "tusk", "install", "--force", packageName]))
|
||||
{
|
||||
// Attempt a hackish work-around for sudo compiled with the --with-secure-path option
|
||||
if (OS.system("sudo bash -c 'source " + getShellConfigFile() + "; tusk install --force "+ packageName))
|
||||
OS.exit(1); //rake abort if ($? != 0)
|
||||
}
|
||||
}
|
||||
else
|
||||
OS.system(["tusk", "install", "--force", packageName]);
|
||||
}
|
||||
|
||||
if (options.after)
|
||||
{
|
||||
options.after(packageInfo.directory);
|
||||
}
|
||||
|
||||
if (options.message)
|
||||
{
|
||||
print(options.message);
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// This is disabled because tusk causes a lot of problems, and no packages will
|
||||
// never be updated anyway
|
||||
// // UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
|
||||
// ensurePackageUpToDate("jake", "0.3");
|
||||
// ensurePackageUpToDate("browserjs", "0.1.1");
|
||||
// ensurePackageUpToDate("shrinksafe", "0.2");
|
||||
// ensurePackageUpToDate("narwhal", "0.3.1", {
|
||||
// noupdate : true,
|
||||
// message : "Update Narwhal by re-running bootstrap.sh, or pulling the latest from git (see: http://github.com/280north/narwhal)."
|
||||
// });
|
||||
// ensurePackageUpToDate("narwhal-jsc", "0.3", {
|
||||
// optional : true,
|
||||
// after : function(dir) {
|
||||
// if (OS.system("cd " + OS.enquote(dir) + " && make webkit")) {
|
||||
// print("Problem building narwhal-jsc.");
|
||||
// OS.exit(1);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
var JAKE = require("jake");
|
||||
|
||||
// Set up development environment variables.
|
||||
|
||||
Reference in New Issue
Block a user