Re: [PATCH 1/2] Deal with media only for media repo package failures (#573492)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/08/2010 03:53 AM, Radek Vykydal wrote:
> This should take care e.g. of the case when hd: or cdrom: repo
> and additional non-media repo is used and download of package from
> non-media repo fails which would lead to traceback.
> 
> The anacondaBaseURLs repo property is quite new in the repo code,
> so now we can take advantage of having it there.
> ---
>  yuminstall.py |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/yuminstall.py b/yuminstall.py
> index 2ada820..17cb2d1 100644
> --- a/yuminstall.py
> +++ b/yuminstall.py
> @@ -783,7 +783,7 @@ class AnacondaYum(YumSorter):
>                  continue
>  
>      def _handleFailure(self, package):
> -        if not self.isodir and self.currentMedia:
> +        if package.repo.anacondaBaseURLs[0].startswith("cdrom:"):
>              buttons = [_("Re_boot"), _("_Eject")]
>          else:
>              buttons = [_("Re_boot"), _("_Retry")]
> @@ -805,7 +805,7 @@ class AnacondaYum(YumSorter):
>              if os.path.exists(package.localPkg()):
>                  os.unlink(package.localPkg())
>  
> -            if not self.isodir and self.currentMedia:
> +            if package.repo.anacondaBaseURLs[0].startswith("cdrom:"):
>                  self._switchCD(self.currentMedia)
>              else:
>                  return
> @@ -816,12 +816,12 @@ class AnacondaYum(YumSorter):
>          # which mirror we were on when we started this particular download. 
>          # Whenever we have run out of mirrors the grabber's get/open/retrieve
>          # method will raise a URLGrabError exception with errno 256.
> -        grab = self.repos.getRepo(kwargs["repo"]).grab
> +        repo = self.repos.getRepo(kwargs["repo"])
>          log.warning("Failed to get %s from mirror %d/%d, "
> -                    "or downloaded file is corrupt" % (obj.url, grab._next + 1,
> -                                                       len(grab.mirrors)))
> +                    "or downloaded file is corrupt" % (obj.url, repo.grab._next + 1,
> +                                                       len(repo.grab.mirrors)))
>  
> -        if self.currentMedia:
> +        if repo.anacondaBaseURLs[0].startswith("cdrom:"):
>              dev = self.anaconda.storage.devicetree.getDeviceByName(self.anaconda.mediaDevice)
>              dev.format.mountpoint = self.tree
>              unmountCD(dev, self.anaconda.intf.messageWindow)


Is package.repo.anacondaBaseURLs a sufficient replacement for
self.currentMedia? Is it going to be initialized in the same situations?

Is [0] always going to be cdrom? It is a list, and I don't see anything
sorting it so couldn't cdrom appear anywhere in the list of URLs?

- -- 
Brian C. Lane <bcl@xxxxxxxxxx>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBS74aFBF+jBaO/jp/AQJf4wgAmz3Kd4gedxysiABIFPL0cl9alI+KLagj
bapsgeuSiji38rGw8U9HgdyoF/YVvHBDDtxNTrmNJ+qh6b2XpqLQEyksyCgp+qKx
xtZF84HDrXfSkWTyoA+q+cgfoPcTcaJZ7lmcVxsdxliFRXmVqaFfIup2xoT8g+ZC
3D03G2VlUnpBmTE1ObbmGm8R4SuOolVhOCzp9DhR8BN+s3Z9qVE9tUhLAEgkU2Rr
PvKT8YYtrfBYzK5NHNJcoWUm0zZV6uDUOqeQVDfE85iKQU8ydNPQ7urtEQTblQnJ
MN9WGXoFhOfgcFM7ray9ATjIi5C77kzTWR9WQcl55/VUlhFC/CWCdw==
=eHrP
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux