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

Proposed by Robert Roth
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 (community) Approve
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
729. By Robert Roth

Updated add-apt-repository manpage with new options

730. By Robert Roth

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

731. By Robert Roth

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

732. By Robert Roth

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

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a *bunch*, that is excellent work!

review: Approve
Revision history for this message
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?

Revision history for this message
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
=== modified file 'add-apt-repository'
--- add-apt-repository 2011-08-19 00:12:32 +0000
+++ add-apt-repository 2011-10-18 19:47:25 +0000
@@ -11,6 +11,17 @@
11from optparse import OptionParser11from optparse import OptionParser
12from gettext import gettext as _12from gettext import gettext as _
1313
14def utf8(s):
15 """
16 Takes a string or unicode object and returns a utf-8 encoded
17 string, errors are ignored
18 """
19 if s is None:
20 return None
21 if isinstance(s, unicode):
22 return s.encode("utf-8", "ignore")
23 return unicode(s, "utf8", "ignore").encode("utf8")
24
14if __name__ == "__main__":25if __name__ == "__main__":
15 try:26 try:
16 locale.setlocale(locale.LC_ALL, "")27 locale.setlocale(locale.LC_ALL, "")
@@ -75,23 +86,37 @@
75 user, sep, ppa_name = line.split(":")[1].partition("/")86 user, sep, ppa_name = line.split(":")[1].partition("/")
76 ppa_name = ppa_name or "ppa"87 ppa_name = ppa_name or "ppa"
77 ppa_info = get_ppa_info_from_lp(user, ppa_name)88 ppa_info = get_ppa_info_from_lp(user, ppa_name)
78 print _("You are about to add the following PPA to your system:")89 if options.remove:
79 print " %s" % ppa_info["displayname"]90 print _("You are about to remove the following PPA from your system:")
80 print " %s" % (ppa_info["description"] or "")91 else:
92 print _("You are about to add the following PPA to your system:")
93 print " %s" % utf8(ppa_info["displayname"])
94 print " %s" % (utf8(ppa_info["description"]) or "")
81 print _(" More info: %s") % ppa_info["web_link"]95 print _(" More info: %s") % ppa_info["web_link"]
82 if sys.stdin.isatty():96 if sys.stdin.isatty():
83 print _("Press [ENTER] to continue or ctrl-c to cancel adding it")97 if options.remove:
98 print _("Press [ENTER] to continue or ctrl-c to cancel removing it")
99 else:
100 print _("Press [ENTER] to continue or ctrl-c to cancel adding it")
84 sys.stdin.readline()101 sys.stdin.readline()
85102
86 # add it103 # add it
87 sp = SoftwareProperties(options=options)104 sp = SoftwareProperties(options=options)
88 if options.remove:105 if options.remove:
89 (line, file) = expand_ppa_line(line.strip(), sp.distro.codename)106 (line, file) = expand_ppa_line(line.strip(), sp.distro.codename)
90 source_entry = SourceEntry(line, file)107 deb_line = sp.expand_http_line(line)
91 try:108 debsrc_line = 'deb-src' + deb_line[3:]
92 sp.remove_source(source_entry)109 deb_entry = SourceEntry(deb_line, file)
93 except ValueError:110 debsrc_entry = SourceEntry(debsrc_line, file)
94 print _("Error: '%s' doesn't exist in a sourcelist file" % line)111 try:
112 sp.remove_source(deb_entry)
113 except ValueError:
114 print _("Error: '%s' doesn't exist in a sourcelist file" % deb_line)
115 try:
116 sp.remove_source(debsrc_entry)
117 except ValueError:
118 print _("Error: '%s' doesn't exist in a sourcelist file" % debsrc_line)
119
95 else:120 else:
96 if not sp.add_source_from_line(line):121 if not sp.add_source_from_line(line):
97 print _("Error: '%s' invalid" % line)122 print _("Error: '%s' invalid" % line)
98123
=== modified file 'data/com.ubuntu.softwareproperties.policy.in'
--- data/com.ubuntu.softwareproperties.policy.in 2011-07-11 10:48:09 +0000
+++ data/com.ubuntu.softwareproperties.policy.in 2011-10-18 19:47:25 +0000
@@ -10,7 +10,7 @@
1010
11 <action id="com.ubuntu.softwareproperties.applychanges">11 <action id="com.ubuntu.softwareproperties.applychanges">
12 <_description>Write Configuration</_description>12 <_description>Write Configuration</_description>
13 <_message>Authentication to write a new APT configuration</_message>13 <_message>To change software repository settings, you need to authenticate.</_message>
14 <defaults>14 <defaults>
15 <allow_any>auth_admin</allow_any>15 <allow_any>auth_admin</allow_any>
16 <allow_inactive>auth_admin</allow_inactive>16 <allow_inactive>auth_admin</allow_inactive>
1717
=== modified file 'data/gtkbuilder/main.ui'
--- data/gtkbuilder/main.ui 2011-07-18 12:43:58 +0000
+++ data/gtkbuilder/main.ui 2011-10-18 19:47:25 +0000
@@ -207,7 +207,7 @@
207 </object>207 </object>
208 <packing>208 <packing>
209 <property name="expand">True</property>209 <property name="expand">True</property>
210 <property name="fill">True</property>210 <property name="fill">False</property>
211 <property name="position">1</property>211 <property name="position">1</property>
212 </packing>212 </packing>
213 </child>213 </child>
214214
=== modified file 'debian/manpages/add-apt-repository.1'
--- debian/manpages/add-apt-repository.1 2010-03-26 12:26:40 +0000
+++ debian/manpages/add-apt-repository.1 2011-10-18 19:47:25 +0000
@@ -1,25 +1,37 @@
1.TH "add-apt-repository" "1"1.TH "add-apt-repository" "1"
2.SH NAME2.SH NAME
3add-apt-repository \- Adds a repository into the /etc/apt/sources.list or3add-apt-repository \- Adds a repository into the
4/etc/apt/sources.list.d4/etc/apt/sources.list or /etc/apt/sources.list.d
5or removes an existing one
5.SH SYNOPSIS6.SH SYNOPSIS
6.B add-apt-repository \fI[OPTIONS]\fR \fIREPOSITORY\fR7.B add-apt-repository \fI[OPTIONS]\fR \fIREPOSITORY\fR
7.SH DESCRIPTION8.SH DESCRIPTION
8.B add-apt-repository9.B add-apt-repository
9is a script which adds an external APT repository to either10is a script which adds an external APT repository to either
10/etc/apt/sources.list or a file in /etc/apt/sources.list.d/.11/etc/apt/sources.list or a file in /etc/apt/sources.list.d/
1112or removes an already existing repository.
12Currently the only option supported by add-apt-repository is as follows:13
1314The options supported by add-apt-repository are:
14.B -h,--help15
16.B -h, --help
15Show help message and exit17Show help message and exit
1618
19.B -r, --remove
20Remove the specified repository
21
22.B -y, --yes
23Assume yes to all queries
24
25.B -k, --keyserver
26Use a custom keyserver URL instead of the default
27
28
17.SH REPOSITORY STRING29.SH REPOSITORY STRING
18\fIREPOSITORY\fR can be either a line that can be added directly to30\fIREPOSITORY\fR can be either a line that can be added directly to
19sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal31sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal
20Package Archives.32Package Archives.
2133
22In the first form, \fIREPOSITORY\fR will just be appended to34In the first form, \fIREPOSITORY\fR will just be appended to
23/etc/apt/sources.list.35/etc/apt/sources.list.
2436
25In the second form, ppa:<user>/<ppa-name> will be expanded to the full deb line37In the second form, ppa:<user>/<ppa-name> will be expanded to the full deb line
2638
=== modified file 'softwareproperties/gtk/DialogMirror.py'
--- softwareproperties/gtk/DialogMirror.py 2011-08-17 05:19:00 +0000
+++ softwareproperties/gtk/DialogMirror.py 2011-10-18 19:47:25 +0000
@@ -319,8 +319,8 @@
319 (test.progress[0], test.progress[1]))319 (test.progress[0], test.progress[1]))
320 self.progress.set_fraction(test.progress[2])320 self.progress.set_fraction(test.progress[2])
321 progress_update.clear()321 progress_update.clear()
322
323 self.dialog_test.hide()322 self.dialog_test.hide()
323 self.label_test.set_label("")
324 # Select the mirror in the list or show an error dialog324 # Select the mirror in the list or show an error dialog
325 if test.best != None:325 if test.best != None:
326 self.model_sort.foreach(self.select_mirror, test.best)326 self.model_sort.foreach(self.select_mirror, test.best)
327327
=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2011-08-17 05:19:00 +0000
+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2011-10-18 19:47:25 +0000
@@ -333,11 +333,13 @@
333333
334 def block_handlers(self):334 def block_handlers(self):
335 for (widget, handler) in self.handlers:335 for (widget, handler) in self.handlers:
336 widget.handler_block(handler)336 if widget.handler_is_connected(handler):
337 widget.handler_block(handler)
337 338
338 def unblock_handlers(self):339 def unblock_handlers(self):
339 for (widget, handler) in self.handlers:340 for (widget, handler) in self.handlers:
340 widget.handler_unblock(handler)341 if widget.handler_is_connected(handler):
342 widget.handler_unblock(handler)
341343
342 def show_distro(self):344 def show_distro(self):
343 """Fill the distro user interface with life"""345 """Fill the distro user interface with life"""
@@ -727,6 +729,7 @@
727 def on_auth_failed(self):729 def on_auth_failed(self):
728 """ send when the authentication failed """730 """ send when the authentication failed """
729 # reread the current config731 # reread the current config
732 self.init_popcon()
730 self.on_sources_list_modified()733 self.on_sources_list_modified()
731 self.on_config_modified()734 self.on_config_modified()
732 self.on_keys_modified()735 self.on_keys_modified()

Subscribers

People subscribed via source and target branches

to status/vote changes: