summaryrefslogtreecommitdiffstats
path: root/source/ap/mc
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/mc')
-rwxr-xr-xsource/ap/mc/mc.SlackBuild24
-rw-r--r--source/ap/mc/mc.ext.in.geeqie.diff11
-rw-r--r--source/ap/mc/mc.image.sh.geeqie.diff11
-rw-r--r--source/ap/mc/mc.save.file.diff37
4 files changed, 68 insertions, 15 deletions
diff --git a/source/ap/mc/mc.SlackBuild b/source/ap/mc/mc.SlackBuild
index 87e929ac2..21d997db6 100755
--- a/source/ap/mc/mc.SlackBuild
+++ b/source/ap/mc/mc.SlackBuild
@@ -22,7 +22,7 @@
VERSION=${VERSION:-$(echo mc-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -56,6 +56,7 @@ cd $TMP
rm -rf mc-$VERSION
tar xvf $CWD/mc-$VERSION.tar.xz || exit 1
cd mc-$VERSION || exit 1
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -63,8 +64,11 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Fix tmp path for saving files:
+zcat $CWD/mc.save.file.diff.gz | patch -p1 --verbose || exit 1
+
# Use geeqie instead of gqview as an external image viewer:
-zcat $CWD/mc.ext.in.geeqie.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/mc.image.sh.geeqie.diff.gz | patch -p1 --verbose || exit 1
if [ ! -x ./configure ]; then
./autogen.sh
@@ -106,8 +110,20 @@ cp -a $CWD/profile.d/mc.* $PKG/etc/profile.d
chown root:root $PKG/etc/profile.d/*
chmod 755 $PKG/etc/profile.d/*
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $(find $PKG/usr/man -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
mkdir -p $PKG/usr/doc/mc-$VERSION
cp -a \
diff --git a/source/ap/mc/mc.ext.in.geeqie.diff b/source/ap/mc/mc.ext.in.geeqie.diff
deleted file mode 100644
index 8cdfecca5..000000000
--- a/source/ap/mc/mc.ext.in.geeqie.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./misc/mc.ext.in.orig 2010-11-08 05:46:13.000000000 -0600
-+++ ./misc/mc.ext.in 2010-11-11 14:34:30.000000000 -0600
-@@ -391,7 +391,7 @@
- Include=image
-
- include/image
-- Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (gqview %f &); fi
-+ Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (geeqie %f &); fi
- View=%view{ascii} identify %f
- #View=%view{ascii} asciiview %f
-
diff --git a/source/ap/mc/mc.image.sh.geeqie.diff b/source/ap/mc/mc.image.sh.geeqie.diff
new file mode 100644
index 000000000..413807e92
--- /dev/null
+++ b/source/ap/mc/mc.image.sh.geeqie.diff
@@ -0,0 +1,11 @@
+--- ./misc/ext.d/image.sh.orig 2012-07-18 04:30:23.000000000 -0500
++++ ./misc/ext.d/image.sh 2012-09-08 14:39:11.998159169 -0500
+@@ -36,7 +36,7 @@
+ if [ "$DISPLAY" = "" ]; then
+ zgv "${MC_EXT_FILENAME}"
+ else
+- (gqview "${MC_EXT_FILENAME}" &)
++ (geeqie "${MC_EXT_FILENAME}" &)
+ fi
+ ;;
+ esac
diff --git a/source/ap/mc/mc.save.file.diff b/source/ap/mc/mc.save.file.diff
new file mode 100644
index 000000000..f54748c1b
--- /dev/null
+++ b/source/ap/mc/mc.save.file.diff
@@ -0,0 +1,37 @@
+diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
+index 2261aaa..536ac7e 100644
+--- a/src/editor/editcmd.c
++++ b/src/editor/editcmd.c
+@@ -222,7 +222,8 @@ edit_save_file (WEdit * edit, const vfs_path_t * filename_vpath)
+ if (savedir == NULL)
+ savedir = g_strdup (".");
+
+- saveprefix = mc_build_filename (savedir, "cooledit", NULL);
++ /* Token-related function never return leading slash, so we need add it manually */
++ saveprefix = mc_build_filename ("/", savedir, "cooledit", NULL);
+ g_free (savedir);
+ fd = mc_mkstemps (&savename_vpath, saveprefix, NULL);
+ g_free (saveprefix);
+@@ -365,13 +366,21 @@ edit_save_file (WEdit * edit, const vfs_path_t * filename_vpath)
+
+ if (this_save_mode == EDIT_DO_BACKUP)
+ {
++ char *tmp_store_filename;
++ vfs_path_element_t *last_vpath_element;
+ vfs_path_t *tmp_vpath;
+ gboolean ok;
+
+ #ifdef HAVE_ASSERT_H
+ assert (option_backup_ext != NULL);
+ #endif
+- tmp_vpath = vfs_path_append_new (real_filename_vpath, option_backup_ext, (char *) NULL);
++ /* add backup extention to the path */
++ tmp_vpath = vfs_path_clone (real_filename_vpath);
++ last_vpath_element = (vfs_path_element_t *) vfs_path_get_by_index (tmp_vpath, -1);
++ tmp_store_filename = last_vpath_element->path;
++ last_vpath_element->path = g_strdup_printf ("%s%s", tmp_store_filename, option_backup_ext);
++ g_free (tmp_store_filename);
++
+ ok = (mc_rename (real_filename_vpath, tmp_vpath) != -1);
+ vfs_path_free (tmp_vpath);
+ if (!ok)