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 02-03-2015, 06:42 PM   #31
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Yes, the install I was talking about and the one I am playing with at the moment is local on PC, using library in NAS and local metadata.db - and the latest script works perfect thanks

the only thing is that the message about right portable location appears regardless whether you are using the script for truly portable install or simply to customise local install (in which case it is a bit confusing _ I simply ignored it, but it is not very neat).
Remember that the script can be used for:
Code:
# By setting the paths correctly it can be used to run:
# 1 - A "portable calibre" off a USB stick.
# 2 - A network installation with local metadata database
# (for performance) and books stored on a network share
# 3 - A local installation using customised settings
whereas, at the moment, if it can't find it, it seems to assume that it is portable installation 1

I will play with portable one tomorrow (it's getting late here and I got early start tomorrow )

Last edited by bambuko; 02-03-2015 at 06:48 PM.
bambuko is offline   Reply With Quote
Old 02-03-2015, 06:47 PM   #32
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Sure thing.

Eventually I will submit this change upstream so other people can make use of it in the meantime I was just holding off a bit to get insight into how it is used in real time.

No pressure.

Anything that could be made more clear, or streamlined, or extra-option-packed, just name it and I will see what I can do.
eschwartz is offline   Reply With Quote
Advert
Old 02-04-2015, 10:19 AM   #33
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
One more question please:
I have tried to be clever and created desktop shortcut to the script file and...
I can right click the shortcut to run it in terminal, but left clicking makes no impression on it?

On the other hand, I can either left click the script file directly and it simply runs, or right click it to run in the terminal.

My idea was, that you right click it to run in terminal to see the settings before executing, or left click it to just run (once everything is set-up and tested satisfactorily), but it doesn't work with shortcuts
bambuko is offline   Reply With Quote
Old 02-05-2015, 12:11 AM   #34
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Did you make the .desktop executable?

Also, see the latest version. You can simply blank the BIN_DIR to tell it that you want to rely on the system path.
eschwartz is offline   Reply With Quote
Old 02-05-2015, 06:02 AM   #35
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Quote:
Originally Posted by eschwartz View Post
Did you make the .desktop executable?
don't forget you are talking to an ignorant and you need to use words of one syllable
so (however embarrasing) - what is .desktop and where do I find it?
I have made calibre-portable.sh executable, but I am not sure I follow you question?

Quote:
Originally Posted by eschwartz View Post
Also, see the latest version. You can simply blank the BIN_DIR to tell it that you want to rely on the system path.
Yes, using the latest version OK.
When you tell me I can blamk BIN_DIR do you mean:

Code:
BIN_DIR=  
if [[ -d "${BIN_DIR}" ]]; then
CALIBRE="${BIN_DIR}/calibre"
echo "PROGRAM FILES: ${BIN_DIR}"
elif [[ -z "${BIN_DIR}" ]]; then
CALIBRE="calibre"
echo "PROGRAM FILES: Using System search path"
else
CALIBRE="calibre"
bambuko is offline   Reply With Quote
Advert
Old 02-05-2015, 03:07 PM   #36
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
You made a desktop shortcut, yes?

Those are the program.desktop files which usually build menus (and which you can pin to the desktop). Since it has become unpopular to actually allow people to make them via GUIs anymore [shakes fist at Canonical] you usually have to create them in a text editor -- well, that is how I got used to creating them.

Desktop Entry

You can get away with desktop entries in the system location having 644 permissions, but elsewhere IIRC it must be executable.

So I assume you were using a .desktop launcher to give it an icon.

I guess I assumed you knew this stuff already because you mentioned desktop shortcuts, but really there is nothing wrong with not knowing them. No one needs to delve first thing into freedesktop specs. I did because I wanted iconized launchers to custom stuff.



Yes, that is what I meant by blanking BIN_DIR. As you can see, if it is a valid directory, we use the calibre binary from it, elseif the length is zero, use the system search path, else complain loudly that the directory doesn't exist and fallback on the system search path.

Last edited by eschwartz; 02-05-2015 at 03:12 PM.
eschwartz is offline   Reply With Quote
Old 02-05-2015, 04:40 PM   #37
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
That was most useful reply - thank you!
Yet again I have learned something (not a bad day then? )
I will look at this shortcut business, although my main priority should be sorting out issues with Qt crashing on PC when running Calibre, causing segmentation faults (real PITA )
I know Kovid told me
Quote:
... just google how to get a backtrace on whatever linux distro you are using...
but it's not so easy when you trying to learn from scratch

BTW when I mess around with BIN_DIR rather than falling back on system search and finding it for me (I know it exists) it simply tells me:

Code:
PROGRAM FILES: Using System search path
--------------------------------------------------
TEMPORARY FILES: /tmp/CALIBRE_TEMP
--------------------------------------------------

Press CTRL-C if you do not want to continue
Press ENTER to continue and start Calibre

Starting up Calibre from portable directory "/opt/calibre"
/opt/calibre/calibre-portable.sh: line 203: calibre: command not found
Script completed hit RETURN to close window.

Last edited by bambuko; 02-05-2015 at 04:44 PM.
bambuko is offline   Reply With Quote
Old 02-08-2015, 08:22 PM   #38
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,422
Karma: 85397180
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 bambuko View Post
That was most useful reply - thank you!
Yet again I have learned something (not a bad day then? )
I will look at this shortcut business, although my main priority should be sorting out issues with Qt crashing on PC when running Calibre, causing segmentation faults (real PITA )
I know Kovid told me but it's not so easy when you trying to learn from scratch
I would just go with running gdb (GNU debugger):

Code:
$ gdb calibre
(gdb) run
(gdb) ### calibre errors out
(gdb) backtrace
(gdb) ### Bunch of debugging info
and then posting it for Kovid to look at, since he probably knows more about debugging calibre than we do.

Quote:
BTW when I mess around with BIN_DIR rather than falling back on system search and finding it for me (I know it exists) it simply tells me:

Code:
PROGRAM FILES: Using System search path
--------------------------------------------------
TEMPORARY FILES: /tmp/CALIBRE_TEMP
--------------------------------------------------

Press CTRL-C if you do not want to continue
Press ENTER to continue and start Calibre

Starting up Calibre from portable directory "/opt/calibre"
/opt/calibre/calibre-portable.sh: line 203: calibre: command not found
Script completed hit RETURN to close window.
Wouldn't that heavily imply that the search path (from within the script, but we haven't exactly changed it...) cannot find "calibre"?

