fedora-review(1) - Linux man page

Name

fedora-review - Automatically review RPM packages for Fedora.

Synopsis

fedora-review [options] [bugzilla options] -b <bug>
fedora-review [options] [--prebuilt] -n <package name>
fedora-review [options] [--prebuilt] -rn <srpm path>
fedora-review [options] -u <url>

Description

This tool makes reviews of rpm packages for Fedora easier. It tries to automate most of the process. Through a bash API the checks can be extended in any programming language and for any programming language. We have at the moment checks for C/C++, R, Java and Perl packages.

Usage

The program runs a number of checks for packages in Fedora, producing a customized review template.
$ fedora-review -b <bug number>

$ fedora-review -u <url>

Will download the SPEC & SRPM files from the Bugzilla report, build them in mock, run a number of tests and generate a template.

Not all bugzillas support the -b option. The -u option only allows for downloads and is not as reliable as -b, but works in many cases. See --url usage notes below.

$ fedora-review -n <package name>

This alternative usage expects <package name>.spec and source rpm in current directory. By adding the -p switch, fedora-review uses already built rpms in current directory instead of building using mock.

$ fedora-review --rpm-spec -n <srpm path>

This form accepts a single path to a source rpm. It uses the specfile bundled in the srpm package.

You will need to have mock installed and be member of the mock group for the build to work. Run as root:

# usermod -a -G mock [your user name]

After this, you will need to logout and login again (or use newgrp(1)) - the changes in user's group list is not read until a new login.

MODE OPTIONS - one is required

-b, --bug <bug nr>
Run against Fedora bugzilla at bugzilla.redhat.com, using the bugzilla bug number
-n, --name <name>
Runs the checks against the named spec and source rpm located in the current working directory. The files are expected to have the names <name>.spec and <name>*.src.rpm. When used together with --rpm-spec/-r, name can also be a complete path to a source rpm.
-u url, --url <url>
Fetch data from given url, typically another bugzilla instance without xmlrpc support such as rpmfusion. For more modern sites with xmlrpc support, first try --bug <bug nr> --other-bz <url>. The option tries to retrieve the URL:s by scanning the page. As for --bug links has to end with '.src.rpm' and '.spec' to be found.
-d, --display-checks
List all available checks, usable as arguments to --exclude and --single
-f, --display-flags
List all available flags, usable as arguments to --define or -D.
-V, --version
Show version info

General Options

-B, --no-colors
Disable use of ansi colors in console output.
-c, --cache
Do not redownload the files from bugzilla or upstream, use the local ones from previous run instead.
-D, --define <flag[=value]>
Define a flag e. g., EPEL5. A flag can either just be activated using flag or set to a value using flag=value. --display-flags shows available flags.
-k, --checksum <md5|sha1|sha224|sha256|sha384|sha512>
Algorithm used for checksum.
-m, --mock-config <configuration>
Specify which mock config to use, one of the files in /etc/mock, with the .cfg suffix stripped. Defaults to the root defined in /etc/mock/default.cfg
-o, --mock-options "options..."
Mock options the build. Defaults to --no-cleanup-after, you might want this along with other options you provide.
--no-report
Do not generate the review report.
--no-build
Do not rebuild or install the source rpm, instead use the last installed package available in mock. Implies --cache.
--other_bz
Url of alternative bugzilla, instead of using default https://bugzilla.redhat.com
-p, --prebuilt
When using -n <name>, use prebuilt rpms in current directory instead of building new ones in mock
-r, --rpm-spec
Instead of using a spec file URL, use the spec file bundled in the srpm file.
-s test, --single test
Run a single test, as listed by --display-checks
-v, --verbose
Provides a more detailed output of what's going on.
-x "test1, test2, ...", --exclude "test1, test2, ..."
Comma-separated list of test(s) to exclude, as listed by --display-checks. A test which depends on an excluded test, will run.

the Review Directory

The report template create by fedora-review lives in a review directory. Besides the report, here is:
srpm directory
Holds whats downloaded, normally a src.rpm and a spec file. When using --rpm-spec, here is no .spec file.
srpm-unpacked directory
Holds the unpacked content of the src.rpm file.
upstream directory
contains sources downloaded from the Source: url in the spec file.
upstream-unpacked directory
Occasionally contains the unpacked sources, but is normally empty.
BUILD link
Points to the mock directory containing the sources used in the build. These sources have been created and modifified by the %prep stuff in the spec file. The link is only valid direct after the run, it's overwritten next time mock executes.
results directory
Contains the result from the build, logs and rpm packages.

Local Sources (git-based or Similar)

Normally, the Source0 (or others SourceX) in the specfile contains an URL to the upstream source. fedora-review uses this url to download the upstream source and then compare md5sum with source in rpm.

However, in some cases the Source0: is just a filename e. g., when sources are generated from git, svn or similar tools. In these cases, fedora-review will look for a file matching the Source0 in current directory. If it exists, it's used as upstream source. This way, a reviewer can generate the source according the comments in the spec before running fedora-review and then have it checked.

Using Koji Scratch Builds

It's possible to use koji to build packages instead of mock when using fedora-review. The basic idea is to run a koji scratch build, download the built packages and invoke fedora-review on these. This workflow uses the --prebuilt option, and has some limitations on checks performed since fedora-review cannot access the build directories.

The workflow: