`ls -1 "$iconsdir/"*` listed the source directory for me when the glob
had no matches. Switching to `-A` circumvents this problem and has the
added advantage that it cannot run into argument list length limits.
Checked the desktop entry spec, there's other field codes than `%[fFuU]`
and those can in fact occur more than once, hence dropping '$' and
adding `/g`.
The "Exec" key in desktop items sometimes has one of the `%f`, `%F`,
`%u` and `%U` suffixes, which specify whether the command takes a file,
multiple files or a generalized URL or URLs. Darwin application bundles
do no understand this syntax so we do the next best thing, which is
simply dropping it.
Allows restricting patches to a specific subdirectory, à la
`git diff --relative=subdir`.
This cannot be done (cleanly) currently because the `includes` logic
happens *after* `stripLen` is applied, so we can't match on `subdir/*`.
This change adds a `relative` argument that makes this possible by
filtering files before doing any processing, and setting `stripLen` and
`extraPrefix` accordingly.
Sometimes scalable icons or icons within the thresholds from the desired
resolutions aren't available. In this case it's still nicer to end up
with a blocky scaled icon rather than the generic default.
In order to compose a `.icns` file containing multiple icon sizes I had
to pass `--toc` to `icnsutil`. This did not seem to have a negative
effect on `.icns` containing only a single icon size.
On macOS 10.13 the 48x48 icon size is not supported. It results in a
corrupted image being displayed. I suspect the image data is being
truncated to what it expects for 32x32 or maybe data is read for
128x128, which would be a buffer overflow.
Older macOS cannot interpret the `CFBundleIconFiles` key so we cannot
rewrite the `CFBundleIconFile` entry without special consideration. I
opted to fix this by inverting the squircle logic. We always add both
the `CFBundleIconFile` and `CFBundleIconFiles` keys. The former is
necessary for at least macOS 10.13 and probably 10.12. The latter seems
to be ignored on those versions and overrides the former on newer
versions of macOS.
Inverting the logic also allows us to rely on the `toPlist` generator to
generate the XML syntax, which is a nice bonus.
Some crates do not have a Cargo.toml at the top-level, but only in
nested directories. Before this change importCargoLock used to fail with:
error: manifest path `/nix/store/some-store-path/Cargo.toml` does not exist
Conflict in pkgs/development/libraries/libvirt/default.nix
required manual adjustments. The fetched patch is already in src.
I checked that libvirt builds.
It is the package list output that should be sorted. The current
output sequence is not logical because '.' is sorted in front of '/'
with input sorting and is not deterministic for different language
environments.
To get a deterministic and logical sorting in environments with
different language configured, env "LC_ALL=C" is set and the produced
strings is that is sorted. To get alphabetic sorting and not a pure
ASCII value sort "--ignore-case" is added.