Skip to content

Commit

Permalink
Don't reimplement calibre's internal update checking code.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-schwartz committed Aug 2, 2017
1 parent 73413cd commit 879aa4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion linux/calibre-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fi


if calibre_is_installed; then
calibre-debug -c "import urllib as u; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < (tuple(map(int, u.urlopen('http://code.calibre-ebook.com/latest').read().split('.'))))))"
calibre-debug -c "from calibre.gui2.update import get_newest_version; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < get_newest_version()))"
UP_TO_DATE=$?
else
echo -e "Calibre is not installed, installing...\n\n"
Expand Down
3 changes: 2 additions & 1 deletion osx/calibre-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ done
# Main

if calibre_is_installed; then
$tools/calibre-debug -c "import urllib as u; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < (tuple(map(int, u.urlopen('http://calibre-ebook.com/downloads/latest_version').read().split('.'))))))"
$tools/calibre-debug -c "from calibre.gui2.update import get_newest_version; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < get_newest_version()))"

UP_TO_DATE=$?
else
echo -e "Calibre is not installed, installing...\n\n"
Expand Down

0 comments on commit 879aa4b

Please sign in to comment.