nixpkgs/pkgs/by-name/dp/dpkg/setup-hook.sh
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

13 lines
574 B
Bash

unpackCmdHooks+=(_tryDpkgDeb)
_tryDpkgDeb() {
if ! [[ "$curSrc" =~ \.deb$ ]]; then return 1; fi
# Don't use dpkg-deb -x as that will error if the archive contains a file
# or directory with a setuid bit in its permissions. This is because dpkg
# calls tar internally with the -p flag, preserving file permissions.
#
# We instead only use dpkg-deb to extract the tarfile containing the files
# we want from the .deb, then finish extracting with tar directly.
mkdir root
dpkg-deb --fsys-tarfile "$curSrc" | tar --extract --directory=root
}