[gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/, sys-fs/mtools/files/

2022-04-17 Thread Sam James
commit: 00ea34182d8ca6041d56a53e7a1cdf63e68c6c12
Author: Sam James  gentoo  org>
AuthorDate: Sun Apr 17 17:04:55 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr 17 17:06:13 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00ea3418

sys-fs/mtools: drop 4.0.35, 4.0.38

Signed-off-by: Sam James  gentoo.org>

 sys-fs/mtools/Manifest |  2 -
 .../files/mtools-4.0.38-strtoi-definition.patch| 94 --
 sys-fs/mtools/mtools-4.0.35.ebuild | 46 ---
 sys-fs/mtools/mtools-4.0.38.ebuild | 61 --
 4 files changed, 203 deletions(-)

diff --git a/sys-fs/mtools/Manifest b/sys-fs/mtools/Manifest
index 99c9fff6b339..5a3c67d64b02 100644
--- a/sys-fs/mtools/Manifest
+++ b/sys-fs/mtools/Manifest
@@ -1,4 +1,2 @@
-DIST mtools-4.0.35.tar.bz2 455988 BLAKE2B 
9c1ac7f3ad3f9f13a572d0e1ea3c3a9d79bd08f0ae963c7357a19a687b74536cd8442eb167a9e50f7d22398c56736753b0d98bccdaa4c7d8427d1c09e1dd786c
 SHA512 
ef563b3319285667993c82d819e08cb819a6bcd71c466fc252568996b4218cfb3731107ffcd6150ba33c0837e012e02057def41e2b011f751eaf550bfa366a10
 DIST mtools-4.0.37.tar.bz2 441076 BLAKE2B 
a84ff9e532a1896706589dfe7e62b1e400baf0ab9b86cc3d4a09bd4a0a24d1e86f504b9005c98765f62d735d227d0a1d5ab78354c587c88e2d42a4146d127dc1
 SHA512 
5ff4da9050dd5d5c0929dd9977866086085bd8fef577f3c6ce2ed6fb958eec2304db612c0766e6be1a048819e29f62023cb0f0a9464a84ed7cc21de9561fadce
-DIST mtools-4.0.38.tar.bz2 440491 BLAKE2B 
4d486b9bcbf31c9056ed6460d3d7ccb160f2d3d68e2b9a87590821251513a299ab321df825821722c41e13f608250eecad52e828c901ab956e471cd56871a50c
 SHA512 
045e7dba159699c53abefd69e2065c116e2e360e7ec537df1e4d38309fb03587c600bb930363ecffef48cef1c8c118146691cf9a35c36abbb40e4546e532ce4a
 DIST mtools-4.0.39.tar.bz2 429751 BLAKE2B 
b1b04fa1614cf36245c60c3ef35de1869e53786dbc9a7e864278a51c9519c63b59fff9dffbd761fbc59782161ba201908b4a5b6792a7231fff6f27be2bea1d67
 SHA512 
6f84ce57a7c088b526e3e4fa7c509f1869a55b87951134d6257533d311b4a97496c44fa374de6f8cb15c645d60b9f9745ccbdf405d0d77a30a86e31ed8d54ce4

diff --git a/sys-fs/mtools/files/mtools-4.0.38-strtoi-definition.patch 
b/sys-fs/mtools/files/mtools-4.0.38-strtoi-definition.patch
deleted file mode 100644
index 637e9193f43f..
--- a/sys-fs/mtools/files/mtools-4.0.38-strtoi-definition.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-https://lists.gnu.org/archive/html/info-mtools/2022-03/msg1.html
-
-From d36dea2ea7f246f28719dcb01b7a8ad7ad8ed1f6 Mon Sep 17 00:00:00 2001
-From: Sam James 
-Date: Sun, 6 Mar 2022 02:36:03 +
-Subject: [PATCH] Use own definition of strtoi
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before this change, build resulted in implicit function declarations like:
-```
-* config.c:269:57: warning: implicit declaration of function ‘strtoi’; did you 
mean ‘strtoui’? [-Wimplicit-function-declaration]
-* floppyd_io.c:473:20: warning: implicit declaration of function ‘strtoi’; did 
you mean ‘strtoui’? [-Wimplicit-function-declaration]
-```
-
-The include(s) for inttypes.h are guarded by HAVE_INTTYPES_H
-(normal autoconf pattern) but we're not checking for inttypes.h
-in configure. But adding this doesn't solve the issue.
-
-If libbsd is installed, configure discovers the strtoi
-provided by libbsd  although the included version may still
-end up being glibc's as the include path doesn't change
-(glibc has its own which doesn't feature strtoi).
-
-If trying to use libbsd's, we end up with a build failure:
-```
-config.c: In function ‘get_env_conf’:
-config.c:269:57: error: too few arguments to function ‘strtoi’
-  269 | * ((int *)global_switches[i].address) = strtoi(s,0,0);
-  | ^~
-In file included from sysincludes.h:174,
- from config.c:18:
-/usr/include/bsd/inttypes.h:43:10: note: declared here
-   43 | intmax_t strtoi(const char *__restrict nptr, char **__restrict endptr,
-  |  ^~
-```
-
-So, it seems best to just always use our own definition of strtoi,
-given our definition doesn't match libbsd's anyway. This avoids
-the build failure as well as the implicit declaration warnings.
-
-Signed-off-by: Sam James 

- configure.in  | 2 +-
- mtools.h  | 2 --
- sysincludes.h | 4 
- 3 files changed, 1 insertions(+), 7 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 72cf205..eb1c754 100644
 a/configure.in
-+++ b/configure.in
-@@ -218,7 +218,7 @@ dnl Checks for library functions.
- AC_TYPE_SIGNAL
- AC_CHECK_FUNCS(strerror random srandom strchr strrchr lockf flock \
- strcasecmp strncasecmp strnlen atexit on_exit getpass memmove \
--strdup strndup strcspn strspn strtoul strtol strtoll strtoi strtoui \
-+strdup strndup strcspn strspn strtoul strtol strtoll strtoui \
- memcpy strpbrk memset setenv seteuid setresuid setpgrp \
- tcsetattr tcflush basename fchdir media_oldaliases  \
- snprintf 

[gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/, sys-fs/mtools/files/

2016-11-09 Thread Mike Frysinger
commit: f073c56142eebe7e2d71a3d1386810eda7e9107a
Author: Mike Frysinger  gentoo  org>
AuthorDate: Thu Nov 10 05:20:17 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Nov 10 05:20:17 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f073c561

sys-fs/mtools: fix locking errors w/syslinux & udev

 sys-fs/mtools/files/mtools-4.0.18-locking.patch | 163 
 sys-fs/mtools/mtools-4.0.18-r1.ebuild   |  51 
 2 files changed, 214 insertions(+)

diff --git a/sys-fs/mtools/files/mtools-4.0.18-locking.patch 
b/sys-fs/mtools/files/mtools-4.0.18-locking.patch
new file mode 100644
index ..3b53c73
--- /dev/null
+++ b/sys-fs/mtools/files/mtools-4.0.18-locking.patch
@@ -0,0 +1,163 @@
+https://crbug.com/508713
+https://lists.gnu.org/archive/html/info-mtools/2016-11/msg0.html
+
+From 04df65ed797e47da5b423c7f9aec99d82dfde400 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Wed, 7 Sep 2016 12:33:42 -0400
+Subject: [PATCH] add support for retrying device locking
+
+When running syslinux's install phase, it will run a bunch of mtools
+commands in quick succession.  If you're on a fast enough machine, it
+can often fail with errors like:
+plain floppy: device "/proc/2908/fd/3" busy (Resource temporarily unavailable):
+Cannot initialize 'S:'
+Bad target s:/ldlinux.sys
+syslinux: failed to create ldlinux.sys
+
+The issue is that after some of the mtools calls, the kernel notices
+that the fs image has changed, so it notifies userspace.  This wakes
+up udev which grabs a lock on the device to rescan it for changes
+(e.g. updated fs metadata like UUID).  The udev phase does not finish
+before syslinux fires off another mtools call which means mtools now
+fails with a locking error.
+
+You can recreate this with a simple test:
+- loop mount a fat fs image
+- open the loop device for writing
+- generate a mtools.conf pointing the file to /proc/$pid/fd/$fd
+- run mattrib && mcopy
+- see udev open/lock the loop device after mattrib runs to probe it
+- see mcopy fail because udev is still holding the lock
+
+To fix things, we teach mtools to retry its locking calls temporarily.
+If it still fails after a timeout, we abort like normal.  We also make
+this behavior configurable by adding a new global timeout option.
+---
+ config.c  |  2 ++
+ mtools.h  |  1 +
+ mtools.texi   |  7 +++
+ mtools.tmpl.5 |  4 
+ plain_io.c| 10 ++
+ xdf_io.c  | 11 +++
+ 6 files changed, 35 insertions(+)
+
+diff --git a/config.c b/config.c
+index f08688399d1d..ea4178452f6a 100644
+--- a/config.c
 b/config.c
+@@ -63,6 +63,7 @@ unsigned int mtools_no_vfat=0;
+ unsigned int mtools_numeric_tail=1;
+ unsigned int mtools_dotted_dir=0;
+ unsigned int mtools_twenty_four_hour_clock=1;
++unsigned int mtools_lock_timeout=30;
+ unsigned int mtools_default_codepage=850;
+ const char *mtools_date_string="-mm-dd";
+ char *country_string=0;
+@@ -90,6 +91,7 @@ static switches_t global_switches[] = {
+   (caddr_t) _twenty_four_hour_clock, T_UINT },
+ { "MTOOLS_DATE_STRING",
+   (caddr_t) _date_string, T_STRING },
++{ "MTOOLS_LOCK_TIMEOUT", (caddr_t) _lock_timeout, T_UINT },
+ { "DEFAULT_CODEPAGE", (caddr_t) _default_codepage, T_UINT }
+ };
+ 
+diff --git a/mtools.h b/mtools.h
+index ef98e942ee2c..fa8c1bdc8a1b 100644
+--- a/mtools.h
 b/mtools.h
+@@ -188,6 +188,7 @@ extern unsigned int mtools_ignore_short_case;
+ extern unsigned int mtools_no_vfat;
+ extern unsigned int mtools_numeric_tail;
+ extern unsigned int mtools_dotted_dir;
++extern unsigned int mtools_lock_timeout;
+ extern unsigned int mtools_twenty_four_hour_clock;
+ extern const char *mtools_date_string;
+ extern unsigned int mtools_rate_0, mtools_rate_any;
+diff --git a/mtools.texi b/mtools.texi
+index 1085789c1cb6..1c7ad94d40f9 100644
+--- a/mtools.texi
 b/mtools.texi
+@@ -658,6 +658,10 @@ DOSEMU image files.
+ @vindex MTOOLS_FAT_COMPATIBILITY
+ @vindex MTOOLS_LOWER_CASE
+ @vindex MTOOLS_NO_VFAT
++@vindex MTOOLS_DOTTED_DIR
++@vindex MTOOLS_NAME_NUMERIC_TAIL
++@vindex MTOOLS_TWENTY_FOUR_HOUR_CLOCK
++@vindex MTOOLS_LOCK_TIMEOUT
+ @cindex FreeDOS
+ 
+ Global flags may be set to 1 or to 0.
+@@ -692,6 +696,9 @@ clash would have happened.
+ @item MTOOLS_TWENTY_FOUR_HOUR_CLOCK
+ If 1, uses the European notation for times (twenty four hour clock),
+ else uses the UK/US notation (am/pm)
++@item MTOOLS_LOCK_TIMEOUT
++How long, in seconds, to wait for a locked device to become free.
++Defaults to 30.
+ @end table
+ 
+ Example:
+diff --git a/mtools.tmpl.5 b/mtools.tmpl.5
+index 565fdd7513aa..8cdaaf2ba929 100644
+--- a/mtools.tmpl.5
 b/mtools.tmpl.5
+@@ -106,6 +106,10 @@ clash would have happened.
+ \&\fR\&\f(CWMTOOLS_TWENTY_FOUR_HOUR_CLOCK\fR\ 
+ If 1, uses the European notation for times (twenty four hour clock),
+ else uses the UK/US notation (am/pm)
++.TP
++\&\fR\&\f(CWMTOOLS_LOCK_TIMEOUT\fR\ 
++How long, in seconds, to wait