Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2013, 01:41 AM   #1
squigish
Junior Member
squigish began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2012
Device: Kindle 3, Kindle Touch
Automatically patching custom recipies with updates to built-in recipies

I'm not sure if this belongs in development or recipes. I picked development, because I think the solution is ultimately going to involve using bzr, and/or other development tools.

I have several custom recipes, all of which are based on built-in recipes (specifically, The New York Times). I'd like to keep my customizations, which are mostly just options I changed or set, but still benefit from the periodic updates to the built-in recipes.

Is there some way to automatically download a diff of the changes to the recipe since the last revision, and then patch my custom recipe?

Ideally, I'd have a linux shell script that would check to see if the built-in recipe has been updated more recently than the locally stored custom recipe, and if so, run a subroutine to download or create a diff file and apply it to my recipe. I figure that doing it this way, rather than re-downloading the recipe every time, would minimize server load, both on my server and on launchpad (or wherever I get the recipe from).

I've been directed to http://bazaar.launchpad.net/~kovid/c...head:/recipes/ for the source code of the built-in recipes, but my browser has trouble loading that page, presumably because there are so many files. Where does the calibre executable get the recipes? Is there an easy way to check modification date from that source, using a command-line tool?

I installed bzr on my linux box (Ubuntu Lucid 10.04), but so far have been unable to find an easy command to get a local copy of the source. I've tried
Code:
bzr branch lp:calibre
bzr co lp:calibre
bzr pull lp:calibre
I do plan on eventually teaching myself how to use bzr (I have a passing familiarity with SVN and git), but this seems like something that should be able to be done in a simple one-liner, I'm just not seeing what it is.

Also, is there an easy command to look for changes for a particular file? Would the best way just be to update my local copy using bzr, and then look at the modification time for the relevant recipe? It'd be ideal if I didn't have to keep a local copy of the entire source, but if I do, so be it.

Thanks for the help!
squigish is offline   Reply With Quote
Old 10-07-2013, 02:06 AM   #2
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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre no longer uses bzr, it uses git. https://github.com/kovidgoyal/calibr...master/recipes
kovidgoyal is offline   Reply With Quote
Old 10-07-2013, 05:27 PM   #3
squigish
Junior Member
squigish began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2012
Device: Kindle 3, Kindle Touch
Thanks for the update! The recipe sticky should probably be edited to reflect the new link, no?

As I said, I have only a passing familiarity with git. Can it fetch the modification time of a single file from the source tree, without having a local copy of the whole source stored?
squigish is offline   Reply With Quote
Old 10-07-2013, 11:09 PM   #4
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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have no idea, I'm a developer of calibre, not git.
kovidgoyal is offline   Reply With Quote
Old 10-13-2013, 03:48 AM   #5
hakan42
Zealot
hakan42 is on a distinguished road
 
hakan42's Avatar
 
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
@squigish No, you have to fetch the git repository ("git fetch") by which time you already have all the changes to every file already downloaded.

What you could do is to use the web interface on github ( https://github.com/kovidgoyal/calibre/tree/ ) and do some web scraping but in the end, you will be much better off just cloning the source tree and periodically updating it (git pull)
hakan42 is offline   Reply With Quote
Reply

Tags
bzr, diff, patch, recipe

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipies using OAI Protocol microgiraffe Recipes 0 05-22-2012 07:02 AM
Looking for spicy (and easy) recipies xg4bx Lounge 5 09-29-2011 04:12 PM
ebook-convert: use user recipies mic47 Recipes 3 03-07-2011 09:21 AM


All times are GMT -4. The time now is 09:13 PM.


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