nixpkgs/pkgs/common-updater/directory-listing-updater.nix
Ryan Hendrickson b639a50d15 common-updater-scripts: add allowedVersions parameter
By providing a regex in allowedVersions, users of genericUpdater,
gitUpdater, directoryListingUpdater, or httpTwoLevelsUpdater can exclude
versions that don't match the regex. This can be simpler to express than
constructing the complement regex in ignoredVersions.
2024-06-25 17:44:44 -04:00

22 lines
622 B
Nix

{ lib
, genericUpdater
, common-updater-scripts
}:
{ pname ? null
, version ? null
, attrPath ? null
, allowedVersions ? ""
, ignoredVersions ? ""
, rev-prefix ? ""
, odd-unstable ? false
, patchlevel-unstable ? false
, url ? null
, extraRegex ? null
}:
genericUpdater {
inherit pname version attrPath allowedVersions ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
versionLister = "${common-updater-scripts}/bin/list-directory-versions ${lib.optionalString (url != null) "--url=${lib.escapeShellArg url}"} ${lib.optionalString (extraRegex != null) "--extra-regex=${lib.escapeShellArg extraRegex}"}";
}