diff options
| author | Arnout Vandecappelle <arnout@mind.be> | 2017-07-03 23:00:48 +0200 |
|---|---|---|
| committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-07-04 00:54:36 +0200 |
| commit | bdbbc72934bc781cff7306da3c5233d21022bc33 (patch) | |
| tree | 7671f497c7b7b144c1c54a70d328aaed481b40bd /package/makedevs | |
| parent | 05b90f45138f1750f46906c358d021fd0c63bc2e (diff) | |
| download | buildroot-bdbbc72934bc781cff7306da3c5233d21022bc33.tar.gz buildroot-bdbbc72934bc781cff7306da3c5233d21022bc33.zip | |
makedevs: support optional files
Add the 'F' file type to makedevs, that allows a file to be optional.
With this option, the line is just silently skipped if the file doesn't
exist (or is not a regular file).
This is useful for _PERMISSIONS where the file can be configured out
by package-specific configuration that is not directly handled by
Buildroot, like busybox.
Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Niranjan Reddy <niranjan.reddy@rockwellcollins.com>
Cc: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/makedevs')
| -rw-r--r-- | package/makedevs/makedevs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/package/makedevs/makedevs.c b/package/makedevs/makedevs.c index 7092b1475e..1ba5936342 100644 --- a/package/makedevs/makedevs.c +++ b/package/makedevs/makedevs.c @@ -570,9 +570,12 @@ int main(int argc, char **argv) ret = EXIT_FAILURE; goto loop; } - } else if (type == 'f') { + } else if (type == 'f' || type == 'F') { struct stat st; if ((stat(full_name, &st) < 0 || !S_ISREG(st.st_mode))) { + if (type == 'F') { + continue; /*Ignore optional files*/ + } bb_perror_msg("line %d: regular file '%s' does not exist", linenum, full_name); ret = EXIT_FAILURE; goto loop; |

