Merge lp:~sergiusens/snapcraft/0.2-framework-policies into lp:snapcraft/0.2

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 210
Merged at revision: 210
Proposed branch: lp:~sergiusens/snapcraft/0.2-framework-policies
Merge into: lp:snapcraft/0.2
Diff against target: 93 lines (+40/-3)
4 files modified
integration-tests/data/framework-policy/snapcraft.yaml (+14/-0)
integration-tests/units/jobs.pxu (+11/-0)
schema/snapcraft.yaml (+4/-0)
snapcraft/meta.py (+11/-3)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/0.2-framework-policies
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Michael Vogt (community) Approve
Review via email: mp+272887@code.launchpad.net

Commit message

Backport rev 221 from trunk: Support framework policies

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) :
review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (215.3 KiB)

The attempt to merge lp:~sergiusens/snapcraft/0.2-framework-policies into lp:snapcraft/0.2 failed. Below is the output from the failed tests.

The project has gotten complex.
Here's the list of units exceeding 10:
- snapcraft/cmds.py:
  286:1: 'cmd' 13

name: # the name of the snap
version: # the version of the snap
# The vendor for the snap (replace 'Vendor <email address hidden>')
vendor: Vendor <email address hidden>
summary: # 79 char long summary
description: # A longer description for the snap
icon: # A path to an icon for the package
cp --preserve=all -R zzz /tmp/tmpc86fvwnt/parts/copy/install/zzz
cp --preserve=all -R src /tmp/tmp0zjfo1_2/parts/copy/install/dst
cp --preserve=all -R src /tmp/tmpcvovtmmt/parts/copy/install/dir/dst
===============================[ Analyzing Jobs ]===============================
=============================[ Session Statistics ]=============================
This session is about 0.00% complete
Estimated duration cannot be determined for automated jobs.
Estimated duration cannot be determined for manual jobs.
Size of the desired job list: 28
Size of the effective execution plan: 28
===========================[ Running Selected Jobs ]============================
--------------[ Running job 1 / 28. Estimated time left: unknown ]--------------
--------------------------[ snapcraft/normal/no-yaml ]--------------------------
ID: 2015.com.canonical.snapcraft::snapcraft/normal/no-yaml
Category: 2013.com.canonical.plainbox::uncategorised
... 8< -------------------------------------------------------------------------
Could not find snapcraft.yaml. Are you sure you are in the right directory? To start a new project, use 'snapcraft init'
------------------------------------------------------------------------- >8 ---
Outcome: job passed
--------------[ Running job 2 / 28. Estimated time left: unknown ]--------------
------------------------[ snapcraft/normal/no-yaml-run ]------------------------
ID: 2015.com.canonical.snapcraft::snapcraft/normal/no-yaml-run
Category: 2013.com.canonical.plainbox::uncategorised
... 8< -------------------------------------------------------------------------
Could not find snapcraft.yaml. Are you sure you are in the right directory? To start a new project, use 'snapcraft init'
------------------------------------------------------------------------- >8 ---
Outcome: job passed
--------------[ Running job 3 / 28. Estimated time left: unknown ]--------------
-----------------[ snapcraft/normal/assemble-meta-externally ]------------------
ID: 2015.com.canonical.snapcraft::snapcraft/normal/assemble-meta-externally
Category: 2013.com.canonical.plainbox::uncategorised
... 8< -------------------------------------------------------------------------
Pulling make-project
Building make-project
make: Nothing to be done for `all'.
cp -a bin /tmp/cwd-j8vc368w.bf60688d24faeff46950dce53ef4aa49a856a3f4dc977454770bce18a2473736/parts/make-project/install/bin
cp -a subdir /tmp/cwd-j8vc368w.bf60688d24faeff46950dce53ef4aa49a856a3f4dc977454770bce18a2473736/parts/make-project/install/subdir
if [ -e copy-meta ]; then \
  cp -arT snappy /tmp/cwd-j8vc368w.bf60688d24faeff4695...

210. By Sergio Schvezov

Backport rev 221 from trunk: Support framework policies

Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'integration-tests/data/framework-policy'
2=== added directory 'integration-tests/data/framework-policy/dir'
3=== added file 'integration-tests/data/framework-policy/dir/a'
4=== added file 'integration-tests/data/framework-policy/dir/b'
5=== added file 'integration-tests/data/framework-policy/icon.png'
6Binary files integration-tests/data/framework-policy/icon.png 1970-01-01 00:00:00 +0000 and integration-tests/data/framework-policy/icon.png 2015-09-30 10:21:51 +0000 differ
7=== added file 'integration-tests/data/framework-policy/one'
8=== added file 'integration-tests/data/framework-policy/snapcraft.yaml'
9--- integration-tests/data/framework-policy/snapcraft.yaml 1970-01-01 00:00:00 +0000
10+++ integration-tests/data/framework-policy/snapcraft.yaml 2015-09-30 10:21:51 +0000
11@@ -0,0 +1,14 @@
12+name: assemble
13+version: 1.0
14+vendor: Sergio Schvezov <sergio.schvezov@canonical.com>
15+summary: one line summary
16+description: a longer description
17+icon: icon.png
18+framework-policy: dir
19+
20+parts:
21+ framework-project:
22+ type: copy
23+ files:
24+ one: one
25+
26
27=== modified file 'integration-tests/units/jobs.pxu'
28--- integration-tests/units/jobs.pxu 2015-09-23 13:42:57 +0000
29+++ integration-tests/units/jobs.pxu 2015-09-30 10:21:51 +0000
30@@ -52,6 +52,17 @@
31 fi
32 flags: simple has-leftovers
33
34+id: snapcraft/normal/assemble-meta-with-policy
35+command:
36+ set -ex
37+ cp -rT $PLAINBOX_PROVIDER_DATA/framework-policy .
38+ ${SNAPCRAFT} assemble
39+ test -e ./snap/meta/framework-policy/a
40+ test -e ./snap/meta/framework-policy/b
41+ test -e ./snap/one
42+ test ! -e ./snap/dir
43+flags: simple has-leftovers
44+
45 id: snapcraft/normal/local-source
46 plugin: shell
47 estimated_duration: 0.3
48
49=== modified file 'schema/snapcraft.yaml'
50--- schema/snapcraft.yaml 2015-09-21 05:04:31 +0000
51+++ schema/snapcraft.yaml 2015-09-30 10:21:51 +0000
52@@ -55,6 +55,10 @@
53 config:
54 type: string
55 description: path to a configure hook to expose configuration for the package
56+ framework-policy:
57+ type: string
58+ description: framework policies to add to the package
59+ format: file-path
60 services:
61 type: object
62 additionalProperties: false
63
64=== modified file 'snapcraft/meta.py'
65--- snapcraft/meta.py 2015-09-21 05:04:31 +0000
66+++ snapcraft/meta.py 2015-09-30 10:21:51 +0000
67@@ -54,6 +54,9 @@
68
69 config_data['icon'] = _copy(meta_dir, config_data['icon'])
70
71+ if 'framework-policy' in config_data:
72+ _copy(meta_dir, config_data['framework-policy'], 'framework-policy')
73+
74 _write_package_yaml(meta_dir, config_data, arches)
75 _write_readme_md(meta_dir, config_data)
76
77@@ -91,9 +94,14 @@
78 _write_wrap_exe(execparts[0], config_hook_path, args=args, cwd='$SNAP_APP_PATH')
79
80
81-def _copy(meta_dir, relpath):
82- new_relpath = os.path.join(meta_dir, os.path.basename(relpath))
83- shutil.copyfile(relpath, new_relpath)
84+def _copy(meta_dir, relpath, new_relpath=None):
85+ new_base = new_relpath or os.path.basename(relpath)
86+ new_relpath = os.path.join(meta_dir, new_base)
87+
88+ if os.path.isdir(relpath):
89+ shutil.copytree(relpath, new_relpath)
90+ else:
91+ shutil.copyfile(relpath, new_relpath)
92
93 return os.path.join('meta', os.path.basename(relpath))
94

Subscribers

People subscribed via source and target branches