tools/git-buildpackage.git
8 years agochange tag name to tizen/0.6.27-20160302 tizen/0.6.27-20160302
Jun Wang [Mon, 7 Mar 2016 11:25:33 +0000 (19:25 +0800)]
change tag name to tizen/0.6.27-20160302

Change-Id: I30395761b89947673da8b71d850f8e6e3ae3f6b0

8 years agoAdd tests/component/rpm/data debian/0.6.27
Jun Wang [Fri, 4 Mar 2016 16:04:47 +0000 (00:04 +0800)]
Add tests/component/rpm/data

Change-Id: Id44fcc89fd290ec821a981294a3f4b78d3a17fe6

8 years agochange log to debian/0.6.27 tag
Jun Wang [Fri, 4 Mar 2016 15:45:41 +0000 (23:45 +0800)]
change log to debian/0.6.27  tag

Change-Id: I37c3fd08ba9286212aa333d79becbb67de97a35c

8 years agochange the log
Jun Wang [Fri, 4 Mar 2016 15:24:24 +0000 (23:24 +0800)]
change the log

Change-Id: Iddd56c43056a5c020c33ef73e9f4ccbdbf6d0f20

8 years agochange version files to match 0.6.27
Jun Wang [Wed, 2 Mar 2016 10:33:22 +0000 (18:33 +0800)]
change version files to match 0.6.27

Change-Id: I6dc3023b4bccffef4f0113229ae0eaf4ddcfc74f

8 years agoFix errors logs when __import__ faild,like "No handlers could be found fo logger"
Jun Wang [Thu, 4 Feb 2016 15:05:20 +0000 (23:05 +0800)]
Fix errors logs when __import__ faild,like "No handlers could be found fo logger"

Change-Id: I785e402e13879c6010780d3a453ea78956833fe1

8 years agofix gbp.log error in opensuse
Jun Wang [Wed, 3 Feb 2016 15:40:55 +0000 (23:40 +0800)]
fix gbp.log error in opensuse

Change-Id: I1fc96948cbd8da9a6325b67ab511ae2c6a199c6e

8 years agoUpdate the version to 0.6.26 debian/0.6.26
Jun Wang [Tue, 2 Feb 2016 15:16:52 +0000 (23:16 +0800)]
Update the version to 0.6.26

Change-Id: Ia8f0e526da0ecc9d765614fe5b3daf37c08e9171

8 years agofix errors in pq_rpm.py
Jun Wang [Mon, 1 Feb 2016 13:43:27 +0000 (21:43 +0800)]
fix errors in pq_rpm.py

Change-Id: Ie8acc86904b75387bf3fbe203ba3b62eeec74c5b

8 years agoUpstreamSource: suppress stderr from tar in _determine_prefix()
Markus Lehtonen [Wed, 3 Dec 2014 15:37:51 +0000 (17:37 +0200)]
UpstreamSource: suppress stderr from tar in _determine_prefix()

Change-Id: I3a0e51de2114e2aa9f9a12c41a9ed4c242fa2127
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agorpm: suppress stderr when unpacking src.rpm
Markus Lehtonen [Wed, 3 Dec 2014 14:40:46 +0000 (16:40 +0200)]
rpm: suppress stderr when unpacking src.rpm

Change-Id: I055e94f905048141268ceb9172b4e10fcb5cdc58
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agobuildpackage-rpm: look for remote upstream branches
Markus Lehtonen [Wed, 19 Nov 2014 15:19:20 +0000 (17:19 +0200)]
buildpackage-rpm: look for remote upstream branches

Consider remote branches, too, while looking for the upstream branch
when trying to guess if a package is native or not.

Change-Id: I3dbbb49816d1d294d81209ea5ab5870e053fd66a
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agofix build problem on Debian_8
Jun Wang [Fri, 29 Jan 2016 08:30:03 +0000 (16:30 +0800)]
fix build problem on Debian_8

Change-Id: I145928ae1416f7847b4d8e6729c1daf07e2ab757

8 years agobackup docs
Jun Wang [Thu, 28 Jan 2016 16:51:48 +0000 (00:51 +0800)]
backup docs

Change-Id: I8fd630aa2a260d6516cc5fa4d82edde45e419c6a

8 years agofix bugs
Jun Wang [Thu, 28 Jan 2016 16:28:34 +0000 (00:28 +0800)]
fix bugs

