Merge lp:~evfool/software-properties/fixes into lp:software-properties

Proposed by Robert Roth on 2011-10-15
Status: Merged
Merged at revision: 724
Proposed branch: lp:~evfool/software-properties/fixes
Merge into: lp:software-properties
Diff against target: 186 lines (+62/-22)
6 files modified
add-apt-repository (+34/-9)
data/com.ubuntu.softwareproperties.policy.in (+1/-1)
data/gtkbuilder/main.ui (+1/-1)
debian/manpages/add-apt-repository.1 (+20/-8)
softwareproperties/gtk/DialogMirror.py (+1/-1)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+5/-2)
To merge this branch: bzr merge lp:~evfool/software-properties/fixes
Reviewer Review Type Date Requested Status
Michael Vogt 2011-10-15 Approve on 2011-10-20
Review via email: mp+79472@code.launchpad.net

Description of the change

This branch contains the following minor fixes, one commit/bug
* Fix warnings logged to terminal about inexistent handlers by checking if the handlers exist
* Change geeky authentication text displayed on policykit auth dialog to the one suggested by mpt (bug #828285 )
* Reset the popcon checkbox value if changed, but auth failed (bug #874759)
* Apt-add-repository --remove changed to also remove the debsrc line (bug #838507)
* Apt-add-repository PPA warning changed to warn you about add/removal depending on what you really want to do.
* Update the manpage of apt-add-repository with the available options. (bug #697546)
* Reset the text on the mirror testing dialog after closing/canceling it (bug #875679)
* Unicode encode PPA description and displaynam to avoid UnicodeDecodeErrors (bug #827355)
* Do not expand the server combobox (bug #875131)

To post a comment you must log in.
lp:~evfool/software-properties/fixes updated on 2011-10-18
729. By Robert Roth on 2011-10-15

Updated add-apt-repository manpage with new options

730. By Robert Roth on 2011-10-18

Reset dialog text after closing or canceling the test dialog (LP: #875679)

731. By Robert Roth on 2011-10-18

Fix UnicodeDecodeErrors caused by PPA displayname or description (LP: #827355)

732. By Robert Roth on 2011-10-18

Do not expand the Download From combo vertically (LP: #875131)

Michael Vogt (mvo) wrote :

Thanks a *bunch*, that is excellent work!

review: Approve
Michael Vogt (mvo) wrote :

Btw, some of this we should consider to backport to oneiric, actually everything that does not change strings. What do you think?

Robert Roth (evfool) wrote :

Yes, it's possible. Revisions 724, 726, 727, 730, 731, 732 are backportable, those do not contain any man page or string changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'add-apt-repository'
2--- add-apt-repository 2011-08-19 00:12:32 +0000
3+++ add-apt-repository 2011-10-18 19:47:25 +0000
4@@ -11,6 +11,17 @@
5 from optparse import OptionParser
6 from gettext import gettext as _
7
8+def utf8(s):
9+ """
10+ Takes a string or unicode object and returns a utf-8 encoded
11+ string, errors are ignored
12+ """
13+ if s is None:
14+ return None
15+ if isinstance(s, unicode):
16+ return s.encode("utf-8", "ignore")
17+ return unicode(s, "utf8", "ignore").encode("utf8")
18+
19 if __name__ == "__main__":
20 try:
21 locale.setlocale(locale.LC_ALL, "")
22@@ -75,23 +86,37 @@
23 user, sep, ppa_name = line.split(":")[1].partition("/")
24 ppa_name = ppa_name or "ppa"
25 ppa_info = get_ppa_info_from_lp(user, ppa_name)
26- print _("You are about to add the following PPA to your system:")
27- print " %s" % ppa_info["displayname"]
28- print " %s" % (ppa_info["description"] or "")
29+ if options.remove:
30+ print _("You are about to remove the following PPA from your system:")
31+ else:
32+ print _("You are about to add the following PPA to your system:")
33+ print " %s" % utf8(ppa_info["displayname"])
34+ print " %s" % (utf8(ppa_info["description"]) or "")
35 print _(" More info: %s") % ppa_info["web_link"]
36 if sys.stdin.isatty():
37- print _("Press [ENTER] to continue or ctrl-c to cancel adding it")
38+ if options.remove:
39+ print _("Press [ENTER] to continue or ctrl-c to cancel removing it")
40+ else:
41+ print _("Press [ENTER] to continue or ctrl-c to cancel adding it")
42 sys.stdin.readline()
43
44 # add it
45 sp = SoftwareProperties(options=options)
46 if options.remove:
47 (line, file) = expand_ppa_line(line.strip(), sp.distro.codename)
48- source_entry = SourceEntry(line, file)
49- try:
50- sp.remove_source(source_entry)
51- except ValueError:
52- print _("Error: '%s' doesn't exist in a sourcelist file" % line)
53+ deb_line = sp.expand_http_line(line)
54+ debsrc_line = 'deb-src' + deb_line[3:]
55+ deb_entry = SourceEntry(deb_line, file)
56+ debsrc_entry = SourceEntry(debsrc_line, file)
57+ try:
58+ sp.remove_source(deb_entry)
59+ except ValueError:
60+ print _("Error: '%s' doesn't exist in a sourcelist file" % deb_line)
61+ try:
62+ sp.remove_source(debsrc_entry)
63+ except ValueError:
64+ print _("Error: '%s' doesn't exist in a sourcelist file" % debsrc_line)
65+
66 else:
67 if not sp.add_source_from_line(line):
68 print _("Error: '%s' invalid" % line)
69
70=== modified file 'data/com.ubuntu.softwareproperties.policy.in'
71--- data/com.ubuntu.softwareproperties.policy.in 2011-07-11 10:48:09 +0000
72+++ data/com.ubuntu.softwareproperties.policy.in 2011-10-18 19:47:25 +0000
73@@ -10,7 +10,7 @@
74
75 <action id="com.ubuntu.softwareproperties.applychanges">
76 <_description>Write Configuration</_description>
77- <_message>Authentication to write a new APT configuration</_message>
78+ <_message>To change software repository settings, you need to authenticate.</_message>
79 <defaults>
80 <allow_any>auth_admin</allow_any>
81 <allow_inactive>auth_admin</allow_inactive>
82
83=== modified file 'data/gtkbuilder/main.ui'
84--- data/gtkbuilder/main.ui 2011-07-18 12:43:58 +0000
85+++ data/gtkbuilder/main.ui 2011-10-18 19:47:25 +0000
86@@ -207,7 +207,7 @@
87 </object>
88 <packing>
89 <property name="expand">True</property>
90- <property name="fill">True</property>
91+ <property name="fill">False</property>
92 <property name="position">1</property>
93 </packing>
94 </child>
95
96=== modified file 'debian/manpages/add-apt-repository.1'
97--- debian/manpages/add-apt-repository.1 2010-03-26 12:26:40 +0000
98+++ debian/manpages/add-apt-repository.1 2011-10-18 19:47:25 +0000
99@@ -1,25 +1,37 @@
100 .TH "add-apt-repository" "1"
101 .SH NAME
102-add-apt-repository \- Adds a repository into the /etc/apt/sources.list or
103-/etc/apt/sources.list.d
104+add-apt-repository \- Adds a repository into the
105+/etc/apt/sources.list or /etc/apt/sources.list.d
106+or removes an existing one
107 .SH SYNOPSIS
108 .B add-apt-repository \fI[OPTIONS]\fR \fIREPOSITORY\fR
109 .SH DESCRIPTION
110 .B add-apt-repository
111 is a script which adds an external APT repository to either
112-/etc/apt/sources.list or a file in /etc/apt/sources.list.d/.
113-
114-Currently the only option supported by add-apt-repository is as follows:
115-
116-.B -h,--help
117+/etc/apt/sources.list or a file in /etc/apt/sources.list.d/
118+or removes an already existing repository.
119+
120+The options supported by add-apt-repository are:
121+
122+.B -h, --help
123 Show help message and exit
124
125+.B -r, --remove
126+Remove the specified repository
127+
128+.B -y, --yes
129+Assume yes to all queries
130+
131+.B -k, --keyserver
132+Use a custom keyserver URL instead of the default
133+
134+
135 .SH REPOSITORY STRING
136 \fIREPOSITORY\fR can be either a line that can be added directly to
137 sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal
138 Package Archives.
139
140-In the first form, \fIREPOSITORY\fR will just be appended to
141+In the first form, \fIREPOSITORY\fR will just be appended to
142 /etc/apt/sources.list.
143
144 In the second form, ppa:<user>/<ppa-name> will be expanded to the full deb line
145
146=== modified file 'softwareproperties/gtk/DialogMirror.py'
147--- softwareproperties/gtk/DialogMirror.py 2011-08-17 05:19:00 +0000
148+++ softwareproperties/gtk/DialogMirror.py 2011-10-18 19:47:25 +0000
149@@ -319,8 +319,8 @@
150 (test.progress[0], test.progress[1]))
151 self.progress.set_fraction(test.progress[2])
152 progress_update.clear()
153-
154 self.dialog_test.hide()
155+ self.label_test.set_label("")
156 # Select the mirror in the list or show an error dialog
157 if test.best != None:
158 self.model_sort.foreach(self.select_mirror, test.best)
159
160=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
161--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2011-08-17 05:19:00 +0000
162+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2011-10-18 19:47:25 +0000
163@@ -333,11 +333,13 @@
164
165 def block_handlers(self):
166 for (widget, handler) in self.handlers:
167- widget.handler_block(handler)
168+ if widget.handler_is_connected(handler):
169+ widget.handler_block(handler)
170
171 def unblock_handlers(self):
172 for (widget, handler) in self.handlers:
173- widget.handler_unblock(handler)
174+ if widget.handler_is_connected(handler):
175+ widget.handler_unblock(handler)
176
177 def show_distro(self):
178 """Fill the distro user interface with life"""
179@@ -727,6 +729,7 @@
180 def on_auth_failed(self):
181 """ send when the authentication failed """
182 # reread the current config
183+ self.init_popcon()
184 self.on_sources_list_modified()
185 self.on_config_modified()
186 self.on_keys_modified()

Subscribers

People subscribed via source and target branches

to status/vote changes: