tools/git-buildpackage.git
9 years agopq-rpm: better error message
Markus Lehtonen [Thu, 4 Sep 2014 12:00:28 +0000 (15:00 +0300)]
pq-rpm: better error message

Change-Id: Iaadc614e9ed5df2e943eed71511559d0b76e0227
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoreadme: we do have manpages for rpm tools
Markus Lehtonen [Mon, 1 Sep 2014 13:10:52 +0000 (16:10 +0300)]
readme: we do have manpages for rpm tools

Change-Id: Ieeeb5dde264d220d4d457e077325c232bd3ec326
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: rebase on top of upstream version 0.6.22
Markus Lehtonen [Fri, 14 Nov 2014 12:08:58 +0000 (14:08 +0200)]
packaging: rebase on top of upstream version 0.6.22

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoTizen release 0.6.15-20140828
Markus Lehtonen [Thu, 5 Jun 2014 10:56:16 +0000 (13:56 +0300)]
Tizen release 0.6.15-20140828

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoAdd PKGBUILD to support arch linux
Junchun Guan [Wed, 16 Jul 2014 03:28:29 +0000 (11:28 +0800)]
Add PKGBUILD to support arch linux

Three split packages: git-buildpackage-{common,rpm,doc}

Signed-off-by: Junchun Guan <junchunx.guan@intel.com>
9 years agorpm tests: add unit tests for buildpackage-rpm
Markus Lehtonen [Fri, 18 Jul 2014 13:18:58 +0000 (16:18 +0300)]
rpm tests: add unit tests for buildpackage-rpm

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: fix one error message
Markus Lehtonen [Wed, 16 Jul 2014 19:13:29 +0000 (22:13 +0300)]
buildpackage-rpm: fix one error message

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: drop unneeded exception
Markus Lehtonen [Wed, 16 Jul 2014 14:16:48 +0000 (17:16 +0300)]
buildpackage-rpm: drop unneeded exception

We will never get here as parse_spec() always returns GbpError.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: handle invalid keys in orig prefix
Markus Lehtonen [Wed, 16 Jul 2014 14:15:44 +0000 (17:15 +0300)]
buildpackage-rpm: handle invalid keys in orig prefix

Gracefully handle invalid keys in the --git-orig-prefix format string.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: minor refactor
Markus Lehtonen [Wed, 16 Jul 2014 14:15:03 +0000 (17:15 +0300)]
buildpackage-rpm: minor refactor

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: get rid of prepare_export_dir()
Markus Lehtonen [Tue, 15 Jul 2014 10:45:06 +0000 (13:45 +0300)]
buildpackage-rpm: get rid of prepare_export_dir()

No need to mangle the export directory.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: remove some outdated/unnecessary exception handling
Markus Lehtonen [Mon, 14 Jul 2014 07:41:36 +0000 (10:41 +0300)]
buildpackage-rpm: remove some outdated/unnecessary exception handling

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: add '--git-native' option
Markus Lehtonen [Tue, 15 Jul 2014 11:54:44 +0000 (14:54 +0300)]
buildpackage-rpm: add '--git-native' option

Can be used to explicitly configure a package as native or non-native.
Default behavior is still to guess based on the existence of upstream
branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: remove some unused variables
Markus Lehtonen [Mon, 21 Jul 2014 12:57:57 +0000 (12:57 +0000)]
buildpackage-rpm: remove some unused variables

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: add missing docstrings
Markus Lehtonen [Mon, 21 Jul 2014 12:39:12 +0000 (12:39 +0000)]
buildpackage-rpm: add missing docstrings

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: remove unused imports
Markus Lehtonen [Mon, 21 Jul 2014 12:29:36 +0000 (12:29 +0000)]
buildpackage-rpm: remove unused imports

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm tests: update component test data
Markus Lehtonen [Fri, 18 Jul 2014 12:48:29 +0000 (15:48 +0300)]
rpm tests: update component test data

