summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-03Rename internal var debian_branch -> packaging_branchMarkus Lehtonen7-27/+29
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>
2013-04-03Add 'packaging-dir' option to config.pyMarkus Lehtonen1-0/+5
Needed by the upcoming rpm tools. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03gbp-pull: two modes for --forceMarkus Lehtonen2-24/+46
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>
2013-04-03gbp-pull: similar update strategy for all branchesMarkus Lehtonen1-3/+10
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>
2013-04-03gbp-pull: implement --all cmdline optionMarkus Lehtonen2-4/+29
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>
2013-04-03config: add rpm-specific option parser classMarkus Lehtonen1-0/+12
Adds a new GbpOptionParserRpm class for handling rpm-specific options. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03Introduce rpm helpersMarkus Lehtonen2-0/+635
Preparation for RPM support. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com> Signed-off-by: Huang Hao <hao.h.huang@intel.com>
2013-04-03gbp-pq: readiness to configure the pq branch nameMarkus Lehtonen3-51/+109
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>
2013-04-03Universal configurable base tmpdir for all gbp toolsMarkus Lehtonen8-23/+35
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>
2013-04-03Add gbp specific tempfile moduleMarkus Lehtonen1-0/+38
Minimal initial implementation that only adds tempdir parent directory creation. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Olev Kartau <olev.kartau@intel.com>
2013-04-03buildpackage: fix exporting of working copy when run from a subdirMarkus Lehtonen2-13/+14
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>
2013-04-03buildpackage: new "working copy" choices for --git-exportMarkus Lehtonen2-4/+9
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>
2013-04-03buildpackage: add 'untracked' option to write_wc()Markus Lehtonen1-2/+9
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>
2013-04-03GitRepository/add_files: add new option 'untracked'Markus Lehtonen2-1/+10
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>
2013-04-03GitRepository/add_files: use GitArgsMarkus Lehtonen1-5/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03config: support for per-tree config filesMarkus Lehtonen1-5/+21
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>
2013-04-03config: read the right config if run from subdirMarkus Lehtonen3-15/+48
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. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03UpstreamSource/guess_version: detect more compression formatsMarkus Lehtonen1-6/+10
By utilizing the parse_archive_filename() function that detects e.g. "alias suffixes" such as 'tgz'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03UpstreamSource: introduce is_tarball() methodMarkus Lehtonen3-2/+16
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>
2013-04-03UpstreamSource: add 'archive_fmt' and 'compression' propertiesMarkus Lehtonen1-0/+25
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>
2013-04-03Introduce PkgPolicy.is_valid_orig_archive()Markus Lehtonen1-10/+9
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>
2013-04-03Change UpstreamSource to have PkgPolicyMarkus Lehtonen8-36/+62
The UpstreamSource class now gets a PkgPolicy in it's initialization. Also, introduces new DebiaUpstreamSource class which is taken in use in the scripts. The PkgPolicy is not yet used for anything in UpstreamSource. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03UpstreamSource.pack: support prefix manglingMarkus Lehtonen4-11/+38
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>
2013-04-03import-orig: move repacked_tarball_name() out from commonMarkus Lehtonen2-19/+19
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>
2013-04-03import-orig: simplify repack_source() and tmpdir handlingMarkus Lehtonen2-10/+8
Now a tmpdir is always created and sources are always unpacked into there. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03import-orig: keep working copy in sync with branch HEADMarkus Lehtonen1-0/+6
Update working copy and index (to branch HEAD) if we modify the currently checked-out branch. Otherwise the repository is left in unclean state when the current branch is upstream or pristine-tar and the '--no-merge' option is used. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03Move get_compression() out of pkg.PkgPolicy classMarkus Lehtonen2-23/+63
Renames the function to parse_archive_filename() and changes it's return values. Filename parsing is merely generic functionality, not tied to any packaging policy. The function now returns the base name of the file (that is, filename without, archive and compression extensions), archive format and compression method. Adds supported archive formats 'tar' and 'zip' and file extension aliases, e.g. 'tgz'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03docs: enable building html docs with docbook2htmlMarkus Lehtonen2-0/+42
This is useful if sgml2x package is not available. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository: add diff_status methodMarkus Lehtonen2-0/+40
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>
2013-04-03GitRepository: add format_patch methodMarkus Lehtonen2-0/+71
A method for generating one patch, with the possibility to filter the git patch through a python function. Always generates textual diffs as the 'patch' utility doesn't support git binary diffs. Ignore changes to submodules in patch generation as these diffs cannot be applied by the patch utility when building packages. TODO: convert all code to use the new format_patch() and get rid of the format_patches() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository/get_commit_info: add patchname to infoMarkus Lehtonen2-3/+6
Add a new 'patchname' field to the information returned by get_commit_info. That is, the subject in a sanitized format, similar to what git-format-patch uses. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03buildpackage/dump_tree: use GitRepository.archive()Markus Lehtonen1-34/+24
Make dump_tree() utilize the GitRepository.archive() method - similarly to git_archive_submodules() - instead of ad-hoc Python pipes. This makes dump_tree() work independent of the callers current working directory. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03buildpackage/git_archive_single: use GitRepository.archive()Markus Lehtonen2-10/+24
Use GitRepository.archive() method like git_archive_submodules() does. This makes it possible to call git_archive_single() independent of the callers current working directory. Get rid of the pipe in git_archive_single() and utilize the filter function of archive() method of GitRepository, instead. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository: rewrite git_archive()Markus Lehtonen3-9/+24
Add support for filtering. That is, allow the caller to pipe the output of git-archive through a filter command, usually a compression program. This utilizes the new filtering functionality of the _git_inout() method. Also, gets rid of the hackish use of 'cwd' option. The 'output' is now considered to be relative to the caller's cwd, not the git repo dir. This should be more intuitive. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03Change compressor cmdline opts in compressor_opts to a listMarkus Lehtonen2-6/+9
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository/_git_inout: implement support for filteringMarkus Lehtonen1-6/+26
Support filtering of the output of git command through a python function. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03common/buildpackage: support for different archive formatsMarkus Lehtonen2-20/+37
Adds support for defining the archive format of the output of git_archive_single(), e.g. 'zip'. Defaults to 'tar', as before. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03tests: add test for archiving without git submodulesMarkus Lehtonen1-10/+16
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03gbp.git: Reimplement rfc822 date parsing without dateutilEd Bartosh2-7/+26
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>
2013-04-03GitRepository: allow repo inititialization from subdirMarkus Lehtonen2-14/+32
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>
2013-04-03GitRepository: Implement status methodEd Bartosh2-0/+55
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>
2013-04-03GitRepository/get_remote_repos: return URLs, tooMarkus Lehtonen2-5/+21
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. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository/find_tag: add 'longfmt' and 'always' optionsMarkus Lehtonen2-6/+19
Add 'longfmt' for getting the tag name in the long format (tag, number of commits and sha1) and 'always' for falling back to sha1 if no (matching) tag name is found. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository: raise GitRepositoryError instead of GbpErrorMarkus Lehtonen3-7/+7
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository.show: use _git_inout()Markus Lehtonen1-2/+3
Instead of the deprecated _git_getoutput() method. Also, capture stderr and put the error message to the exception, instead. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03Support unit tests on Ubuntu: allow "ubuntu" as part of versionOlev Kartau1-12/+12
In tests/11_test_dch_main.py, there are checks for package names. This change adds "ubuntu" and related release bane strings ORed in regexp match to the patterns that are expecteds in assert statements. Signed-off-by: Olev Kartau <olev.kartau@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03GitRepository/rev_parse: use _git_inout()Markus Lehtonen1-2/+3
instead of the deprecated _git_getoutput() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-03Add .coveragercMarkus Lehtonen1-0/+2
To get correct report if coverage is invoked directly (not through nose/disttools) in order to get an xml report, for example. Currently only used for restricting the coverage output to the gbp python package. That is, same thing that 'cover-package' option in setup.cfg does. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-29Move DscFile to separate moduleGuido Günther3-87/+118
2013-03-29Move DebianPkgPolicy to separate moduleGuido Günther2-63/+87