If you change the last line from "$CALIBRE" to "calibre" you should get the same result??

Right before the last line, try inserting "command -v calibre; command -v $CALIBRE" -- they should both point to "/usr/bin/calibre" -- that shouldn't actually be any different than trying to launch calibre directly via the command line, though...

And I assume you have not installed the system calibre to /opt/calibre (default) then.
eschwartz is offline   Reply With Quote
Old 02-15-2015, 07:49 AM   #39
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Sorry for a long silence.
I am now trying things on a different distro (LinuxMint17.1 cinnamon) and the script finds Config, Library, and Programme fine, but this is what happens when I try to run it in terminal:
Code:
Press CTRL-C if you do not want to continue
Press ENTER to continue and start Calibre

Starting up Calibre from portable directory "/media/bambuko/b3fe1f5a-f86b-4425-ad6f-999d97b9def7"
Traceback (most recent call last):
  File "site.py", line 49, in main
  File "site-packages/calibre/__init__.py", line 21, in <module>
  File "site-packages/calibre/startup.py", line 77, in <module>
  File "site-packages/calibre/utils/localization.py", line 129, in set_translators
  File "site-packages/calibre/utils/localization.py", line 63, in get_lang
  File "site-packages/calibre/utils/config_base.py", line 446, in <module>
  File "site-packages/calibre/utils/config_base.py", line 354, in __getitem__
  File "site-packages/calibre/utils/config_base.py", line 364, in get
  File "site-packages/calibre/utils/config_base.py", line 348, in refresh
  File "site-packages/calibre/utils/config_base.py", line 275, in parse
  File "site-packages/calibre/utils/lock.py", line 139, in __enter__
  File "site-packages/calibre/utils/lock.py", line 118, in unix_open
OSError: [Errno 13] Permission denied: '/media/bambuko/b3fe1f5a-f86b-4425-ad6f-999d97b9def7/CalibreConfig/global.py'
/media/bambuko/b3fe1f5a-f86b-4425-ad6f-999d97b9def7/calibre/lib/python2.7/site-packages/calibre/ptempfile.py:27: RuntimeWarning: Parent module 'calibre' not found while handling absolute import
All my previous tests were done with a simple distro running in root so this is first time I come across the delight of password/permissions

