~mterry/snapcraft/ros-project

« back to all changes in this revision

Viewing changes to snapcraft/plugins/ubuntu.py

  • Committer: Michael Terry
  • Date: 2015-07-29 17:05:14 UTC
  • mfrom: (103.1.10 snapcraft)
  • Revision ID: michael.terry@canonical.com-20150729170514-aczn45auvspkx1sp
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
 
import apt
 
17
import logging
18
18
import os
19
 
import snapcraft.common
20
19
import subprocess
21
20
import sys
22
21
 
 
22
import apt
 
23
 
 
24
import snapcraft.common
 
25
 
 
26
 
 
27
logger = logging.getLogger(__name__)
 
28
 
23
29
 
24
30
class UbuntuPlugin(snapcraft.BasePlugin):
25
31
 
32
38
        else:
33
39
            # User didn't specify a package, use the part name
34
40
            if name == 'ubuntu':
35
 
                snapcraft.common.log("Part %s needs either a package option or a name" % name)
 
41
                logger.error('Part %s needs either a package option or a name' % name)
36
42
                sys.exit(1)
37
43
            self.included_packages.append(name)
38
44
 
83
89
        for p in packages:
84
90
            if p not in alldeps:
85
91
                exit = True
86
 
                snapcraft.common.log("Package %s not recognized" % p, file=sys.stderr)
 
92
                logger.error('Package %s not recognized' % p, file=sys.stderr)
87
93
        if exit:
88
94
            sys.exit(1)
89
95