|
@@ -44,11 +44,8 @@ public static int manifest_main(string[] args) {
|
|
|
return 253;
|
|
return 253;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(verb == "build") {
|
|
|
|
|
- return build();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(verb == "install" || verb == "autoprovides") {
|
|
|
|
|
|
|
+ // Automatically create a temporary directory for these commands if one was not provided.
|
|
|
|
|
+ if(verb == "install" || verb == "autoprovides" || verb == "test") {
|
|
|
if(build_path == null) {
|
|
if(build_path == null) {
|
|
|
var dir = File.new_build_filename("/tmp", Uuid.string_random());
|
|
var dir = File.new_build_filename("/tmp", Uuid.string_random());
|
|
|
try {
|
|
try {
|
|
@@ -62,6 +59,25 @@ public static int manifest_main(string[] args) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Automatically create the specified directory for these commands if it doesn't exist
|
|
|
|
|
+ if(verb == "install" || verb == "autoprovides" || verb == "test" || verb == "build") {
|
|
|
|
|
+ var build_dir = File.new_for_path(build_path);
|
|
|
|
|
+ if(!build_dir.query_exists()) {
|
|
|
|
|
+ printerr(@"Creating build directory: $build_path\n");
|
|
|
|
|
+ try {
|
|
|
|
|
+ build_dir.make_directory_with_parents();
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Error e) {
|
|
|
|
|
+ printerr(@"Could not create build directory: $(e.message)\n");
|
|
|
|
|
+ return 255;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(verb == "build") {
|
|
|
|
|
+ return build();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(verb == "install") {
|
|
if(verb == "install") {
|
|
|
return install();
|
|
return install();
|
|
|
}
|
|
}
|
|
@@ -96,6 +112,9 @@ private void manifest_usage() {
|
|
|
|
|
|
|
|
|
|
|
|
|
private int build() {
|
|
private int build() {
|
|
|
|
|
+ // Create build directory if it doesn't exist
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
|
|
|
|
|
@@ -131,6 +150,19 @@ private int build() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private int install() {
|
|
private int install() {
|
|
|
|
|
+ // Create build directory if it doesn't exist
|
|
|
|
|
+ var build_dir = File.new_for_path(build_path);
|
|
|
|
|
+ if(!build_dir.query_exists()) {
|
|
|
|
|
+ printerr(@"Creating build directory: $build_path\n");
|
|
|
|
|
+ try {
|
|
|
|
|
+ build_dir.make_directory_with_parents();
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Error e) {
|
|
|
|
|
+ printerr(@"Could not create build directory: $(e.message)\n");
|
|
|
|
|
+ return 255;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
|
var missing_runtime_deps = manifest.dependencies.runtime.where(d => !d.is_satisfied());
|
|
var missing_runtime_deps = manifest.dependencies.runtime.where(d => !d.is_satisfied());
|
|
@@ -346,6 +378,19 @@ private int package() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private int autoprovides() {
|
|
private int autoprovides() {
|
|
|
|
|
+ // Create build directory if it doesn't exist
|
|
|
|
|
+ var build_dir = File.new_for_path(build_path);
|
|
|
|
|
+ if(!build_dir.query_exists()) {
|
|
|
|
|
+ printerr(@"Creating build directory: $build_path\n");
|
|
|
|
|
+ try {
|
|
|
|
|
+ build_dir.make_directory_with_parents();
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Error e) {
|
|
|
|
|
+ printerr(@"Could not create build directory: $(e.message)\n");
|
|
|
|
|
+ return 255;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
var missing_build_deps = manifest.dependencies.build.where(d => !d.is_satisfied());
|
|
|
var missing_runtime_deps = manifest.dependencies.runtime.where(d => !d.is_satisfied());
|
|
var missing_runtime_deps = manifest.dependencies.runtime.where(d => !d.is_satisfied());
|
|
@@ -608,6 +653,19 @@ private int test() {
|
|
|
return 255;
|
|
return 255;
|
|
|
}
|
|
}
|
|
|
build_path = dir.get_path();
|
|
build_path = dir.get_path();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // Create build directory if it doesn't exist
|
|
|
|
|
+ var build_dir = File.new_for_path(build_path);
|
|
|
|
|
+ if(!build_dir.query_exists()) {
|
|
|
|
|
+ printerr(@"Creating build directory: $build_path\n");
|
|
|
|
|
+ try {
|
|
|
|
|
+ build_dir.make_directory_with_parents();
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Error e) {
|
|
|
|
|
+ printerr(@"Could not create build directory: $(e.message)\n");
|
|
|
|
|
+ return 255;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|
|
var missing_management_deps = manifest.dependencies.manage.where(d => !d.is_satisfied());
|