diff --git a/mc-mkdir_mc_home.patch b/mc-mkdir_mc_home.patch new file mode 100644 index 0000000..0be3e59 --- /dev/null +++ b/mc-mkdir_mc_home.patch @@ -0,0 +1,37 @@ +--- src/main.c 2009-10-10 22:21:47.000000000 +0200 ++++ src/main.c 2009-10-11 12:05:35.000000000 +0200 +@@ -62,6 +62,7 @@ + #include "listmode.h" + #include "execute.h" + #include "ext.h" /* For flush_extension_file() */ ++#include "fileloc.h" + + /* Listbox for the command history feature */ + #include "widget.h" +@@ -2129,8 +2130,10 @@ + int + main (int argc, char *argv[]) + { ++ struct stat s; + /* Check whether we have UTF-8 locale */ + char *lang = getenv("LANG"); ++ char *mc_dir; + size_t len = 0; + + if ( lang ) +@@ -2201,6 +2204,15 @@ + + init_xterm_support (); + ++ /* create home directory */ ++ mc_dir = mhl_str_dir_plus_file (home_dir, MC_USERCONF_DIR); ++ canonicalize_pathname (mc_dir); ++ if ((stat (mc_dir, &s) != 0) && (errno == ENOENT) && mkdir (mc_dir, 0700) != 0) ++ message (D_ERROR, _("Warning"), ++ _("Cannot create %s directory"), mc_dir); ++ g_free (mc_dir); ++ ++ + #ifdef HAVE_SUBSHELL_SUPPORT + + /* Done here to ensure that the subshell doesn't */ diff --git a/mc.changes b/mc.changes index ba324ed..1d9b5d0 100644 --- a/mc.changes +++ b/mc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Oct 11 10:16:07 UTC 2009 - mseben@novell.com + +- added mc-mkdir_mc_home.patch - create .mc home dir at startup (bnc#533262) + ------------------------------------------------------------------- Mon Jul 13 21:22:27 CEST 2009 - coolo@novell.com diff --git a/mc.spec b/mc.spec index 686424f..23c25dd 100644 --- a/mc.spec +++ b/mc.spec @@ -26,7 +26,7 @@ Group: Productivity/File utilities PreReq: permissions AutoReqProv: on Version: 4.6.2 -Release: 5 +Release: 6 Summary: Midnight Commander Source: mc-4.6.2.tar.bz2 Source1: x11_browser @@ -70,6 +70,8 @@ Patch42: mc-utf8-slang-codeset.patch Patch43: mc-crash-bnc500516.patch # PATCH-FIX-UPSTREAM mc-port-number-bnc483249.patch nadvornik@suse.cz - port number in shell link - midnight-commander.org/ticket/118 Patch44: mc-port-number-bnc483249.patch +# PATCH-FIX-UPSTREAM mc-mkdir_mc_home.patch mseben@suse.cz - create .mc home dir at startup (bnc#533262) +Patch45: mc-mkdir_mc_home.patch # BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://www.ibiblio.org/mc/ @@ -133,6 +135,7 @@ target directory. %patch42 -p1 %patch43 %patch44 -p1 +%patch45 pushd po rename no nb no.* popd