diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-02 02:22:04 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-02 02:22:04 -0300 |
commit | f303ce805abe78bcbab81704bc0d4ad4d0fb8d61 (patch) | |
tree | ae5fa1f9264cd94456e9c272633ead6a8eeb9e0f /libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch | |
parent | 7545468778b501c3a5a805dc33bc8ae20019020e (diff) | |
download | abslibre-f303ce805abe78bcbab81704bc0d4ad4d0fb8d61.tar.gz abslibre-f303ce805abe78bcbab81704bc0d4ad4d0fb8d61.tar.bz2 abslibre-f303ce805abe78bcbab81704bc0d4ad4d0fb8d61.zip |
uboot-mx6_cubox-i: add new package to [libre]
Diffstat (limited to 'libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch')
-rw-r--r-- | libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch b/libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch new file mode 100644 index 000000000..02f2d9493 --- /dev/null +++ b/libre/uboot-mx6_cubox-i/cmd_test_implement_-e_for_file_existance.patch @@ -0,0 +1,53 @@ +This is much like a regular shell's -e operator, except that it takes +multiple arguments to specify the device type and device/partition ID +in addition to the usual filename: + +if test -e mmc 0:1 /boot/boot.scr; then echo yes; else echo no; fi + +Signed-off-by: Stephen Warren <swarren at nvidia.com> +--- +v3: New patch. +--- + common/cmd_test.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/common/cmd_test.c b/common/cmd_test.c +index 4c2f967c6dc0..c93fe7823100 100644 +--- a/common/cmd_test.c ++++ b/common/cmd_test.c +@@ -16,6 +16,7 @@ + + #include <common.h> + #include <command.h> ++#include <fs.h> + + #define OP_INVALID 0 + #define OP_NOT 1 +@@ -33,6 +34,7 @@ + #define OP_INT_LE 13 + #define OP_INT_GT 14 + #define OP_INT_GE 15 ++#define OP_FILE_EXISTS 16 + + const struct { + int arg; +@@ -55,6 +57,7 @@ const struct { + {0, "-a", OP_AND, 1}, + {0, "-z", OP_STR_EMPTY, 2}, + {0, "-n", OP_STR_NEMPTY, 2}, ++ {0, "-e", OP_FILE_EXISTS, 4}, + }; + + static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +@@ -143,6 +146,9 @@ static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) + expr = simple_strtol(ap[0], NULL, 10) >= + simple_strtol(ap[2], NULL, 10); + break; ++ case OP_FILE_EXISTS: ++ expr = file_exists(ap[1], ap[2], ap[3], FS_TYPE_ANY); ++ break; + } + + switch (op) { +-- +1.8.1.5 |