![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 149
Karma: 585496
Join Date: Aug 2009
Device: Astak EZ Reader Pocket Pro, Kobo Mini, Nook Glowlight 2, Kobo Forma
|
Official Calibre PPA?
I was wondering if there was an official Calibre ppa for Ubuntu. I've read on the main page that the version of Calibre in the Ubuntu Software Centre is out of date, and I know that the programme updates every week.
It would be really awesome if there was an official ppa for it, so when it updated I wouldn't have to do back out to the page to update it. |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
That would require either (a) a PPA maintainer, or (b) a whole lot of complexity added to Calibre's build system.
And what about those poor RPMers? Not to mention Slackware and Gentoo. ^_^; I find that running my calibre_update.sh whenever Calibre notifies me is good enough. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,884
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
When I see the new version message, I can just slide my rodent over it and click ![]() |
|
![]() |
![]() |
![]() |
#4 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I created a script out of it (mine just extracts to ~/bin/calibre/ since I'm using a school system, but whatever) and put it in a crontab to happen every week at 6:00 AM Friday, just hours after calibre is released and before i wake up in the morning. Why bother waiting for the notification?
|
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Thing is, this would download and install even if the version hasn't changed. I've added a little Python snippet to mine to make sure that what I've got is actually outdated.
Sure, it doesn't waste much bandwidth, but hey, after seeing the downloads stats I've decided that every little bit (hah!) helps. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 149
Karma: 585496
Join Date: Aug 2009
Device: Astak EZ Reader Pocket Pro, Kobo Mini, Nook Glowlight 2, Kobo Forma
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Quote:
Meaning, as soon as I get that monster SQL statement to actually work, instead of giving me either too much or no records. Grr. EDIT: So, here it is: calibre-check.py: Code:
#!/usr/bin/env python ## -*- coding: utf-8 -*- import subprocess, tempfile, sys, os if sys.version_info[0] > 2: import urllib.request as u else: import urllib as u from distutils.version import LooseVersion as ver local_version = tempfile.TemporaryFile() subprocess.call(["calibre-debug", '-c', "import calibre; print (calibre.__version__)"], stdout=local_version) local_version.seek(0) local_version = ver(local_version.read()[:-1]) remote_version = ver(u.urlopen('http://calibre-ebook.com/downloads/latest_version').read()[:-1]) if local_version < remote_version: sys.exit(0) else: sys.exit(1) I'm sure someone can put it in a one-liner and integrate it to the current updater one-liner. Or maybe integrate that (or a variation) to linux_installer. Then, calibre-update.sh: Code:
#!/bin/bash if python calibre-check.py; then sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')" else echo "Calibre is up-to-date" fi EDIT: newer version of update code here Last edited by aleyx; 11-21-2013 at 02:05 PM. |
|
![]() |
![]() |
![]() |
#8 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Looks awesome, though really, it is usually updated every Friday. This would only be useful on the odd week that it doesn't get updated. Still, it's cool so I'm gonna use it. Thanks!!!
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,462
Karma: 10484861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
I usually run update script (manually) when Calibre tells me there is a new version.
I want to visit the download page and read what is new anyway. |
![]() |
![]() |
![]() |
#10 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
![]() |
![]() |
![]() |
#11 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Quote:
Don't forget to customize calibre-update.sh for your particular needs. For exemple, backup before update: Code:
#!/bin/bash if python calibre-check.py; then . backup-library.sh sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')" else echo "Calibre is up-to-date" fi Code:
#!/bin/bash if python calibre-check.py; then killall calibre-server . backup-library.sh sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')" calibre-server --port 8080 --restriction Novels --daemonize calibre-server --port 8081 --restriction News --daemonize calibre-server --port 8082 --restriction DontLetTheKidsSeeThis --daemonize --password=mykidswonteverfindit --username=momndad else echo "Calibre is up-to-date" fi EDIT: newer version of update code here Last edited by aleyx; 11-19-2013 at 04:58 PM. |
|
![]() |
![]() |
![]() |
#12 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Heh, thanks ^_^
Well, all the cool comes from Kovid, Python and bash, really. For myself, I read the changelog from the RSS post, then I go and run update.sh. Although now that I've just added the checking stuff, I'll probably just add update.sh to my cron and save myself an ssh session. Oh, and please, for anyone who want to use that bit of code, don't hesitate to report any bug or weird responses. The error checking on this is pretty much absent. For exemple, there's no 404 or other error response handling for http://calibre-ebook.com/downloads/latest_version... |
![]() |
![]() |
![]() |
#13 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,156
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@aleyx: You can save yourself having to call subprocess to get the current calibre version by running your script using calibre itself, like this:
calibre-debug update-calibre.py and in update-calibre.py from calibre.constants import numeric_version ... the rest of the script should be the same |
![]() |
![]() |
![]() |
#14 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
That's indeed a lot leaner, especially since numeric_version is already a tuple, so version comparison is pretty straightforward.
Thanks Kovid! Code:
#!/usr/bin/env python ## -*- coding: utf-8 -*- if sys.version_info[0] > 2: import urllib.request as u else: import urllib as u from calibre.constants import numeric_version if numeric_version < tuple(map(int, u.urlopen('http://calibre-ebook.com/downloads/latest_version').read()[:-1].split("."))): sys.exit(0) else: sys.exit(1) Last edited by aleyx; 11-19-2013 at 04:58 PM. |
![]() |
![]() |
![]() |
#15 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,156
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can also lose the version check since calibre-debug is always python 2
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
0.7 Linux Ubuntu ppa | dicknskip | Sigil | 21 | 04-20-2013 04:29 AM |
Official Calibre ereader app for mobile devices? | mcandre | Calibre | 15 | 12-18-2012 03:27 PM |
New official covers | gers1978 | Amazon Kindle | 20 | 10-07-2011 11:15 AM |
Firmware Update 3.0.2 is official | mrzerga | Amazon Kindle | 33 | 10-23-2010 07:32 AM |
It's Official | BuddyBoy | Sony Reader | 9 | 11-09-2006 05:21 PM |