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.
This commit is contained in:
Maciej Krüger 2023-08-28 00:07:09 +02:00
parent abf6c22cc4
commit 9fa3a8b629
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F
2 changed files with 8 additions and 14 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, fetchurl, python310, nodePackages, wkhtmltopdf
{ stdenv, lib, fetchFromGitHub, fetchzip, python310, nodePackages, wkhtmltopdf
, nixosTests }:
let
@ -38,7 +38,7 @@ let
};
odoo_version = "15.0";
odoo_release = "20230720";
odoo_release = "20230816";
in python.pkgs.buildPythonApplication rec {
pname = "odoo15";
version = "${odoo_version}.${odoo_release}";
@ -46,18 +46,12 @@ in python.pkgs.buildPythonApplication rec {
format = "setuptools";
# latest release is at https://github.com/odoo/docker/blob/master/15.0/Dockerfile
src = fetchurl {
url =
"https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.tar.gz";
src = fetchzip {
url = "https://nightly.odoo.com/${odoo_version}/nightly/src/odoo_${version}.zip";
name = "${pname}-${version}";
hash = "sha256-XH4cN2OrPvMjN3VcDJFxCacNxKkrN65jwhUN1dnGwgo="; # odoo
hash = "sha256-h81JA0o44DVtl/bZ52rGQfg54TigwQcNpcMjQbi0zIQ="; # odoo
};
unpackPhase = ''
tar xfz $src
cd odoo*
'';
# needs some investigation
doCheck = false;

View File

@ -1,9 +1,9 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused nix coreutils
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
set -euo pipefail
DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/15.0/Dockerfile)
DOCKER=$(curl -s https://raw.githubusercontent.com/odoo/docker/master/16.0/Dockerfile)
get_var() {
echo "$DOCKER" | grep -E "^[A-Z][A-Z][A-Z] ODOO_$1" | sed -r "s|^[A-Z]{3} ODOO_$1.||g"
@ -22,6 +22,6 @@ fi
cd "$(dirname "${BASH_SOURCE[0]}")"
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
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
sed -ri "s| odoo_version.+| odoo_version = \"$VERSION\";|" default.nix
sed -ri "s| odoo_release.+| odoo_release = \"$RELEASE\";|" default.nix