Merge ~ycheng-twn/pc-enablement/+git/oem-scripts:0002_umadision into ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master

Proposed by Yuan-Chen Cheng
Status: Merged
Merged at revision: 041bf599338d75a1c678d98898b71173f5c0eb4a
Proposed branch: ~ycheng-twn/pc-enablement/+git/oem-scripts:0002_umadision
Merge into: ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master
Diff against target: 98 lines (+51/-3)
5 files modified
debian/changelog (+13/-2)
debian/links (+1/-0)
setup.py (+1/-0)
tests/test_flake8 (+2/-1)
umadision (+34/-0)
Reviewer Review Type Date Requested Status
Shih-Yuan Lee Approve
Review via email: mp+405292@code.launchpad.net

Commit message

add umadision to query debian site with ubuntu distro which is more than 1 time faster.

To post a comment you must log in.
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 378680c..8342b9e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,8 +1,19 @@
6 oem-scripts (0.99) UNRELEASED; urgency=medium
7
8+ [ Yuan-Chen Cheng]
9 * launchpad-api: refine message and add handy test.
10-
11- -- Yuan-Chen Cheng <yc.cheng@canonical.com> Fri, 04 Jun 2021 13:00:53 +0800
12+ * umadision, debian/links, setup.py, tests/test_flake8: add script to
13+ query qa.debian for ubuntu pkg because it response faster.
14+
15+ [ Jeremy Szu ]
16+ * recovery-from-iso.sh: with stella image support.
17+ Need to use the image build after pc-stella-cmit-focal-amd64-X00-20210617-1562.iso
18+ because the ubuntu recovery needs to support recovery_type=dev.
19+ This patch is just for supporting re-deploy, the auto sanity check
20+ will be supported in the future.
21+ Inject ssh key, nopasswd for automation
22+
23+ -- Yuan-Chen Cheng <yc.cheng@canonical.com> Wed, 07 Jul 2021 11:37:50 +0800
24
25 oem-scripts (0.98) focal; urgency=medium
26
27diff --git a/debian/links b/debian/links
28index e77a689..327b5c7 100644
29--- a/debian/links
30+++ b/debian/links
31@@ -1,3 +1,4 @@
32 /usr/bin/pkg-oem-meta /usr/bin/pkg-somerville-meta
33 /usr/bin/pkg-oem-meta /usr/bin/pkg-stella-meta
34 /usr/bin/pkg-oem-meta /usr/bin/pkg-sutton-meta
35+/usr/bin/umadision /usr/bin/dmadision
36diff --git a/setup.py b/setup.py
37index f944b38..e9054ce 100644
38--- a/setup.py
39+++ b/setup.py
40@@ -61,6 +61,7 @@ Also there is a meta package oem-dev-tools that installs all scripts""",
41 "bug-bind.py",
42 "mir-bug",
43 "check-ssid-duplicated.sh",
44+ "umadision"
45 ],
46 packages=find_packages(),
47 data_files=[("share/oem-scripts", ["config.sh"])],
48diff --git a/tests/test_flake8 b/tests/test_flake8
49index deb8ef0..6447121 100755
50--- a/tests/test_flake8
51+++ b/tests/test_flake8
52@@ -11,4 +11,5 @@ flake8 --ignore E501,W503,E203 \
53 pkg-list \
54 pkg-oem-meta \
55 review-merge-proposal \
56- setup.py
57+ setup.py \
58+ umadision
59diff --git a/umadision b/umadision
60new file mode 100755
61index 0000000..7694aa4
62--- /dev/null
63+++ b/umadision
64@@ -0,0 +1,34 @@
65+#!/usr/bin/python3
66+
67+import requests
68+import sys
69+
70+
71+def usage():
72+ print("umadision DEB_PKG_NAME")
73+ print("Query qa.debian.org for ubuntu pkg version")
74+ print()
75+ print("dmadision DEB_PKG_NAME")
76+ print("Query qa.debian.org for debian pkg version")
77+
78+
79+if len(sys.argv) != 2:
80+ usage()
81+ sys.exit(0)
82+
83+pkg = sys.argv[1]
84+dist = "ubuntu"
85+if "dmadision" in sys.argv[0]:
86+ dist = "debian"
87+
88+url = f"https://qa.debian.org/madison.php?package={pkg}&table={dist}&text=on"
89+
90+r = requests.get(url)
91+
92+if r.status_code == requests.codes.ok:
93+ pass
94+else:
95+ print("Get f{url} failed")
96+ sys.exit(-1)
97+
98+print(r.text)

Subscribers

People subscribed via source and target branches