Ticket #1424: install some files into /usr/share/mc instead of /etc/mc.

RPMLint shows the following warnings:
mc.i586: W: conffile-without-noreplace-flag /etc/mc/Syntax
mc.i586: W: conffile-without-noreplace-flag /etc/mc/mc.lib
mc.i586: W: conffile-without-noreplace-flag /etc/mc/mc.charsets

First step: install Syntax into /usr/share/mc instead of /etc/mc.
This also fixes the impossibility of editing of system-wide Syntax file
in mcedit under root (menu Options->Syntax file->System Wide).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-09-15 16:35:57 +04:00
parent f581e555c1
commit 51f28528f6
3 changed files with 8 additions and 16 deletions

View File

@ -1,4 +1,5 @@
SYNTAXFILES = \
Syntax \
PKGBUILD.syntax \
ada95.syntax \
aspx.syntax \
@ -69,15 +70,9 @@ SYNTAXFILES = \
yum-repo.syntax \
yxx.syntax
SYNTAXCONFFILES = \
Syntax
if USE_EDIT
syntaxdir = $(pkgdatadir)/syntax
syntax_DATA = $(SYNTAXFILES)
syntaxconfdir = $(sysconfdir)/@PACKAGE@
syntaxconf_DATA = $(SYNTAXCONFFILES)
endif
EXTRA_DIST = $(SYNTAXFILES) $(SYNTAXCONFFILES)
EXTRA_DIST = $(SYNTAXFILES)

View File

@ -1008,11 +1008,11 @@ edit_load_syntax_file (WEdit * edit)
_("&User"), _("&System Wide"));
}
extdir = concat_dir_and_file (mc_home, "syntax" PATH_SEP_STR "Syntax");
extdir = g_build_filename (mc_home, "syntax", "Syntax", (char *) NULL);
if (!exist_file (extdir))
{
g_free (extdir);
extdir = concat_dir_and_file (mc_home_alt, "syntax" PATH_SEP_STR "Syntax");
extdir = g_build_filename (mc_home_alt, "syntax", "Syntax", (char *) NULL);
}
if (dir == 0)

View File

@ -810,22 +810,19 @@ open_include_file (const char *filename)
return fopen (filename, "r");
g_free (error_file_name);
error_file_name = g_strconcat (home_dir, PATH_SEP_STR EDIT_DIR PATH_SEP_STR,
filename, (char *) NULL);
error_file_name = g_build_filename (home_dir, EDIT_DIR, filename, (char *) NULL);
f = fopen (error_file_name, "r");
if (f != NULL)
return f;
g_free (error_file_name);
error_file_name = g_strconcat (mc_home, PATH_SEP_STR, "syntax", PATH_SEP_STR,
filename, (char *) NULL);
error_file_name = g_build_filename (mc_home, "syntax", filename, (char *) NULL);
f = fopen (error_file_name, "r");
if (f != NULL)
return f;
g_free (error_file_name);
error_file_name = g_strconcat (mc_home_alt, PATH_SEP_STR "syntax" PATH_SEP_STR,
filename, (char *) NULL);
error_file_name = g_build_filename (mc_home_alt, "syntax", filename, (char *) NULL);
return fopen (error_file_name, "r");
}
@ -1259,7 +1256,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
f = fopen (syntax_file, "r");
if (f == NULL)
{
lib_file = g_build_filename (mc_home, "Syntax", (char *) NULL);
lib_file = g_build_filename (mc_home_alt, "syntax", "Syntax", (char *) NULL);
f = fopen (lib_file, "r");
g_free (lib_file);
if (f == NULL)