Change-Id: I406d49bdbfb8b978b62a6bb1fb770df37043f81c

8 years agofix import error
Jun Wang [Thu, 28 Jan 2016 15:01:09 +0000 (23:01 +0800)]
fix import error

Change-Id: I97a7737cf643f20b6e7b30b77c6d6987fe0b7235

8 years agofix merge errors
Jun Wang [Thu, 28 Jan 2016 14:50:55 +0000 (22:50 +0800)]
fix merge errors

Change-Id: I4419bb8322f341f92db7e9e19f60ffaa93af2171

8 years agodeleted: tests/component/rpm/data/.gitignore
Jun Wang [Thu, 28 Jan 2016 11:09:59 +0000 (19:09 +0800)]
deleted:    tests/component/rpm/data/.gitignore

Change-Id: Ib0b50f55c146e8a2f365dc10d3af51fd66f2e5a5

8 years agoChange .gitmodules address url to local gerrit
Jun Wang [Thu, 28 Jan 2016 10:41:32 +0000 (18:41 +0800)]
Change .gitmodules address url to local gerrit

Change-Id: Ic27e2b5cd4ba3aacb651568e4b351666f16af176

8 years agoChange .gitmodules address to local gerrit
Jun Wang [Thu, 28 Jan 2016 10:22:05 +0000 (18:22 +0800)]
Change .gitmodules address to local gerrit

Change-Id: I87aad5e51e209dcd6bbe03b25be558600453b34d

8 years agoAdd tests/component/rpm/data/
Jun Wang [Thu, 28 Jan 2016 09:47:15 +0000 (17:47 +0800)]
Add tests/component/rpm/data/

Change-Id: I83de13c6695a7a7c6d14500fc5c608d621f7bb21

8 years agoFix some errors of merging
Jun Wang [Wed, 27 Jan 2016 20:32:24 +0000 (04:32 +0800)]
Fix some errors of merging

Change-Id: I4441fb369aa88598f238c41710edeba01cd537b6

8 years agolog: don't crash getLogger if getting the root logger
Markus Lehtonen [Tue, 17 Feb 2015 10:51:34 +0000 (12:51 +0200)]
log: don't crash getLogger if getting the root logger

The root logger won't have the gbp-specific default_handlers attribute.

Change-Id: I0b81fdfbe70fe16ce3fd226248b83a4f6a17fc7f
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.create_tag: add 'annotate' argument
Markus Lehtonen [Wed, 17 Dec 2014 15:39:59 +0000 (17:39 +0200)]
GitRepository.create_tag: add 'annotate' argument

For forcing the creation of annotated tags. Causes the an editor to be
spawned if no message is given.

Change-Id: I8ec7e195cf7ae997606af1d887f04e84a14b2abc
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.create_tag: use GitArgs class
Markus Lehtonen [Wed, 17 Dec 2014 15:37:27 +0000 (17:37 +0200)]
GitRepository.create_tag: use GitArgs class

Change-Id: I8ead4dda504152bde4c35ee0c03d6e3295820fd6
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agolog: don't initialize handlers in GbpLogger init
Markus Lehtonen [Thu, 11 Sep 2014 12:25:00 +0000 (15:25 +0300)]
log: don't initialize handlers in GbpLogger init

Better compatibility with 3rd party modules that have their own logging
initializations.

Change-Id: Ic91ab54c70537061c3e76dd6317ceeec888fab36
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agorpm packaging: include python egg-info in -common
Markus Lehtonen [Thu, 18 Dec 2014 11:55:08 +0000 (13:55 +0200)]
rpm packaging: include python egg-info in -common

We need this for the Python pkg_resources.

Change-Id: I74c7d466040279b8f34ec357b6947fa2f7c29a15
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agopatchseries: strip numbering when guessing subject from filename
Markus Lehtonen [Mon, 24 Nov 2014 17:12:37 +0000 (19:12 +0200)]
patchseries: strip numbering when guessing subject from filename

Change-Id: I58c4f8871411dae15d0e0e4246f0eebe65e3967d
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agolog: don't propagate to ancestor loggers
Markus Lehtonen [Thu, 25 Sep 2014 09:02:56 +0000 (12:02 +0300)]
log: don't propagate to ancestor loggers

