summaryrefslogtreecommitdiff
path: root/gbp/pkg
AgeCommit message (Collapse)AuthorFilesLines
2014-11-14UpstreamSource.unpack: return UpstreamSource instanceMarkus Lehtonen1-3/+11
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 Lehtonen1-13/+76
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-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 Lehtonen1-14/+63
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 Lehtonen1-0/+10
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 Lehtonen1-6/+18
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-14Change compressor cmdline opts in compressor_opts to a listMarkus Lehtonen1-4/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-11-14UpstreamSource.guess_version: recognise debian native tarballsMarkus Lehtonen1-1/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-07-24Make pychecker happyGuido Günther1-2/+2
We don't use the class variable anywhere
2014-07-24UpstreamSource: move version guessing logic to PkgPolicyMarkus Lehtonen1-51/+61
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
2014-07-24Change UpstreamSource to have PkgPolicyMarkus Lehtonen1-2/+3
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>
2014-07-24UpstreamSource.guess_version: don't check for directoriesMarkus Lehtonen1-11/+5
Directories are not recognized anyway, if guess_version() is called for non-existent sources. And, parse_archive_filename() works fine for directory names, too. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-07-24UpstreamSource/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>
2014-07-24Fix typosGuido Günther1-4/+4
2014-07-24Move get_compression() out of pkg.PkgPolicy classMarkus Lehtonen1-21/+60
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-03-22Better document how one derives from PkgTypesGuido Günther1-1/+25
2013-03-22Return boolean types from is_ methodsGuido Günther1-3/+5
instead of a match object or None
2013-03-22Remove unused importsGuido Günther1-2/+0
2012-07-02Make exception syntax consistentGuido Günther1-5/+5
2012-06-30PristineTar: move Debian-specific stuff to DebianPristineTarMarkus Lehtonen1-44/+15
Continuation to the PristineTar refactoring, makes the "common" PristineTar independent of DebianPkgPolicy. This commit moves the Debian-specific has_commit() and checkout() methods to DebianPristineTar class and replaces them with more generic functions in the base class. Also, drops the Debian-specific get_commit() method completely, as it was not used outside the PristineTar class itself. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-25UpstreamSource: automatically detect package name and versions from directoriesGuido Günther1-3/+10
of the form packagename-<version>
2012-05-25Refactor deb helpers: move PristineTar classGuido Günther1-0/+115
Based on a patch by Markus Lehtonen This refactor is preparation to the upcoming rpm support.
2012-05-01Refactor deb helpers: move UpstreamSource classMarkus Lehtonen1-0/+205
to pkg base module. This refactor is preparation to the upcoming rpm support.
2012-05-01Refactor deb helpers: introduce PkgPolicy classMarkus Lehtonen1-0/+104
Create a new 'pkg' basemodule, intended to be re-used by the upcoming rpm package helpers. Move some deb functionality to a new pkg.PkgPolicy class, to be used as a base for different package types. Introduces Deb-specific deb.DebianPkgPolicy.