Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add debs plugin to easily create snaps from deb files #53
Conversation
sergiusens
reviewed
Oct 30, 2015
| + | ||
| +from snapcraft.repo import _fix_contents | ||
| +from snapcraft.common import isurl | ||
| + |
sergiusens
Oct 30, 2015
Collaborator
Can you add a docstring here explaining the plugin a bit? Use the other plugins as inspiration for the format explaining the keys and use.
longsleep
Oct 30, 2015
Contributor
Yes - i will add docs and preferably also an example - suggestions for a package which would make a fine example?
sergiusens
reviewed
Oct 30, 2015
| + def schema(cls): | ||
| + return { | ||
| + 'properties': { | ||
| + 'debs': { |
sergiusens
Oct 30, 2015
Collaborator
I have an inclination for calling this deb-packages or debian-packages, in the help we also need to mention that dependencies won't we resolved.
sergiusens
reviewed
Oct 30, 2015
| + | ||
| + def pull_file(self, source, destdir=None): | ||
| + if isurl(source): | ||
| + self.run(['wget', '-q', '-c', source], cwd=destdir) |
longsleep
Oct 30, 2015
Contributor
Sure, i can use requests - seems like snapcraft has that dependency already / i did not want to introduce any new dependencies.
sergiusens
reviewed
Oct 30, 2015
| + if isurl(source): | ||
| + self.run(['wget', '-q', '-c', source], cwd=destdir) | ||
| + else: | ||
| + self.run(['cp', os.path.join(os.getcwd(), source), destdir]) |
sergiusens
reviewed
Oct 30, 2015
| + | ||
| + def build(self): | ||
| + self.unpack_debs(self.packages, self.installdir, debdir=self.sourcedir) | ||
| + _fix_contents(debdir=self.installdir) |
sergiusens
Oct 30, 2015
Collaborator
this is a private implementation, if you wish to use it fine, but remove the _
|
Can you get |
longsleep
added some commits
Jul 31, 2015
|
Rebased to master to get travis. |
|
The integration tests failed, luckily a simple one: |
|
I'll be closing this until it is ready again. Looking forward to seeing this pass its tests. |
longsleep commentedOct 30, 2015
The debs plugin helps to easily create snaps with files built as deb packages. It can use local deb files or pull deb files from remote http urls.
Example for busybox
We use this to build armhf snaps on amd64 build platform like this:
It also allows us to use existing clean builds (cowbuilder to create deb packages) to directly use with snappy.