mirror of
https://github.com/Mic92/nix-update.git
synced 2024-11-03 21:04:49 +03:00
remove modSha256
no longer used in nixpkgs
This commit is contained in:
parent
9cbc543c67
commit
eba1571866
@ -11,7 +11,7 @@ designed to work with nixpkgs but also other package sets.
|
||||
- pypi
|
||||
- rubygems.org
|
||||
- update buildRustPackage's cargoHash/cargoSha256
|
||||
- update buildGoModule's vendorSha256/modSha256
|
||||
- update buildGoModule's vendorSha256
|
||||
- build and run the resulting package (see `--build`,
|
||||
`--run` or `--shell`
|
||||
- commit updated files (see `--commit` flag)
|
||||
|
@ -26,7 +26,6 @@ class Package:
|
||||
url: Optional[str]
|
||||
rev: str
|
||||
hash: Optional[str]
|
||||
mod_sha256: Optional[str]
|
||||
vendor_sha256: Optional[str]
|
||||
cargo_sha256: Optional[str]
|
||||
tests: List[str]
|
||||
@ -67,7 +66,6 @@ def eval_expression(import_path: str, attr: str) -> str:
|
||||
url = pkg.src.url or null;
|
||||
rev = pkg.src.rev or null;
|
||||
hash = pkg.src.outputHash or null;
|
||||
mod_sha256 = pkg.modSha256 or null;
|
||||
vendor_sha256 = pkg.vendorSha256 or null;
|
||||
cargo_sha256 = pkg.cargoHash or pkg.cargoSha256 or null;
|
||||
tests = builtins.attrNames (pkg.passthru.tests or {{}});
|
||||
|
@ -91,12 +91,6 @@ def update_src_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||
replace_hash(filename, current_hash, target_hash)
|
||||
|
||||
|
||||
def update_mod256_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||
expr = f"{{ sha256 }}: (import {opts.import_path} {disable_check_meta(opts)}).{opts.attribute}.go-modules.overrideAttrs (_: {{ modSha256 = sha256; }})"
|
||||
target_hash = nix_prefetch([expr])
|
||||
replace_hash(filename, current_hash, target_hash)
|
||||
|
||||
|
||||
def update_go_vendor_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||
expr = f"{{ sha256 }}: (import {opts.import_path} {disable_check_meta(opts)}).{opts.attribute}.go-modules.overrideAttrs (_: {{ vendorSha256 = sha256; }})"
|
||||
target_hash = nix_prefetch([expr])
|
||||
@ -152,9 +146,6 @@ def update(opts: Options) -> Package:
|
||||
if update_hash or not package.hash:
|
||||
if package.vendor_sha256:
|
||||
update_go_vendor_hash(opts, package.filename, package.vendor_sha256)
|
||||
# legacy go module checksums
|
||||
elif package.mod_sha256:
|
||||
update_mod256_hash(opts, package.filename, package.mod_sha256)
|
||||
|
||||
if package.cargo_sha256:
|
||||
update_cargo_sha256_hash(opts, package.filename, package.cargo_sha256)
|
||||
|
Loading…
Reference in New Issue
Block a user