Commit Graph

2069 Commits

Author SHA1 Message Date
Shannon Booth
dd373eacbc LibDiff+patch: Support multiple patches in a single patch file
Multiple patches may be concatenated in the same patch file, such as git
commits which are changing multiple files at the same time. To handle
this, parse each patch in order in the patch file, and apply each patch
sequentially.

To determine whether we are at the end of a patch (and not just parsing
another hunk) the parser will look for a leading '@@ ' after every hunk.
If that is found, there is another hunk. Otherwise, we must be at the
end of this patch.
2023-07-30 07:47:22 +01:00
Shannon Booth
ddbd77cca1 run-tests: Correct logic for calculating number of skipped/xfail tests
Skipped tests were mistakenly being considered as expected failures.
2023-07-30 07:47:22 +01:00
Shannon Booth
f893e0820f patch: Support creation of a file
Previously patch would always expect the file that it was patching to
exist (even it were empty). If we know that the patch is creating a file
from nothing (i.e has a start line of '0'), then we treat a file that
doesn't exist as if it has no content lines.
2023-07-30 07:47:22 +01:00
Shannon Booth
81df0278b1 patch+LibDiff: Implement 'strip' of filenames when parsing patch
Implement the patch '-p' / '--strip' option, which strips the given
number of leading components from filenames parsed in the patch header.
If not given this option defaults to the basename of that path.
2023-07-29 17:09:09 -06:00
Shannon Booth
4d8a59f34b patch: Implement d, --directory option
When given, patch will chdir into the given directory before processing
the patch file.
2023-07-29 17:09:09 -06:00
Sergey Bugaev
cd4298ae04 Userland: Teach strace(1) to format pledge(2) 2023-07-29 16:51:58 -06:00
Zaggy1024
66c9696687 LibGfx: Add initial ISO BMFF parsing and a utility to print file info
Currently, the `isobmff` utility will only print the media file type
info from the FileTypeBox (major brand and compatible brands), as well
as the names and sizes of top-level boxes.
2023-07-27 12:02:37 +01:00
Andrew Kaster
5028223c37 Meta+Utilities: Make pre-commit checks significantly less verbose
When markdown-check is built, it outputs hundreds of lines of "ignoring
this and that link because reasons". This is extremely not helpful when
trying to figure out exactly which check failed on your commit. Also
remove the timing numbers from lint-ci.sh These are just noise and also
don't help to figure out which pre-commit check failed. Ideally the
output on fail should be "[OK]: Check A" for all the passing checks and
"[FAIL] Check N" with the required context for the failed check.
2023-07-26 06:21:39 -04:00
Tim Ledbetter
ea411774f0 truncate: Clamp file size to 0 when using the -s option
When using the `-s` option to reduce the size of a file, the file size
is now set to zero if the argument given would result in a file
size less than zero.

This matches the behavior of truncate on Linux and FreeBSD.
2023-07-26 08:42:05 +02:00
Tim Ledbetter
8e79afebb9 truncate: Allow size suffixes to be used with the -s option
The base 2 size suffixes: 'K', 'M' and 'G' may now be used when
specifying a file size with the `-s` option.
2023-07-26 08:42:05 +02:00
Tim Ledbetter
fb27702981 truncate: Remove unnecessary includes
These are no longer necessary, as we are now using LibCore syscall
wrappers.
2023-07-26 08:42:05 +02:00
Tim Ledbetter
0ae92cdaa0 truncate: Prefer StringView over DeprecatedString 2023-07-26 08:42:05 +02:00
Andreas Kling
72516ca101 js: Run with the JavaScript bytecode VM by default
The AST interpreter is still available behind a new `--ast` flag.
2023-07-25 20:00:46 +02:00
Andreas Kling
c3e5487f00 headless-browser: Run with the JavaScript bytecode VM by default
The AST interpreter is still available behind a new `--ast` flag.
2023-07-25 20:00:46 +02:00
Nico Weber
4bb29e6ac4 pdf: Add a --debugging-stats flag
Tries to render all pages of a PDF and then produces a report on which
unimplemented things were encountered.

