Skip to content

Commit

Permalink
incus: 6.7.0 -> 6.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcstephens committed Dec 14, 2024
1 parent 699f041 commit 51c259e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 105 deletions.
2 changes: 1 addition & 1 deletion nixos/tests/incus/incusd-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ../make-test-python.nix (

container-image-metadata = "${
releases.incusContainerMeta.${pkgs.stdenv.hostPlatform.system}
}/tarball/nixos-system-${pkgs.stdenv.hostPlatform.system}.tar.xz";
}/tarball/nixos-image-lxc-*-${pkgs.stdenv.hostPlatform.system}.tar.xz";
container-image-rootfs = "${
releases.incusContainerImage.${pkgs.stdenv.hostPlatform.system}
}/nixos-lxc-image-${pkgs.stdenv.hostPlatform.system}.squashfs";
Expand Down
77 changes: 0 additions & 77 deletions pkgs/by-name/in/incus/1377-reverse.patch

This file was deleted.

8 changes: 4 additions & 4 deletions pkgs/by-name/in/incus/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ./generic.nix {
hash = "sha256-k7DHJRbhUJwamEOW8B7wdCWQyYEUtsIHwuHh20lpLmA=";
version = "6.7.0";
vendorHash = "sha256-u12zYcKiHNUH1kWpkMIyixtK9t+G4N2QerzOGsujjFQ=";
patches = [ ./1377-reverse.patch ];
hash = "sha256-Ir+cT+2xA+L4kBXhwA0XXE/D8zjMPGYiwW0VrEdobZ4=";
version = "6.8.0";
vendorHash = "sha256-CDLq41AB2Y9nYlTuXZaAOgwXIin9CbqSXCFoigsc14A=";
patches = [ ];
}
45 changes: 22 additions & 23 deletions pkgs/by-name/in/incus/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
nixpkgs_path = os.environ["PWD"]

attr = "incus"
file = f"pkgs/by-name/in/incus/package.nix"
file = "pkgs/by-name/in/incus/package.nix"
if args.lts:
attr = "incus-lts"
file = f"pkgs/by-name/in/incus/lts.nix"
file = "pkgs/by-name/in/incus/lts.nix"

tags = (
run(["list-git-tags", "--url=https://github.com/lxc/incus"], capture_output=True)
Expand All @@ -30,7 +30,7 @@

latest_version = "0"
for tag in tags:
if args.regex != None and not re.match(args.regex, tag):
if args.regex is not None and not re.match(args.regex, tag):
continue

if LooseVersion(tag) > LooseVersion(latest_version):
Expand All @@ -53,23 +53,19 @@

run(["update-source-version", attr, latest_version, f"--file={file}"])

current_vendor_hash = (
run(
[
"nix-instantiate",
".",
"--eval",
"--strict",
"-A",
f"{attr}.goModules.drvAttrs.outputHash",
"--json",
],
capture_output=True,
file_content: str

with open(file, "r+") as f:
file_content = f.read()
file_content = re.sub(
'vendorHash = "sha256-.*"',
'vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="',
file_content,
)
.stdout.decode("utf-8")
.strip()
.strip('"')
)
f.seek(0)
f.write(file_content)

print("Generating new vendorHash")

latest_vendor_hash = (
run(
Expand All @@ -80,8 +76,11 @@
.strip()
)

with open(file, "r+") as f:
file_content = f.read()
file_content = re.sub(current_vendor_hash, latest_vendor_hash, file_content)
f.seek(0)
file_content = file_content.replace(
"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", latest_vendor_hash
)

with open(file, "w") as f:
f.write(file_content)

print("Done")

0 comments on commit 51c259e

Please sign in to comment.