Gdebi-kde can't install packages whose path contains brackets or spaces or other special characters.

Bug #196030 reported by applegrew
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdebi (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gdebi-kde

This happens because it seems to be handling the package path improperly. When we click on Install then it seems that gdebi-kde re-launches itself but via sudo. It also passes the package's path, and it seems that the path is NOT enclosed in quotes. Hence, when the path containing spaces are sent then it fails to find the package during installation (as reported by https://bugs.launchpad.net/ubuntu/+source/gdebi/+bug/152856), and when the path contains parenthesis ( '(' or ')' ) then bash throws syntax and quits. The error I get when the path contains parenthesis is below:-

/bin/bash: -c: line 0: syntax error near unexpected token `('
/bin/bash: -c: line 0: `sudo -H -S -p passprompt gdebi-kde -n /home/apple/Files/New/CLAM (Audio tools)/clam-smstools_0.4.9~svn11102-1_i386.deb '

The /home/apple/Files/New/CLAM (Audio tools)/clam-smstools_0.4.9~svn11102-1_i386.deb should have been in quotes as "/home/apple/Files/New/CLAM (Audio tools)/clam-smstools_0.4.9~svn11102-1_i386.deb".

My speculation is that, because of this bug the path which contains other special characters like curly braces ({ or }) too should run into problems.

I have gdebi-kde 0.3.2ubuntu1 installed, on a Kubuntu Gutsy Gibbon (7.10) OS.

====
PATCH
====
File to edit /usr/share/pycentral/gdebi-kde/site-packages/GDebi/GDebiKDE.py

Search for the line :-
"gdebi-kde -n " + self._deb.file)

It should be on line 215.

Replace the portion shown above with the one shown below
"gdebi-kde -n \"" + self._deb.file + "\"")

This should fix the bug.

Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :

Confirm on KDE 3.5.x and Hardy.

The Desktop folder is translated to 'Työpöytä' in Finnish and this makes gdebi-kde fail when trying to install.

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Works with gdebi-kde 0.3.13 in Intrepid.

Changed in gdebi:
status: New → Fix Released
Revision history for this message
Laur Mõtus (vprints) wrote :

Jonathan, sorry, but it dosen't work with 0.3.13 on Interpid nor in up-to-date Hardy, IF, as Risto pointed out, the folder name contains "special" charaters that the english users will never encounter: "ö" "õ" "ä" or "ü"
In Estonian the desktop folder is translated 'Töölaud' and any attempt to install packages from there in Hardy or Interpid fail, so i did a little test, made folders Töö, Tää; Tüü and Tõõ and every time when trying to istall a package from there with gdebi-kde, it fails. Running it from Console shows the following error:

user@laur-kerge:~$ sudo gdebi-kde /home/user/Tõõ/nxclient_3.2.0-14_i386.deb
/usr/lib/python2.5/site-packages/apt/__init__.py:18: FutureWarning: apt API not stable yet
  warnings.warn("apt API not stable yet", FutureWarning)
Error: "/var/tmp/kdecache-user" is owned by uid 1000 instead of uid 0.
Traceback (most recent call last):
  File "/usr/bin/gdebi-kde", line 100, in <module>
    afile = unicode(afile, 'utf-8')
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-16: invalid data

when installing it from the console from any of these folders with just the command line 'gdebi' everything works as expected.

Please somebody look into this because this bug means that any Estonian or Finnish user can install anything from their desktop folders in Hardy nor Interpid, and this leaves an unpleasant experience.

Revision history for this message
Laur Mõtus (vprints) wrote :

Confirmed on both up-to-date Hardy and Interpid

Changed in gdebi:
status: Fix Released → Confirmed
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Unicode issues would be bug 149893.
The original bug here was about spaces and other special, non-utf characters.

Changed in gdebi:
status: Confirmed → Fix Released
Changed in gdebi:
status: Fix Released → Confirmed
Revision history for this message
Rivo Laks (rivol) wrote :

The encoding problem actually looks like kdesu problem to me:

$ls '/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb'
/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb
$sudo ls '/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb'
/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb
$gksu ls '/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb'
/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb
$kdesu ls '/home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb'
ls: /home/rivo/Töölaud/estobuntu-settings_0.2.1_all.deb ei saa kasutada: No such file or directory

As you can see sudo and gksu work fine but kdesu seems to reencode (?) the filename, making it unusable.

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Please do not open this bug unless gdebi-kde cannot open files with spaces or parenthesis.
All problems with Unicode characters are bug 149893.

@rivo
kdesu very well may have an encoding issue too, but gdebi has the issue also.

Changed in gdebi:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.