Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2013, 06:39 AM   #1
Ladyrixx
Zealot
Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.
 
Ladyrixx's Avatar
 
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.
Ladyrixx is offline   Reply With Quote
Old 11-03-2013, 07:40 AM   #2
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
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.
aleyx is offline   Reply With Quote
Advert
Old 11-03-2013, 09:26 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by Ladyrixx View Post
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.
Make a shell script out of the command line given in the Linux page,. I placed hat onto the menu and attached the 'connect_share.png' icon
When I see the new version message, I can just slide my rodent over it and click
theducks is offline   Reply With Quote
Old 11-03-2013, 08:27 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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?
eschwartz is offline   Reply With Quote
Old 11-04-2013, 03:47 AM   #5
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
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.
aleyx is offline   Reply With Quote
Advert
Old 11-04-2013, 01:20 PM   #6
Ladyrixx
Zealot
Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.Ladyrixx ought to be getting tired of karma fortunes by now.
 
Ladyrixx's Avatar
 
Posts: 149
Karma: 585496
Join Date: Aug 2009
Device: Astak EZ Reader Pocket Pro, Kobo Mini, Nook Glowlight 2, Kobo Forma
Quote:
Originally Posted by aleyx View Post
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.
I don't suppose you could share that? My Python is pretty much non-existent.
Ladyrixx is offline   Reply With Quote
Old 11-04-2013, 01:31 PM   #7
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
Quote:
Originally Posted by Ladyrixx View Post
I don't suppose you could share that? My Python is pretty much non-existent.
I will as soon as I get back from work ^^

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)
In English: Get Calibre's version string, then get the online version; if the online version is higher, return 0, else return 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
Putting calibre-update.sh in a cron running Friday night every few hours would be the next step.

EDIT: newer version of update code here

Last edited by aleyx; 11-21-2013 at 02:05 PM.
aleyx is offline   Reply With Quote
Old 11-04-2013, 04:04 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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!!!
eschwartz is offline   Reply With Quote
Old 11-04-2013, 04:09 PM   #9
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
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.
kacir is offline   Reply With Quote
Old 11-04-2013, 04:18 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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)
Quote:
Originally Posted by kacir View Post
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.
But it saves you an extra click. Plus it's cooler.
eschwartz is offline   Reply With Quote
Old 11-04-2013, 04:20 PM   #11
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
Quote:
Originally Posted by eschwartz View Post
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!!!
You're welcome.

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
Now with acrobatics:
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
Although the three calibre-server commands should rather be in a calibre-servers.sh of their own, so you'll be able to kill/restart whenever you want.
EDIT: newer version of update code here

Last edited by aleyx; 11-19-2013 at 04:58 PM.
aleyx is offline   Reply With Quote
Old 11-04-2013, 04:33 PM   #12
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
Quote:
Originally Posted by eschwartz View Post
But it saves you an extra click. Plus it's cooler.
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...
aleyx is offline   Reply With Quote
Old 11-04-2013, 10:44 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 11-05-2013, 03:47 AM   #14
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
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)
EDIT: newer version of update code here

Last edited by aleyx; 11-19-2013 at 04:58 PM.
aleyx is offline   Reply With Quote
Old 11-05-2013, 04:42 AM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:58 AM.


MobileRead.com is a privately owned, operated and funded community.