Change-Id: I6548dcfe5ba2f779b9d9244ad1eb88fa92c2180e
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agorpm packaging: enable CentOS 7
Markus Lehtonen [Fri, 12 Sep 2014 13:31:20 +0000 (16:31 +0300)]
rpm packaging: enable CentOS 7

Fix dependencies and enable git-buildpackage(-deb) subpackage for
CentOS 7.

Also fixes one excess dependency for Fedora: no need for dpkg-devel,
dpkg-dev is enough.

Change-Id: I2c3929ae623c9694aa9afcb8a4e3155696179f05
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository/__git_inout: correctly handle input error
Markus Lehtonen [Fri, 12 Sep 2014 12:48:20 +0000 (15:48 +0300)]
GitRepository/__git_inout: correctly handle input error

Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 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>
8 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>
8 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>
8 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>
Conflicts:
debian/control

8 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>
8 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>
Conflicts:
gbp/scripts/buildpackage_rpm.py

8 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>
Conflicts:
gbp/config.py
gbp/scripts/pq_rpm.py

8 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>
Conflicts:
gbp/scripts/pq_rpm.py

8 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>
Conflicts:
gbp/scripts/buildpackage_rpm.py

8 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>
Conflicts:
gbp/rpm/policy.py
gbp/scripts/buildpackage_rpm.py
gbp/scripts/import_orig_rpm.py
gbp/scripts/pq_rpm.py

8 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>
Conflicts:
gbp/config.py

8 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>
8 years agoREADME: mention RPM support
Markus Lehtonen [Thu, 12 Apr 2012 13:37:37 +0000 (16:37 +0300)]
README: mention RPM support

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agorpm: add 'vendor' config option
Markus Lehtonen [Thu, 12 Jan 2012 13:45:06 +0000 (15:45 +0200)]
rpm: add 'vendor' config option

Intended to represent the distribution vendor (e.g. 'Debian'). This can
be used in tag and branch name formatting.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/buildpackage_rpm.py
gbp/scripts/import_orig_rpm.py
gbp/scripts/pq_rpm.py

8 years agopq-rpm: support patch-export up to an arbitrary tree-ish
Markus Lehtonen [Wed, 8 May 2013 17:42:45 +0000 (20:42 +0300)]
pq-rpm: support patch-export up to an arbitrary tree-ish

If the end of the export range is not a commit "normal" patches are
generated up to HEAD and finally a raw diff between HEAD and the
end-tree-is generated.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/pq_rpm.py

8 years agopq-rpm: add new --pq-branch option
Markus Lehtonen [Fri, 11 May 2012 08:29:24 +0000 (11:29 +0300)]
pq-rpm: add new --pq-branch option

Adds a new command line option '--pq-branch' to set the name of
patch-queue branches. Changes the defaults pq-branch name for rpm tools
to 'development/%(branch)s' (instead of the old
'patch-queue/%(branch)s').

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/config.py
gbp/scripts/pq_rpm.py

8 years agogbp-pq-rpm: add 'export-rev' option
Markus Lehtonen [Thu, 12 Jan 2012 13:44:43 +0000 (15:44 +0200)]
gbp-pq-rpm: add 'export-rev' option

This option allows generating patches from any git tree-ish (instead of
the default that is HEAD of patch-queue branch).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/pq_rpm.py

8 years agoIntroduce gbp-pq-rpm tool
Markus Lehtonen [Thu, 12 Jan 2012 13:38:29 +0000 (15:38 +0200)]
Introduce gbp-pq-rpm tool

Initial version of gbp-pq-rpm: a tool for managing patch queues for rpm
packages.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Olev Kartau <olev.kartau@intel.com>
Conflicts:
gbp/config.py
gbp/scripts/pq_rpm.py
tests/01_test_help.py

8 years agoRename internal var debian_tag -> packaging_tag
Markus Lehtonen [Thu, 12 Jan 2012 13:35:49 +0000 (15:35 +0200)]
Rename internal var debian_tag -> packaging_tag

This is done in sake of more general purpose naming, intended for
enabling rpm support: to allow logical naming for rpm and to
share as much code between debian and rpm tools as possible.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoAdd 'packaging-branch' cmdline option
Markus Lehtonen [Thu, 12 Jan 2012 13:35:37 +0000 (15:35 +0200)]
Add 'packaging-branch' cmdline option

This is the counterpart of 'debian-branch' (basically identical to that)
to not confuse rpm maintainers.

