Commit Graph

13 Commits

Author SHA1 Message Date
Jeremy Cline ee1ee0467b extra-files: Write a metadata file enumerating extra files
Introduces a new metadata file to track arbitrary files added during the
extra-files phase. This file is placed in the root of each tree and is
called ``extra_files.json``. It is a JSON file containing a single
object, which contains a "header" key with an object describing the
metadata, and a "data" key, which is an array of objects, where each
object represents a file. Each object contains the "file", "checksums",
and "size" keys. "file" is the relative path from the tree root to the
extra file. "checksums" is an object containing one or more checksums,
where the key is the digest type and the value of that key is the hex
digest. Finally, the size is the size of the file in bytes.

For example:
{
  "header": {"version": "1.0},
  "data": [
    {
      "file": "GPL",
      "checksums": {
        "sha256": "8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643"
      },
      "size": 18092
    },
    {
      "file": "release-notes/notes.html",
      "checksums": {
        "sha256": "82b1ba8db522aadf101dca6404235fba179e559b95ea24ff39ee1e5d9a53bdcb"
      },
      "size": 1120
    }
  ]
}

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Fixes: #295
2016-09-07 13:02:48 +02:00
Lubomír Sedlář e1ab519542 [scm] Add logging for exporting local files
This will avoid confusion when the file can not be found, but previous
export from remote location worked well. In such case the log said:

    Exporting from SCM...
    Boom, no files found...

This commit changes it into:

    Exporting from SCM...
    Exporting file from current working dir...
    Boom, no files found...

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 08:07:23 +02:00
Lubomír Sedlář b67f6369db [extra-files] Copy files using existing function
Instead of calling cp as a system command. This will help debug problems
if something fails.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-23 07:25:52 +02:00
Lubomír Sedlář 2abf9511c9 [scm-wrapper] Remove unused method
It should have raised NotImplementedError, but we better remove it
altogher since we are missing export_dir anyway.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 29a2b45fb4 [scm-wrapper] Report when file wrapper did not match anything
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 3ac7148b38 [scm-wrapper] Use context manager for managing temp dir
This is a sure way to have it removed, without having to duplicate the
logic in all places where it is used.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 6daf43f72e [scm-wrapper] Reduce code duplication in RPM wrapper
The logic for expanding the list of patterns into a list of actual RPM
paths was duplicated for both exporting a directory and file.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 770ca9c202 [scm-wrapper] Copy files directly
Instead of spawning `cp x/* y` there is now Python code to the same
thing. This should help with debugging if something fails as the
traceback will be more informative (rather than saying a command
failed). As another benefit the tests get much simpler.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubomír Sedlář 5d14304dd1 [scm-wrapper] Reduce code duplication
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-04-18 14:24:43 +02:00
Lubos Kocman 7ec409a236 scm.py: use git clone instead git archive for http(s)://
Signed-off-by: Lubos Kocman <lkocman@redhat.com>
2016-01-14 06:42:57 -05:00
Dennis Gilmore f828850466 tell the scm wrapper to do an absolute import otherwise we hit a
circular dep issue and things go wonky

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2015-04-24 17:51:28 -05:00
Dennis Gilmore 07e90f0f96 change pypungi imports to pungi 2015-03-12 16:12:38 -05:00
Daniel Mach f116d9384f Initial code merge for Pungi 4.0. 2015-02-10 08:19:34 -05:00