Adds pq/devel branch and .gitignore file to gbp-test package.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm tests: remove RepoManifest.add_project()
Markus Lehtonen [Tue, 10 Jun 2014 13:20:02 +0000 (16:20 +0300)]
rpm tests: remove RepoManifest.add_project()

This functionality is moved to the rpm testdata submodule.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: remove too general exception catching
Markus Lehtonen [Fri, 11 Jul 2014 12:41:45 +0000 (15:41 +0300)]
buildpackage-rpm: remove too general exception catching

There should be no reason to catch general Exception here.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: don't crash on invalid vcs format strings
Markus Lehtonen [Fri, 11 Jul 2014 12:40:59 +0000 (15:40 +0300)]
buildpackage-rpm: don't crash on invalid vcs format strings

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: add --git-no-build option
Markus Lehtonen [Fri, 11 Jul 2014 12:23:19 +0000 (15:23 +0300)]
buildpackage-rpm: add --git-no-build option

Replaces and deprecates --git-export-only. The new option name is way
better in line with the other option names.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage_rpm: always run cleaner hook
Markus Lehtonen [Mon, 30 Jun 2014 14:46:41 +0000 (17:46 +0300)]
buildpackage_rpm: always run cleaner hook

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage_rpm: fix crash when running prebuild hook
Markus Lehtonen [Mon, 30 Jun 2014 14:12:48 +0000 (17:12 +0300)]
buildpackage_rpm: fix crash when running prebuild hook

GitRepository.git_dir is not callable.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage_rpm: check submodules from the exported treeish
Markus Lehtonen [Fri, 27 Jun 2014 05:42:33 +0000 (08:42 +0300)]
buildpackage_rpm: check submodules from the exported treeish

And not from the current working copy.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: always create tarball for native packages
Markus Lehtonen [Fri, 13 Jun 2014 10:31:48 +0000 (13:31 +0300)]
buildpackage-rpm: always create tarball for native packages

If the package is native, always (re-)create the source tarball, even if
--git-no-create-orig is used. Not creating the tarball does not make
much sense (and most probably just causes problems and confusion): for
native packages there is no place for external tarball and no patches so
we need to always have the correct sources (i.e. the exported revision)
in the tarball.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: fix exit code in case of GitRepositoryError
Markus Lehtonen [Thu, 12 Jun 2014 12:42:21 +0000 (15:42 +0300)]
buildpackage-rpm: fix exit code in case of GitRepositoryError

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: implement --meta-bts option
Markus Lehtonen [Fri, 6 Jun 2014 09:40:32 +0000 (12:40 +0300)]
rpm-ch: implement --meta-bts option

This gives the user the possibility to define what meta tags (in git
commit message) git-rpm-ch recognizes as bug tracking system references.
Or, makes it possible to disable bts meta tag tracking altogether.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: implement --commit-msg option
Markus Lehtonen [Thu, 5 Jun 2014 14:25:25 +0000 (17:25 +0300)]
rpm-ch: implement --commit-msg option

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: implement --commit option
Markus Lehtonen [Thu, 5 Jun 2014 13:37:25 +0000 (16:37 +0300)]
rpm-ch: implement --commit option

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: new 'commitish' keyword for spec vcs tag
Markus Lehtonen [Mon, 2 Jun 2014 08:57:34 +0000 (11:57 +0300)]
buildpackage-rpm: new 'commitish' keyword for spec vcs tag

Add a new keyword '%(commitish)s' that can be used in the
--git-spec-vcs-tag option. This will be translated to the sha1 of the
commitish (i.e. tag or commit). That is, if you export a tag you will
get the sha1 of the tag object - not resolving to a commit object unlike
'%(commit)s' does.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agodocs: manpages for the rpm tools
Markus Lehtonen [Tue, 27 May 2014 07:09:36 +0000 (10:09 +0300)]
docs: manpages for the rpm tools

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoTizen release 0.6.12-20140521
Markus Lehtonen [Wed, 19 Mar 2014 13:31:19 +0000 (15:31 +0200)]
Tizen release 0.6.12-20140521

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: don't create pq branch when switching
Markus Lehtonen [Wed, 9 Apr 2014 13:48:45 +0000 (16:48 +0300)]
pq-rpm: don't create pq branch when switching

