-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
odoo: update script for all versions
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
- Loading branch information
1 parent
34e7279
commit d48355b
Showing
6 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
PKG=$(basename "$SCRIPT_DIR") | ||
|
||
LATEST="18" # increment manually | ||
VERSION="${PKG/#odoo}" | ||
VERSION="${VERSION:-$LATEST}.0" | ||
|
||
RELEASE="$( | ||
curl "https://nightly.odoo.com/$VERSION/nightly/src/" | | ||
sed -nE 's/.*odoo_'"$VERSION"'.(20[0-9]{6}).tar.gz.*/\1/p' | | ||
tail -n 1 | ||
)" | ||
|
||
latestVersion="$VERSION.$RELEASE" | ||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; $PKG.version or (lib.getVersion $PKG)" | tr -d '"') | ||
|
||
if [[ "$currentVersion" == "$latestVersion" ]]; then | ||
echo "$PKG is up-to-date: $currentVersion" | ||
exit 0 | ||
fi | ||
|
||
cd "$SCRIPT_DIR" | ||
|
||
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 | ||
sed -ri "s|odoo_version = .+|odoo_version = \"$VERSION\";|" package.nix | ||
sed -ri "s|odoo_release = .+|odoo_release = \"$RELEASE\";|" package.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
PKG=$(basename "$SCRIPT_DIR") | ||
|
||
LATEST="18" # increment manually | ||
VERSION="${PKG/#odoo}" | ||
VERSION="${VERSION:-$LATEST}.0" | ||
|
||
RELEASE="$( | ||
curl "https://nightly.odoo.com/$VERSION/nightly/src/" | | ||
sed -nE 's/.*odoo_'"$VERSION"'.(20[0-9]{6}).tar.gz.*/\1/p' | | ||
tail -n 1 | ||
)" | ||
|
||
latestVersion="$VERSION.$RELEASE" | ||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; $PKG.version or (lib.getVersion $PKG)" | tr -d '"') | ||
|
||
if [[ "$currentVersion" == "$latestVersion" ]]; then | ||
echo "$PKG is up-to-date: $currentVersion" | ||
exit 0 | ||
fi | ||
|
||
cd "$SCRIPT_DIR" | ||
|
||
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 | ||
sed -ri "s|odoo_version = .+|odoo_version = \"$VERSION\";|" package.nix | ||
sed -ri "s|odoo_release = .+|odoo_release = \"$RELEASE\";|" package.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p curl gnused nix coreutils nix-prefetch | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
PKG=$(basename "$SCRIPT_DIR") | ||
|
||
LATEST="18" # increment manually | ||
VERSION="${PKG/#odoo}" | ||
VERSION="${VERSION:-$LATEST}.0" | ||
|
||
RELEASE="$( | ||
curl "https://nightly.odoo.com/$VERSION/nightly/src/" | | ||
sed -nE 's/.*odoo_'"$VERSION"'.(20[0-9]{6}).tar.gz.*/\1/p' | | ||
tail -n 1 | ||
)" | ||
|
||
latestVersion="$VERSION.$RELEASE" | ||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; $PKG.version or (lib.getVersion $PKG)" | tr -d '"') | ||
|
||
if [[ "$currentVersion" == "$latestVersion" ]]; then | ||
echo "$PKG is up-to-date: $currentVersion" | ||
exit 0 | ||
fi | ||
|
||
cd "$SCRIPT_DIR" | ||
|
||
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 | ||
sed -ri "s|odoo_version = .+|odoo_version = \"$VERSION\";|" package.nix | ||
sed -ri "s|odoo_release = .+|odoo_release = \"$RELEASE\";|" package.nix |