C implementation of createrepo

Run createrepo -h for usage syntax.


Devel tips


Package build requires - Pkg name in Fedora/Ubuntu:

From your checkout dir:

mkdir build
cd build/
cmake ..

To build the documentation, from the build/ directory: make doc

Note: For build with debugging symbols you could use (from the build/ directory):


Building from an rpm checkout

E.g. when you want to try weak and rich dependencies.

cmake -DRPM_PATH="/home/tmlcoch/git/rpm" .. && make

Note: The RPM must be buit in that directory

Commands I am using for building of RPM:

cd /home/tmlcoch/git/rpm
CPPFLAGS='-I/usr/include/nss3/ -I/usr/include/nspr4/' ./ --rpmconfigure --with-vendor=redhat --with-external-db --with-lua --with-selinux --with-cap --with-acl --enable-python
make clean && make

Building with delta rpm support (drpm)

At first, you have to checkout drpm library from the and build it.

git clone ssh://
cd drpm/

Then run cmake for createrepo_c with param -DDRPM_PATH="/home/tmlcoch/git/drpm" where the path is path to your build of drpm library.

cmake -DDRPM_PATH="/home/tmlcoch/git/drpm" .. && make

Building for a different Python version

By default, cmake should set up things to build for Python 2, but you can do a build for Python 3 like this:


Build tarball

utils/ [git revision]

Without git revision specified HEAD is used.

Build RPM package

Modify createrepo_c.spec and run:


Note: Current .spec for Fedora rawhide


All unit tests run from librepo checkout dir

Build C tests && run c and python tests

make tests && make test

Note: For a verbose output of testing use: make ARGS="-V" test

Run only C unittests (from your checkout dir):


Note: The C tests have to be builded by make tests)!

Run only Python unittests (from your checkout dir):

PYTHONPATH=`readlink -f ./build/src/python/` nosetests -s tests/python/tests/



Important notes

In original createrepo sha is a nickname for the sha1 checksum. Createrepo_c mimics this behaviour.

Differences in behavior between createrepo_c and createrepo

Checksums after update

Use case:

createrepo_c result:

original createrepo result:

Skip symlinks param

Use case:

createrepo_c result:

original createrepo result:

Base path from update-md-path repo

Use case:

createrepo_c results:

original createrepo result:

Crippled paths in filelists.xml after update

Use case:

createrepo_c results:

original createrepo result:

--update leaves behind some old repodata files

Use case:

createrepo_c results:

original createrepo result:


Modifyrepo_c is compatible with classical Modifyrepo except some misbehaviour:

Batch file

When there is need to do several modification to repository (repomd.xml) a batch file could be used.

Batch file is Modifyrepo_c specific. It is not supported by the classical Modifyrepo - at least not yet.


# Add:
#   [<path/to/file>]
#   <options>

# Metadata that use a bunch of config options

# Metadata that use default settings

# Remove:
#   [<metadata name>]
#   remove=true


Supported options

Option name Description Supported value(s) Default
path Path to the file. When specified it override the path specified in group name (name between [] parenthesis) Any string group name (string between '[' ']')
type Type of the metadata Any string Based on filename
remove Remove specified file/type from repodata true or false false
compress Compress the new metadata before adding it to repo true or false true
compress-type Compression format to use gz, bz2, xz gz
checksum Checksum type to use md5, sha, sha1, sha224, sha256, sha384, sha512 sha256
unique-md-filenames Include the file's checksum in the filename true or false true
new-name New name for the file. If compress is true, then compression suffix will be appended. If unique-md-filenames is true, then checksum will be prepended. Any string Original source filename