~ubuntu-branches/ubuntu/karmic/sugar-toolkit/karmic

« back to all changes in this revision

Viewing changes to debian/patches/2003_bundlebuilder_exit_nonzero_on_error.patch

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-12-03 23:48:42 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081203234842-guzkdy09koa7dc6p
Tags: 0.82.11-6
Add patch 0001 to fix locale path for system activities. Closes:
bug#507719.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
 
2
--- a/src/sugar/activity/bundlebuilder.py
 
3
+++ b/src/sugar/activity/bundlebuilder.py
 
4
@@ -120,6 +120,7 @@ class Builder(object):
 
5
             retcode = subprocess.call(args)
 
6
             if retcode:
 
7
                 print 'ERROR - msgfmt failed with return code %i.' % retcode
 
8
+                exit (1)
 
9
 
 
10
             cat = gettext.GNUTranslations(open(mo_file, 'r'))
 
11
             translated_name = cat.gettext(self.config.activity_name)
 
12
@@ -132,7 +133,7 @@ class Builder(object):
 
13
         files = self.config.bundle.get_files()
 
14
 
 
15
         if not files:
 
16
-            logging.error('No files found, fixing the MANIFEST.')
 
17
+            logging.warn('No files found, fixing the MANIFEST.')
 
18
             self.fix_manifest()
 
19
             files = self.config.bundle.get_files()
 
20
 
 
21
@@ -258,8 +259,9 @@ def cmd_dev(config, args):
 
22
     '''Setup for development'''
 
23
 
 
24
     if args:
 
25
+        print 'ERROR - Wrong argument.'
 
26
         print 'Usage: %prog dev'
 
27
-        return
 
28
+        exit (1)
 
29
 
 
30
     bundle_path = env.get_user_activities_path()
 
31
     if not os.path.isdir(bundle_path):
 
32
@@ -272,13 +274,15 @@ def cmd_dev(config, args):
 
33
             print 'ERROR - The bundle has been already setup for development.'
 
34
         else:
 
35
             print 'ERROR - A bundle with the same name is already installed.'
 
36
+        exit (1)
 
37
 
 
38
 def cmd_dist_xo(config, args):
 
39
     '''Create a xo bundle package'''
 
40
 
 
41
     if args:
 
42
+        print 'ERROR - Wrong argument.'
 
43
         print 'Usage: %prog dist_xo'
 
44
-        return
 
45
+        exit (1)
 
46
    
 
47
     packager = XOPackager(Builder(config))
 
48
     packager.package()
 
49
@@ -287,8 +291,9 @@ def cmd_fix_manifest(config, args):
 
50
     '''Add missing files to the manifest'''
 
51
 
 
52
     if args:
 
53
+        print 'ERROR - Wrong argument.'
 
54
         print 'Usage: %prog fix_manifest'
 
55
-        return
 
56
+        exit (1)
 
57
 
 
58
     builder = Builder(config)
 
59
     builder.fix_manifest()
 
60
@@ -297,8 +302,9 @@ def cmd_dist_source(config, args):
 
61
     '''Create a tar source package'''
 
62
 
 
63
     if args:
 
64
+        print 'ERROR - Wrong argument.'
 
65
         print 'Usage: %prog dist_source'
 
66
-        return
 
67
+        exit (1)
 
68
 
 
69
     packager = SourcePackager(config)
 
70
     packager.package()
 
71
@@ -311,8 +317,9 @@ def cmd_install(config, args):
 
72
                       help='Prefix to install files to')
 
73
     (suboptions, subargs) = parser.parse_args(args)
 
74
     if subargs:
 
75
+        print 'ERROR - Wrong argument.'
 
76
         parser.print_help()
 
77
-        return
 
78
+        exit (1)
 
79
 
 
80
     installer = Installer(Builder(config))
 
81
     installer.install(suboptions.prefix)
 
82
@@ -321,8 +328,9 @@ def cmd_genpot(config, args):
 
83
     '''Generate the gettext pot file'''
 
84
 
 
85
     if args:
 
86
+        print 'ERROR - Wrong argument.'
 
87
         print 'Usage: %prog genpot'
 
88
-        return
 
89
+        exit (1)
 
90
 
 
91
     po_path = os.path.join(config.source_dir, 'po')
 
92
     if not os.path.isdir(po_path):
 
93
@@ -354,22 +362,24 @@ def cmd_genpot(config, args):
 
94
     retcode = subprocess.call(args)
 
95
     if retcode:
 
96
         print 'ERROR - xgettext failed with return code %i.' % retcode
 
97
+       exit (1)
 
98
 
 
99
 def cmd_release(config, args):
 
100
     '''Do a new release of the bundle'''
 
101
 
 
102
     if args:
 
103
+        print 'ERROR - Wrong argument.'
 
104
         print 'Usage: %prog release'
 
105
-        return
 
106
+        exit (1)
 
107
 
 
108
     if not os.path.isdir('.git'):
 
109
         print 'ERROR - this command works only for git repositories'
 
110
-        return
 
111
+        exit (1)
 
112
 
 
113
     retcode = subprocess.call(['git', 'pull'])
 
114
     if retcode:
 
115
         print 'ERROR - cannot pull from git'
 
116
-        return
 
117
+        exit (1)
 
118
 
 
119
     print 'Bumping activity version...'
 
120
 
 
121
@@ -440,22 +450,22 @@ def cmd_release(config, args):
 
122
     retcode = subprocess.call(['git', 'commit', '-a', '-m % s' % changelog])
 
123
     if retcode:
 
124
         print 'ERROR - cannot commit to git'
 
125
-        return
 
126
+        exit (1)
 
127
 
 
128
     retcode = subprocess.call(['git', 'tag', 'v%s' % version])
 
129
     if retcode:
 
130
         print 'ERROR - cannot tag the commit'
 
131
-        return
 
132
+        exit (1)
 
133
 
 
134
     retcode = subprocess.call(['git', 'push'])
 
135
     if retcode:
 
136
         print 'ERROR - cannot push to git'
 
137
-        return
 
138
+        exit (1)
 
139
     
 
140
     retcode = subprocess.call(['git', 'push', '--tags'])
 
141
     if retcode:
 
142
         print 'ERROR - cannot push tags to git'
 
143
-        return
 
144
+        exit (1)
 
145
 
 
146
     print 'Done.'
 
147
 
 
148
@@ -463,8 +473,9 @@ def cmd_build(config, args):
 
149
     '''Build generated files'''
 
150
 
 
151
     if args:
 
152
+        print 'ERROR - Wrong argument.'
 
153
         print 'Usage: %prog build'
 
154
-        return
 
155
+        exit (1)
 
156
 
 
157
     builder = Builder(config)
 
158
     builder.build()
 
159
@@ -492,7 +503,9 @@ def start(bundle_name=None):
 
160
     try:
 
161
         globals()['cmd_' + args[0]](config, args[1:])
 
162
     except (KeyError, IndexError):
 
163
+        print 'ERROR - Wrong command or argument.'
 
164
         print_commands()
 
165
+        exit (1)
 
166
 
 
167
 if __name__ == '__main__':
 
168
     start()