Le 26/04/2012 11:38, Colin Guthrie a écrit :
'Twas brillig, and Thomas Backlund at 26/04/12 10:25 did gyre and gimble:
Guillaume Rousse skrev 26.4.2012 12:22:
Le 26/04/2012 11:20, Colin Guthrie a écrit :
'Twas brillig, and Thomas Backlund at 26/04/12 10:06 did gyre and
gimble:
Thierry Vignaud skrev 26.4.2012 11:46:

At install time, w/o proper requires/... you can't garanty that
rpm and thus the packages it requires may be installed after
the packages needing it for their %post scripts
=>     ERROR

At upgrade time, w/o proper versionaed requiresn you can't
garanty that rpm and thus the packages it requires wil be
updated before the packages needing it for their %post scripts
=>     ERROR

So all of theese packages need to be checked and possibly add:

Requires: rpm-helper>= 0.24.8-1

I think it should be Requires(post) and Requires(preun) if possible

Yeah, thats the needed ones.

(tho' someone with more rpm-foo can comment about that in particular).
You bascially cannot uninstall rpm-helper, so it's maybe not needed in
this case?

Not sure if that's something we can do with an automatic script
(find-requires), but it would certainly be nicer than adding it manually
all the time and they can just be bumped and rebuilt.
We can, that's a task for a spec-helper scriptlet.


So, anyone up for fixing spec-helper so we can start resubmitting the
packages that need fixing?

I've never played with any spec-helper stuff so I'd rather not do this,
but if no-one else steps up, I might be able to look tonight.
Actually, it's rather something for rpm-mageia-setup, which contains all other automatic dependencies handlers.

Here is a quick prototype, built to be easily extendable in the future for similar cases.
--
BOFH excuse #398:

Data for intranet got routed through the extranet and landed on the internet.
#!/usr/bin/perl

use strict;
use warnings;

my $version;

# Given a list of filenames on the command line or on stdin this
# script returns the rpm-helper minimal version needed to handle them

if (@ARGV) {
    foreach (@ARGV) {
        process_file($_);
    }
} else {
  # notice we are passed a list of filenames NOT as common in unix the
  # contents of the file.
    foreach (<>) {
        process_file($_);
    }
}

if ($version) {
    print "Requires(post): rpm-helper >= $version\n";
    print "Requires(preun): rpm-helper >= $version\n";

}

sub process_file {
    my ($file) = @_;

    return unless -f $file;
    return unless $file =~ m{/lib/systemd/system/\S+\.service$};

    $version = "0.24.8";
}

Reply via email to