Also, adds this option to gbp-clone and gbp-pull commands (as an
alternative to the 'debian-branch option), which are usable for RPM in
their current form.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoRename internal var debian_branch -> packaging_branch
Markus Lehtonen [Thu, 12 Jan 2012 13:35:20 +0000 (15:35 +0200)]
Rename internal var debian_branch -> packaging_branch

This is done in sake of more general purpose naming, intended for
enabling rpm support.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/clone.py
gbp/scripts/pull.py

8 years agogbp-pull: two modes for --force
Markus Lehtonen [Thu, 12 Jan 2012 13:26:55 +0000 (15:26 +0200)]
gbp-pull: two modes for --force

The 'force' option now has two possible values:
'merge': upstream branch is merged, even if fast-forward is not
possible.

'clean': check out a clean copy from the upstream if fast-forward is not
possible (i.e. no merge). Local changes are lost in this case.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
docs/manpages/gbp-pull.sgml

8 years agogbp-pull: similar update strategy for all branches
Markus Lehtonen [Thu, 12 Jan 2012 13:25:57 +0000 (15:25 +0200)]
gbp-pull: similar update strategy for all branches

Treat non-checked-out branches similarly to the current branch when
forcing update. That is, do git merge, instead of just setting the ref.

Also, renames fast_forward_branch() to update_branch() to better match
the functionality.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/pull.py

8 years agogbp-pull: implement --all cmdline option
Markus Lehtonen [Tue, 15 Jan 2013 14:28:24 +0000 (16:28 +0200)]
gbp-pull: implement --all cmdline option

This updates all remote-tracking branches (for the remote that is
fetched from) whose local branch name is identical to the remote branch
name.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
docs/manpages/gbp-pull.sgml
gbp/scripts/pull.py

8 years agocommon/pq: support more flexible pq-branch naming
Markus Lehtonen [Fri, 6 Sep 2013 11:23:03 +0000 (14:23 +0300)]
common/pq: support more flexible pq-branch naming

Now any string fields (e.g. '%(version)s') can be used in the pq-branch
format strings - in addition to the '%(branch)s' supported before.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/pq.py

8 years agogbp-pq: readiness to configure the pq branch name
Markus Lehtonen [Fri, 11 May 2012 07:56:17 +0000 (10:56 +0300)]
gbp-pq: readiness to configure the pq branch name

All other gbp branches have configurable names. This commit adds the
readiness for user to configure/change the name of the patch-queue
branches, as well.

Patch-queue is defined in options as a format string, where '%(branch)s'
refers to the debian/packaging branch. If the pq-branch format string
does not contain '%(branch)s', there is only one patch-queue branch and
the debian/packaging branch is used as its base branch. That is, e.g. a
'gbp-pq switch' operation from the patch-queue branch always switches to
the debian/packaging branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Olev Kartau <olev.kartau@intel.com>
Conflicts:
gbp/scripts/common/pq.py

8 years agoUniversal configurable base tmpdir for all gbp tools
Markus Lehtonen [Thu, 12 Jul 2012 06:07:47 +0000 (09:07 +0300)]
Universal configurable base tmpdir for all gbp tools

Adds support for a configurable tmpdir under which all gbp tools now
create their temporary directories and files.

NOTE: an exception is git-import-dscs which doesn't use the common
configuration system.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/buildpackage.py

8 years agobuildpackage: implement --[no-]build cmdline option
Markus Lehtonen [Fri, 26 Apr 2013 08:20:11 +0000 (11:20 +0300)]
buildpackage: implement --[no-]build cmdline option

For enabling/disabling the builder script. The option is a bit
asymmetric: --git-no-build automatically disables the 'postbuild' hook
whereas --git-build does not enable it (e.g. if --git-no-hooks is
given).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agobuildpackage: fix exporting of working copy when run from a subdir
Markus Lehtonen [Thu, 25 Oct 2012 06:25:25 +0000 (09:25 +0300)]
buildpackage: fix exporting of working copy when run from a subdir

Exporting sources failed when git-buildpackage was run from a
subdirectory of the git working directory because the path of the custom
index file was not handled correctly.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agobuildpackage: new "working copy" choices for --git-export
Markus Lehtonen [Mon, 9 Jul 2012 07:52:36 +0000 (10:52 +0300)]
buildpackage: new "working copy" choices for --git-export

Add support for building different kind of "working copies", when using
the --git-export option:
- 'WC.TRACKED': only use files that are already tracked
- 'WC.UNTRACKED': use untracked files, too
- 'WC.IGNORED': also add files that'd normally be ignored

Using '--git-export=WC' beaves like before.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/buildpackage.py

8 years agobuildpackage: add 'untracked' option to write_wc()
Markus Lehtonen [Fri, 6 Jul 2012 13:45:54 +0000 (16:45 +0300)]
buildpackage: add 'untracked' option to write_wc()

Whether to ignore untracked files (untracked=False) or not
(untracked=True). Now, clones the temporary index file from the actual
index, in order to correctly update files.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Conflicts:
gbp/scripts/common/buildpackage.py

8 years agoGitRepository/add_files: add new option 'untracked'
Markus Lehtonen [Fri, 6 Jul 2012 12:55:19 +0000 (15:55 +0300)]
GitRepository/add_files: add new option 'untracked'

With this option you can either only update already tracked files to
index the (untracked=False) or add new files, too.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoconfig: support for per-tree config files
Markus Lehtonen [Mon, 25 Mar 2013 08:56:47 +0000 (10:56 +0200)]
config: support for per-tree config files

Add support for reading the local config file(s) from a given git
tree-ish.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoconfig: read the right config if run from subdir
Markus Lehtonen [Fri, 6 Jul 2012 06:58:06 +0000 (09:58 +0300)]
config: read the right config if run from subdir

A step towards being able to run GBP tools from subdirectories.

Now expands '%(top_dir)s' and '%(git_dir)s' in config file path to root
of the working directory and git metadata directory, respectively.

Also, adds a new method _read_config_file() in preparation for
supporting per-tree config files.

Fixes tests.test_Config: currently the only correct way to define the
config file(s) to be parsed is by using the GBP_CONF_FILES environment
variable.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/config.py

8 years agotests/testutils: add directories arg to ls_* functions
Markus Lehtonen [Fri, 27 Jun 2014 05:39:15 +0000 (08:39 +0300)]
tests/testutils: add directories arg to ls_* functions

With this you can exclude directories from the listing returned by the
ls_tar(), ls_zip() and ls_dir() functions.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agotests.testutils: add ls_zip() helper
Markus Lehtonen [Thu, 29 Aug 2013 07:37:56 +0000 (10:37 +0300)]
tests.testutils: add ls_zip() helper

For listing zip contents.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
tests/testutils.py

8 years agoimport-orig: rework sourcecode preparation and filtering
Markus Lehtonen [Wed, 14 Nov 2012 07:03:37 +0000 (09:03 +0200)]
import-orig: rework sourcecode preparation and filtering

Take in to use the newly added prepare_sources() function. Drop dead,
unneeded code.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/import_orig.py
gbp/scripts/import_orig.py

8 years agoimport-orig: new function for filtering/re-packing sources
Markus Lehtonen [Mon, 26 Aug 2013 07:22:00 +0000 (10:22 +0300)]
import-orig: new function for filtering/re-packing sources

Introduces a new function prepare_sources() that prepares upstream
sources for importing into upstream branch and pristine-tar. That
includes unpacking, filtering and re-packing sources. What somewhat
complicates the logic is that it tries to avoid excess unpacking/packing
of the sources.

Also fixes the unpacking / filtering / repacking logic which was broken
with some parameter combinations.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
tests/test_import_orig.py
tests/testutils.py

8 years agoUpstreamSource.unpack: return UpstreamSource instance
Markus Lehtonen [Thu, 6 Jun 2013 12:19:37 +0000 (15:19 +0300)]
UpstreamSource.unpack: return UpstreamSource instance

Trying to keep UpstreamSource in consistent state so that unpacked and
packed sources are kept in sync.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/import_srpm.py

8 years agoUpstreamSource.pack: reuse unpacked dir if no filter is used
Markus Lehtonen [Thu, 6 Jun 2013 12:21:48 +0000 (15:21 +0300)]
UpstreamSource.pack: reuse unpacked dir if no filter is used

Set the unpacked attribute to the source dir if the content is not
filtered.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoUpstreamSource: implement prefix guessing
Markus Lehtonen [Thu, 22 Aug 2013 13:24:13 +0000 (16:24 +0300)]
UpstreamSource: implement prefix guessing

Add a new attribure 'prefix', i.e. the "leading directory name" in an
archive. For example, this usually is '<name>-<version>' in release
tarballs.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ɓukasz Stelmach <l.stelmach@samsung.com>
Conflicts:
gbp/pkg/__init__.py

8 years agoUpstreamSource: check that the sources exist
Markus Lehtonen [Fri, 23 Aug 2013 11:04:12 +0000 (14:04 +0300)]
UpstreamSource: check that the sources exist

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agotests: test find_source() with unittest
Markus Lehtonen [Mon, 13 Jan 2014 16:39:05 +0000 (18:39 +0200)]
tests: test find_source() with unittest

Change doctests to unittests in order to have more flexibility in
testing.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
tests/test_import_orig.py

8 years agoUpstreamSource: store the absolute path
Markus Lehtonen [Fri, 23 Aug 2013 11:01:39 +0000 (14:01 +0300)]
UpstreamSource: store the absolute path

This is more robust and reliable, e.g. in case cwd is changed.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py

8 years agoUpstreamSource: move version guessing logic to PkgPolicy
Markus Lehtonen [Fri, 23 Aug 2013 10:39:19 +0000 (13:39 +0300)]
UpstreamSource: move version guessing logic to PkgPolicy

PkgPolicy is more logical context, for example if guessing version from
a plain filename and not a real file.

Also, changes guess_version() to always return a tuple to simplify
checking its return value.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py
tests/06_test_upstream_source.py

8 years agoUpstreamSource: introduce is_tarball() method
Markus Lehtonen [Mon, 9 Jul 2012 14:19:27 +0000 (17:19 +0300)]
UpstreamSource: introduce is_tarball() method

New method for checking if the sources are a tarball (possibly for
checking if the sources are committable by pristine-tar).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoUpstreamSource: add 'archive_fmt' and 'compression' properties
Markus Lehtonen [Mon, 9 Jul 2012 14:16:21 +0000 (17:16 +0300)]
UpstreamSource: add 'archive_fmt' and 'compression' properties

New properties for easily getting the archive format (tar, zip, ...) and
compression format (gzip, bzip2, ...) of the sources.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py

8 years agoIntroduce PkgPolicy.is_valid_orig_archive()
Markus Lehtonen [Mon, 9 Jul 2012 13:10:37 +0000 (16:10 +0300)]
Introduce PkgPolicy.is_valid_orig_archive()

A new method for checking if the given filename is usable as a orig
(upstream) source archive.

Also, takes this method into use in the UpstreamSource class.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py

8 years agoUpstreamSource.pack: support prefix mangling
Markus Lehtonen [Thu, 14 Jun 2012 16:30:26 +0000 (19:30 +0300)]
UpstreamSource.pack: support prefix mangling

Add support for changing the prefix directory inside the tarball that is
generated. Also, fixes a bug that caused a "prefix-less" tarball to get
one, if unpacked and then repacked.

Also, adds this support to repack_source() in common/import_orig.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py
gbp/scripts/common/import_orig.py

8 years agoimport-orig: move repacked_tarball_name() out from common
Markus Lehtonen [Fri, 15 Jun 2012 06:00:35 +0000 (09:00 +0300)]
import-orig: move repacked_tarball_name() out from common

Moves repacked_tarball_name() from scripts/common back to the
Debian-specific script. The logic is too Debian-specific for RPM, after
all.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/import_orig.py
gbp/scripts/import_orig.py

8 years agoimport-orig: simplify repack_source() and tmpdir handling
Markus Lehtonen [Fri, 15 Jun 2012 05:43:12 +0000 (08:43 +0300)]
import-orig: simplify repack_source() and tmpdir handling

Now a tmpdir is always created and sources are always unpacked into
there.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/common/import_orig.py
gbp/scripts/import_orig.py

8 years agoimport-orig: implement --create-missing-branches option
Markus Lehtonen [Wed, 12 Feb 2014 13:11:30 +0000 (15:11 +0200)]
import-orig: implement --create-missing-branches option

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

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/scripts/import_orig.py

8 years agodocs: enable building html docs with docbook2html
Markus Lehtonen [Mon, 13 Feb 2012 10:28:13 +0000 (12:28 +0200)]
docs: enable building html docs with docbook2html

This is useful if sgml2x package is not available.

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

8 years agoGitRepository: add diff_status method
Markus Lehtonen [Fri, 14 Sep 2012 10:40:14 +0000 (13:40 +0300)]
GitRepository: add diff_status method

This is a method of getting the filename and status information of a
diff. That is, a list of files that changed and their status, "added",
"modified" etc.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agogbp.git: Reimplement rfc822 date parsing without dateutil
Ed Bartosh [Wed, 30 May 2012 06:02:55 +0000 (09:02 +0300)]
gbp.git: Reimplement rfc822 date parsing without dateutil

In order to get rid of dependency to dateutil.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
debian/control

8 years agopq/parse_gbp_commands: return non-matched lines
Markus Lehtonen [Thu, 30 Jan 2014 15:46:18 +0000 (17:46 +0200)]
pq/parse_gbp_commands: return non-matched lines

In order to make it easy to re-use this function in changelog
generation.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.add_files: consistently update ALL tracked files
Markus Lehtonen [Tue, 3 Sep 2013 13:09:11 +0000 (16:09 +0300)]
GitRepository.add_files: consistently update ALL tracked files

Use the --all option of git-add so that all tracked files are updated in
all conditions. Previously deletion of tracked files was not staged, for
example.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/git/repository.py

8 years agoGitRepository.add_files: use GitArgs
Markus Lehtonen [Fri, 6 Jul 2012 12:51:14 +0000 (15:51 +0300)]
GitRepository.add_files: use GitArgs

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/git/repository.py

8 years agoGitRepository: allow repo inititialization from subdir
Markus Lehtonen [Tue, 5 Jun 2012 11:55:19 +0000 (14:55 +0300)]
GitRepository: allow repo inititialization from subdir

This allows initialization of a GitRepository object, even if the
current working directory (or path given to GitRepository) is not the
top level directory of the git repository.

Don't guess the git meta data dir, but, take it as reported by git
itself.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository: Implement status method
Ed Bartosh [Wed, 6 Jun 2012 11:45:44 +0000 (14:45 +0300)]
GitRepository: Implement status method

Simple wrapper to the git-status command.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository: raise GitRepositoryError instead of GbpError
Markus Lehtonen [Mon, 25 Mar 2013 13:57:24 +0000 (15:57 +0200)]
GitRepository: raise GitRepositoryError instead of GbpError

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository/rev_parse: use _git_inout()
Markus Lehtonen [Tue, 11 Sep 2012 12:08:13 +0000 (15:08 +0300)]
GitRepository/rev_parse: use _git_inout()

instead of the deprecated _git_getoutput() method.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository/git_command: strip stderr output in case of error
Markus Lehtonen [Wed, 11 Dec 2013 13:50:13 +0000 (15:50 +0200)]
GitRepository/git_command: strip stderr output in case of error

In order to get rid of extra line feeds in exception message.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository/has_submodules: add treeish argument
Markus Lehtonen [Fri, 27 Jun 2014 05:36:29 +0000 (08:36 +0300)]
GitRepository/has_submodules: add treeish argument

For defining a Git treeish which to look into, instead of the current
working copy.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.create_branch: add 'force' option
Markus Lehtonen [Fri, 13 Sep 2013 06:53:16 +0000 (09:53 +0300)]
GitRepository.create_branch: add 'force' option

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.commit_files: add edit argument
Markus Lehtonen [Wed, 5 Feb 2014 14:11:42 +0000 (16:11 +0200)]
GitRepository.commit_files: add edit argument

In order to be able to spawn an editor, similarly to other commitX
methods in GitRepository.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/git/repository.py

8 years agoGitRepository.commit_all: add committer_info argument
Markus Lehtonen [Wed, 5 Feb 2014 14:11:42 +0000 (16:11 +0200)]
GitRepository.commit_all: add committer_info argument

For setting the committer name/email/date - similarly to author_info.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
8 years agoGitRepository.commit_files: add committer_info argument
Markus Lehtonen [Wed, 5 Feb 2014 14:11:42 +0000 (16:11 +0200)]
GitRepository.commit_files: add committer_info argument

For setting the committer name/email/date - similarly to author_info.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/git/repository.py

8 years agoGbpOptionParser: allow using the default 'dest' attribute
Markus Lehtonen [Mon, 20 May 2013 08:28:51 +0000 (11:28 +0300)]
GbpOptionParser: allow using the default 'dest' attribute

Make it possible to add options without explicitly defining the 'dest'
attribute - in which case the default of OptionParser is used.

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