mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-11 10:35:43 +03:00
support new goModules attr
go-modules has been renamed to goModules for nixpkgs pr 242905
This commit is contained in:
parent
15ef70af59
commit
68b5b4b5a3
@ -50,6 +50,7 @@ class Package:
|
||||
rev: str
|
||||
hash: Optional[str]
|
||||
go_modules: Optional[str]
|
||||
go_modules_old: Optional[str]
|
||||
cargo_deps: Optional[str]
|
||||
npm_deps: Optional[str]
|
||||
tests: List[str]
|
||||
@ -141,7 +142,8 @@ in {{
|
||||
url = pkg.src.url or null;
|
||||
rev = pkg.src.rev or null;
|
||||
hash = pkg.src.outputHash or null;
|
||||
go_modules = pkg.go-modules.outputHash or null;
|
||||
go_modules = pkg.goModules.outputHash or null;
|
||||
go_modules_old = pkg.go-modules.outputHash or null;
|
||||
cargo_deps = pkg.cargoDeps.outputHash or null;
|
||||
raw_cargo_lock =
|
||||
if pkg ? cargoDeps.lockFile then
|
||||
|
@ -147,6 +147,11 @@ def update_src_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||
|
||||
|
||||
def update_go_modules_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||
target_hash = nix_prefetch(opts, "goModules")
|
||||
replace_hash(filename, current_hash, target_hash)
|
||||
|
||||
|
||||
def update_go_modules_hash_old(opts: Options, filename: str, current_hash: str) -> None:
|
||||
target_hash = nix_prefetch(opts, "go-modules")
|
||||
replace_hash(filename, current_hash, target_hash)
|
||||
|
||||
@ -344,6 +349,9 @@ def update(opts: Options) -> Package:
|
||||
if package.go_modules:
|
||||
update_go_modules_hash(opts, package.filename, package.go_modules)
|
||||
|
||||
if package.go_modules_old:
|
||||
update_go_modules_hash_old(opts, package.filename, package.go_modules_old)
|
||||
|
||||
if package.cargo_deps:
|
||||
update_cargo_deps_hash(opts, package.filename, package.cargo_deps)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user