Pq branch must be created with 'import'.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: Prepare for next Tizen tools release
Markus Lehtonen [Thu, 7 Nov 2013 11:54:08 +0000 (13:54 +0200)]
packaging: Prepare for next Tizen tools release

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: implement --retain-history option
Markus Lehtonen [Mon, 31 Mar 2014 12:18:34 +0000 (15:18 +0300)]
pq-rpm: implement --retain-history option

With this option defined gbp tries to preserve the history when
converting. That is, for each commit in the old branch create one
corresponding commit in the new orphan packaging branch. This works by
dumping packaging files and updating patches for each commit. However,
empty commits are not generated - these are caused e.g. by changes in
files that are ignored by patch-generation.

NOTE! Only valid for the 'convert' action.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: implement --new-packaging-dir cmdline option
Markus Lehtonen [Tue, 11 Feb 2014 08:18:47 +0000 (10:18 +0200)]
pq-rpm: implement --new-packaging-dir cmdline option

Used for setting the packaging directory to be used in the new orphan
packaging branch. Defaults to --packaging-dir so that the gbp.conf files
are more likely to work without modification.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: implement 'convert' subcommand
Markus Lehtonen [Mon, 10 Feb 2014 08:49:29 +0000 (10:49 +0200)]
pq-rpm: implement 'convert' subcommand

The new subcommand is intended to be a one-time-callable command for
converting a package to use the "orphan-packaging" development model and
git layout (where packaging files are maintained in a separate branch
and code development in another branch).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: patch-export from development branch
Markus Lehtonen [Thu, 6 Feb 2014 13:24:54 +0000 (15:24 +0200)]
buildpackage-rpm: patch-export from development branch

Adds git-buildpackage-rpm --patch-export support for the 'orphan
packaging' development model (where packaging files and development sources are kept in separate
branches).

New functionality:
1. If patch-export is enabled and gbp detects that the current branch
   has a development/patch-queue branch it exports the patches from there,
   instead of the tip of the packaging branch.
