Bug 14366 - urpmi: when --noclean and --urpmi-root are both used, all installed packages should be stored in /var/cache/urpmi/rpms of the rooted system
Summary: urpmi: when --noclean and --urpmi-root are both used, all installed packages ...
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-25 09:19 CEST by Francis Moreau
Modified: 2014-12-10 13:04 CET (History)
2 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Francis Moreau 2014-10-25 09:19:48 CEST
Hi,

When installing a new mageia system in a chroot by using:

  $ urpmi --urpmi-root /chroot --noclean --auto basesystem

I expect to find all installed packages in /chroot/var/cache/urpmi/rpms since --noclean option is used.

However if a local media was used by urpmi during installation, packages coming from this local media are not kept and therefore /chroot/var/cache/urpmi/rpms is empty.

I understand this is probably done because packages coming from a local media are not downloaded before being installed and they can be retrieved on the system since the media is local but when --urpmi-root is used the second assumption is no longer true once the chrooted system is booted.

If --noclean is also used I think urpmi should consider this as "please keep all rpms you installed so I can reuse them later whatever will happen."

Also adding --no-install option makes the urpmi command a nop which seems weird.

Would it be possible to change this behaviour and make urpmi stored all installed packages even if they're part of a local media, at least when --noclean and --urpmi-root are both used ?

Thanks

Reproducible: 

Steps to Reproduce:
Comment 1 Thomas Backlund 2014-10-25 10:21:54 CEST
Since it's the host urpmi that is running, did you check if the rpms got stored in host /var/cache/urpmi/rpms

CC: (none) => tmb

Comment 2 Francis Moreau 2014-10-25 20:41:08 CEST
yes I did check and the packages weren't stored in /var/cache/urpmi/rpms, neither in the host nor in the chroot.

I would expect them to be stored in host /var/cache/urpmi/rpm if --root is used and in chroot /var/cache/urpmi/rpms if --urpmi-root is used though.
Manuel Hiebel 2014-11-01 22:17:56 CET

Assignee: bugsquad => thierry.vignaud

Comment 3 Francis Moreau 2014-12-10 11:39:38 CET
Could anybody take a look at this, that would be great !
Comment 4 Pascal Terjan 2014-12-10 11:48:30 CET
Yes this is working as intended.

--no-clean means to skip the code deleting temporary files, but if using a local media there are no temporary files so it has no effect.

It will never mean copy extra files.

CC: (none) => pterjan

Comment 5 Francis Moreau 2014-12-10 11:58:55 CET
According the man page, --noclean is not about temporary files but about keeping packages in a cache.

So if the user asks to keep them in the cache of the rootfs, I think urpmi should do that.

The local media is not local to the rooted/target system (created by --urpmi-root option), it's local only for the host system where the urpmi command has been issued. So if one wants to use the new created rootfs through a container for example then he has no way to access to the (host) local media anymore.

I tried to explain that in my initial request.
Comment 6 Pascal Terjan 2014-12-10 12:21:55 CET
Cache is a set temporary files.
Keep the cache means to not delete it.
It only applies when files are downloaded into the cache directory, which does not happen for local media as they are installed directly from the already local file.

You want to have urpmi copy files into the chroot, which is unrelated to not cleaning up the cache.
Comment 7 Thierry Vignaud 2014-12-10 12:22:31 CET
This is the cache of downloaded packages.

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Comment 8 Francis Moreau 2014-12-10 13:04:23 CET
(In reply to Pascal Terjan from comment #6)
> Cache is a set temporary files.

Then rename it into "temporary_directory" instead of "cache"..,

> Keep the cache means to not delete it.
> It only applies when files are downloaded into the cache directory, which
> does not happen for local media as they are installed directly from the
> already local file.

You should then clarify the documentation then since nothing mentions *downloaded* packages.

> You want to have urpmi copy files into the chroot, which is unrelated to not
> cleaning up the cache.

In my opinion, the primary use of the cache is to be able to reinstall packages that may not be available anymore. And they can be missing because you want to reinstall a previous version or because the media is not reachable anymore (and you can't assume that local media will be always present).

If there's another way to backup *all* installed packages in the target system, then fine, just teach me please. But then realize that your current cache becomes totally useless.

Note You need to log in before you can comment on or make changes to this bug.