summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-14Universal configurable base tmpdir for all gbp toolsMarkus Lehtonen7-23/+36
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>
2014-11-14buildpackage: implement --[no-]build cmdline optionMarkus Lehtonen3-0/+27
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>
2014-11-14buildpackage: fix exporting of working copy when run from a subdirMarkus Lehtonen2-12/+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>
2014-11-14buildpackage: 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>
2014-11-14buildpackage: 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>
2014-11-14GitRepository/add_files: add new option 'untracked'Markus Lehtonen2-2/+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>
2014-11-14config: 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>
2014-11-14config: read the right config if run from subdirMarkus Lehtonen3-19/+46
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>
2014-11-14tests/testutils: add directories arg to ls_* functionsMarkus Lehtonen1-7/+8
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>
2014-11-14tests.testutils: add ls_zip() helperMarkus Lehtonen1-0/+11
For listing zip contents. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14import-orig: rework sourcecode preparation and filteringMarkus Lehtonen2-122/+37
Take in to use the newly added prepare_sources() function. Drop dead, unneeded code. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14import-orig: new function for filtering/re-packing sourcesMarkus Lehtonen3-1/+273
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>
2014-11-14UpstreamSource.unpack: return UpstreamSource instanceMarkus Lehtonen5-7/+15
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>
2014-11-14UpstreamSource.pack: reuse unpacked dir if no filter is usedMarkus Lehtonen1-1/+5
Set the unpacked attribute to the source dir if the content is not filtered. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14UpstreamSource: implement prefix guessingMarkus Lehtonen3-16/+84
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>
2014-11-14UpstreamSource: check that the sources existMarkus Lehtonen1-0/+2
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14tests: test find_source() with unittestMarkus Lehtonen2-15/+64
Change doctests to unittests in order to have more flexibility in testing. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14UpstreamSource: store the absolute pathMarkus Lehtonen1-1/+1
This is more robust and reliable, e.g. in case cwd is changed. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14UpstreamSource: move version guessing logic to PkgPolicyMarkus Lehtonen2-14/+67
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>
2014-11-14UpstreamSource: 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>
2014-11-14UpstreamSource: 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>
2014-11-14Introduce 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>
2014-11-14UpstreamSource.pack: support prefix manglingMarkus Lehtonen4-11/+39
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>
2014-11-14import-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>
2014-11-14import-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>
2014-11-14import-orig: implement --create-missing-branches optionMarkus Lehtonen3-6/+24
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>
2014-11-14docs: 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>
2014-11-14GitRepository: 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>
2014-11-14gbp.git: Reimplement rfc822 date parsing without dateutilEd Bartosh2-7/+24
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>
2014-11-14pq/parse_gbp_commands: return non-matched linesMarkus Lehtonen2-3/+7
In order to make it easy to re-use this function in changelog generation. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository.add_files: consistently update ALL tracked filesMarkus Lehtonen1-0/+1
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>
2014-11-14GitRepository.add_files: use GitArgsMarkus Lehtonen1-5/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository: 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>
2014-11-14GitRepository: 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>
2014-11-14GitRepository: raise GitRepositoryError instead of GbpErrorMarkus Lehtonen3-5/+5
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository/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>
2014-11-14GitRepository/git_command: strip stderr output in case of errorMarkus Lehtonen1-1/+2
In order to get rid of extra line feeds in exception message. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository/has_submodules: add treeish argumentMarkus Lehtonen1-4/+9
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>
2014-11-14GitRepository.create_branch: add 'force' optionMarkus Lehtonen1-1/+3
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository.commit_files: add edit argumentMarkus Lehtonen1-5/+8
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>
2014-11-14GitRepository.commit_all: add committer_info argumentMarkus Lehtonen1-2/+6
For setting the committer name/email/date - similarly to author_info. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository.commit_files: add committer_info argumentMarkus Lehtonen1-3/+9
For setting the committer name/email/date - similarly to author_info. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GbpOptionParser: allow using the default 'dest' attributeMarkus Lehtonen1-5/+3
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>
2014-11-14GitRepository: implement create_tree methodMarkus Lehtonen1-9/+19
New method for creating tree objects from a directory content. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository: fix the 'edit' mode in commit methodsMarkus Lehtonen1-8/+6
Previously the editor would not show in the shell because stdout was captured. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository: allow interactive commandsMarkus Lehtonen1-10/+19
Make it possible for git commands to output directly to stdout without redirection (i.e. capturing their stdout stream). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14buildpackage: refactor tarball compressionMarkus Lehtonen1-18/+31
Introduce a new function for running the compressor commands. Unifies exception/error handling - GbpError will be returned if the compressor fails. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14buildpackage/dump_tree: add 'recursive' optionMarkus Lehtonen1-3/+8
For selecting whether to dump all the files recursively or just the top level directory of the tree. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository.archive: add 'paths' optionMarkus Lehtonen1-1/+5
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14GitRepository.archive: drop the '**kwargs' argumentMarkus Lehtonen1-4/+3
Unused and misleading. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>