Bug 17765

Summary: Add an "obsoletes" command to mgarepo
Product: Mageia Reporter: papoteur <yvesbrungard>
Component: RPM PackagesAssignee: papoteur <yvesbrungard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: thierry.vignaud
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: mgarepo CVE:
Status comment:

Description papoteur 2016-02-14 16:59:33 CET
> $ svn mv svn+ssh://svn.mageia.org/svn/packages/cauldron/xemacs-ess
> svn+ssh://svn.mageia.org/svn/packages/obsolete/xemacs-ess

We should really add a "mgarepo obsoletes" command...

Referring to mga#11254

Is it only needed to have the command 
 svn mv svn+ssh://svn.mageia.org/svn/packages/<release>/<package> svn+ssh://svn.mageia.org/svn/packages/obsolete/<package>
?

Reproducible: 

Steps to Reproduce:
papoteur 2016-02-14 17:00:49 CET

CC: (none) => thierry.vignaud
Assignee: bugsquad => yves.brungard_mageia

Comment 1 Thierry Vignaud 2016-02-15 08:29:08 CET
I think so.

Though may also want to alter "mgarepo import" so that it first check if the package had already been imported & obsolted (in that case, we probably want to keep the existing history and not diverge much from previous spec file)
Comment 2 Rémi Verschelde 2016-02-16 10:59:26 CET
(In reply to papoteur from comment #0)
> Is it only needed to have the command 
>  svn mv svn+ssh://svn.mageia.org/svn/packages/<release>/<package>
> svn+ssh://svn.mageia.org/svn/packages/obsolete/<package>
> ?

Basically yes. It should also support the "-l" argument of svn mv to define the commit log directly:

mgarepo obsolete <package> -l 'dropping <package> as it cannot cook fries properly'

About the <release>, I guess cauldron could be hardcoded (maybe in a clever way so that if we're forked and cauldron renamed to "potaufeu", it's easily adapted), I don't think we can or should obsolete packages in updates/<release number>.
Comment 3 papoteur 2016-02-16 12:44:50 CET
OK, TV, I keep the idea for the import.
Barjac said that "obsoletes" command can be understood as doing the whole job of obsoleting, i.e. writing the Obsoletes commands in the related spec and so on. 

Thus, will a command "mv2obsol" or "mv2obsololete" be more accurate?

@Rémi
I will provide a -m option for the log message (as for ci).
And, yes, <release> will be cauldron as already hardcoded in layout.py.

I can also add an final output of the command suggested by pterjan:
 rpm -q --specfile SPECS/foo.spec --qf "Obsoletes: %{name} <= %{evr}\n"

This could help the packager to modify the spec of the new package or of task-obsoletes.
Comment 4 Rémi Verschelde 2016-02-16 12:53:11 CET
I think naming the command "mgarepo obsolete" (no "s") is fine enough, Barjac raises a good point but packagers should be familiar enough with the buildsystem to know what mgarepo does and doesn't. There are so far no mgarepo commands that I know that do edit spec files automatically, mgarepo only handles the SVN repo and binrepo in a convenient way.

And actually the act of obsoleting a package is most of the time not done in the package itself, but must be done in the other package that obsoletes it, so packagers would know expect mgarepo to find this new package by itself I hope :)

Having an output that gives a suggestion on how to obsolete is a good idea though.
Comment 5 Rémi Verschelde 2016-02-16 12:56:27 CET
For the output, it could be e.g.:

The package source was moved to the "obsolete" section of the SVN repo.
To actually obsolete existing binary packages, add those commands in the spec of the package that replaces the obsoleted package:
rpm -q --specfile SPECS/foo.spec --qf "Obsoletes: %{name} <= %{evr}\n"
rpm -q --specfile SPECS/foo.spec --qf "Provides: %{name}\n"
Comment 6 papoteur 2016-02-16 22:39:20 CET
Hello,
I pushed a release to include the "obsolete" command.
It has the -m option to put a log message.
Papoteur
Comment 7 papoteur 2017-04-14 22:43:14 CEST
Fixed long time ago

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

Comment 8 papoteur 2017-04-14 22:45:18 CEST
Fixed long time ago