mc: upgrade to 4.8.32

This commit is contained in:
Raven 2024-08-25 08:51:26 +06:00
parent 1f7c75d104
commit d9a8215a96
3 changed files with 79 additions and 25 deletions

View File

@ -1,25 +1,6 @@
--- a/contrib/mc-wrapper.sh.in
+++ b/contrib/mc-wrapper.sh.in
@@ -1,5 +1,5 @@
MC_USER=`whoami`
-MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
+MC_PWD_FILE="${TMPDIR-/var/tmp}/mc-$MC_USER/mc.pwd.$$"
@bindir@/mc -P "$MC_PWD_FILE" "$@"
if test -r "$MC_PWD_FILE"; then
--- mc-4.8.21/lib/global.h~
+++ mc-4.8.21/lib/global.h
@@ -131,7 +131,7 @@
#define PATH_SEP_STR "/"
#define IS_PATH_SEP(c) ((c) == PATH_SEP)
#define PATH_ENV_SEP ':'
-#define TMPDIR_DEFAULT "/tmp"
+#define TMPDIR_DEFAULT "/var/tmp"
#define SCRIPT_SUFFIX ""
#define get_default_editor() "vi"
#define OS_SORT_CASE_SENSITIVE_DEFAULT TRUE
--- a/contrib/mc-wrapper.csh.in
+++ b/contrib/mc-wrapper.csh.in
diff -Naur a/contrib/mc-wrapper.csh.in b/contrib/mc-wrapper.csh.in
--- a/contrib/mc-wrapper.csh.in 2024-08-08 13:49:18.000000000 +0600
+++ b/contrib/mc-wrapper.csh.in 2024-08-25 08:34:15.121295453 +0600
@@ -3,7 +3,7 @@
if ($?TMPDIR) then
setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
@ -29,3 +10,25 @@
endif
@bindir@/mc -P "$MC_PWD_FILE" $*
diff -Naur a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in
--- a/contrib/mc-wrapper.sh.in 2024-08-08 13:49:18.000000000 +0600
+++ b/contrib/mc-wrapper.sh.in 2024-08-25 08:34:03.489374384 +0600
@@ -1,5 +1,5 @@
MC_USER=`whoami`
-MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
+MC_PWD_FILE="${TMPDIR-/var/tmp}/mc-$MC_USER/mc.pwd.$$"
@bindir@/mc -P "$MC_PWD_FILE" "$@"
if test -r "$MC_PWD_FILE"; then
diff -Naur a/lib/unixcompat.h b/lib/unixcompat.h
--- a/lib/unixcompat.h 2024-08-08 13:49:18.000000000 +0600
+++ b/lib/unixcompat.h 2024-08-25 08:35:59.689585879 +0600
@@ -108,7 +108,7 @@
#define PATH_SEP_STR "/"
#define IS_PATH_SEP(c) ((c) == PATH_SEP)
#define PATH_ENV_SEP ':'
-#define TMPDIR_DEFAULT "/tmp"
+#define TMPDIR_DEFAULT "/var/tmp"
#define SCRIPT_SUFFIX ""
#define get_default_editor() "vi"
#define OS_SORT_CASE_SENSITIVE_DEFAULT TRUE

View File

@ -0,0 +1,40 @@
diff -Naur a/lib/widget/input_complete.c b/lib/widget/input_complete.c
--- a/lib/widget/input_complete.c 2024-08-08 13:49:18.000000000 +0600
+++ b/lib/widget/input_complete.c 2024-08-25 08:44:41.545041816 +0600
@@ -685,6 +685,27 @@
return strcmp (*(char *const *) a, *(char *const *) b);
}
+/* Replace by g_ptr_array_insert when we depend on glib >= 2.40. */
+static
+void array_insert(GPtrArray *array, gpointer element, size_t pos)
+{
+ size_t original_array_len = array->len;
+
+ /* Allocate an unused element at the end of the array. */
+ g_ptr_array_add(array, NULL);
+
+ /* If we are not inserting at the end, move the elements by one. */
+ if (pos < original_array_len) {
+ memmove(&(array->pdata[pos + 1]),
+ &(array->pdata[pos]),
+ (original_array_len - pos) * sizeof(gpointer));
+ }
+
+ /* Insert the value and bump the array len */
+ array->pdata[pos] = element;
+}
+
+
/* --------------------------------------------------------------------------------------------- */
/** Returns an array of char * matches with the longest common denominator
in the 1st entry. Then a NULL terminated list of different possible
@@ -763,7 +784,7 @@
}
string = g_ptr_array_index (match_list, 0);
- g_ptr_array_insert (match_list, 0, g_strndup (string, low));
+ array_insert (match_list, g_strndup (string, low), 0);
}
return match_list;

View File

@ -1,8 +1,12 @@
%if %{?rhel} >= 7
%bcond_without slang
%else
%bcond_with slang
%endif
Summary: User-friendly text console file manager and visual shell
Name: mc
Version: 4.8.31
Version: 4.8.32
Release: 1%{?dist}
Epoch: 2
License: GPLv3+
@ -13,6 +17,7 @@ Patch1: %{name}-spec.syntax.patch
Patch2: %{name}-python3.patch
Patch3: %{name}-default_setup.patch
Patch4: %{name}-tmpdir.patch
Patch5: %{name}-use-glib-older-than-2.40.patch
URL: http://www.midnight-commander.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -59,6 +64,9 @@ specific files.
%patch1 -p1 -b .spec
%patch3 -p1 -b .setup
%patch4 -p1 -b .tmpdir
%if 0%{?rhel} <= 7
%patch5 -p1 -b .glib2
%endif
%build
export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -Wno-strict-aliasing"
@ -97,8 +105,8 @@ rm -rf %{buildroot}
make install DESTDIR="%{buildroot}"
%__install -d -m 755 %{buildroot}%{_sysconfdir}/profile.d
%__install contrib/mc.{sh,csh} -Dt %{buildroot}%{_sysconfdir}/profile.d
install -d -m 755 %{buildroot}%{_sysconfdir}/profile.d
install contrib/mc.{sh,csh} -Dt %{buildroot}%{_sysconfdir}/profile.d
%find_lang %{name}
@ -141,6 +149,9 @@ rm -rf %{buildroot}
%dir %{_libexecdir}/mc/ext.d
%changelog
* Sun Aug 25 2024 Raven <raven@sysadmins.ws> 4.8.32-1
- update to 4.8.32
* Sat Jan 27 2024 Raven <raven@sysadmins.ws> 4.8.31-1
- update to 4.8.31