Wednesday, February 20, 2013

local yum repository for koji builds

It takes days to see new packages on the official Fedora update-testing mirrors, and I'm so impatient... And sometimes it's necessary to test unofficial builds. The solution is pretty simple with "koji download-build" command.

Let's create a /usr/local/bin/local-repo script:
  #!/bin/bash
  REPODIR=/tmp/local-repo

  mkdir -p $REPODIR
  koji download-build $1
  createrepo -d .
And local repository config file /etc/yum.repos.d/local-updates-testing.repo
  [local-updates-testing]
  name=Local $releasever - $basearch - Test Updates
  failovermethod=priority
  baseurl=file:///tmp/local-repo/
  enabled=0
  gpgcheck=0
  metadata_expire=10
Now if you want to download the latest package:
  # local-repo pkgname-ver-rel
  # yum --enablerepo=local-updates-testing update
Note that if you want to use the repository for something large than /tmp is probably not the best place :-)

No comments:

Post a Comment