Issue248

Project smart
Title smart doesn't recognize reconfig.urpmi files
Priority bug Status resolved
Superseder Nosy List misc, netmask, twofish
Assigned To netmask Topics

Created on 2006-11-13.04:04:04 by twofish, last changed 2006-12-04.14:55:35 by netmask.

Files
File name Uploaded Type Edit Remove
smart-reconfig-urpmi-2.patch netmask, 2006-11-22.12:22:54 text/x-patch
smat-reconfig-urpmi-1.patch netmask, 2006-11-21.17:44:04 text/x-patch
Messages
msg1009 (view) Author: netmask Date: 2006-12-04.14:55:35
Even though nobody posted any positive or negative reviews, my tests show it's ok.

The last patch has been applied on SVN trunk r836.
msg976 (view) Author: netmask Date: 2006-11-22.12:22:54
smart-reconfig-urpmi-2.patch
This is my proposal for the final solution to this problem. After the first
reading of reconfig.urpmi it changes permanently the channel 'baseurl'. The
recursion also works, i.e. it will look for reconfig.urpmi in each executed
reconfig, allowing for (possibly) unlimited recursion and (proably) completely
URL rewriting.

Please test before I commit into trunk. Thanks.
msg974 (view) Author: misc Date: 2006-11-21.20:35:47
a) changes are permanent.

b) i think this take only the first one, but it will take the second on second
run, etc, etc.
msg970 (view) Author: netmask Date: 2006-11-21.17:44:04
I'm sending a simple patch that should be considered 1st-try-only. I still need
to clarify some points in order to provide the final patch.

a) Does the original urpmi code changes the base url permanently on the config,
or does it read the reconfig.urpmi every time it needs to fetch something?

b) Is it possible to exist more than one reconfig.urpmi? I mean, if 'a'
redirects to 'a/b' then it have another redirection to 'a/b/c', or is this
redirection one-time-only?

While these questions are being clarified, I would like to ask anyone interested
to test the attached patch (smat-reconfig-urpmi-1.patch).
msg925 (view) Author: misc Date: 2006-11-14.17:44:42
Afaik, I just added the code to parse synthesis hdlist, and the rest of the 
code was already here. I have also added some patch, but nothing big.

A urpmi.reconfig file is a way to reconfigure urpmi url, when someone decide 
to change the mirror structure, for whatever reason ( it happened for plf and 
mandriva, for more logical support of arch, etc ).
Here is a sample file, found on 
ftp://ftp.free.fr/mirrors/plf.zarb.org/mandriva/free/2006.0/reconfig.urpmi  :

# this is an urpmi reconfiguration file
/2006.0 /2006.0/$ARCH

The first line is a "marker", to recognize the file type. It has to be here to 
be a valid file. 

The second line ( and the other, if any ) is just used for regexp based 
replacement :
search /2006.0,
replace by /2006.0/$ARCH

It is a perl based regexp :
if ($medium->{$k} =~ s/$r->[0]/$r->[1]/) {

Basically, it split the line, using space, and take the first word for search, 
the secund for replace.

You can add two flags L and N as a third word, but they were not used for the 
moment. Comment in the source code speak of mod_rewrite, so I guess L stand 
for Last, but I do not understand what N does. 

The $ARCH part is escaped and not important for this bug report, but you can 
see this mail for explanation ( 
http://archives.mandrivalinux.com/cooker/2005-02/msg02853.php ), as it will 
also cause problem in case of automated rewrite ( and is likely to require 
more work to have a complete support )

The code for this can be found in urpm.pm, function reconfig_urpmi. The mail 
announcing the change for plf can be found on 
https://www.zarb.org/pipermail/plf-discuss/2006-April/003911.html, you can see 
a test run and the effect on url.

I fear I cannot devote much time on this issue for the moment, even if the 
feature is not complex to add by itself. 

Real problems would come from keyword expansion, and how to use this as a 
general method for every source. 

Given the fact that we used this feature in the past one or two times, it 
would surely benefit to every type of repository to be able to do the same
msg924 (view) Author: netmask Date: 2006-11-14.17:14:38
The original contributor that added the urpmi code is Michael Scherer from
Mandriva. The issue is being assigned to him.

Meanwhile, could you please provide a description of what this file does and
maybe point out some doc about it? Maybe we could help with temporary fixes
until Michael confirms the correct one.
msg923 (view) Author: twofish Date: 2006-11-13.04:04:03
smart doesn't recognize reconfig.urpmi files which causes problems with
easyurpmi and the plf repositories
History
Date User Action Args
2006-12-04 14:55:38netmasksetstatus: testing -> resolved
messages: + msg1009
2006-11-22 12:22:55netmasksetfiles: + smart-reconfig-urpmi-2.patch
messages: + msg976
2006-11-21 20:35:48miscsetmessages: + msg974
2006-11-21 17:44:05netmasksetstatus: need-info -> testing
files: + smat-reconfig-urpmi-1.patch
messages: + msg970
assignedto: misc -> netmask
2006-11-14 17:44:43miscsetnosy: misc, twofish, netmask
messages: + msg925
2006-11-14 17:14:42netmasksetstatus: unread -> need-info
assignedto: misc
messages: + msg924
nosy: + misc, netmask
2006-11-13 04:04:05twofishcreate