Beta Pndstore


Tempel

Active Member
Joined
Dec 30, 2008
Messages
670
Age
37
Website
randy.heydon.selfip.net
Dear everyone,

I present to you PNDstore, a Pandora application for managing PNDs from remote repositories!

The recent open beta of milkshake's repository prompted me to get in gear and finish up this client for interacting with it. PNDstore can manage all PND files on your system, including installing and updating them from any site that implements version 2 of the PND repository specification (of which milkshake's site is the only current example). Source is available under the LGPL.

The current version 1.0 mostly includes extra backend stability. The biggest change was updating to version 3.0 of the repository spec, allowing for more efficient list updating. Bug reports on this are the best help you could give!

But there's another way you can help, even without a Pandora. Though the backend is mostly complete, the GUI frontend is rather weak. I intend to continue improving it with PyGTK and Glade, but I know nothing about good GUI design! Show me how you think the interface should look and behave. Be aware that all information in the repo spec and PXML spec are available to the client and can be displayed to the user. Also consider that it should be able to work with any number of repositories (maybe ED or Craig will add support to the file archive or app store, or maybe someone will resurrect the Box). Consider what kind of options should be available and how they should be presented to the user. Finally, consider how to handle errors like checksum mismatches, or repositories and PXMLs that don't match the spec. Oh, and keep screen size in mind! Photoshop mockups would be absolutely great, Glade mockups would be even better since I could integrate them directly, and working code would be amazing (but I don't expect that level of effort from you yet).

And another! The current icon is ripped from the GNOME icon set. Make something cool that can be used instead!

One last note: there's also a command-line frontend, though it's not usable from the PND. But to use it you'll have to download the source and work around the ctypes bug yourself. Once you've extracted the source, you can run "python pndst" from the source directory, or you can install it to NAND with "sudo python setup.py install", then use it as "pndst". But that won't install it through the package manager, so it won't be easy to remove if you do that.

Thanks in advance for feedback :)

Old content:
The current version 0.3 adds threading to the GUI, so it will let you know what's happening as it downloads applications. It also allows package upgrades to be selected individually. It's a small improvement, but they'll keep coming. As always, if it works well, let me know; if it doesn't work well, let me know and also post the contents of /tmp/pndrun_pndstore.out.

Version 1.0 has been released, though it's not all that different to the end-user.

The current version 0.2 includes a real GUI with the ability to install and remove apps in addition to updating them. The GUI is not yet threaded, meaning that long-running operations like installation and updating will appear to make it lock up; once the download or whatever finishes, it'll be usable again. Also, it isn't yet able to remove appdata directories, but that will come in later versions. So try it out! If it works well, let me know; if it doesn't work well, let me know and also post the contents of /tmp/pndrun_pndstore.out.

Version 0.3 is out, so try that instead!

Or rather, that's what I think it'll do. Though I've tested it here, it's never been tested on a real Pandora. In particular, I have no idea if my workaround for the missing ctypes bug will actually work. But that's where you come in, my intrepid beta testers! Please run the program, click "Okay" through all the windows (be patient, it can take some time for each window to pop up), and if it crashes (or doesn't run at all!), post the contents of /tmp/pndrun_pndstore.out in spoiler tags here.

Thanks to some tireless testers, particularly IsSuE and mindlord, all the show-stopping bugs have been ironed out.
 
Last edited by a moderator:
fails to launch here too
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/Pand32G/pandora/menu//PNDstore-0.1.pnd -e PNDstore -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon:
/dev/loop6
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop6 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is ext2
Mounting the Union FS using /media/Pand32G/pandora/appdata/pndstore as Write directory:
none on /mnt/utmp/pndstore type aufs (rw,si=670a4c77)
none on /mnt/utmp/pndstore type aufs (rw,si=670a4c77)
[------------------------------]{ App start }[---------------------------------]
Traceback (most recent call last):
File "./PNDstore", line 6, in <module>
from pndstore import options, database_update, packages
File "/mnt/utmp/pndstore/pndstore/options.py", line 7, in <module>
import libpnd
File "/mnt/utmp/pndstore/pndstore/libpnd.py", line 7, in <module>
p = c.CDLL('libpnd.so.1')
File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libpnd.so.1: undefined symbol: __cxa_pure_virtual
[-------------------------------]{ App end }[----------------------------------]
cleanup done
 
