Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #149 by adding ?full_index=1 to fetchurl #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,9 @@ let
EXTRA_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin "-X github.com/nlewo/nix2container/nix.useNixCaseHack=true";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.patchutils ];
preBuild = let
# Needs to use fetchpatch2 to handle "git extended headers", which include
# lines with semantic content like "rename from" and "rename to".
# However, it also includes "index" lines which include the git revision(s) the patch was initially created from.
# These lines may include revisions of differing length, based on how Github generates them.
# fetchpatch2 does not filter out, but probably should
fetchgitpatch = args: pkgs.fetchpatch2 (args // {
postFetch = (args.postFetch or "") + ''
sed -i \
-e '/^index /d' \
-e '/^similarity index /d' \
-e '/^dissimilarity index /d' \
$out
'';
});
patch = fetchgitpatch {
url = "https://github.com/nlewo/image/commit/c2254c998433cf02af60bf0292042bd80b96a77e.patch";
sha256 = "sha256-6CUjz46xD3ORgwrHwdIlSu6JUj7WLS6BOSyRGNnALHY=";
patch = pkgs.fetchurl {
url = "https://github.com/nlewo/image/commit/c2254c998433cf02af60bf0292042bd80b96a77e.patch?full_index=1";
sha256 = "sha256-qIVVXn1Cs8OkCXM8i1magAkE5Iftl8kksDvE5EjHynI=";
};
in ''
mkdir -p vendor/github.com/nlewo/nix2container/
Expand Down