RPM/Mash

De TartareFR
Aller à la navigation Aller à la recherche

Mash

Présentation

Mash est un outil qui interroge Koji à propos des derniers RPM créés pour un tag donné et qui créer un dépôt avec ces RPM, incluant leurs dépendances.

Installation

yum install mash

Configuration

Configuration générale de mash

Fichier <path>/etc/mash/mash.conf</path>

[defaults]
configdir = /etc/mash
buildhost = http://didier.b2pweb.com/kojihub
repodir = file:///mnt/koji
use_sqlite = True
use_repoview = False

Configuration du dépôt pour CentOS 5

Par défaut, mash créé une somme de vérification avec l'algorythme sha256, ce qui est incompatible avec CentOS 5. On doit donc lui préciser d'utiliser l'algorythme sha1 en lieu et place.

Fichier <path>/etc/mash/centos5.mash</path>

# mash config file

[5]
rpm_path = os/RPMS/%(arch)s/
repodata_path = os/RPMS/%(arch)s/
source_path = os/SRPMS
debuginfo = True
debuginfo_path = debug/%(arch)s/
multilib = True
multilib_method = devel
tag = centos-5
inherit = True
strict_keys = False
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9
repoviewurl = http://didier.b2pweb.com/repositories/
repoviewtitle = "CentOS 5 repository - %(arch)s"
arches = i386 x86_64
delta = True
# Change distro_tags as fedora-release version gets bumped
#distro_tags = cpe:/o:fedoraproject:fedora:17 rawhide
hash_packages = True
#make_ancient = True
hash = sha1
outputdir = /mnt/repositories/centos

Configuration du dépôt pour CentOS 6

Fichier <path>/etc/mash/centos6.mash</path>

[6]
rpm_path = os/RPMS/%(arch)s/
repodata_path = os/RPMS/%(arch)s/
source_path = os/SRPMS
debuginfo = True
debuginfo_path = debug/%(arch)s/
multilib = True
multilib_method = devel
tag = centos-6
inherit = True
strict_keys = False
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9
repoviewurl = http://didier.b2pweb.com/repositories/
repoviewtitle = "CentOS 6 repository - %(arch)s"
arches = i386 x86_64
delta = True
# Change distro_tags as fedora-release version gets bumped
#distro_tags = cpe:/o:fedoraproject:fedora:17 rawhide
hash_packages = True
outputdir = /mnt/repositories/centos

Configuration du dépôt pour fedora 17

Fichier <path>/etc/httpd/conf.d/mash.conf</path>

# mash config file

[17]
rpm_path = os/RPMS/%(arch)s/
repodata_path = os/RPMS/%(arch)s/
source_path = os/SRPMS
debuginfo = True
debuginfo_path = debug/%(arch)s/
multilib = True
multilib_method = devel
tag = fedora-17
inherit = True
strict_keys = False
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9
repoviewurl = http://didier.b2pweb.com/repositories/
repoviewtitle = "Fedora 17 repository - %(arch)s"
arches = i386 x86_64
delta = True
# Change distro_tags as fedora-release version gets bumped
#distro_tags = cpe:/o:fedoraproject:fedora:17 rawhide
hash_packages = True
outputdir = /mnt/repositories/fedora

Mise en place d'un alias

Le répertoire <path>/mnt/repositories</path> doit être accessible par HTTP. On ajoute donc un alias.

Fichier <path>/etc/httpd/conf.d/mash.conf</path>

Alias /repositories "/mnt/repositories"
<Directory "/mnt/repositories">
        Options Indexes
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

Lancement de l'outil

mash 5
mash 6

F.A.Q.

FaqQuestion.png
Erreur yum.Errors.RpmDBError: Package tuple could not be found in rpmdb
Cette erreur se rencontre après avoir mis à jour <package>yum</package>

Ce bug est répertorié chez RedHat[1]

La correction est triviale, Il faut appliquer le patch suivant au fichier <path>/usr/lib/python2.6/site-packages/yum/depsolve.py</path>( _checkFileRequires() caches the file requires of installed or to-be installed packages. Update it when removing packages in TS_INSTALL_STATES from transaction).[2]

diff -up a/depsolve.py b/depsolve.py
--- a/depsolve.py    2014-01-14 14:51:27.288392585 +0100
+++ b/depsolve.py.new        2014-01-14 14:51:17.683392467 +0100
@@ -808,6 +808,8 @@ class Depsolve(object):
                                     # Have to deal with loops!
                                     continue
                                 self.tsInfo.remove(otxmbr.pkgtup)
+                                ifr = self.installedFileRequires or {}
+                                ifr.pop(otxmbr.pkgtup, None)
                                 #  We need to remove an obsoleted entry that
                                 # was maybe used to resolve something ... ?
                                 CheckDeps = True

Références