From deb3ed0a579dadbd6cca7ef2e7fb10148387a1ca Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 9 Mar 2017 15:42:32 +0300 Subject: Add support for in place editing for sed builtin --- build2/test/script/builtin.cxx | 157 +++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 86 deletions(-) (limited to 'build2/test') diff --git a/build2/test/script/builtin.cxx b/build2/test/script/builtin.cxx index a971f64..336fa72 100644 --- a/build2/test/script/builtin.cxx +++ b/build2/test/script/builtin.cxx @@ -148,11 +148,6 @@ namespace build2 // cat ... // - // Read files in sequence and write their contents to STDOUT in the same - // sequence. Read from STDIN if no arguments provided or '-' is specified - // as a file path. STDIN, STDOUT and file streams are set to binary mode - // prior to I/O operations. - // // Note that POSIX doesn't specify if after I/O operation failure the // command should proceed with the rest of the arguments. The current // implementation exits immediatelly in such a case. @@ -340,12 +335,6 @@ namespace build2 // cp ... / // cp -R|-r ... / // - // Copy files and/or directories. The first two forms make a copy of a - // single entity at the specified path. The last two copy one or more - // entities into the specified directory. - // - // For details read the builtin description in the manual. - // // Note: can be executed synchronously. // static uint8_t @@ -517,7 +506,9 @@ namespace build2 // false // - // Return 1. Failure to close the file descriptors is silently ignored. + // Failure to close the file descriptors is silently ignored. + // + // Note: can be executed synchronously. // static future false_ (scope&, const strings&, auto_fd, auto_fd, auto_fd) @@ -527,7 +518,9 @@ namespace build2 // true // - // Return 0. Failure to close the file descriptors is silently ignored. + // Failure to close the file descriptors is silently ignored. + // + // Note: can be executed synchronously. // static future true_ (scope&, const strings&, auto_fd, auto_fd, auto_fd) @@ -554,10 +547,6 @@ namespace build2 // mkdir [-p] ... // - // -p - // Create any missing intermediate pathname components. Each argument - // that names an existing directory must be ignored without error. - // // Note that POSIX doesn't specify if after a directory creation failure // the command should proceed with the rest of the arguments. The current // implementation exits immediatelly in such a case. @@ -653,19 +642,6 @@ namespace build2 // rm [-r] [-f] ... // - // Remove a file or directory. A path must not be the test working - // directory or its parent directory. It also must not be outside the - // testscript working directory unless the -f option is specified. Note - // that directories are not removed by default. - // - // -r - // Remove directories recursively. Must be specified to remove even an - // empty directory. - // - // -f - // Do not fail if path doesn't exist or no paths specified. Removing - // paths outside the testscript working directory is not an error. - // // The implementation deviates from POSIX in a number of ways. It doesn't // interact with a user and fails immediatelly if unable to process an // argument. It doesn't check for dots containment in the path, and @@ -786,14 +762,6 @@ namespace build2 // rmdir [-f] ... // - // Remove a directory. The directory must be empty and not be the test - // working directory or its parent directory. It also must not be outside - // the testscript working directory unless the -f option is specified. - // - // -f - // Do not fail if no directory is specified, the directory does not - // exist, or is outside the script working directory. - // // Note: can be executed synchronously. // static uint8_t @@ -894,34 +862,7 @@ namespace build2 return 1; } - // sed [-n] -e