« RPM/Mash » : différence entre les versions
| (8 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 2 : | Ligne 2 : | ||
== Présentation == | == Présentation == | ||
<app>Mash</app> est un outil qui interroge [[Koji|Koji]] afin d'obtenir les RPMs pour un tag donné et qui créer un dépôt directement utilisable avec ceux-ci. | |||
== Installation == | == Installation == | ||
| Ligne 13 : | Ligne 13 : | ||
Fichier <path>/etc/mash/mash.conf</path> | Fichier <path>/etc/mash/mash.conf</path> | ||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
[defaults] | [defaults] | ||
configdir = /etc/mash | configdir = /etc/mash | ||
buildhost = http:// | buildhost = http://koji.b2pweb.com/kojihub | ||
repodir = file:///mnt/koji | repodir = file:///mnt/koji | ||
use_sqlite = True | use_sqlite = True | ||
use_repoview = | use_repoview = True | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 39 : | Ligne 41 : | ||
tag = centos-5 | tag = centos-5 | ||
inherit = True | inherit = True | ||
strict_keys = | strict_keys = True | ||
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9 | keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9, 773DF357 | ||
repoviewurl = http:// | repoviewurl = http://koji.b2pweb.com/repositories/ | ||
repoviewtitle = "CentOS 5 repository - %(arch)s" | repoviewtitle = "CentOS 5 repository - %(arch)s" | ||
arches = i386 x86_64 | arches = i386 x86_64 | ||
| Ligne 47 : | Ligne 49 : | ||
# Change distro_tags as fedora-release version gets bumped | # Change distro_tags as fedora-release version gets bumped | ||
#distro_tags = cpe:/o:fedoraproject:fedora:17 rawhide | #distro_tags = cpe:/o:fedoraproject:fedora:17 rawhide | ||
distro_tags = cpe:/o:centos:centos:5 centos-5 | |||
hash_packages = True | hash_packages = True | ||
#make_ancient = True | #make_ancient = True | ||
hash = sha1 | hash = sha1 | ||
outputdir = /mnt/ | outputdir = /mnt/repos/centos | ||
# This forces to also create older version of same package | |||
latest = False | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 58 : | Ligne 63 : | ||
Fichier <path>/etc/mash/centos6.mash</path> | Fichier <path>/etc/mash/centos6.mash</path> | ||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
# mash config file | |||
[6] | [6] | ||
rpm_path = os/RPMS/%(arch)s/ | rpm_path = os/RPMS/%(arch)s/ | ||
| Ligne 68 : | Ligne 75 : | ||
tag = centos-6 | tag = centos-6 | ||
inherit = True | inherit = True | ||
strict_keys = | strict_keys = True | ||
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9 | keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9, D3F3C56A | ||
repoviewurl = http:// | repoviewurl = http://koji.b2pweb.com/repositories/ | ||
repoviewtitle = "CentOS 6 repository - %(arch)s" | repoviewtitle = "CentOS 6 repository - %(arch)s" | ||
arches = i386 x86_64 | arches = i386 x86_64 | ||
delta = True | delta = True | ||
# Change distro_tags as fedora-release version gets bumped | # Change distro_tags as fedora-release version gets bumped | ||
distro_tags = cpe:/o:centos:centos:6 centos-6 | |||
hash_packages = True | hash_packages = True | ||
outputdir = /mnt/ | outputdir = /mnt/repos/centos | ||
# This forces to also create older version of same package | |||
latest = False | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Configuration du dépôt pour fedora | === Configuration du dépôt pour fedora 20 === | ||
Fichier <path>/etc/ | Le fichier existe déjà (installé en même temps que <app>mash</app>). Seul la version de fedora s'incrémente au fur et à mesure des sorties de la distribution. | ||
Fichier <path>/etc/mash/branched.mash</path> | |||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
# mash config file | # mash config file | ||
[ | [20] | ||
rpm_path = os/RPMS/%(arch)s/ | rpm_path = os/RPMS/%(arch)s/ | ||
repodata_path = os/RPMS/%(arch)s/ | repodata_path = os/RPMS/%(arch)s/ | ||
| Ligne 94 : | Ligne 106 : | ||
multilib = True | multilib = True | ||
multilib_method = devel | multilib_method = devel | ||
tag = fedora- | tag = fedora-20 | ||
inherit = True | inherit = True | ||
strict_keys = | strict_keys = True | ||
keys = | keys = 246110C1 | ||
repoviewurl = http:// | repoviewurl = http://koji.b2pweb.com/repositories/ | ||
repoviewtitle = "Fedora | repoviewtitle = "Fedora 20 repository - %(arch)s" | ||
arches = i386 x86_64 | arches = i386 x86_64 | ||
delta = True | delta = True | ||
max_delta_rpm_size = 800000000 | |||
# Change distro_tags as fedora-release version gets bumped | # Change distro_tags as fedora-release version gets bumped | ||
distro_tags = cpe:/o:fedoraproject:fedora:20 Null | |||
hash_packages = True | hash_packages = True | ||
outputdir = /mnt/repositories/fedora | outputdir = /mnt/repositories/fedora | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 120 : | Ligne 134 : | ||
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
Options +Indexes | |||
AllowOverride None | |||
<IfModule mod_authz_core.c> | |||
# Apache 2.4 | |||
Require all granted | |||
</IfModule> | |||
<IfModule !mod_authz_core.c> | |||
# Apache 2.2 | |||
Order allow,deny | |||
Allow from all | |||
</IfModule> | |||
</Directory> | </Directory> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Lancement de l'outil == | == Lancement de l'outil == | ||
=== Setup initial === | |||
On va simplement créé l'arborescence nécessaire | |||
<syntaxhighlight lang="bash">mkdir /mnt/repos/{fedora,centos}</syntaxhighlight> | |||
=== Création des dépôts === | |||
Création du dépôt pour CentOS 5 | |||
<syntaxhighlight lang="bash">mash 5</syntaxhighlight> | |||
Création du dépôt pour CentOS 6 | |||
<syntaxhighlight lang="bash">mash 6</syntaxhighlight> | |||
Création du dépôt pour Fedora 20 | |||
<syntaxhighlight lang="bash">mash 20</syntaxhighlight> | |||
== F.A.Q. == | |||
{{Admon/faq|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<ref>https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=920758</ref> | |||
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).<ref>http://lists.baseurl.org/pipermail/yum-devel/2013-March/010022.html</ref> | |||
<syntaxhighlight lang="diff"> | |||
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 | |||
</syntaxhighlight> | |||
}} | |||
== Références == | |||
<references/> | |||
[[Catégorie:RPM]] | [[Catégorie:RPM]] | ||
[[Catégorie:Koji]] | [[Catégorie:Koji]] | ||
[[Catégorie:Server]] | [[Catégorie:Server]] | ||
Dernière version du 15 janvier 2014 à 09:16
Mash
Présentation
<app>Mash</app> est un outil qui interroge Koji afin d'obtenir les RPMs pour un tag donné et qui créer un dépôt directement utilisable avec ceux-ci.
Installation
yum install mash
Configuration
Configuration générale de mash
Fichier <path>/etc/mash/mash.conf</path>
[defaults]
configdir = /etc/mash
buildhost = http://koji.b2pweb.com/kojihub
repodir = file:///mnt/koji
use_sqlite = True
use_repoview = True
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 = True
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9, 773DF357
repoviewurl = http://koji.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
distro_tags = cpe:/o:centos:centos:5 centos-5
hash_packages = True
#make_ancient = True
hash = sha1
outputdir = /mnt/repos/centos
# This forces to also create older version of same package
latest = False
Configuration du dépôt pour CentOS 6
Fichier <path>/etc/mash/centos6.mash</path>
# mash config file
[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 = True
keys = 22B3B81A, 1ACA3465, A82BA4B7, 069C8460, 97A1071F, E8E40FDE, 57BBCCBA, D22E77F2, 4EBFC273, 0B86274E, 6DF2196F, DF9B0AE9, D3F3C56A
repoviewurl = http://koji.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:centos:centos:6 centos-6
hash_packages = True
outputdir = /mnt/repos/centos
# This forces to also create older version of same package
latest = False
Configuration du dépôt pour fedora 20
Le fichier existe déjà (installé en même temps que <app>mash</app>). Seul la version de fedora s'incrémente au fur et à mesure des sorties de la distribution.
Fichier <path>/etc/mash/branched.mash</path>
# mash config file
[20]
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-20
inherit = True
strict_keys = True
keys = 246110C1
repoviewurl = http://koji.b2pweb.com/repositories/
repoviewtitle = "Fedora 20 repository - %(arch)s"
arches = i386 x86_64
delta = True
max_delta_rpm_size = 800000000
# Change distro_tags as fedora-release version gets bumped
distro_tags = cpe:/o:fedoraproject:fedora:20 Null
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
Options +Indexes
AllowOverride None
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
</IfModule>
</Directory>
Lancement de l'outil
Setup initial
On va simplement créé l'arborescence nécessaire
mkdir /mnt/repos/{fedora,centos}
Création des dépôts
Création du dépôt pour CentOS 5
mash 5
Création du dépôt pour CentOS 6
mash 6
Création du dépôt pour Fedora 20
mash 20
F.A.Q.
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