Example, for pdf_reference_1-7.pdf:

    113 times: Rendering of feature not supported: Type0 font not imp...
        on pages: 170 (3x) 217 (2x) 250 (9x) 252 (2x) 329 (6x)...
    21 times: Rendering of feature not supported: unknown color space
        on pages: 489 (4x) 490 (5x) 491 (3x) 492 (5x) 493 (4x)
    4 times: Rendering of feature not supported: CCITTFaxDecode Filte...
        on pages: 494 (4x)

(Actually, rendering crashes for some page in that file at the moment.
This was with a local change to only render the first 800 pages to work
around that. So this is also good for finding crashes.)
2023-07-24 11:00:01 -04:00
Shannon Booth
af60c740e3 LibTest: Add support for xfail JavaScriptTestRunner tests
This is meant to be used in a similar manner to skipping tests, with the
extra advantage that if the test begins passing unexpectedly, the test
will fail.

Being notified of unexpected passes allows for the test to be updated to
the correct expectation.
2023-07-23 07:36:13 +02:00
Andreas Kling
5d6169793a Ladybird+LibWebView: Respawn with same JS interpreter after crash
WebView::ViewImplementation now remembers which JS interpreter it
started with, and uses the same setting if the WebContent process
crashes and we have to spawn a new one.
2023-07-22 08:49:59 -04:00
Tim Ledbetter
6710622bf7 file: Add -b option to omit file name from output 2023-07-21 19:32:43 -04:00
Timothy Flynn
77d7f715e3 LibJS+CI: Remove bytecode optimization passes for now
These passes have not been shown to actually optimize any JS, and tests
have become very flaky with optimizations enabled. Until some measurable
benefit is shown, remove the optimization passes to reduce overhead of
maintaining bytecode operations and to reduce CI churn. The framework
for optimizations will live on in git history, and can be restored once
proven useful.
2023-07-21 19:47:36 +03:30
Tim Ledbetter
73a6f2e9ed ps: Add the -o option to specify a user-defined column format
This option allows the user to change which colums are displayed
by giving comma or space separated list of column format specifiers.

A column format specifier is of the form: `COLUMN_NAME[=COLUMN_TITLE]`.
Where `COLUMN_NAME` is any of: uid, pid, ppid, pgid, sid, state, tty,
or cmd. Specifying a `COLUMN_TITLE` will change the name shown in the
column header.

`COLUMN_TITLE` may be blank. If all given column titles
are blank, the header is omitted.
2023-07-19 11:21:59 +01:00
Tim Ledbetter
cdb15a20ff ps: Select user-specified processes only when the -q option is used
This fixes a logic bug which allowed processes not specified by the
user to be selected when the `-q` option was used. This caused the
program to crash when sorting processes into the correct order.
2023-07-19 11:21:59 +01:00
MacDue
b5658d75f5 Fuzzers: Add a DDS fuzzer 2023-07-19 06:52:06 +02:00
MacDue
581236b24a Fuzzers: Add a TinyVG fuzzer 2023-07-19 06:52:06 +02:00
Shannon Booth
2b46e6f664 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2023-07-15 16:21:29 +02:00
Shannon Booth
5625ca5cb9 AK: Rename URLParser::parse to URLParser::basic_parse
To make it more clear that this function implements
'concept-basic-url-parser' instead of 'concept-url-parser'.
2023-07-15 09:45:16 +02:00
Lucas CHOLLET
15bd708cfd file: Use the mime-type description provided by LibCore
This allows us to get rid of another mime-type list in the codebase.

