Add epatch_user and pull prealloc patch (bug #532424 by Ulenrich).
authorSergei Trofimovich <slyfox@gentoo.org>
Mon, 15 Dec 2014 22:37:59 +0000 (22:37 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Mon, 15 Dec 2014 22:37:59 +0000 (22:37 +0000)
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0x611FF3AA

app-misc/mc/ChangeLog
app-misc/mc/Manifest
app-misc/mc/files/mc-4.8.13-3297-prealloc.patch [new file with mode: 0644]
app-misc/mc/mc-4.8.13-r1.ebuild [new file with mode: 0644]

index 128eb9ab52ed33f769953878d2360274de82cb1f..9181456933710771138b8d25e039dea43cbbffa2 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for app-misc/mc
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/mc/ChangeLog,v 1.312 2014/11/01 15:55:26 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/mc/ChangeLog,v 1.313 2014/12/15 22:37:58 slyfox Exp $
+
+*mc-4.8.13-r1 (15 Dec 2014)
+
+  15 Dec 2014; Sergei Trofimovich <slyfox@gentoo.org>
+  +files/mc-4.8.13-3297-prealloc.patch, +mc-4.8.13-r1.ebuild:
+  Add epatch_user and pull prealloc patch (bug #532424 by Ulenrich).
 
   01 Nov 2014; Sergei Trofimovich <slyfox@gentoo.org>
   +files/mc-4.8.13-tinfo.patch, mc-4.8.13.ebuild:
index 42a2bd3c00865e9daceb6fb5228cba9feb37587e..a18619ca12bf9668394811fbdd4e1339bb6e33d5 100644 (file)
@@ -2,20 +2,22 @@
 Hash: SHA256
 
 AUX mc-4.8.11-ncurses_build_fix.patch 1188 SHA256 62dadbcbca441c0eeca7e2414697fc4679fa461b47470967b34c8dcfbafd4a49 SHA512 66b6c778f15bf75f2474bdaaf3114d9644e7c2b6ca8ce3dbd2f2f379f8daf90b0896e0c22164b0d5791d7ad8b9b3b13a298032a882bc0273cf6b59653b201b02 WHIRLPOOL b272312da887167907d26b67b873a9f567a9b635409223c9f3069e4691ae06f034befe708b0044dae7aace95610cdcb8e033c9d7559ba4d846e38cf4a03a1174
+AUX mc-4.8.13-3297-prealloc.patch 4488 SHA256 62c3c356406809e634dc749b507a32366567da21c167480174fcc2a7107a7aa3 SHA512 591b036a3a2fb6a11954190087eac759f47a7634a1526104f9e485a9bd383ccc10a104e0d9438ac9dd118899c9955cd2003044f67b069a104d7a7dbc37b6b83f WHIRLPOOL 0c57b478fe4ca2a9eb42f768ac3a649d1274b3ae194ed4e23ca212486ddfc544ea070529d85504dfb6874e487f48d31a900db6496dafce3c182bb277d772b805
 AUX mc-4.8.13-tinfo.patch 1742 SHA256 e195c6d498a2aaca51401215969f6bf42fba607666d54b504ac5478745c6d098 SHA512 7714d42ece73fe6f044f5cc0f59ab5c23bedb820122291d1af581f5f7dd94d4410072868205e94419be459ed9769c8ed75dfb8ad5b945c8df820901f756e7c3c WHIRLPOOL 9f6030011f81dc518adeb7cbaed1efab09b7c1bd72328d15abfc2be31bec5e814c89aae281327557074d86f809e993a5233a5261b3ed26c6dcbf6d9f3e6a2008
 DIST mc-4.8.11.tar.xz 2211144 SHA256 1877ea844f9d71e133b9e03ca3bebcd7b10b9ba5b419b8d268e255816fe1993a SHA512 5afb9e0704b8c0e98cd4787f03baf40131a0ab40027103e42f44b2ebd5b6c33b8702d7f534ca8175f3b8efbb25a04f08f0f51a1eb3a1783a99e6117472344fbc WHIRLPOOL bbe6dbad549f45b9d4aab0985ce9a2c35e42017d2f2020972d27d8d43c66473c49fea8754fd6635195b72e6a531625a28327c0f2aa65f5e79cea0db0d54ea7e6
 DIST mc-4.8.12.tar.xz 2237892 SHA256 5f2fd570a798dc0cc06374adffef8ca403588c4e73dfdf908e9a4311718153fe SHA512 f482177fd2a457b75d96b953922f473ad669ae4d83910c0c3d5445dd459fff38c9abdc0b39e531b58692e00beb6cae2ca4858d79f55204105a62889784b1fbd3 WHIRLPOOL 79fa8fef9f1a076588093360a1f1b5f31ad6e88c2de285408c118492f9d1e9d37ab8d36d3d96b3dae29e3d547a5ecca601cf5ef0a49e7d3e6f5c81a8172536ba
 DIST mc-4.8.13.tar.xz 2231448 SHA256 36d6191a47ec5d89d3788e48846fb620c481816441ff25264add8898d277b657 SHA512 556047072cc1d22a911cfb3cc82b03d204881f2773e06a8fe2020ecfbd4ffa491e1c710ca2124b9f3b219cd73f2b732a4bfad1671f095c1768864704514b067f WHIRLPOOL 4224dea453e6d46aa0a783bcf1778dab5dc8eac090bae45a617145a8507e7c65b78dd7d7b0f50d2477a4002c62c75ce5304be59a20e84842042fe602318cccf4
 EBUILD mc-4.8.11.ebuild 2631 SHA256 ce8c8731cb21d692a8944f41e28a9f212908fde98c6c1c7fa412887f7bfdc599 SHA512 29ad68127d1e733a34fdba4e14884111c3280dfc394963f80984e87056712f8b677f0147504d5b7377d54c6e279e828caf3bd5441887fd6bc308ba4f63dec506 WHIRLPOOL 84e33e69d07fe2dab1d77492a0701478d49de20812b34b3d3679b2a015767a74c8582ba330df2c52fe5d1b66e9a076a1447150209b55c01850783df6266933e3
 EBUILD mc-4.8.12.ebuild 2590 SHA256 b0b170afef4c09c214aae5a96c524fe752aabce698db4425d3c4ac3fb240a623 SHA512 8d21ac16f60e57b3326f7160b6d6e8af915735ed9ae60303a60418c1ff1664a33124e3c847793021c138aaa5b72264fba789f9df38c4840bc2b94bb32a762198 WHIRLPOOL 854e03121fe1147fe6a1f2dedb647640fc8be7cb559daa7220abc9ea50a7acd9c36cb2dd2374d4d605df2a9ad8f4e944d5e0d25ad77aa61d3ab8631c276c1e16
+EBUILD mc-4.8.13-r1.ebuild 2716 SHA256 3ace222dd71f4986759b4889e7716c18af01e1896664324a872eb62fcd967a2d SHA512 e94b174d71b21c259b062b5b4400d1b04411482c7ba0e5621ee3e0d63d73d7877366a64606c1ba9158b80ebf1968c4fa54653972b9b212a91d77195d7d45c679 WHIRLPOOL cfa6e183b8a41801d301abffbe9dec903316d884f6dba6df023cb2141c98c3d7f3ca2bdd577322b11d095a5e6820675f359f8651a71e968d0fd6d8cfc7a0593c
 EBUILD mc-4.8.13.ebuild 2653 SHA256 bb3b615ca98711fffd5cf6ecf278b9357371d4aa9fddc5de3121918ef414ca1e SHA512 be88a9bef8f3b000143c142315129d79bb3161d807af703b472257a29c1790de357acdd4a15899f94b1b464f93e085d88e8c527b7bcf12a1a914d0ad3661267f WHIRLPOOL 0123aafe24a2e5d2713cf02e10326271052fec00f0a5c523f2d33500accbcfc3a79dc08905dc260993f8ddbbd092bc3e2dc6ee441ef05ba07c428a3fb5f21bd2
 EBUILD mc-9999.ebuild 2883 SHA256 9cd304088c881b3f8cca9b0a1faa93654c1e8583b8542712139065290e64deb2 SHA512 02194e3b2e4b3157043bcb41eb249f0f771260fd4f93b79feabaffc0d9887731cbb9ad84d0247e8e1eba1238f557e442a2774a58b9f50b82dfa4533c4a706f8f WHIRLPOOL 4b8ffa91a840203f22f8b7485ce0898ad15cd4e4e858c05dcd1b88928bf7499b24c1c705b880deccf15368b68de9ec93ea69a231c9ad73b4146631c70cc65da3
-MISC ChangeLog 46710 SHA256 02ac328969fcfb34f3e201c8cdd66909de4a25957cf82411ae5e68d6fe0c6c77 SHA512 80fbe085ac7a85396e970c7b1710e0c42f7a350573e2a5953e13a46a6fcd859b1ccb6e5e8d99bbe4c8698e65b19fc05a3bf57065ed333aa5ac9bd0457f5a0938 WHIRLPOOL 0dbc15f319c499a66fd13a5b46707ca27a1274d2a53908a664e7324436ee56d1160141b784c263b024d1b5664a7051d24a77c14e45670ea1982332a90ab5c448
+MISC ChangeLog 46925 SHA256 beac078c6c69d826f0820521acf2fc6f575e73dbd16190cbe223023191730c7b SHA512 ce3572b98242778fa53067e03b7d97c988c5dc0a5f10ed5ccb6b8e86cff4a9a14dca2ac14612d9ee04015adf9e79aef9488e4a8bb307548e1f349dafaf86ed4c WHIRLPOOL 2a04455707b5867faa140cee47996e1fa5b7f789fa7c9eb1387ef4aca150accea1a4f36733a50b1ace18f36d9a4de1e4d463f5791f5f8af4c01c78f736fcf021
 MISC metadata.xml 950 SHA256 7a5f3db095ee82a58da8299170da072eb298919ae2beec7020e2ca12982b3263 SHA512 9143eda1ccedb0613eb915f30e70259c32b5075669e256c43c488c1baf34ffecb3210583144bf0389af463fdbc98f60f5d781b6afa77f1951cba11b16555132b WHIRLPOOL cbcc220f6ba1de379b0225d0079945991362aadf88df2aac225994841ec7c81f5132ef3a0b506433d46abe445673dc7dc406fce37dc5e04a17179c6858a3bdea
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
-iEYEAREIAAYFAlRVAnEACgkQcaHudmEf86pR5ACfb9Tfkd3y9owbfYq9IYt39TkU
-XfYAnRA+fp4c2DXr227NaE4ESvJt1beY
-=JqY2
+iEYEAREIAAYFAlSPYscACgkQcaHudmEf86oWYQCfVK/FLpxT8jvyzk1UMo8+hT5e
+2mMAn2HVRMmVFUGbdIT6mwfalOVjCECY
+=htrs
 -----END PGP SIGNATURE-----
diff --git a/app-misc/mc/files/mc-4.8.13-3297-prealloc.patch b/app-misc/mc/files/mc-4.8.13-3297-prealloc.patch
new file mode 100644 (file)
index 0000000..d84c348
--- /dev/null
@@ -0,0 +1,120 @@
+commit a3486faac37680e3bcf7d0b3905f745765a823fd
+Author: Andrew Borodin <aborodin@vmail.ru>
+Date:   Mon Nov 10 10:32:34 2014 +0300
+
+    Ticket #3297: don't lose file in case of preallocate space fail.
+    
+    Don't remove the destination file if it was retrieved incompletely
+    but it was already exist and appended during copy/move operation.
+    
+    Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
+
+diff --git a/src/filemanager/file.c b/src/filemanager/file.c
+index 9fbf081..3009ccf 100644
+--- a/src/filemanager/file.c
++++ b/src/filemanager/file.c
+@@ -1497,7 +1497,6 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
+     int open_flags;
+     gboolean is_first_time = TRUE;
+     vfs_path_t *src_vpath = NULL, *dst_vpath = NULL;
+-    gboolean write_errno_nospace = FALSE;
+ 
+     /* FIXME: We should not be using global variables! */
+     ctx->do_reget = 0;
+@@ -1739,28 +1738,39 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
+         goto ret;
+     }
+ 
+-    while (TRUE)
++    /* try preallocate space; if fail, try copy anyway */
++    while (vfs_preallocate (dest_desc, file_size, ctx->do_append != 0 ? sb.st_size : 0) != 0)
+     {
+-        errno = vfs_preallocate (dest_desc, file_size, (ctx->do_append != 0) ? sb.st_size : 0);
+-        if (errno == 0)
++        if (ctx->skip_all)
++        {
++            /* cannot allocate, start the file copying anyway */
++            return_status = FILE_CONT;
+             break;
++        }
+ 
+-        if (ctx->skip_all)
+-            return_status = FILE_SKIPALL;
+-        else
++        return_status =
++            file_error (_("Cannot preallocate space for target file \"%s\"\n%s"), dst_path);
++
++        if (return_status == FILE_SKIPALL)
++            ctx->skip_all = TRUE;
++
++        if (ctx->skip_all || return_status == FILE_SKIP)
+         {
+-            return_status =
+-                file_error (_("Cannot preallocate space for target file \"%s\"\n%s"), dst_path);
+-            if (return_status == FILE_RETRY)
+-                continue;
+-            if (return_status == FILE_SKIPALL)
+-                ctx->skip_all = TRUE;
++            /* skip the space allocation error, start file copying */
++            return_status = FILE_CONT;
++            break;
+         }
+-        mc_close (dest_desc);
+-        dest_desc = -1;
+-        mc_unlink (dst_vpath);
+-        dst_status = DEST_NONE;
+-        goto ret;
++
++        if (return_status == FILE_ABORT)
++        {
++            mc_close (dest_desc);
++            dest_desc = -1;
++            mc_unlink (dst_vpath);
++            dst_status = DEST_NONE;
++            goto ret;
++        }
++
++        /* return_status == FILE_RETRY -- try allocate space again */
+     }
+ 
+     ctx->eta_secs = 0.0;
+@@ -1822,6 +1832,8 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
+                 /* dst_write */
+                 while ((n_written = mc_write (dest_desc, t, n_read)) < n_read)
+                 {
++                    gboolean write_errno_nospace;
++
+                     if (n_written > 0)
+                     {
+                         n_read -= n_written;
+@@ -1851,10 +1863,6 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
+                     }
+                     if (return_status != FILE_RETRY)
+                         goto ret;
+-
+-                    /* User pressed "Retry". Will the next mc_write() call be successful?
+-                     * Reset error flag to be ready for that. */
+-                    write_errno_nospace = FALSE;
+                 }
+             }
+ 
+@@ -1933,16 +1941,9 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
+ 
+     if (dst_status == DEST_SHORT)
+     {
+-        /* Remove short file */
+-        int result = 0;
+-
+-        /* In case of copy/move to full partition, keep source file
+-         * and remove incomplete destination one */
+-        if (!write_errno_nospace)
+-            result = query_dialog (Q_ ("DialogTitle|Copy"),
+-                                   _("Incomplete file was retrieved. Keep it?"),
+-                                   D_ERROR, 2, _("&Delete"), _("&Keep"));
+-        if (result == 0)
++        /* Query to remove short file */
++        if (query_dialog (Q_ ("DialogTitle|Copy"), _("Incomplete file was retrieved. Keep it?"),
++                          D_ERROR, 2, _("&Delete"), _("&Keep")) == 0)
+             mc_unlink (dst_vpath);
+     }
+     else if (dst_status == DEST_FULL)
diff --git a/app-misc/mc/mc-4.8.13-r1.ebuild b/app-misc/mc/mc-4.8.13-r1.ebuild
new file mode 100644 (file)
index 0000000..d039823
--- /dev/null
@@ -0,0 +1,102 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/mc/mc-4.8.13-r1.ebuild,v 1.1 2014/12/15 22:37:58 slyfox Exp $
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic
+
+MY_P=${P/_/-}
+
+DESCRIPTION="GNU Midnight Commander is a text based file manager"
+HOMEPAGE="http://www.midnight-commander.org"
+SRC_URI="http://www.midnight-commander.org/downloads/${MY_P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="+edit gpm mclib nls samba sftp +slang spell test X +xdg"
+
+REQUIRED_USE="spell? ( edit )"
+
+RDEPEND=">=dev-libs/glib-2.8:2
+       gpm? ( sys-libs/gpm )
+       kernel_linux? ( sys-fs/e2fsprogs )
+       samba? ( net-fs/samba )
+       sftp? ( net-libs/libssh2 )
+       slang? ( >=sys-libs/slang-2 )
+       !slang? ( sys-libs/ncurses )
+       spell? ( app-text/aspell )
+       X? ( x11-libs/libX11
+               x11-libs/libICE
+               x11-libs/libXau
+               x11-libs/libXdmcp
+               x11-libs/libSM )"
+DEPEND="${RDEPEND}
+       app-arch/xz-utils
+       virtual/pkgconfig
+       nls? ( sys-devel/gettext )
+       test? ( dev-libs/check )
+       "
+
+[[ -n ${LIVE_EBUILD} ]] && DEPEND="${DEPEND} dev-vcs/cvs" # needed only for SCM source tree (autopoint uses cvs)
+
+src_prepare() {
+       [[ -n ${LIVE_EBUILD} ]] && ./autogen.sh
+
+       epatch "${FILESDIR}"/${P}-tinfo.patch
+       epatch "${FILESDIR}"/${P}-3297-prealloc.patch
+       epatch_user
+       eautoreconf
+}
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+       local myscreen=ncurses
+       use slang && myscreen=slang
+       [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket"
+
+       local homedir=".mc"
+       use xdg && homedir="XDG"
+
+       econf \
+               --disable-silent-rules \
+               --disable-dependency-tracking \
+               $(use_enable nls) \
+               --enable-vfs \
+               $(use_enable kernel_linux vfs-undelfs) \
+               --enable-charset \
+               $(use_with X x) \
+               $(use_enable samba vfs-smb) \
+               $(use_enable sftp vfs-sftp) \
+               $(use_enable spell aspell) \
+               $(use_with gpm gpm-mouse) \
+               --with-screen=${myscreen} \
+               $(use_with edit internal-edit) \
+               $(use_enable mclib) \
+               $(use_enable test tests) \
+               --with-homedir=${homedir}
+}
+
+src_install() {
+       emake DESTDIR="${D}" install
+       dodoc AUTHORS README NEWS
+
+       # fix bug #334383
+       if use kernel_linux && [[ ${EUID} == 0 ]] ; then
+               fowners root:tty /usr/libexec/mc/cons.saver
+               fperms g+s /usr/libexec/mc/cons.saver
+       fi
+
+       if ! use xdg ; then
+               sed 's@MC_XDG_OPEN="xdg-open"@MC_XDG_OPEN="/bin/false"@' \
+                       -i "${ED}"/usr/libexec/mc/ext.d/*.sh || die
+       fi
+}
+
+pkg_postinst() {
+       elog "To enable exiting to latest working directory,"
+       elog "put this into your ~/.bashrc:"
+       elog ". ${EPREFIX}/usr/libexec/mc/mc.sh"
+}