mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
common-updater-scripts,directoryListingUpdater: add extraRegex parameter
This commit is contained in:
parent
c1188a559b
commit
19e4b53b09
@ -11,9 +11,10 @@
|
|||||||
, odd-unstable ? false
|
, odd-unstable ? false
|
||||||
, patchlevel-unstable ? false
|
, patchlevel-unstable ? false
|
||||||
, url ? null
|
, url ? null
|
||||||
|
, extraRegex ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
genericUpdater {
|
genericUpdater {
|
||||||
inherit pname version attrPath ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
|
inherit pname version attrPath ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
|
||||||
versionLister = "${common-updater-scripts}/bin/list-directory-versions ${lib.optionalString (url != null) "--url=${lib.escapeShellArg url}"}";
|
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}"}";
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ parser.add_argument(
|
|||||||
parser.add_argument("--url", help="url of the page that lists the package versions")
|
parser.add_argument("--url", help="url of the page that lists the package versions")
|
||||||
parser.add_argument("--file", help="file name for writing debugging information")
|
parser.add_argument("--file", help="file name for writing debugging information")
|
||||||
|
|
||||||
|
parser.add_argument("--extra-regex", help="additional regex to filter versions with")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -62,4 +64,6 @@ if __name__ == "__main__":
|
|||||||
rf"(.*/)?{args.pname}-([\d.]+?(-[\d\w.-]+?)?)(\.tar)?(\.[^.]*)", link_url
|
rf"(.*/)?{args.pname}-([\d.]+?(-[\d\w.-]+?)?)(\.tar)?(\.[^.]*)", link_url
|
||||||
)
|
)
|
||||||
if match:
|
if match:
|
||||||
print(match.group(2))
|
version = match.group(2)
|
||||||
|
if (not args.extra_regex) or re.fullmatch(args.extra_regex, version):
|
||||||
|
print(version)
|
||||||
|
Loading…
Reference in New Issue
Block a user