delorie.com/riscv/rpm-install-latest.html
|
search
|
RPM Install Latest
dnf-reinstall
#!/bin/bash
TOP=/envy/dj/riscv/fedora/fedora-riscv-bootstrap/stage3-built-rpms/RPMS
dnf install \
--installroot=/mnt/stage3 \
--disablerepo='*' \
--forcearch=riscv64 \
--noautoremove \
--skip-broken \
--best \
`rpm-only-latest $TOP/*/*.rpm`
dnf-missings
#!/bin/bash
TOP=/envy/dj/riscv/fedora/fedora-riscv-bootstrap/stage3-built-rpms/RPMS
dnf install \
--installroot=/mnt/stage3 \
--disablerepo='*' \
--forcearch=riscv64 \
--noautoremove \
--best \
`rpm-only-latest $TOP/*/*.rpm` 2>&1 \
| grep 'nothing provides' \
| sed 's/needed by .*//' \
| sort -u
rpm-only-latest
#!/usr/bin/perl
# -*- perl -*-
# given a list of RPMs, print only the latest, removing any older
# version from the list where a newer version is also listed.
sub rpm2ver() {
my ($f) = @_;
my ($name, $nvr) = $f =~ m@(.*)-(.*-.*)\..*\.rpm@;
$nvr =~ s/([\d]+)/sprintf("%06d", $1)/ge;
if (!$latest{$name} || $latest{$name} lt $nvr) {
$latest{$name} = $nvr;
$package{$name} = $f;
}
}
for $i (@ARGV) {
&rpm2ver($i);
}
print join(' ', sort values %package);