Thanks mindlord, that's exactly what I needed! That's a bug in libpnd; I saw it on my desktop machine, but assumed it wouldn't appear on Pandora. But since it does, I worked around it with an LD_PRELOAD that is now included in the PND. Download it again from the same link, and we'll see where it fails next!
 
new output
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/Pand32G/pandora/menu//PNDstore-0.1.pnd -e wrapper.sh -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon:
losetup: Could not find any loop device. Maybe this kernel does not know
about the loop device? (If so, recompile or `modprobe loop'.)

usedminor
freeminor 1
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop1 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is ext2
Mounting the Union FS using /media/Pand32G/pandora/appdata/pndstore as Write directory:
none on /mnt/utmp/pndstore type aufs (rw,si=66579077)
none on /mnt/utmp/pndstore type aufs (rw,si=66579077)
[------------------------------]{ App start }[---------------------------------]
Traceback (most recent call last):
File "./PNDstore", line 6, in <module>
from pndstore import options, database_update, packages
File "/mnt/utmp/pndstore/pndstore/options.py", line 7, in <module>
import libpnd
File "/mnt/utmp/pndstore/pndstore/libpnd.py", line 166, in <module>
pxml_get_description = p.pnd_pxml_get_description
File "/usr/lib/python2.6/ctypes/__init__.py", line 366, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python2.6/ctypes/__init__.py", line 371, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libpnd.so.1: undefined symbol: pnd_pxml_get_description
[-------------------------------]{ App end }[----------------------------------]
cleanup done
 
new output
Code:
kiwidora:/tmp$ cat pndrun_pndstore.out 
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/BIG/pandora/menu//PNDstore-0.1.pnd -e PNDstore -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon: 
/dev/loop2
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop2 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is vfat
Mounting the Union FS using /media/BIG/pandora/appdata/pndstore as Write directory:
mount -t aufs -o exec,noplink,dirs=/media/BIG/pandora/appdata/pndstore=rw+nolwh:/mnt/pnd/pndstore=rr none /mnt/utmp/pndstore
none on /mnt/utmp/pndstore type aufs (rw,si=6623e037,noplink)
none on /mnt/utmp/pndstore type aufs (rw,si=6623e037,noplink)
[------------------------------]{ App start }[---------------------------------]
Traceback (most recent call last):
  File "./PNDstore", line 6, in <module>
    from pndstore import options, database_update, packages
  File "/mnt/utmp/pndstore/pndstore/options.py", line 7, in <module>
    import libpnd
  File "/mnt/utmp/pndstore/pndstore/libpnd.py", line 7, in <module>
    p = c.CDLL('libpnd.so.1')
  File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libpnd.so.1: undefined symbol: __cxa_pure_virtual
[-------------------------------]{ App end }[----------------------------------]
cleanup done
looks like the first one though. I downloaded the pnd from the link provided in the first post
 
IsSuE, that's identical to the first problem I fixed. When did you download that? Try downloading it fresh from the same link; maybe clear your browser's cache first (or use a different browser) to make sure you get the latest one.
 
Tempel said:
IsSuE, that's identical to the first problem I fixed. When did you download that? Try downloading it fresh from the same link; maybe clear your browser's cache first (or use a different browser) to make sure you get the latest one.
Mhh strange. Just downloaded it again and same error. I download it with wget via ssh

edit: should look better, I was actually using the old version.
Code:
kiwidora:/tmp$ cat pndrun_pndstore.out 
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/BIG/pandora/menu//PNDstore-0.1.pnd -e wrapper.sh -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon: 
losetup: Could not find any loop device. Maybe this kernel does not know
       about the loop device? (If so, recompile or `modprobe loop'.)

usedminor
freeminor 1
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop1 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is vfat
Mounting the Union FS using /media/BIG/pandora/appdata/pndstore as Write directory:
mount -t aufs -o exec,noplink,dirs=/media/BIG/pandora/appdata/pndstore=rw+nolwh:/mnt/pnd/pndstore=rr none /mnt/utmp/pndstore
none on /mnt/utmp/pndstore type aufs (rw,si=616ebd37,noplink)
none on /mnt/utmp/pndstore type aufs (rw,si=616ebd37,noplink)
[------------------------------]{ App start }[---------------------------------]
ERROR: ld.so: object '/usr/lib/libstdc++.so' from LD_PRELOAD cannot be preloaded: ignored.
Traceback (most recent call last):
  File "./PNDstore", line 6, in <module>
    from pndstore import options, database_update, packages
  File "/mnt/utmp/pndstore/pndstore/options.py", line 7, in <module>
    import libpnd
  File "/mnt/utmp/pndstore/pndstore/libpnd.py", line 7, in <module>
    p = c.CDLL('libpnd.so.1')
  File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libpnd.so.1: undefined symbol: __cxa_pure_virtual
[-------------------------------]{ App end }[----------------------------------]
cleanup done
triple checked now. and it looks a bit different from the previous one. The first line after app start
 
Last edited by a moderator:
That's strange, it can't find the library to load on your Pandora, but it had no problem on mindlord's. Have you installed or removed anything through opkg? Maybe mindlord has, and that's why he has the library available?

Okay IsSuE, quick check: can you please tell me the output of "ls /usr/lib/libstdc++.*" Maybe you just don't have the highest-level link, and I should work around that.
 
Tempel said:
That's strange, it can't find the library to load on your Pandora, but it had no problem on mindlord's. Have you installed or removed anything through opkg? Maybe mindlord has, and that's why he has the library available?

Okay IsSuE, quick check: can you please tell me the output of "ls /usr/lib/libstdc++.*" Maybe you just don't have the highest-level link, and I should work around that.

I did not install any libraries on my pandora as far as i remember.
here are my libs:
Code:
kiwidora:/usr/lib$ ls | grep libstdc
libstdc++.so.6
libstdc++.so.6.0.10
kiwidora:/usr/lib$
btw: are you on irc, would be easier than on the forums

edit: just symlinked libstdc++, now i get a GUI

edit2: after 2 times clicking OK i get this
Code:
kiwidora:/media/BIG$ cat /tmp/pndrun_pndstore.out 
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/BIG/pandora/menu//PNDstore-0.1.pnd -e wrapper.sh -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon: 
losetup: Could not find any loop device. Maybe this kernel does not know
       about the loop device? (If so, recompile or `modprobe loop'.)

usedminor
freeminor 1
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop1 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is vfat
Mounting the Union FS using /media/BIG/pandora/appdata/pndstore as Write directory:
mount -t aufs -o exec,noplink,dirs=/media/BIG/pandora/appdata/pndstore=rw+nolwh:/mnt/pnd/pndstore=rr none /mnt/utmp/pndstore
none on /mnt/utmp/pndstore type aufs (rw,si=61766377,noplink)
none on /mnt/utmp/pndstore type aufs (rw,si=61766377,noplink)
[------------------------------]{ App start }[---------------------------------]
/mnt/utmp/pndstore/pndstore/database_update.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import options, libpnd, urllib2, sqlite3, json, md5, ctypes
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
Traceback (most recent call last):
  File "./PNDstore", line 27, in <module>
    database_update.update_local()
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 430, in update_local
    update_local_file(path)
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 260, in update_local_file
    except etree.ParseError:
AttributeError: 'module' object has no attribute 'ParseError'
[-------------------------------]{ App end }[----------------------------------]
cleanup done
 
Last edited by a moderator:
tried again got two questions about updating the repo cache and install applications list then this
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/Pand32G/pandora/menu//PNDstore-0.1.pnd -e wrapper.sh -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon:
losetup: Could not find any loop device. Maybe this kernel does not know
about the loop device? (If so, recompile or `modprobe loop'.)

usedminor
freeminor 1
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop1 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is ext2
Mounting the Union FS using /media/Pand32G/pandora/appdata/pndstore as Write directory:
none on /mnt/utmp/pndstore type aufs (rw,si=66579077)
none on /mnt/utmp/pndstore type aufs (rw,si=66579077)
[------------------------------]{ App start }[---------------------------------]
/mnt/utmp/pndstore/pndstore/database_update.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import options, libpnd, urllib2, sqlite3, json, md5, ctypes
Traceback (most recent call last):
File "./PNDstore", line 27, in <module>
database_update.update_local()
File "/mnt/utmp/pndstore/pndstore/database_update.py", line 430, in update_local
update_local_file(path)
File "/mnt/utmp/pndstore/pndstore/database_update.py", line 260, in update_local_file
except etree.ParseError:
AttributeError: 'module' object has no attribute 'ParseError'
[-------------------------------]{ App end }[----------------------------------]
cleanup done
 
Thanks both of you. I fixed the preload to get libstdc++.so.6, so you shouldn't need to make the link manually. And it turns out ParseError is Python 2.7-specific, so I got rid of that too. Could this be it?!
 
tried again :)
Code:
kiwidora:~$ cat /tmp/pndrun_pndstore.out 
sudo /usr/pandora/scripts/pnd_run.sh -m -p /media/BIG/pandora/menu//PNDstore-0.1.pnd -e wrapper.sh -b pndstore -a --working-dir=.
not mounted on loop yet, doing so
LoopMountedon: 
losetup: Could not find any loop device. Maybe this kernel does not know
       about the loop device? (If so, recompile or `modprobe loop'.)

usedminor
freeminor 1
Filetype is Squashfs
Mounting PND (mount -t squashfs) :
/dev/loop1 on /mnt/pnd/pndstore type squashfs (ro)
Filesystem is vfat
Mounting the Union FS using /media/BIG/pandora/appdata/pndstore as Write directory:
mount -t aufs -o exec,noplink,dirs=/media/BIG/pandora/appdata/pndstore=rw+nolwh:/mnt/pnd/pndstore=rr none /mnt/utmp/pndstore
none on /mnt/utmp/pndstore type aufs (rw,si=6dd2af77,noplink)
none on /mnt/utmp/pndstore type aufs (rw,si=6dd2af77,noplink)
[------------------------------]{ App start }[---------------------------------]
/mnt/utmp/pndstore/pndstore/database_update.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import options, libpnd, urllib2, sqlite3, json, md5, ctypes
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
Traceback (most recent call last):
  File "./PNDstore", line 27, in <module>
    database_update.update_local()
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 436, in update_local
    update_local_file(libpnd.box_get_key(node))
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 391, in update_local_file
    None) ) # TODO: Get icon buffer with pnd_desktop's pnd_emit_icon_to_buffer
sqlite3.IntegrityError: local.description may not be NULL
[-------------------------------]{ App end }[----------------------------------]
cleanup done
kiwidora:~$
 
Ah, that one's not my fault! You must have a PND that has no description, even though they must always have descriptions!

But there's no need for me to be so particular about it. I've loosened up that restriction in my code. I'll need to have more graceful error handling in the future, but I thought I should see where the errors appear first.
 
Tempel said:
Ah, that one's not my fault! You must have a PND that has no description, even though they must always have descriptions!

But there's no need for me to be so particular about it. I've loosened up that restriction in my code. I'll need to have more graceful error handling in the future, but I thought I should see where the errors appear first.
Code:
[------------------------------]{ App start }[---------------------------------]
/mnt/utmp/pndstore/pndstore/database_update.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import options, libpnd, urllib2, sqlite3, json, md5, ctypes
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
/home/issue/.gtkrc-2.0:1: error: unexpected string constant "xfdesktop-icon-view", expected character `='
/usr/share/themes/Shiki-Wise/gtk-2.0/gtkrc:126: Murrine configuration option "gradients" is no longer supported and will be ignored.
Traceback (most recent call last):
  File "./PNDstore", line 27, in <module>
    database_update.update_local()
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 436, in update_local
    update_local_file(libpnd.box_get_key(node))
  File "/mnt/utmp/pndstore/pndstore/database_update.py", line 247, in update_local_file
    with open(path, 'rb') as p: m = md5.new(p.read())
MemoryError
[-------------------------------]{ App end }[----------------------------------]
on the version u just upped
 
Last edited by a moderator:
Damn. That problem may take a while longer, as I have to recode hashing routines so they don't take the whole file at once. I may not upload it tonight, so don't wait around.

But thanks so much for all the testing you've done :)
 
Np, I am pretty bored right now anyways :)
I just tried it on a new formatted SD card, with no PNDs on it, there it tells me no updates available. Seems to work :)
 
Turns out it wasn't that hard, thanks to StackOverflow. It should now read your arbitrarily-large PND files.

You're good at this IsSuE. What other crazy behaviour can you dig up? Any more poorly-formed PNDs?
 
I run it and it says it's updating lists, then it wants to update installed list. But nothing happens after that. I run it again and the same thing happens :(
 
Back
Top