Ubuntu Pastebin

Paste from sergiusens at Wed, 5 Aug 2015 12:01:56 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
=== modified file 'snapcraft/plugins/python2.py'
--- snapcraft/plugins/python2.py	2015-08-04 21:54:52 +0000
+++ snapcraft/plugins/python2.py	2015-08-05 11:56:16 +0000
@@ -24,7 +24,7 @@
         super().__init__(name, options)
 
         class UbuntuOptions:
-            package = "python-dev"
+            packages = ["python-dev", "python-setuptools"]
         self.ubuntu = ubuntu.UbuntuPlugin(name, UbuntuOptions())
 
     # note that we don't need to set PYTHONHOME here,

=== modified file 'snapcraft/plugins/python2_project.py'
--- snapcraft/plugins/python2_project.py	2015-08-03 18:21:58 +0000
+++ snapcraft/plugins/python2_project.py	2015-08-05 12:01:24 +0000
@@ -14,6 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import os
+
 import snapcraft
 
 
@@ -26,6 +28,9 @@
         return self.handle_source_options()
 
     def build(self):
+        env = os.environ.copy()
+        env['PYTHONPATH'] = '{}/usr/lib/python2.7/dist-packages'.format(self.installdir)
         return self.run(
             ["python2", "setup.py", "install", "--install-layout=deb",
-             "--prefix={}/usr".format(self.installdir)])
+             "--prefix={}/usr".format(self.installdir)],
+            env=env)

=== modified file 'snapcraft/plugins/ubuntu.py'
--- snapcraft/plugins/ubuntu.py	2015-07-23 14:23:29 +0000
+++ snapcraft/plugins/ubuntu.py	2015-08-05 11:55:56 +0000
@@ -33,8 +33,8 @@
         super().__init__(name, options)
         self.downloadable_packages = []
         self.included_packages = []
-        if options.package:
-            self.included_packages.append(options.package)
+        if options.packages:
+            [self.included_packages.append(p)for p in options.packages]
         else:
             # User didn't specify a package, use the part name
             if name == 'ubuntu':
@@ -89,7 +89,7 @@
         for p in packages:
             if p not in alldeps:
                 exit = True
-                logger.error('Package %s not recognized' % p, file=sys.stderr)
+                logger.error('Package %s not recognized' % p)
         if exit:
             sys.exit(1)
 
Download as text