You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,3 +34,8 @@ optional arguments:
34
34
|`sudo ubports-qa remove xenial_-_somebranch`| Remove the `xenial_-_somebranch` ppa and upgrade all packages |
35
35
|`ubports-qa list`| List all installed testing-PPAs |
36
36
|`sudo ubports-qa update`| Upgrade all packages |
37
+
38
+
39
+
### Contributing
40
+
41
+
When modifying the ubports-qa script, run [black](https://github.com/ambv/black) before you commit. This helps to reduce the diffs between commits and keeps formatting simple.
"""Prints error_message in red and exits with status 3"""
152
+
print_error(error_message)
153
+
exit(3)
154
+
155
+
156
+
definstall_command(args):
157
+
"""Install a PPA or Pull Request"""
99
158
ifargs.pr!=-1:
100
159
args.repo.replace("ubports/", "")
101
-
ref=get_issue_branch(args.repo, args.pr);
102
-
status=get_issue_status(args.repo, ref);
160
+
ref=get_issue_branch(args.repo, args.pr)
161
+
status=get_issue_status(args.repo, ref)
103
162
ifstatus==Status.FAILED:
104
163
die("Issue failed to build")
105
164
ifstatus==Status.BUILDING:
106
165
die("Issue is currently building")
107
-
add_list(args.repo)
108
-
apt_update()
109
-
apt_upgrade()
166
+
withWritableRootFS():
167
+
add_list(args.repo)
168
+
apt_update()
169
+
apt_upgrade()
110
170
111
-
defremove(args):
112
-
ensure_root()
113
-
ifnotlist_exists(args.repo):
114
-
die("Repo %s is not installed"%args.repo)
115
-
remove_list(args.repo)
116
-
update(args)
117
-
118
-
deflist(args):
119
-
print(" ".join(list_lists()))
120
171
121
-
defupdate(args):
122
-
ensure_root()
123
-
mount()
124
-
apt_update()
125
-
apt_upgrade()
126
-
unmount()
127
-
128
-
parser=argparse.ArgumentParser(description='The UBports QA scripts allow you to efficiently manage PPAs from repo.ubports.com for testing deb components. See http://docs.ubports.com/en/latest/about/process/ppa.html.')
129
-
subparsers=parser.add_subparsers(help='')
172
+
defremove_command(args):
173
+
"""Remove and uninstall a PPA"""
174
+
ifnotlist_exists(args.repo):
175
+
die("Repo {} is not installed".format(args.repo))
176
+
withWritableRootFS():
177
+
remove_list(args.repo)
178
+
apt_update()
179
+
apt_upgrade()
130
180
131
-
parser_install=subparsers.add_parser('install', help='Install a ppa or pull-request', description='Install a ppa or pull-request. See http://docs.ubports.com/en/latest/about/process/ppa.html.')
132
-
parser_install.add_argument('repo', type=str, help='Name of a PPA on repo.ubports.com. Alternatively, if the \'pr\' argument is provided, the name of a git repository can be specified to automatically add the PPA from a pull-request.')
133
-
parser_install.add_argument('pr', type=int, help='Numeric ID of a pull-request on the git repository specified in the \'repo\' argument. If \'repo\' is supposed to be the name of a ppa, the \'pr\' argument should not be specified.', nargs='?', default=-1)
134
-
parser_install.set_defaults(func=install)
135
181
136
-
parser_remove=subparsers.add_parser('remove', help='Remove and uninstall a PPA', description='Remove and uninstall a ppa')
137
-
parser_remove.add_argument('repo', type=str, help='Name of the ppa')
parser_update=subparsers.add_parser('update', help='Update all packages using apt', description='Update all packages using apt')
144
-
parser_update.set_defaults(func=update)
187
+
defupdate_command(args):
188
+
"""Update all packages using apt"""
189
+
withWritableRootFS():
190
+
apt_update()
191
+
apt_upgrade()
192
+
193
+
194
+
parser=argparse.ArgumentParser(
195
+
description="The UBports QA scripts allow you to efficiently manage PPAs from repo.ubports.com for testing deb components. See http://docs.ubports.com/en/latest/about/process/ppa.html."
196
+
)
197
+
subparsers=parser.add_subparsers(help="")
198
+
199
+
parser_install=subparsers.add_parser(
200
+
"install",
201
+
help=install_command.__doc__,
202
+
description="Install a ppa or pull-request. See http://docs.ubports.com/en/latest/about/process/ppa.html.",
203
+
)
204
+
parser_install.add_argument(
205
+
"repo",
206
+
type=str,
207
+
help="Name of a PPA on repo.ubports.com. Alternatively, if the 'pr' argument is provided, the name of a git repository can be specified to automatically add the PPA from a pull-request.",
208
+
)
209
+
parser_install.add_argument(
210
+
"pr",
211
+
type=int,
212
+
help="Numeric ID of a pull-request on the git repository specified in the 'repo' argument. If 'repo' is supposed to be the name of a ppa, the 'pr' argument should not be specified.",
213
+
nargs="?",
214
+
default=-1,
215
+
)
216
+
parser_install.set_defaults(func=install_command)
217
+
218
+
parser_remove=subparsers.add_parser(
219
+
"remove", help=remove_command.__doc__, description="Remove and uninstall a ppa"
220
+
)
221
+
parser_remove.add_argument("repo", type=str, help="Name of the ppa")
0 commit comments