--- origsrc/xdg-utils-1.1.0-rc1/scripts/xdg-mime	2011-01-01 05:03:14.000000000 -0500
+++ src/xdg-utils-1.1.0-rc1/scripts/xdg-mime	2012-03-31 13:19:46.769441000 -0400
@@ -658,7 +658,10 @@ make_default_generic()
     # Add $2=$1 to XDG_DATA_HOME/applications/defaults.list
     xdg_user_dir="$XDG_DATA_HOME"
     [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
-    default_file="$xdg_user_dir/applications/defaults.list"
+    default_dir="$xdg_user_dir/applications"
+    default_file="$default_dir/defaults.list"
+    mkdir -p $default_dir
+    [ -f $default_file ] || touch $default_file
     DEBUG 2 "make_default_generic $1 $2"
     DEBUG 1 "Updating $default_file"
     grep -v "$2=" $default_file > ${default_file}.new 2> /dev/null