After laboriously changing all the permissions (right PITA) managed to get it all going, but still getting the following error messages:

Code:
Failed to initialize plugin: ISBNDB (1, 0, 0)
Failed to initialize plugin: <class 'calibre.ebooks.metadata.sources.isbndb.ISBNDB'>
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

Last edited by bambuko; 02-15-2015 at 08:53 AM.
bambuko is offline   Reply With Quote
Old 02-15-2015, 06:56 PM   #40
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
But it is actually running? If so, that is good news and *probably* all you need.

I don't know why it cannot import the isbndb module, though. However, that does sound like a calibre problem. (The libpng warning is just noise.)

Perhaps Kovid could figure it out -- it sounds worrying that anything should be failiing to start, although I guess you probably don't usually need that plugin anyway.
eschwartz is offline   Reply With Quote
Old 02-15-2015, 07:49 PM   #41
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Yes, it is running fine and without "broken pipe" problems I had with another distro.
My concern was that if it is to be truly portable than it would be good to avoid all this permission nonsense - i.e. if every time I want to use it with another Linux machine I have to go through sorting out permissions than it is not really as portable as I was hoping for?
I guess the windows version is easy because permissions and owners etc are not an issue...
bambuko is offline   Reply With Quote
Old 02-15-2015, 07:53 PM   #42
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Hmm, if you use FAT and mount it rwx that would nicely get around the permissions problem... alternatively you can go ahead and make sure your username/uid is identical on every system you use. What do you usually do when you have permission problems with other files?

Last edited by eschwartz; 02-15-2015 at 08:00 PM.
eschwartz is offline   Reply With Quote
Old 02-15-2015, 07:54 PM   #43
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,167
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Remember that even on Windows IF the USB / Portable Media is formatted with NTFS you will have issues; the only reason it normally doesn't is that most people would format the media with FAT32.
PeterT is offline   Reply With Quote
Old 02-16-2015, 05:12 AM   #44
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Until very recently I didn't have this problem because I was using Puppy Linux which runs simply as root and that's it, but now that I switched to LinuxMint it's a whole new ball game with all this confusing nonsense of permissions, priviledges, accounts etc but that's a discussion for another time and since most of the people would be using mainstream distros, testing calibre-portable on LinuxMint is the right way to go about it.
I don't know enough about linux to make sensible suggestions..

As for USB/portable media adn FAT32, isn't it limited in size? I am using at the moment 60Gb portable HDD for the testing.
When I tried it with windows (two desktops and laptop, all running XP) I didn't have any issues (it was formatted NTFS)?
bambuko is offline   Reply With Quote
Old 02-20-2015, 03:48 PM   #45
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
NTFS and ext3/4 and in fact newer filesystems in general support privileges (that is the problem) as well as large files and other goodies -- FAT is old enough that it doesn't support filesizes larger than 4GiB. That is per-file, the actual filesystem volume can be far larger. My 32GB flashdrive is quite comfortable on FAT32, and depending on the cluster size you can have a max filesystem size ranging from 2TiB to 16TiB.


(technically, FAT32+ can store 256GiB files, but that isn't very well supported and non-FAT32+ drivers will truncate the files. Which defeats the purpose of using a shoddy filesystem format because it is universally supported... )


tl;dr -- FAT should be perfectly safe.



Why did the NTFS volume work just fine? Because, in addition to using a permissions-supporting filesystem, you also have to remove the permissions from the "Everyone" SID, since I think Windows by default allows everyone rwx except inside an actual userprofile. Linux by default sets restrictive umasks that denies write access to other users -- making an fstab rule for that drive mounting it with a umask of 000 should ensure all new files are created with permissions of 666.
That would mean you don't have to reset the permissions with sudo in the future, and you don't have to use FAT.

Similar discussion: http://ubuntuforums.org/showthread.php?t=1502775
What is umask: https://wiki.archlinux.org/index.php/umask
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Portable cstandifird Devices 3 01-24-2012 02:29 PM
Portable Calibre? hermes Related Tools 2 06-02-2011 02:50 PM
Calibre Portable beckywc Calibre 4 12-21-2010 11:13 AM
Portable Linux version of Sigil readx Sigil 9 09-03-2010 02:59 AM
Portable Linux-Mobile-Guide for iSilo and Plucker Colin Dunstan Lounge 0 08-31-2005 05:48 AM


All times are GMT -4. The time now is 01:13 AM.


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