Merge lp:~cameronnemo/capnet-assist/various-fixups into lp:~elementary-apps/capnet-assist/trunk

Proposed by Cameron Norman
Status: Merged
Merged at revision: 20
Proposed branch: lp:~cameronnemo/capnet-assist/various-fixups
Merge into: lp:~elementary-apps/capnet-assist/trunk
Diff against target: 270 lines (+74/-78)
7 files modified
90captive_portal_test (+4/-4)
AUTHORS (+3/-3)
README (+2/-0)
debian/control (+4/-3)
debian/copyright (+31/-39)
debian/rules (+0/-3)
src/CaptiveLogin.vala (+30/-26)
To merge this branch: bzr merge lp:~cameronnemo/capnet-assist/various-fixups
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+256249@code.launchpad.net

Description of the change

Mainly improves logging and packaging. See the individual commit descriptions for more details. I find it easier to review commit by commit (there are four) than all at once.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

I think network-manager belongs in Depends instead of Recommends, isn't it a critical dependency?

Revision history for this message
Cameron Norman (cameronnemo) wrote :

We can install without it. The captive-login binary still works. It is
just that the NM script is never run. If we ever support other wifi
daemons, we can just change it then I guess.

So your call, you think we should make it a Depends?

Revision history for this message
Cody Garver (codygarver) wrote :

Yeah move it to Depends.

