1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
3 # shellcheck shell=bash
7 SCRIPT_DIR
="$(dirname "${BASH_SOURCE[0]}")"
8 PKG
=$
(basename "$SCRIPT_DIR")
10 LATEST
="18" # increment manually
11 VERSION
="${PKG/#odoo}"
12 VERSION
="${VERSION:-$LATEST}.0"
15 curl "https
://nightly.odoo.com
/$VERSION/nightly
/src
/" |
16 sed -nE 's/.*odoo_'"$VERSION"'.(20[0-9]{6}).tar.gz.*/\1/p' |
20 latestVersion
="$VERSION.$RELEASE"
21 currentVersion
=$
(nix-instantiate
--eval -E "with import ./. {}; $PKG.version or (lib.getVersion $PKG)" |
tr -d '"')
23 if [[ "$currentVersion" == "$latestVersion" ]]; then
24 echo "$PKG is up-to-date: $currentVersion"
30 sed -ri "s| hash.+ # odoo| hash = \"$(nix-prefetch -q fetchzip --option extra-experimental-features flakes --url "https
://nightly.odoo.com
/${VERSION}/nightly
/src
/odoo_
${latestVersion}.
zip")\"; # odoo|g" package.nix
31 sed -ri "s|odoo_version = .+|odoo_version = \"$VERSION\";|" package.nix
32 sed -ri "s|odoo_release = .+|odoo_release = \"$RELEASE\";|" package.nix