Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250865 - rox-base/zeroinstall-injector-0.33 does not work if '/var/lib/dpkg/status' is missing
Summary: rox-base/zeroinstall-injector-0.33 does not work if '/var/lib/dpkg/status' is...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Rox Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-13 20:19 UTC by Markus Rathgeb
Modified: 2009-05-25 22:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rathgeb 2008-12-13 20:19:47 UTC
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:
Comment 1 Jim Ramsay (lack) (RETIRED) gentoo-dev 2008-12-15 13:39:34 UTC
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?
Comment 2 Markus Rathgeb 2008-12-15 17:17:38 UTC
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.
Comment 3 Markus Rathgeb 2008-12-15 17:34:06 UTC
The problem exists still in zeroinstall-injector 0.37 (recent version)
Comment 4 Markus Rathgeb 2008-12-15 19:49:18 UTC
Fixed upstream (git)
http://bugs.gentoo.org/show_bug.cgi?id=250865
Comment 6 Jim Ramsay (lack) (RETIRED) gentoo-dev 2008-12-15 20:52:13 UTC
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?
Comment 7 Markus Rathgeb 2008-12-15 22:46:41 UTC
> ... 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)
Comment 8 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-05-21 16:15:21 UTC
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.
Comment 9 Markus Rathgeb 2009-05-23 19:48:52 UTC
The source file for distribution checking looks okay for me and the program works fine too (again: for me).

Is resolution "upstream" okay?
Comment 10 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-05-25 22:34:40 UTC
Good enough ;)