about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorAdam Stephens <adam@valkor.net>2024-03-26 20:08:43 -0400
committerAdam Stephens <adam@valkor.net>2024-03-26 20:08:43 -0400
commita5a4da89baeac9ee920bb9184ab54767c8639a36 (patch)
treeda8643edcb286cdb6c4906bc0edac08a56d225c5 /pkgs/by-name
parentaa1257d0d3751e2c65cc512382bdc1af1fd85c5c (diff)
incus: 0.6 -> 0.7
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/in/incus/529.patch29
-rw-r--r--pkgs/by-name/in/incus/client.nix4
-rw-r--r--pkgs/by-name/in/incus/generic.nix10
-rw-r--r--pkgs/by-name/in/incus/package.nix11
-rwxr-xr-xpkgs/by-name/in/incus/update.nu11
5 files changed, 15 insertions, 50 deletions
diff --git a/pkgs/by-name/in/incus/529.patch b/pkgs/by-name/in/incus/529.patch
deleted file mode 100644
index 5e4156b907ca3..0000000000000
--- a/pkgs/by-name/in/incus/529.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 32a4beecbf8098fdbb15ef5f36088956922630f7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
-Date: Fri, 23 Feb 2024 18:47:15 -0500
-Subject: [PATCH] incusd/device/disk: Fix incorrect block volume usage
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
----
- internal/server/device/disk.go | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/internal/server/device/disk.go b/internal/server/device/disk.go
-index 0d19e21139..4f9a3e7c1b 100644
---- a/internal/server/device/disk.go
-+++ b/internal/server/device/disk.go
-@@ -339,6 +339,11 @@ func (d *disk) validateConfig(instConf instance.ConfigReader) error {
- 				var usedBy []string
- 
- 				err = storagePools.VolumeUsedByInstanceDevices(d.state, d.pool.Name(), storageProjectName, &dbVolume.StorageVolume, true, func(inst db.InstanceArgs, project api.Project, usedByDevices []string) error {
-+					// Don't count the current instance.
-+					if d.inst != nil && d.inst.Project().Name == inst.Project && d.inst.Name() == inst.Name {
-+						return nil
-+					}
-+
- 					usedBy = append(usedBy, inst.Name)
- 
- 					return nil
diff --git a/pkgs/by-name/in/incus/client.nix b/pkgs/by-name/in/incus/client.nix
index 5d69725ba59dd..ecad050f042a9 100644
--- a/pkgs/by-name/in/incus/client.nix
+++ b/pkgs/by-name/in/incus/client.nix
@@ -31,10 +31,8 @@ buildGoModule {
   subPackages = [ "cmd/incus" ];
 
   postInstall = ''
-    # use custom bash completion as it has extra logic for e.g. instance names
-    installShellCompletion --bash --name incus ./scripts/bash/incus
-
     installShellCompletion --cmd incus \
+      --bash <($out/bin/incus completion bash) \
       --fish <($out/bin/incus completion fish) \
       --zsh <($out/bin/incus completion zsh)
   '';
diff --git a/pkgs/by-name/in/incus/generic.nix b/pkgs/by-name/in/incus/generic.nix
index f6a8954066c39..cf73d366e10c8 100644
--- a/pkgs/by-name/in/incus/generic.nix
+++ b/pkgs/by-name/in/incus/generic.nix
@@ -45,12 +45,6 @@ buildGoModule rec {
     inherit hash;
   };
 
-  # replace with env var > 0.6 https://github.com/lxc/incus/pull/610
-  postPatch = ''
-    substituteInPlace internal/usbid/load.go \
-      --replace-fail "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
-  '';
-
   excludedPackages = [
     # statically compile these
     "cmd/incus-agent"
@@ -103,10 +97,8 @@ buildGoModule rec {
     '';
 
   postInstall = ''
-    # use custom bash completion as it has extra logic for e.g. instance names
-    installShellCompletion --bash --name incus ./scripts/bash/incus
-
     installShellCompletion --cmd incus \
+      --bash <($out/bin/incus completion bash) \
       --fish <($out/bin/incus completion fish) \
       --zsh <($out/bin/incus completion zsh)
   '';
diff --git a/pkgs/by-name/in/incus/package.nix b/pkgs/by-name/in/incus/package.nix
index 40fd52de86179..de85b0310bc91 100644
--- a/pkgs/by-name/in/incus/package.nix
+++ b/pkgs/by-name/in/incus/package.nix
@@ -1,9 +1,6 @@
 import ./generic.nix {
-  hash = "sha256-tGuAS0lZvoYb+TvmCklQ8TADZhbm4w/lhdI0ycS4/0o=";
-  version = "0.6.0";
-  vendorHash = "sha256-+WmgLOEBJ/7GF596iiTgyTPxn8l+hE6RVqjLKfCi5rs=";
-  patches = [
-    # fix storage bug, fixed in > 0.6
-    ./529.patch
-  ];
+  hash = "sha256-6TLoua3rooDRyPc5BPYgzU/oeVy6F8h+p3UtKGPZkAE=";
+  version = "0.7.0";
+  vendorHash = "sha256-Slw58pszT6sbpxK6/f+ojA+uStt0zSWxztFTm5ovZr8=";
+  patches = [ ];
 }
diff --git a/pkgs/by-name/in/incus/update.nu b/pkgs/by-name/in/incus/update.nu
index 1a0755e8f32d8..754da9b59abfc 100755
--- a/pkgs/by-name/in/incus/update.nu
+++ b/pkgs/by-name/in/incus/update.nu
@@ -10,12 +10,19 @@ def main [--lts = false, --regex: string] {
   let current_version = nix eval --raw -f default.nix $"($attr).version" | str trim
 
   if $latest_tag != $current_version {
+    print $"Updating: new ($latest_tag) != old ($current_version)"
     update-source-version $attr $latest_tag $"--file=($file)"
 
     let oldVendorHash = nix-instantiate . --eval --strict -A $"($attr).goModules.drvAttrs.outputHash" --json | from json
-    let vendorHash = do { nix-build -A $"($attr).goModules" } | complete | get stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
-    open $file | str replace $oldVendorHash $vendorHash | save --force $file
+    let checkBuild = do { nix-build -A $"($attr).goModules" } | complete
+    let vendorHash = $checkBuild.stderr | lines | str trim | find --regex 'got:[[:space:]]*sha256' | split row ' ' | last
 
+    if $vendorHash != null {
+      open $file | str replace $oldVendorHash $vendorHash | save --force $file
+    } else {
+      print $checkBuild.stderr
+      exit 1
+    }
   }
 
   {"lts?": $lts, before: $current_version, after: $latest_tag}