Bug 25563 - xdg-mime default displays error when kde is not on the machine
Summary: xdg-mime default displays error when kde is not on the machine
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-10 06:29 UTC by Pascal Terjan
Modified: 2009-12-17 11:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Pascal Terjan 2009-12-10 06:29:50 UTC
code in make_default_kde contains:

    if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
        default_dir=`kde4-config --path xdgdata-apps | cut -d ':' -f 1`
        default_file="$default_dir/mimeapps.list"
    else
        default_dir=`kde-config --path config | cut -d ':' -f 1`
        default_file="$default_dir/profilerc"
    fi

so it will give an error if kde-config is not available
Comment 1 Rex Dieter 2009-12-17 10:56:00 UTC
I'll take a look to see if we can make it fail a little more gracefully.
Comment 2 Rex Dieter 2009-12-17 11:07:49 UTC
Fixed in cvs.

Index: xdg-mime.in                                                                                          
===================================================================                                         
RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-mime.in,v                                            
retrieving revision 1.46                                                                                    
diff -u -3 -p -r1.46 xdg-mime.in                                                                            
--- xdg-mime.in 31 Jul 2009 06:42:46 -0000      1.46                                                        
+++ xdg-mime.in 17 Dec 2009 19:06:35 -0000                                                                  
@@ -106,12 +106,16 @@ make_default_kde()
     vendor="$1"
     mimetype="$2"
     if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
-        default_dir=`kde4-config --path xdgdata-apps | cut -d ':' -f 1`
+        default_dir=`kde4-config --path xdgdata-apps 2> /dev/null | cut -d ':' -f 1`
         default_file="$default_dir/mimeapps.list"
     else
-        default_dir=`kde-config --path config | cut -d ':' -f 1`
+        default_dir=`kde-config --path config 2> /dev/null | cut -d ':' -f 1`
         default_file="$default_dir/profilerc"
     fi
+    if [ -z "$default_dir" ]; then
+        DEBUG 2 "make_default_kde: No kde runtime detected"
+        return
+    fi
     DEBUG 2 "make_default_kde $vendor $mimetype"
     DEBUG 1 "Updating $default_file"
     mkdir -p "$default_dir"


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.