[packagekit] Network Status and Repository accessibility
hughsient at gmail.com
Wed Jul 2 01:05:09 PDT 2008
On Wed, 2008-07-02 at 14:37 +0800, Tick Chen wrote:
> Hi List,
> About the pk_xxx_get_network_status only detects if the system have IP or Route.
> Either in with NM path and Unix path. That means the system *may* access
> to the network, but it does not imply the system actually can get
> refresh/install/update... from the repository.
Right, it's a check for "has the user a half decent connection" rather
than has the user got a connection that can connect to the internet.
> For example, if the system does not set DNS server well, packagekitd
> will detect the system is online but some repository in which only used
> domain name will be hard to access. Packagekitd cannot detect that.
Right, the daemon can't, but the backend can. For instance, when the yum
backend attempts to connect to redhat.com when I'm not using my vpn then
the network checks pass, but the backend returns a
PK_ERROR_ENUM_NO_NETWORK error enum.
> Is there are any easy way to detect the actual accessibility of repository?
> What come up to me is actually trying to access the repository.
> Try to get an arbitrary file from the repository, and to see if there are any error from the server or just cannot access to the server.
Yup, that's best.
> Here I have some questions:
> 1. Is Network Status enough for packagekit?
> 2. Is repository accessibility the real thing the package manager cares
> 3. Is this shall be done in packagekit? Or it shall be done in backends?
> In my option, I think that is what backends care about.
Yes, the NM and unix check are just sanity checks so we don't try to
even schedule an action until the network is up. I certainly don't think
the daemon should be pinging anything, but this is fine in the backend
-- we can even make a bool=pk_backend_ping_host() helper if you wish.
More information about the PackageKit