I installed rox-base/zeroinstall-injector-0.33 and started 0launch with different 0install xml file passed. I always get the error message: OSError: [Errno 2] No such file or directory: '/var/lib/dpkg/status' After created this file as root with touch /var/lib/dpkg/status The program works fine. Reproducible: Always Steps to Reproduce:
Can you please detail: - Exactly how you tried to run 0launch - What is this "different 0install xml file" you passed, and how did you pass it?
First as root (removing the created file '/var/lib/dpkg/status'): rm /var/lib/dpkg/status Empty cache: rm -rf /home/maggu2810/.cache/0install.net/ grep Exec /usr/share/applications/zeroinstall-zero2desktop.desktop Exec=0launch http://0install.net/2007/interfaces/Zero2Desktop.xml -- %u So, first I used the following line: 0launch http://0install.net/2007/interfaces/Zero2Desktop.xml and get that output: WARNING:root:Failed to load feed /usr/lib/python2.5/site-packages/zeroinstall/0launch-gui/ZeroInstall-GUI.xml for <Interface http://0install.net/2008/interfaces/ZeroInstall-GUI.xml>: [Errno 2] No such file or directory: '/var/lib/dpkg/status' Traceback (most recent call last): File "/usr/bin/0launch", line 4, in <module> cli.main(sys.argv[1:]) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 335, in main _normal_mode(options, args) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 228, in _normal_mode sels = _fork_gui(iface_uri, gui_args, prog_args, options) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 254, in _fork_gui return helpers.get_selections_gui(iface_uri, gui_args, test_callback) File "/usr/lib/python2.5/site-packages/zeroinstall/helpers.py", line 35, in get_selections_gui gui_sel = get_selections_gui(namespaces.injector_gui_uri, ['--refresh']) File "/usr/lib/python2.5/site-packages/zeroinstall/helpers.py", line 44, in get_selections_gui assert gui_policy.ready # Should always be some version available AssertionError Then I tested the YoFrankie (CrystalSpace edition) XML file for 0install: 0launch http://crystalspace3d.org/downloads/YoFrankie/YoFrankie.xml and get that output: WARNING:root:Failed to load feed /usr/lib/python2.5/site-packages/zeroinstall/0launch-gui/ZeroInstall-GUI.xml for <Interface http://0install.net/2008/interfaces/ZeroInstall-GUI.xml>: [Errno 2] No such file or directory: '/var/lib/dpkg/status' Traceback (most recent call last): File "/usr/bin/0launch", line 4, in <module> cli.main(sys.argv[1:]) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 335, in main _normal_mode(options, args) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 228, in _normal_mode sels = _fork_gui(iface_uri, gui_args, prog_args, options) File "/usr/lib/python2.5/site-packages/zeroinstall/injector/cli.py", line 254, in _fork_gui return helpers.get_selections_gui(iface_uri, gui_args, test_callback) File "/usr/lib/python2.5/site-packages/zeroinstall/helpers.py", line 35, in get_selections_gui gui_sel = get_selections_gui(namespaces.injector_gui_uri, ['--refresh']) File "/usr/lib/python2.5/site-packages/zeroinstall/helpers.py", line 44, in get_selections_gui assert gui_policy.ready # Should always be some version available AssertionError So I created the missing file '/var/lib/dpkg/status' (as root:) touch /var/lib/dpkg/status The first command: 0launch http://0install.net/2007/interfaces/Zero2Desktop.xml Zero Install starts fine. Only the following message appears on command line dpkg-query: failed to open package info file `/var/lib/dpkg/available' for reading: No such file or directory But it is working. Second command: 0launch http://crystalspace3d.org/downloads/YoFrankie/YoFrankie.xml This works also now. So, now I have a look at the code: /usr/lib/python2.5/site-packages/zeroinstall/injector/distro.py _dpkg_db_dir = '/var/lib/dpkg' _rpm_db_dir = '/var/lib/rpm' if os.access(_dpkg_db_dir, os.R_OK | os.X_OK): _host_distribution = DebianDistribution(_dpkg_db_dir) elif os.path.isdir(_rpm_db_dir): _host_distribution = RPMDistribution(_rpm_db_dir) else: _host_distribution = Distribution() I believe this method, to look for the used distribution is not very good. equery belongs /var/lib/dpkg app-arch/dpkg-1.14.23 (/var/lib/dpkg) So, if you have installed 'app-arch/dpkg' 0install complains you are using a debian based distribution. And therefore it will have an access to the named file. IMHO this is should be fixed upstream, but perhabs we can offer a workaround.
The problem exists still in zeroinstall-injector 0.37 (recent version)
Fixed upstream (git) http://bugs.gentoo.org/show_bug.cgi?id=250865
Sorry, wrong link. https://sourceforge.net/tracker/?func=detail&atid=547191&aid=2431388&group_id=76468 The patch (should be included in portage tree): http://repo.or.cz/w/zeroinstall.git?a=blobdiff;f=zeroinstall/injector/distro.py;fp=zeroinstall/injector/distro.py;h=2852ad6f34e6885d1f22d1fb0b4e1fa4e17dc0dd;hp=e41154bcec20ccc182347ad0ea951a701daddcbd;hb=dd74d84d29ac3ce822d6c140154091cd76d43c20;hpb=ae38ce83a1f5cc4db67931b7439e979da479c1c3 Renaming the ebuild to 0.37 works for me to use the new version.
Thanks very much for the investigation! This is definitely the reason why you are seeing it and I am not - You (or something on your system) must have somehow created the directory /var/lib/dpkg, whereas that directory does not even exist on my system. I suspect that if you removed this patch and also removed that directory you would not see the same issue. Just so we're clear - Does 0.37 require I apply the patch in the ebuild, or does it include the patch already?
> ... You (or something on your system) must have > somehow created the directory /var/lib/dpkg ... As I stated before, in this case it was the package 'app-arch/dpkg' > ... and also > removed that directory you would not see the same issue. But I need the 'app-arch/dpkg' package and other people, too. So the removing of the directory is 'a no way' ;-) > Just so we're clear Yes, I belief we are :)) > Does 0.37 require I apply the patch in the ebuild, or > does it include the patch already? 0.37 do not include the patch, you should add it to the ebuild and tree. (only the git tree contains the patch)
I've just put zeroinstall-injector-0.40 in the tree. Please re-test with this updated version, as I believe it contains the fix you mention.
The source file for distribution checking looks okay for me and the program works fine too (again: for me). Is resolution "upstream" okay?
Good enough ;)