odoo15: 15.0.20230317->15.020230816 fix broken fetcher

Upstream seems to publish and retain `.zip` more consistently than `.tar.gz`, which caused the previous expression to break. This modifies the odoo package and updater script to use the `zip` sources.

+8 -14
+5 -11
pkgs/applications/finance/odoo/odoo15.nix
··· 1 - { stdenv, lib, fetchFromGitHub, fetchurl, python310, nodePackages, wkhtmltopdf 1 + { stdenv, lib, fetchFromGitHub, fetchzip, python310, nodePackages, wkhtmltopdf 2 2 , nixosTests }: 3 3 4 4 let ··· 38 38 }; 39 39 40 40 odoo_version = "15.0"; 41 - odoo_release = "20230720"; 41 + odoo_release = "20230816"; 42 42 in python.pkgs.buildPythonApplication rec { 43 43 pname = "odoo15"; 44 44 version = "${odoo_version}.${odoo_release}"; ··· 46 46 format = "setuptools"; 47 47 48 48 # latest release is at https://github.com/odoo/docker/blob/master/15.0/Dockerfile 49 - src = fetchurl { 50 - url = 51 - "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.tar.gz"; 49 + src = fetchzip { 50 + url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip"; 52 51 name = "${pname}-${version}"; 53 - hash = "sha256-XH4cN2OrPvMjN3VcDJFxCacNxKkrN65jwhUN1dnGwgo="; # odoo 52 + hash = "sha256-h81JA0o44DVtl/bZ52rGQfg54TigwQcNpcMjQbi0zIQ="; # odoo 54 53 }; 55 - 56 - unpackPhase = '' 57 - tar xfz $src 58 - cd odoo* 59 - ''; 60 54 61 55 # needs some investigation 62 56 doCheck = false;
+3 -3
pkgs/applications/finance/odoo/update.sh
··· 1 1 #!/usr/bin/env nix-shell 2 - #!nix-shell -i bash -p curl gnused nix coreutils 2 + #!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch 3 3 4 4 set -euo pipefail 5 5 6 - DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/15.0/Dockerfile) 6 + DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/16.0/Dockerfile) 7 7 8 8 get_var() { 9 9 echo "$DOCKER" | grep -E "^[A-Z][A-Z][A-Z] ODOO_$1" | sed -r "s|^[A-Z]{3} ODOO_$1.||g" ··· 22 22 23 23 cd "$(dirname "${BASH_SOURCE[0]}")" 24 24 25 - sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch-url --type sha256 "https://nightly.odoo.com/${VERSION}/nightly/src/odoo_${latestVersion}.tar.gz")\"; # odoo|g" default.nix 25 + sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch -q fetchzip --url "https://nightly.odoo.com/${VERSION}/nightly/src/odoo_${latestVersion}.zip")\"; # odoo|g" default.nix 26 26 sed -ri "s| odoo_version.+| odoo_version = \"$VERSION\";|" default.nix 27 27 sed -ri "s| odoo_release.+| odoo_release = \"$RELEASE\";|" default.nix