To do so, the `get_description_from_mime_type` function is introduced in
this patch.
2023-07-14 17:33:06 +01:00
Nico Weber
e78ea08ed9 pdf: Make --dump-contents print all objects referenced by page too 2023-07-13 20:29:58 +02:00
Shannon Booth
e838b6c8cc patch: Add the beginnings of a patch utility
This is still very bare bones, and there is _much_ more to still
handle. However, this implements enough functionality to parse a single
unified patch read from stdin, and apply it to a file.
2023-07-13 10:29:30 +01:00
Tim Ledbetter
6d2f9f0316 less: Replace LibC calls with their LibCore equivalents 2023-07-13 10:26:13 +02:00
Tim Ledbetter
e0fcfc8a99 less: Ignore SIGINT signals
This matches the behavior of less on Linux and FreeBSD.
2023-07-13 10:26:13 +02:00
Tim Ledbetter
7b0da10dd5 less: Restore original terminal state when SIGTERM is received 2023-07-13 10:26:13 +02:00
Nico Weber
62013f2008 pdf: Minorly tweak a help text 2023-07-13 04:53:59 +02:00
Nico Weber
52ff180ed4 pdf: Add --dump-contents flag
This dumps the /Content stream of a page, which is possibly useful for
debugging.
2023-07-12 18:22:35 -04:00
Nico Weber
16c1a6a447 pdf: Alphabetize options 2023-07-12 18:22:35 -04:00
Sebastian Zaha
88872ca42d LibIPC: Do not leak the Core::File fd by default
This prevents fd leaks when the user of the API forgets to pass
CloseAfterSending to IPC::File. Since we are calling leak_fd in the
constructor, we want it to also take care of closing.
2023-07-12 18:22:18 -04:00
Nico Weber
c3f78d9561 pdf: Add function to render a page of a PDF to a bitmap
Use like so:

    Build/lagom/bin/pdf --render foo.png --page=50 path/to.pdf
2023-07-12 07:54:28 +01:00
Kemal Zebari
20c59a143c Utilites: Implement nohup
This snapshot implements the nohup command-line utility.
2023-07-12 10:11:24 +03:30
Nico Weber
c781686198 pdf: Add a --password option for encrypted PDFs 2023-07-12 06:28:15 +02:00
Nico Weber
f418605ec7 pdf: Print PDF version; tweak output 2023-07-11 13:49:17 -04:00
Valtteri Koskivuori
f2ce47e3a1 Userland: Sync file utility descriptions with LibCore
Added descriptions for the following formats: icc, bzip2, SerenityOS
Spreadsheet, svg, tiff, targa, css, csv, html, plaintext, webm
2023-07-11 17:48:57 +01:00
Valtteri Koskivuori
2c6b156803 Userland: Teach the file utility about zip files
It now shows a short description with a file and directory counts, and
the total content size uncompressed.
2023-07-11 17:48:57 +01:00
Tim Ledbetter
4e7e878606 ps: Add --ppid option to filter by parent PID 2023-07-11 13:02:08 +01:00
Tim Ledbetter
d3c5ae0860 ps: Add -t option to filter by TTY 2023-07-11 13:02:08 +01:00
Tim Ledbetter
aeb87d6e78 ps: Allow multiple filtering options to be used simultaneously
Previously, it was assumed that only one filtering option, such as
`-u` or `-p` would be used at a time. With this PR, processes are now
shown if they match any of the specified filters.
2023-07-11 13:02:08 +01:00
Tim Ledbetter
a758e27153 ps: Disallow using -q with any other filtering options
This matches the behavior of `ps` on Linux.
2023-07-11 13:02:08 +01:00
Nico Weber
c8e0db5061 pdf: Print info dict metadata if present 2023-07-10 17:49:07 +01:00
Caoimhe
9204a60397 zip: Move away from DeprecatedString 2023-07-08 13:14:50 +01:00
Caoimhe
f222028f79 zip: Use the helpers in ZipOutputStream for adding files 2023-07-08 13:14:50 +01:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Sebastian Zaha
d77986f01c headless-browser: Ensure IPC::File is closed after sending
On systems with the default ulimit for open files <= 256 (default
on some systems) the LibWeb tests were crashing because the
input file handles are not closed in headless-browser.
2023-07-08 06:11:08 +02:00