2. If gbp detects that the current (or exported) branch is a
   development/patch-queue branch it automatically enables patch-export
   and exports packaging files from the base branch (instead of the
   development/patch-queue branch.

Also, add a new '--git-patch-export-rev' command line option with which
the user can explicitly set the treeish from which patches are generated
(i.e. HEAD..<patch-export-rev>)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoimport-orig-rpm: get archive from spec file
Markus Lehtonen [Thu, 13 Feb 2014 10:41:39 +0000 (12:41 +0200)]
import-orig-rpm: get archive from spec file

Try to get archive path/filename from spec file if no file name is given
on the command line.  This should make version bumps more
straightforward: just update version number in the spec file and run
'git-import-orig-rpm'.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoimport-orig-rpm: implement automatic downloading
Markus Lehtonen [Thu, 13 Feb 2014 10:41:39 +0000 (12:41 +0200)]
import-orig-rpm: implement automatic downloading

Automatically try to download the archive if the archive filename points
to a remote location.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoimport-orig-rpm: implement --create-missing-branches option
Markus Lehtonen [Wed, 12 Feb 2014 13:11:30 +0000 (15:11 +0200)]
import-orig-rpm: implement --create-missing-branches option

Create the upstream branch if it does not exist. Use the same option
name that import-srpm has.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: add unit tests for the command line tool
Markus Lehtonen [Tue, 25 Feb 2014 10:20:24 +0000 (12:20 +0200)]
rpm-ch: add unit tests for the command line tool

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: implement '--all' option
Markus Lehtonen [Fri, 16 May 2014 11:26:49 +0000 (14:26 +0300)]
rpm-ch: implement '--all' option

If defined, git-rpm-ch uses all commits in the Git history. Also,
'--since' option is omitted.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: add --message cmdline option
Markus Lehtonen [Wed, 26 Mar 2014 07:01:28 +0000 (09:01 +0200)]
rpm-ch: add --message cmdline option

For giving the text for new changelog entry/entries, skipping git commit
messages entirely.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-ch: make it possible to commit/tag the changes
Markus Lehtonen [Thu, 6 Feb 2014 09:35:42 +0000 (11:35 +0200)]
rpm-ch: make it possible to commit/tag the changes

Implement '--tag' command line option (and other related options for
signing) for creating and tagging a release. These correspond the
tagging options in git-buildpackage-rpm.

The git-buildpackage-rpm tool does not commit anything to git. However,
in rpm-ch the '--tag' option causes the changelog modifications (and,
all other staged changes) to be committed to git before creating the
tag. This makes it possible to create a release and document the
packaging/release tag name in the rpm changelog.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoIntroduce git-rpm-ch tool
Markus Lehtonen [Tue, 4 Feb 2014 15:54:36 +0000 (17:54 +0200)]
Introduce git-rpm-ch tool

Initial version of the git-rpm-ch tool which is intended for maintaining
RPM changelogs. Supports both spec files and separate "OBS style"
changelog files.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: add gbp.rpm.changelog module
Markus Lehtonen [Tue, 4 Feb 2014 15:49:28 +0000 (17:49 +0200)]
rpm: add gbp.rpm.changelog module

This new module contains basic containers and functionality for parsing
and updating rpm changelogs. It is coupled with the rpm packaging policy
class which now has definitions for rpm changelog formatting.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: add unit tests for the command line tool
Markus Lehtonen [Fri, 27 Sep 2013 08:16:39 +0000 (11:16 +0300)]
pq-rpm: add unit tests for the command line tool

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm-tests: add RepoManifest class
Markus Lehtonen [Wed, 2 Oct 2013 09:35:22 +0000 (12:35 +0300)]
rpm-tests: add RepoManifest class

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: implement '--import-files' command line option
Markus Lehtonen [Tue, 10 Dec 2013 13:25:32 +0000 (15:25 +0200)]
pq-rpm: implement '--import-files' command line option

For defining the packaging file(s) that will be imported into the
development/patch-queue branch.

By default, the local gbp conf files are imported in order to try to
ensure that gbp sees the same settings on the development/pq branch as
on the packaging branch.

NOTE: This option does not affect the patch files that are imported. The
files defined with this option will appear as new files in one
monolithic commit in the development/patch-queue branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: bigger refactor of the code
Markus Lehtonen [Thu, 19 Sep 2013 13:22:57 +0000 (16:22 +0300)]
pq-rpm: bigger refactor of the code

Support '%(upstreamversion)s' as a replacable string in the pq branch
name.

Eliminate some unneeded branch switches that were only needed for
finding/parsing the spec file. Now, spec file is directly searched from
the git repository (from the 'base' branch) if the command is run when
on the pq branch - except for the 'export' subcommand which always
switches to the base branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: Prepare for next Tizen tools release
Markus Lehtonen [Mon, 2 Dec 2013 11:01:13 +0000 (13:01 +0200)]
packaging: Prepare for next Tizen tools release

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: create diff up to the last merge commit
Markus Lehtonen [Thu, 21 Nov 2013 15:25:37 +0000 (17:25 +0200)]
pq-rpm: create diff up to the last merge commit

Before, merge commits broke patch generation, or, (most probably) caused
the generated patches to be unapplicable (similar to how
git-format-patch behaves).

Now, changes up to the last merge commit are squashed into one diff if
merge commits are found in the revision list from which patches are to
be generated. Individual patches (one per commit) are generated from the
last merge commit up to the exported revision.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: Release, update changelogs
Markus Lehtonen [Wed, 16 Oct 2013 08:07:10 +0000 (11:07 +0300)]
packaging: Release, update changelogs

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: support guessing spec file from git treeish
Markus Lehtonen [Fri, 6 Sep 2013 13:07:08 +0000 (16:07 +0300)]
rpm: support guessing spec file from git treeish

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: change guess_spec() to return SpecFile object
Markus Lehtonen [Fri, 6 Sep 2013 13:43:23 +0000 (16:43 +0300)]
rpm: change guess_spec() to return SpecFile object

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoGitRepository/get_remote_repos: return URLs, too
Markus Lehtonen [Mon, 3 Dec 2012 08:21:43 +0000 (10:21 +0200)]
GitRepository/get_remote_repos: return URLs, too

In addition to the remote name, return remote URLs. Return value is now
a dict with remote name as the key and a list of URLs as the value. The
first value in the list is the effective fetch URL, the rest of the
values are push URLs.

NOTE! This patch is to be dropped, not going for upstream.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agodebian packaging: change to 1.0 source package format
Markus Lehtonen [Mon, 2 Sep 2013 11:56:57 +0000 (14:56 +0300)]
debian packaging: change to 1.0 source package format

Changes package to be non-native (assuming debian/changelog has version
in correct format).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: Update changelogs
Markus Lehtonen [Mon, 2 Sep 2013 11:46:30 +0000 (14:46 +0300)]
packaging: Update changelogs

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopackaging: Release, update changelogs
Markus Lehtonen [Thu, 25 Oct 2012 06:35:46 +0000 (09:35 +0300)]
packaging: Release, update changelogs

Add rpm changelog. Start providing proper changelogs for Tizen Tools
releases.

Also, make it easier to track Tizen releases:
- RPM: Add a 'Provides:' tag to the git-buildpackage-rpm subpackage in
  order to be able to track Tizen releases.
- DEB: Change the package to non-native, by adding a corresponding
  release number to the version field in changelog of Debian packaging.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agotests: add tests for git-import-orig-rpm
Markus Lehtonen [Wed, 31 Oct 2012 15:27:58 +0000 (17:27 +0200)]
tests: add tests for git-import-orig-rpm

Basic tests for virtually all features of import-orig-rpm.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoCentOS compatibility: fix GitRepository.diff
Markus Lehtonen [Fri, 8 Nov 2013 10:37:51 +0000 (12:37 +0200)]
CentOS compatibility: fix GitRepository.diff

Remove the "all" parameter from --ignore-submodules which is not
supported by the old Git version of CentOS 6 (besides, it's the default,
anyway)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoCentOS compatibility: disable Debian tools
Markus Lehtonen [Wed, 24 Apr 2013 11:08:19 +0000 (14:08 +0300)]
CentOS compatibility: disable Debian tools

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoCentOS compatibility: fix GitRepository._cmd_has_feature()
Markus Lehtonen [Mon, 4 Mar 2013 11:17:24 +0000 (13:17 +0200)]
CentOS compatibility: fix GitRepository._cmd_has_feature()

Make it work in CentOS 6.3 with older git by removing backspace
characters when examining man page section names.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoCentOS compatibility: fix tests
Markus Lehtonen [Tue, 5 Mar 2013 15:49:56 +0000 (17:49 +0200)]
CentOS compatibility: fix tests

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoCentOS compatibility: make GBP work with older python2.6
Zhang Qiang [Fri, 8 Feb 2013 06:09:26 +0000 (14:09 +0800)]
CentOS compatibility: make GBP work with older python2.6

- use loops to generate dict/list
- Called logging.Logger.__init__ instead of using super(). In python 2.6
  logging.Logger is not new-style class, therefore supper() is failing.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: support importing bzip2 compressed patches
Markus Lehtonen [Mon, 20 May 2013 07:45:25 +0000 (10:45 +0300)]
rpm: support importing bzip2 compressed patches

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoimport-srpm: support for patch import
Markus Lehtonen [Wed, 27 Jun 2012 15:12:01 +0000 (18:12 +0300)]
import-srpm: support for patch import

Adds a new commandline option '--patch-import' for importing patches
into the source tree in packaging branch. When enabled, gbp applies and
commits all patches (not marked for manual maintenance) into the
packaging branch. If this succeeds, it also removes all imported patch
files from the packaging directory and the spec file.

Currently only supported for non-orphan-packaging.

This setting is true by default which should make more sense as the
developer wants to do code development in the packaging branch (if
he/she selects to use non-orphan packaging).

However, patch-import is force-disabled if in bare git repository. We
cannot support this, currently.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: implement --[no-]hooks option
Markus Lehtonen [Tue, 23 Apr 2013 12:45:38 +0000 (15:45 +0300)]
buildpackage-rpm: implement --[no-]hooks option

For enabling/disabling all hooks, similar to git-buildpackage (the
Debian tool). Does not affedt the builder.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoDisable xcover support for nose
Markus Lehtonen [Mon, 22 Apr 2013 11:11:32 +0000 (14:11 +0300)]
Disable xcover support for nose

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: listen to --no-create-orig option for native packages, too
Markus Lehtonen [Tue, 2 Apr 2013 07:50:08 +0000 (10:50 +0300)]
buildpackage-rpm: listen to --no-create-orig option for native packages, too

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years ago.gbp.conf: Tizen specific changes
Markus Lehtonen [Tue, 26 Mar 2013 08:53:30 +0000 (10:53 +0200)]
.gbp.conf: Tizen specific changes

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: use config file(s) from exported tree-ish
Markus Lehtonen [Mon, 25 Mar 2013 09:34:45 +0000 (11:34 +0200)]
buildpackage-rpm: use config file(s) from exported tree-ish

Use the local per-tree/per-branch config file(s) from the exported
tree-ish instead of the current working copy.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: support conditionals in patch-export
Markus Lehtonen [Mon, 25 Feb 2013 10:11:14 +0000 (12:11 +0200)]
rpm: support conditionals in patch-export

One can now define conditional patches that are enclosed in '%if' or
'%ifarch' when the spec file is updated. One can do this by defining
'Gbp-Rpm-If: <conditional>' and 'Gbp-Rpm-IfArch: <conditional>' in the
commit message.

Only one conditional per patch is supported, i.e. you cannot define
'IfArch' and 'If' for the same patch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoImport RpmGitRepository if DebianGitRepository is not available
Zhang Qiang [Thu, 24 Jan 2013 03:41:25 +0000 (22:41 -0500)]
Import RpmGitRepository if DebianGitRepository is not available

This is just a workaround, this should be fixed in nicer way by
refactoring the code.

Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
9 years agorpm.SpecFile: drop the internal 'patches' structure
Markus Lehtonen [Fri, 11 Jan 2013 14:41:38 +0000 (16:41 +0200)]
rpm.SpecFile: drop the internal 'patches' structure

To get rid of duplicate data tracking. Also, add test for testing the
macro expansion of patch and source names.

Also add tests for SpecFile.patchseries.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm.SpecFile: change specfile attribute to represent filename
Markus Lehtonen [Fri, 4 Jan 2013 13:10:02 +0000 (15:10 +0200)]
rpm.SpecFile: change specfile attribute to represent filename

There is specdir to get the (absolute) directory path.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm refactor: rewrite set_tag functionality
Markus Lehtonen [Thu, 3 Jan 2013 10:43:08 +0000 (12:43 +0200)]
rpm refactor: rewrite set_tag functionality

In addition to refactoring, make sure that we keep the internal _tags
structure in sync.

Changes the default place for new tags: add new tags after the 'Name:'
tag instead of 'Release:'.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: support setting/updating the 'VCS:' tag
Markus Lehtonen [Thu, 17 Jan 2013 08:41:18 +0000 (10:41 +0200)]
buildpackage-rpm: support setting/updating the 'VCS:' tag

Git-buildpackage-rpm now always updates the 'VCS:' tag in the exported
spec file. A new config option 'spec-vcs-tag' controls the format:
- if empty, no 'VCS' tag is inserted and possible old 'VCS' tag is
  removed
- otherwise, a 'VCS' tag is inserted or the old 'VCS' tag is updated
- '%(tag)s' expands to the long tag name (from git-describe)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: configuration option for setting the output color scheme
Markus Lehtonen [Tue, 13 Nov 2012 09:50:34 +0000 (11:50 +0200)]
rpm: configuration option for setting the output color scheme

Adds the new 'color-scheme' option to the rpm tools.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agodebian packaging: HACK: disable test in Debian builds
Markus Lehtonen [Mon, 10 Sep 2012 10:05:07 +0000 (13:05 +0300)]
debian packaging: HACK: disable test in Debian builds

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoTODO: add rpm todo
Markus Lehtonen [Fri, 13 Jan 2012 13:01:28 +0000 (15:01 +0200)]
TODO: add rpm todo

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: fail patch-export if local patches found
Markus Lehtonen [Thu, 8 Nov 2012 10:27:43 +0000 (12:27 +0200)]
buildpackage-rpm: fail patch-export if local patches found

Make patch export fail if local patch files (not marked for manual
maintenance) exist.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agodocs: add initial RPM documentation
Markus Lehtonen [Wed, 22 Feb 2012 10:48:57 +0000 (12:48 +0200)]
docs: add initial RPM documentation

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agotests: add unit tests for gbp.rpm.SrcRpmFile
Markus Lehtonen [Thu, 13 Nov 2014 16:33:45 +0000 (18:33 +0200)]
tests: add unit tests for gbp.rpm.SrcRpmFile

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: return 2 for patch-export or tarball generation errors
Markus Lehtonen [Fri, 21 Sep 2012 05:38:57 +0000 (08:38 +0300)]
buildpackage-rpm: return 2 for patch-export or tarball generation errors

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: implement file path filters in patch export
Markus Lehtonen [Fri, 14 Sep 2012 14:21:09 +0000 (17:21 +0300)]
rpm: implement file path filters in patch export

Implements a filter option allows one to filter out changes to certain
files/paths in the patch-generation. A commit is totally ignored if all
files would be filtered out. The path filter is given as a Python
regexp.

This option is useful for example in filtering out the changes to
packaging files when maintaining packaging and sources in the same
branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: support special tree-ish names in --git-upstream-tree
Markus Lehtonen [Fri, 24 Aug 2012 13:32:44 +0000 (16:32 +0300)]
buildpackage-rpm: support special tree-ish names in --git-upstream-tree

Support special 'WC*' and 'INDEX' values for the --git-upstream-tree
option.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoUniversal configurable base tmpdir for all gbp rpm tools
Markus Lehtonen [Thu, 12 Jul 2012 06:07:47 +0000 (09:07 +0300)]
Universal configurable base tmpdir for all gbp rpm tools

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: support squashing commits in patch generation
Markus Lehtonen [Tue, 12 Jun 2012 07:42:41 +0000 (10:42 +0300)]
rpm: support squashing commits in patch generation

Implements an option for git-buildpackage-rpm and gbp-pq to squash
commits (from upstream) up to certain tree-ish into one monolithic diff.
Useful e.g. if you wan't to auto-generate a stable update patch.

The new format of the cmdline option filename is commit-ish followed by
(optionally) a colon and the desired diff filename base. Suffix '.diff'
is added by GBP.

Magic word 'HEAD' translates to the end-commit when given as the
squash-point.  This allows one to configure gbp to always squash all
commits into one monolithic diff.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: add --orig-prefix option
Markus Lehtonen [Thu, 14 Jun 2012 16:34:09 +0000 (19:34 +0300)]
rpm: add --orig-prefix option

Adds a new option --orig-prefix that affects the prefix of the
generated/imported orig tarballs.

For git-buildpackage-rpm, it defines the prefix of tarballs generated by
the tool, 'auto' (default) makes gbp to guess the prefix, as before.
NOTE: this doesn't affect the tarballs checked out from pristine-tar
(i.e. if --pristine-tar is defined) or tarballs that are already present
(see --git-tarball-dir option).

For git-import-orig, this new option affects the prefix of tarballs
imported into pristine-tar branch. If set to 'auto' (default) gbp
doesn't mangle the prefix.

Other tools (e.g. git-import-srpm) are not affected.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: enhance logic in guessing the prefix of source archives
Markus Lehtonen [Fri, 8 Jun 2012 07:20:12 +0000 (10:20 +0300)]
rpm: enhance logic in guessing the prefix of source archives

Now a prefix is guessed for all source archives (not for the one and
only "orig archive"). By default it is
'<archive_name>-<archive_version>/' if name and version can be
determined from the filename. If not, the archive basename (i.e.
filename less archive and compression extensions) is used.

In addition, more logic is applied to the "orig archive": gbp examines
the setup macro (if found) for the source and takes the prefix from
there. If some macros (in the '-n' option of the setup macro) cannot be
expanded archive basename us used as the prefix.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: support generating compressed patches
Markus Lehtonen [Thu, 7 Jun 2012 14:20:21 +0000 (17:20 +0300)]
rpm: support generating compressed patches

This patch adds the support to generate compressed patches. User can
define the patch file size limit after which patches gzipped.

Re-writes the write_patch() function(s) and now uses the same-and-only
write_patch() for buildpackage-rpm and pq-rpm.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agopq-rpm: support importing compressed patches
Markus Lehtonen [Thu, 7 Jun 2012 16:13:43 +0000 (19:13 +0300)]
pq-rpm: support importing compressed patches

Adds support for importing compressed patches.

NOTE: Only gzip is supported, for the time being, other compression
methods shouldn't be to hard to add, if needed.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agobuildpackage-rpm: add more tagging options
Markus Lehtonen [Wed, 4 Sep 2013 07:33:03 +0000 (10:33 +0300)]
buildpackage-rpm: add more tagging options

Add new possible keywords to be used in packaging-tag format string:
'nowtime', 'authortime', 'committime', 'nowtimenum', 'authortimenum' and
'committimenum'.

The '*timenum' keyword denote the corresponding '*time' keyword appended
with an additional incremental serial number. E.g. if 'nowtime' would
produce '20120531', 'nowtimenum' would (the first time) produce
'20120531.1'.

What is completely missing is a way to support these new tag keywords in
git-import-srpm tool. So, if you use these tags, git-import-srpm is not
able to reproduce the tags, (and, it is not necessarily able to
correctly tell if you've already imported a certain version of the
package).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agoRpmGitRepository: make version-tag methods more flexible
Markus Lehtonen [Thu, 31 May 2012 06:48:50 +0000 (09:48 +0300)]
RpmGitRepository: make version-tag methods more flexible

Simplifies version_to_tag() and find_version() so that all string fields
(for the format string) are given in one dict. Now it's easier to
add support for new string fields (e.g. commitdate etc).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
9 years agorpm helpers: make SpecFile and SrcRpmFile give (full) version as dict.
Markus Lehtonen [Wed, 30 May 2012 17:02:39 +0000 (20:02 +0300)]
rpm helpers: make SpecFile and SrcRpmFile give (full) version as dict.

The Dictionary contains different "version components", such as
upstreamversion, release and epoch. Makes e.g. tag creation consistent,
now.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agorpm: add version parsing functions to pkg policy
Markus Lehtonen [Mon, 23 Apr 2012 09:51:08 +0000 (12:51 +0300)]
rpm: add version parsing functions to pkg policy

Adds functions for version string generation and parsing. These are
intended for parsing version strings taken e.g. from rpm filename or
changelogs.

Also, take these new version parsing functions into use in the rpm gbp
scripts.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
9 years agobuildpackage-rpm: add option --git-ignore-untracked
Markus Lehtonen [Wed, 30 May 2012 06:23:46 +0000 (09:23 +0300)]
buildpackage-rpm: add option --git-ignore-untracked

Adds a new commandline option to ignore untracked files, when running
git-buildpackage-rpm. When this option is given, the
git-buildpackage-rpm command fails if there are changes to tracked
files, but, succeeds if there are untracked files present. Normally it
fails in either case.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
9 years agodebian packaging: relax requirements on devscripts
Markus Lehtonen [Tue, 14 Jan 2014 07:39:12 +0000 (09:39 +0200)]
debian packaging: relax requirements on devscripts

No need to depend on the latest version.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>