File tree Expand file tree Collapse file tree 6 files changed +110
-7
lines changed Expand file tree Collapse file tree 6 files changed +110
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env nix-shell
22#! nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
3+ # shellcheck shell=bash
34
45set -euo pipefail
56
6- VERSION=" ${1:- 18.0} " # must be incremented manually
7- echo $VERSION
7+ SCRIPT_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
8+ PKG=$( basename " $SCRIPT_DIR " )
9+
10+ LATEST=" 18" # increment manually
11+ VERSION=" ${PKG/# odoo} "
12+ VERSION=" ${VERSION:- $LATEST } .0"
813
914RELEASE=" $(
1015 curl " https://nightly.odoo.com/$VERSION /nightly/src/" |
@@ -13,15 +18,15 @@ RELEASE="$(
1318) "
1419
1520latestVersion=" $VERSION .$RELEASE "
16- currentVersion=$( nix-instantiate --eval -E " with import ./. {}; odoo .version or (lib.getVersion odoo )" | tr -d ' "' )
21+ currentVersion=$( nix-instantiate --eval -E " with import ./. {}; $PKG .version or (lib.getVersion $PKG )" | tr -d ' "' )
1722
1823if [[ " $currentVersion " == " $latestVersion " ]]; then
19- echo " odoo is up-to-date: $currentVersion "
24+ echo " $PKG is up-to-date: $currentVersion "
2025 exit 0
2126fi
2227
23- cd " $( dirname " ${BASH_SOURCE[0]} " ) "
28+ cd " $SCRIPT_DIR "
2429
2530sed -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
26- sed -ri " s|odoo_version = .+; |odoo_version = \" $VERSION \" |" package.nix
27- sed -ri " s|odoo_release = .+; |odoo_release = \" $RELEASE \" |" package.nix
31+ sed -ri " s|odoo_version = .+|odoo_version = \" $VERSION \" ; |" package.nix
32+ sed -ri " s|odoo_release = .+|odoo_release = \" $RELEASE \" ; |" package.nix
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ in python.pkgs.buildPythonApplication rec {
9898 dontStrip = true ;
9999
100100 passthru = {
101+ updateScript = ./update.sh ;
101102 tests = { inherit ( nixosTests ) odoo15 ; } ;
102103 } ;
103104
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
3+ # shellcheck shell=bash
4+
5+ set -euo pipefail
6+
7+ SCRIPT_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
8+ PKG=$( basename " $SCRIPT_DIR " )
9+
10+ LATEST=" 18" # increment manually
11+ VERSION=" ${PKG/# odoo} "
12+ VERSION=" ${VERSION:- $LATEST } .0"
13+
14+ RELEASE=" $(
15+ curl " https://nightly.odoo.com/$VERSION /nightly/src/" |
16+ sed -nE ' s/.*odoo_' " $VERSION " ' .(20[0-9]{6}).tar.gz.*/\1/p' |
17+ tail -n 1
18+ ) "
19+
20+ latestVersion=" $VERSION .$RELEASE "
21+ currentVersion=$( nix-instantiate --eval -E " with import ./. {}; $PKG .version or (lib.getVersion $PKG )" | tr -d ' "' )
22+
23+ if [[ " $currentVersion " == " $latestVersion " ]]; then
24+ echo " $PKG is up-to-date: $currentVersion "
25+ exit 0
26+ fi
27+
28+ cd " $SCRIPT_DIR "
29+
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
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ in python.pkgs.buildPythonApplication rec {
8080 dontStrip = true ;
8181
8282 passthru = {
83+ updateScript = ./update.sh ;
8384 tests = {
8485 inherit ( nixosTests ) odoo ;
8586 } ;
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
3+ # shellcheck shell=bash
4+
5+ set -euo pipefail
6+
7+ SCRIPT_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
8+ PKG=$( basename " $SCRIPT_DIR " )
9+
10+ LATEST=" 18" # increment manually
11+ VERSION=" ${PKG/# odoo} "
12+ VERSION=" ${VERSION:- $LATEST } .0"
13+
14+ RELEASE=" $(
15+ curl " https://nightly.odoo.com/$VERSION /nightly/src/" |
16+ sed -nE ' s/.*odoo_' " $VERSION " ' .(20[0-9]{6}).tar.gz.*/\1/p' |
17+ tail -n 1
18+ ) "
19+
20+ latestVersion=" $VERSION .$RELEASE "
21+ currentVersion=$( nix-instantiate --eval -E " with import ./. {}; $PKG .version or (lib.getVersion $PKG )" | tr -d ' "' )
22+
23+ if [[ " $currentVersion " == " $latestVersion " ]]; then
24+ echo " $PKG is up-to-date: $currentVersion "
25+ exit 0
26+ fi
27+
28+ cd " $SCRIPT_DIR "
29+
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
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -i bash -p curl gnused nix coreutils nix-prefetch
3+ # shellcheck shell=bash
4+
5+ set -euo pipefail
6+
7+ SCRIPT_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
8+ PKG=$( basename " $SCRIPT_DIR " )
9+
10+ LATEST=" 18" # increment manually
11+ VERSION=" ${PKG/# odoo} "
12+ VERSION=" ${VERSION:- $LATEST } .0"
13+
14+ RELEASE=" $(
15+ curl " https://nightly.odoo.com/$VERSION /nightly/src/" |
16+ sed -nE ' s/.*odoo_' " $VERSION " ' .(20[0-9]{6}).tar.gz.*/\1/p' |
17+ tail -n 1
18+ ) "
19+
20+ latestVersion=" $VERSION .$RELEASE "
21+ currentVersion=$( nix-instantiate --eval -E " with import ./. {}; $PKG .version or (lib.getVersion $PKG )" | tr -d ' "' )
22+
23+ if [[ " $currentVersion " == " $latestVersion " ]]; then
24+ echo " $PKG is up-to-date: $currentVersion "
25+ exit 0
26+ fi
27+
28+ cd " $SCRIPT_DIR "
29+
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
You can’t perform that action at this time.
0 commit comments