Also why did you disable xz compression? (BTW "Pre-Depends: dpkg (>= 1.15.6)" line is exclusively there because it's xz package compression dependency.

Revision history for this message
Cameron Norman (cameronnemo) wrote :

xz compression is default since dpkg 1.17

Do you still want to force it on older stuff or just use the default?

Revision history for this message
Cody Garver (codygarver) wrote :

Oh cool, I didn't know that.

Remove the Pre-Depends line too then.

23. By Cameron Norman

Remove versioned dpkg PreDepends (xz is default now), switch network-manager to depends

Revision history for this message
Cameron Norman (cameronnemo) wrote :

Pushed both changes.

Revision history for this message
Cody Garver (codygarver) wrote :

I merged these changes excluding r21 (licensing changes) because I am not sure how elementary LLC. is supposed to be attributed

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '90captive_portal_test'
2--- 90captive_portal_test 2015-03-03 18:28:28 +0000
3+++ 90captive_portal_test 2015-04-15 02:41:11 +0000
4@@ -24,26 +24,26 @@
5 local user="$1"
6 wait_for_process nm-applet
7 $logger "Running browser as '$user' to login in captive portal"
8- su "$user" -s /bin/sh -c "captive-login 2>/dev/null || sensible-browser start.elementaryos.org 2>/dev/null"
9+ su "$user" -s /bin/sh -c "captive-login 2>/dev/null"
10 }
11
12 # Run the right scripts
13 case "$2" in
14 up|vpn-up)
15- $logger "DetectCaptivePortal script triggered"
16+ $logger -p user.debug "DetectCaptivePortal script triggered"
17
18 # assume the DISPLAY where to show the browser
19 if [ -z $DISPLAY ];then
20 export DISPLAY=':0'
21 fi
22
23- $logger "Display set"
24+ $logger -p user.debug "Display set as: $DISPLAY"
25
26 #get the usernames
27 users=$(who | grep "$DISPLAY" | awk '{print $1}')
28
29 for u in $users; do
30- start_browser $u || :
31+ start_browser $u || $logger -p user.err "captive-login browser failed for user: $u"
32 done
33 ;;
34 *)
35
36=== modified file 'AUTHORS'
37--- AUTHORS 2013-08-22 15:09:15 +0000
38+++ AUTHORS 2015-04-15 02:41:11 +0000
39@@ -1,6 +1,6 @@
40-Sergio Spinatelli <spinatelli.sergio@gmail.com>
41-
42-Copyright 2013 Sergio Spinatelli
43+Copyright 2013 Sergio Spinatelli <spinatelli.sergio@gmail.com>
44+ 2015 Daniel Foré <daniel@elementaryos.org>
45+ 2015 Cameron Norman <camerontnorman@gmail.com>
46
47 This program is free software; you can redistribute it and/or modify
48 it under the terms of the GNU General Public License as published by
49
50=== modified file 'README'
51--- README 2013-08-22 15:06:17 +0000
52+++ README 2015-04-15 02:41:11 +0000
53@@ -2,3 +2,5 @@
54 ===
55
56 A small WebKit app only to make a user log in when a captive portal is detected.
57+
58+Set the environment variable G_MESSAGES_DEBUG to "all" to have the captive-login binary print debug messages.
59
60=== modified file 'debian/control'
61--- debian/control 2015-03-04 23:49:03 +0000
62+++ debian/control 2015-04-15 02:41:11 +0000
63@@ -8,13 +8,14 @@
64 libwebkitgtk-3.0-dev,
65 libgtk-3-dev,
66 valac (>= 0.18)
67-Standards-Version: 3.9.3
68+Standards-Version: 3.9.6
69 Homepage: https://launchpad.net/capnet-assist
70+Vcs-Bzr: https://code.launchpad.net/capnet-assist
71+Vcs-Browser: http://bazaar.launchpad.net/~elementary-apps/capnet-assist/trunk/files
72
73 Package: capnet-assist
74 Architecture: any
75-Depends: ${misc:Depends}, ${shlibs:Depends}
76-Pre-Depends: dpkg (>= 1.15.6)
77+Depends: ${misc:Depends}, ${shlibs:Depends}, network-manager
78 Description: Captive login detector (debugging symbols)
79 A small WebKit app only to make a user log in when a
80 captive portal is detected.
81
82=== modified file 'debian/copyright'
83--- debian/copyright 2013-08-22 15:09:15 +0000
84+++ debian/copyright 2015-04-15 02:41:11 +0000
85@@ -1,39 +1,31 @@
86-This work was packaged for Debian by:
87-
88- Cody Garver <cody@elementaryos.org> on Thu, 22 Aug 2013
89-
90-It was downloaded from:
91-
92- https://launchpad.net/capnet-assist
93-
94-Upstream Author(s):
95-
96- Sergio Spinatelli <spinatelli.sergio@gmail.com>
97-
98-Copyright:
99-
100- Copyright (C) 2013 Sergio Spinatelli
101-
102-License:
103-
104- This program is free software: you can redistribute it and/or modify
105- it under the terms of the GNU General Public License as published by
106- the Free Software Foundation, either version 3 of the License, or
107- (at your option) any later version.
108-
109- This package is distributed in the hope that it will be useful,
110- but WITHOUT ANY WARRANTY; without even the implied warranty of
111- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
112- GNU General Public License for more details.
113-
114- You should have received a copy of the GNU General Public License
115- along with this program. If not, see <http://www.gnu.org/licenses/>.
116-
117-On Debian systems, the complete text of the GNU General
118-Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
119-
120-The Debian packaging is:
121-
122- Copyright (C) 2013 Cody Garver <cody@elementaryos.org>
123-
124-and is licensed under the GPL version 3, see above.
125+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
126+Upstream-Name: capnet-assist
127+Source: https://launchpad.net/capnet-assist
128+
129+Files: *
130+Copyright: 2013 Sergio Spinatelli <spinatelli.sergio@gmail.com>
131+ 2015 Daniel Foré <daniel@elementaryos.org>
132+ 2015 Cameron Norman <camerontnorman@gmail.com>
133+License: GPL-3+
134+
135+Files: debian/*
136+Copyright: 2013-2015 Cody Garver <cody@elementaryos.org>
137+ 2015 Cameron Norman <camerontnorman@gmail.com>
138+License: GPL-3+
139+
140+License: GPL-3+
141+ This program is free software: you can redistribute it and/or modify
142+ it under the terms of the GNU General Public License as published by
143+ the Free Software Foundation; either version 3 of the License, or
144+ (at your option) any later version.
145+ .
146+ This program is distributed in the hope that it will be useful,
147+ but WITHOUT ANY WARRANTY; without even the implied warranty of
148+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149+ GNU General Public License for more details.
150+ .
151+ You should have received a copy of the GNU General Public License
152+ along with this program. If not, see <http://www.gnu.org/licenses/>.
153+ .
154+ On Debian systems, the complete text of the GNU General Public
155+ License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
156
157=== modified file 'debian/rules'
158--- debian/rules 2013-08-22 15:06:17 +0000
159+++ debian/rules 2015-04-15 02:41:11 +0000
160@@ -12,9 +12,6 @@
161 %:
162 dh $@
163
164-override_dh_builddeb:
165- dh_builddeb -- -Zxz
166-
167 override_dh_strip:
168 dh_strip --dbg-package=capnet-assist-dbg
169
170
171=== modified file 'src/CaptiveLogin.vala'
172--- src/CaptiveLogin.vala 2015-03-04 20:53:40 +0000
173+++ src/CaptiveLogin.vala 2015-04-15 02:41:11 +0000
174@@ -1,20 +1,24 @@
175 /***
176- BEGIN LICENSE
177-
178- Copyright (C) 2015 elementary LLC.
179- This program is free software: you can redistribute it and/or modify it
180- under the terms of the GNU Lesser General Public License version 3, as published
181- by the Free Software Foundation.
182-
183- This program is distributed in the hope that it will be useful, but
184- WITHOUT ANY WARRANTY; without even the implied warranties of
185- MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
186- PURPOSE. See the GNU General Public License for more details.
187-
188- You should have received a copy of the GNU General Public License along
189- with this program. If not, see <http://www.gnu.org/licenses/>
190-
191- END LICENSE
192+ BEGIN LICENSE
193+
194+ Copyright (C) 2013 Sergio Spinatelli <spinatelli.sergio@gmail.com>
195+ 2015 Daniel Foré <daniel@elementaryos.org>
196+ 2015 Cameron Norman <camerontnorman@gmail.com>
197+
198+ This program is free software: you can redistribute it and/or modify it
199+ under the terms of the GNU Lesser General Public License version 3, as
200+ published by the Free Software Foundation; either version 3 of the License,
201+ or (at your option) any later version.
202+
203+ This program is distributed in the hope that it will be useful, but
204+ WITHOUT ANY WARRANTY; without even the implied warranties of
205+ MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
206+ PURPOSE. See the GNU General Public License for more details.
207+
208+ You should have received a copy of the GNU General Public License along
209+ with this program. If not, see <http://www.gnu.org/licenses>
210+
211+ END LICENSE
212 ***/
213
214 public class ValaBrowser : Gtk.Window {
215@@ -47,20 +51,20 @@
216 scrolled_window.add (this.web_view);
217 var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
218 vbox.set_homogeneous (false);
219- vbox.pack_start (scrolled_window,true,true,0);
220+ vbox.pack_start (scrolled_window, true, true, 0);
221 add (vbox);
222 }
223
224 public bool isLoggedIn () {
225 var page = "http://clients3.google.com/generate_204";
226- stdout.printf ("Getting 204 page\n");
227+ debug ("Getting 204 page");
228
229 var session = new Soup.Session ();
230 var message = new Soup.Message ("GET", page);
231
232 session.send_message (message);
233
234- stdout.printf ("Return code: %u\n",message.status_code);
235+ debug ("Return code: %u", message.status_code);
236 return message.status_code == 204;
237 }
238
239@@ -73,11 +77,11 @@
240
241 this.web_view.document_load_finished.connect ( (frame) => {
242 if (isLoggedIn ()) {
243- stdout.printf ("Logged in!\n");
244+ debug ("Logged in!");
245 Gtk.main_quit ();
246- } else
247- stdout.printf ("Still not logged in.\n");
248- stdout.flush ();
249+ } else {
250+ debug ("Still not logged in.");
251+ }
252 });
253 }
254
255@@ -91,12 +95,12 @@
256
257 var browser = new ValaBrowser ();
258
259- if (!browser.isLoggedIn ()){
260- stdout.printf ("Opening browser to login\n");
261+ if (!browser.isLoggedIn ()) {
262+ debug ("Opening browser to login");
263 browser.start ();
264 Gtk.main ();
265 } else {
266- stdout.printf ("Already logged in and connected, shutting down.\n");
267+ debug ("Already logged in and connected, shutting down.");
268 }
269
270 return 0;

Subscribers

People subscribed via source and target branches

to all changes: