Commit 0cfc319f authored by Weijia Wang's avatar Weijia Wang Committed by nicoo
Browse files

fetchDebianPatch: Require patch names with extensions

Otherwise the fetcher is unuseable with patches
whose filename (in Debian) doesn't end in `.patch`.
parent 4fdb5e27
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ Most other fetchers return a directory rather than a single file.
## `fetchDebianPatch` {#fetchdebianpatch}

A wrapper around `fetchpatch`, which takes:
- `patch` and `hash`: the patch's filename without the `.patch` suffix,
- `patch` and `hash`: the patch's filename,
  and its hash after normalization by `fetchpatch` ;
- `pname`: the Debian source package's name ;
- `version`: the upstream version number ;
@@ -110,7 +110,7 @@ buildPythonPackage rec {
    (fetchDebianPatch {
      inherit pname version;
      debianRevision = "5";
      name = "Add-quotes-to-SOAPAction-header-in-SoapClient";
      name = "Add-quotes-to-SOAPAction-header-in-SoapClient.patch";
      hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0=";
    })
  ];
+3 −3
Original line number Diff line number Diff line
{ lib, fetchpatch }:

lib.makeOverridable (
  { pname, version, debianRevision ? null, patch, hash,
    area ? "main", name ? "${patch}.patch" }:
  { pname, version, debianRevision ? null, area ? "main",
    patch, name ? patch, hash }:
  let
    inherit (lib.strings) hasPrefix substring;
    prefix =
@@ -14,6 +14,6 @@ lib.makeOverridable (
    inherit name hash;
    url =
      "https://sources.debian.org/data/${area}/${prefix}/"
      + "${pname}/${versionString}/debian/patches/${patch}.patch";
      + "${pname}/${versionString}/debian/patches/${patch}";
  }
)