[Bug 866257] New: Can't browse or install software via gnome-software
https://bugzilla.novell.com/show_bug.cgi?id=866257 https://bugzilla.novell.com/show_bug.cgi?id=866257#c0 Summary: Can't browse or install software via gnome-software Classification: openSUSE Product: openSUSE Factory Version: 13.2 Milestone 0 Platform: x86-64 OS/Version: openSUSE 13.2 Status: NEW Severity: Normal Priority: P5 - None Component: GNOME AssignedTo: bnc-team-gnome@forge.provo.novell.com ReportedBy: Antoine.Saroufim@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.15 (KHTML, like Gecko) Safari/538.15 SUSE/13.2 (3.11.90) Epiphany/3.11.90 It's not possible to browse software using gnome-software. Installed apps are listed but new apps can't be browsed or searched for. The result for a search is always "No Application Found" even if the application is already installed and listed in the installed section. Reproducible: Always Steps to Reproduce: 1.open gnome-software 2.Try to search for software 3.Notice that you can't browse software, or see any categories Actual Results: Can't see software to install Expected Results: To be able to browse and install software pkcon refresh didn't help. Zypper works perfectly. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c1
Dominique Leuenberger
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c2
Michael Andres
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c3
Dominique Leuenberger
@Dominique: Actually i don't like to have too much knowledge about the application details coded in libzypp. So I'd suggest to use a plugin for this. (http://doc.opensuse.org/projects/libzypp/HEAD/zypp-plugins.html)
- I'd provide a plugin hook within libzypp; called after a repos raw matadata were updated. Zypp could pass the path to the directory tree containing the new metadata and the repos type to the plugin.
- Some gnome package had to provide the plugin script picking and consuming the appdata.
Would that be ok?
I guess that would be fine. I would need hooks on: - Repo refresh (install new appdata into the right location) - Repo disable/enable (remove/install appdata) - Repo rename (uninstall old appdata/install new appdata) - Repo delete (uninstall appdata) I think that's about all the cases I would need to hook in. In any case I would need to know 'where' to find the raw cache data (/var/cache/zypp/raw/<reponame>, the 'repo type' (rpm-md has a repodata folder with all the content, while yast has the /suse/setup/descr structure) and the 'type' of action. The zypp hooks would be installed by gnome-software (or any package it depends on). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c4
--- Comment #4 from Michael Andres
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c5
--- Comment #5 from Dominique Leuenberger
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c6
--- Comment #6 from Michael Andres
Would that make things easier?
I try to explain...
As for 'temporary' repositories: I guess they should not be a problem: if it refreshes, we 'install' the appdata (which likely won't be found in the flat repo) and, as it's a temp repo, we delete it again on repo removal.
- Temp repos are never added, thus never removed, just refreshed - There are zypper commands which 'silently' scan through disabled repos (i.e. refresh them) to look for specific packages (e.g debuginfo packages) The coupling between system repository actions (add/remove/enable/disable/rename) and metadata download (refresh) is quite loose. The repo data download (refresh) in libzypp is using a repo description (URLs, a few settings, a bunch of cache directories consider). The origin of such a description is basically unknown to the downloader. It just tries to provide a consistent set of metadata based on the settings in the description. The purpose these data serve is also unknown. The 'system repos' are serialized repo descriptions. Repository actions (add/remove/enable/disable/rename) create/remove/modify these serialized descriptions. But you may also use cp, vi and rm. libzypp offers the 'system repos' descriptions to the application. But it's the application that picks/creates descriptions and passes them to the downloader according to it's needs. 'zypper --no-refresh' won't refresh any repo 'zypper --plus-repo' will refresh using a self created repo description 'zypper --plus-content' will also refresh disabled system repos If libzypp indicates a 'repo add' you should use the repo, but at that time only the serialized description exists. Your app won't get any data from the repo. However if libzypp indicates a 'refresh', it's not necessarily a repo that you want to use in your application. Can't you simply poll the list of currently active system repos and their current metadata path? ===[requires libzypp-bindings]=== #! /usr/bin/python import zypp for repo in zypp.RepoManager().knownRepositories(): if not repo.enabled(): continue print '%-40s %s' % ( repo.alias(), repo.metadataPath() ) ======== - not imported: import if metadata are already present (else e.g 'zypper ref') - imported: update (e.g. if metadata dir is newer than last import) - imported but not listed -> delete import (repo deleted/disabed). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c7
--- Comment #7 from Dominique Leuenberger
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c8
--- Comment #8 from Dominique Leuenberger
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c9
--- Comment #9 from Michael Andres
- once zypp signals that 'all repos are refreshed' (I hope I can get this?
As mentioned above, the applications usually take the repo descriptions one by one and pass it to zypp in order to refresh. Zypp knows that _a_ repo was refreshend but not when _all_ were processed. Is some zypp trigger required, or would gnome-software be able to execute the script at it's startup? Another issue we may need to solve if we respond to a libzypp trigger, is the fact that the refreshing zypp instance might hold locks which prevent the script (if running as root) from getting the data at that point in time.
Assuming the code extract above gives, as it indicates, the location where the metadata is stored, it should be rather simple... only question for me left at this moment:
- for rpm-md, I guess metadataPath() points to /var/cache/zypp/raw/<repo>/repodata (or to <repo>/?)
and for yast2? to /var/cache/zypp/raw/<repo>/ or somewhere deeper?
Metadata path is always the '/var/cache/zypp/raw/<repo>/' level. The files below metadata path are at the same location as they are on the media below repo URL: <metadatapath>/ *rpmmd* /repodata/repomd.xml ... *susetags* /content /suse/setup/descr/ ...
for type, i assume repo.type() would be the right thing to identify this as well.
Yes, but keep in mind that type is just a hint. Type is usually UNKNOWN until we probe the repo or we got the value from a serialized description. A known type does not imply metadata are available; UNKNOWN does not imply metadata are missing. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c10
--- Comment #10 from Dominique Leuenberger
(In reply to comment #7)
- once zypp signals that 'all repos are refreshed' (I hope I can get this?
As mentioned above, the applications usually take the repo descriptions one by one and pass it to zypp in order to refresh. Zypp knows that _a_ repo was refreshend but not when _all_ were processed.
Is some zypp trigger required, or would gnome-software be able to execute the script at it's startup?
g-s runs as user and does not have the needed permission to install meta-data to the required location (/usr/share/app-info)
Another issue we may need to solve if we respond to a libzypp trigger, is the fact that the refreshing zypp instance might hold locks which prevent the script (if running as root) from getting the data at that point in time.
Maybe we can work around this by a file being touched upon 'any' refresh and triggering the external script when the locks disappear (I'm sure zypp knows when it's no longer locked)
Assuming the code extract above gives, as it indicates, the location where the metadata is stored, it should be rather simple... only question for me left at this moment:
- for rpm-md, I guess metadataPath() points to /var/cache/zypp/raw/<repo>/repodata (or to <repo>/?)
and for yast2? to /var/cache/zypp/raw/<repo>/ or somewhere deeper?
Metadata path is always the '/var/cache/zypp/raw/<repo>/' level. The files below metadata path are at the same location as they are on the media below repo URL:
<metadatapath>/
*rpmmd* /repodata/repomd.xml ...
*susetags* /content /suse/setup/descr/ ...
for type, i assume repo.type() would be the right thing to identify this as well.
Yes, but keep in mind that type is just a hint. Type is usually UNKNOWN until we probe the repo or we got the value from a serialized description. A known type does not imply metadata are available; UNKNOWN does not imply metadata are missing.
repos that have metadata cached locally are the only ones we care for and those always have a valid type.... good enough -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c11
--- Comment #11 from Michael Andres
g-s runs as user and does not have the needed permission to install meta-data to the required location (/usr/share/app-info)
Then g-s uses PackageKit? Why not using PK for refreshing the appdata? AFAIK zypp_refresh_cache is the location that loops over the 'interesting' repos and refreshes their metadata. After the loop all repos are up-to-date. Isn't this exactly where you want to update the appdata? This way g-s should see the same applications PK is able to deliver. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c12
--- Comment #12 from Dominique Leuenberger
(In reply to comment #10)
g-s runs as user and does not have the needed permission to install meta-data to the required location (/usr/share/app-info)
Then g-s uses PackageKit? Why not using PK for refreshing the appdata?
g-s does... other similar software installers might or might not (appstream goes beyond PackageKit, see for example also listaller, using the same data set) Hence the actual goal to not only make PK work, but get a solution for the final thing. Additionally: if a user does zypper refresh, then PK uses the zypp internal refresh code and won't trigger refreshs anytime soon, thus putting a good risk that the meta data is different (and a forced refresh sounds like a performance penalty I'd like to avoid)
AFAIK zypp_refresh_cache is the location that loops over the 'interesting' repos and refreshes their metadata. After the loop all repos are up-to-date. Isn't this exactly where you want to update the appdata? This way g-s should see the same applications PK is able to deliver.
I will have another look here, to make sure we don't trigger this too often or risk of missing refreshes... but it will mean that any other tool might have to implement similar things to get such triggers to work too -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=866257
https://bugzilla.novell.com/show_bug.cgi?id=866257#c13
--- Comment #13 from Michael Andres
Hence the actual goal to not only make PK work, but get a solution for the final thing.
So back to the python snippet? The python snippet 'knows' about the system repos and it can feed the 'final thing'. Without performing a refresh by itself, it could check and sync the latest apdata state into the 'final thing' quite fast if there's nothing todo (and without need to care about any zypp lock). A 'repo refresh' - if performed - just tells you that something in the repo changed. I assume the appdata in a repo change far less frequently than the repos package data. So updating the 'final thing' with each repo refresh is probably superfluous. The python snippet could remember size/md5 sum of the appdata files it already fed, and feed only changed stuff/add new/remove outdated. If nothing has changed, there's not much to do. You could think about putting it into /etc/cron.hourly and it will pick up the latest state once an hour... ...while I'm looking for a place in libzypp to trigger the script. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=866257
--- Comment #15 from Dominique Leuenberger
participants (1)
-
bugzilla_noreply@novell.com