[Mageia-dev] [soft-commits] [5686] For non-local media, iurt is suppressing the urpmi. cfg file while creating

Thierry Vignaud thierry.vignaud at gmail.com
Wed Sep 5 18:05:54 CEST 2012


On 5 September 2012 17:11,  <root at mageia.org> wrote:
> Revision 5686 Author rtp Date 2012-09-05 17:11:26 +0200 (Wed, 05 Sep 2012)
>
> Log Message
>
> For non-local media, iurt is suppressing the urpmi.cfg file while creating
> the chroot.

Wrong, it's always removed

> This has the side effect of forcing people to use things like
> --chrooted-urpmi even if the iurt configuration is fine (since it managed
> to create the chroot). So, add media while creating the build chroot for
> non-local media, as long as --chrooted-urpmi has not been used.

Anyway this is insane IMHO: new logic is:
- add media
- install pkgs
- remove media
- readd media

Either you should use --chrooted-urpmi (instead of re-implementing it)
or you should just not remove the media in the first place when using
use__urpmi_root,
aka if using remote media

> --- build_system/iurt/trunk/lib/Iurt/Chroot.pm	2012-09-05 15:07:40 UTC (rev
> 5685)
> +++ build_system/iurt/trunk/lib/Iurt/Chroot.pm	2012-09-05 15:11:26 UTC (rev
> 5686)
> @@ -300,11 +300,23 @@
>
>  sub create_build_chroot {
>      my ($chroot, $chroot_ref, $run, $config) = @_;
> +    my $ret = 0;
>      if ($run->{storage} eq 'btrfs') {

this is perl, no need to initialize to 0.

> -        return create_build_chroot_btrfs($chroot, $chroot_ref, $run,
> $config);
> +        $ret = create_build_chroot_btrfs($chroot, $chroot_ref, $run,
> $config);
>      } else {
> -        return create_build_chroot_tar($chroot, $chroot_ref, $run,
> $config);
> +        $ret = create_build_chroot_tar($chroot, $chroot_ref, $run,
> $config);
>      }
> +
> +    if ($ret) {
> +        my $urpmi = $run->{urpmi};
> +        if ($urpmi->{use__urpmi_root} && !$run->{chrooted_urpmi}) {
> +	    if (!$urpmi->add_media__urpmi_root($chroot, $config->{base_media})) {
> +	        plog('ERROR', "urpmi.addmedia --urpmi-root failed");
> +	        return;
> +	    }
> +        }
> +    }
> +    return $ret;
>  }
>
>  sub create_build_chroot_tar {


More information about the Mageia-dev mailing list