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

2022-03-05 Thread Sam James
commit: 0b01c1ac7d47153853e1ec678d7eb52d245c6b82
Author: Sam James  gentoo  org>
AuthorDate: Sun Mar  6 02:46:37 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Mar  6 04:34:28 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b01c1ac

sys-fs/mtools: add 4.0.38

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

 sys-fs/mtools/Manifest |  1 +
 .../files/mtools-4.0.38-strtoi-definition.patch| 94 ++
 sys-fs/mtools/mtools-4.0.38.ebuild | 61 ++
 3 files changed, 156 insertions(+)

diff --git a/sys-fs/mtools/Manifest b/sys-fs/mtools/Manifest
index 4d28b1eed9d4..4d7315e52f86 100644
--- a/sys-fs/mtools/Manifest
+++ b/sys-fs/mtools/Manifest
@@ -1,2 +1,3 @@
 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

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
new file mode 100644
index ..637e9193f43f
--- /dev/null
+++ b/sys-fs/mtools/files/mtools-4.0.38-strtoi-definition.patch
@@ -0,0 +1,94 @@
+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 setlocale toupper_l strncasecmp_l \
+diff --git a/mtools.h b/mtools.h
+index b3fd3c8..190ddf8 100644
+--- a/mtools.h
 b/mtools.h
+@@ -188,9 +188,7 @@ off_t str_to_offset(char *str);
+ uint32_t parseSize(char *sizeStr);
+ unsigned int strtoui(const char *nptr, char **endptr, int base);
+ unsigned int atoui(const char *nptr);
+-#ifndef HAVE_STRTOI
+ int strtoi(const char *nptr, char **endpt

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

2020-10-26 Thread Lars Wendler
commit: 6bede4b47335b52eb82ef28a06f8e289a41344cd
Author: Lars Wendler  gentoo  org>
AuthorDate: Mon Oct 26 09:18:11 2020 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Mon Oct 26 09:18:21 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bede4b4

sys-fs/mtools: Removed old

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Lars Wendler  gentoo.org>

 sys-fs/mtools/Manifest  |   2 -
 sys-fs/mtools/files/mtools-4.0.18-attr.patch|  51 
 sys-fs/mtools/files/mtools-4.0.18-locking.patch | 163 
 sys-fs/mtools/files/mtools-4.0.18-memset.patch  |  27 
 sys-fs/mtools/mtools-4.0.18-r2.ebuild   |  56 
 sys-fs/mtools/mtools-4.0.23.ebuild  |  54 
 6 files changed, 353 deletions(-)

diff --git a/sys-fs/mtools/Manifest b/sys-fs/mtools/Manifest
index 2174b50f5a3..3b548a818c7 100644
--- a/sys-fs/mtools/Manifest
+++ b/sys-fs/mtools/Manifest
@@ -1,4 +1,2 @@
-DIST mtools-4.0.18.tar.bz2 420190 BLAKE2B 
92fdf8b054287e3cb4eddb40c98f5ac4229a38473b633c25ab74a07a8a72d38c2767ae648a35cf0dac9dedfa2f7789afc4904a50e1328e2baa0a289d93b094fb
 SHA512 
3981a4727aa4e2ec5c931201b236f52fcd1c9d55f888cb2fbdc5c4172402e2b229ede9a5005b972ffdad59bcb861e2fcc01404845e521116419079ae78239090
-DIST mtools-4.0.23.tar.bz2 418592 BLAKE2B 
442f552087a5d53ef0ead6161cdad7997dc45a3e210c2cb442a8b2ba42866152f93e4a1f5b58df8d68316168374ea034b390bcf4c607ac3a1c477c4ec5e7842c
 SHA512 
c8c48adedc3f3e4eeafead27ce80172c9cb9690b575618842001ed16aa0011dcd2bc517882ea4bf01a73810ba151aa4b86f8ce2f97d6e8a0177d09be71a6d1ed
 DIST mtools-4.0.24.tar.bz2 418178 BLAKE2B 
96ccbde0e5ed5e304c73c7faaeb495751c43ae37970e5c2329299e0f7bf90f3a810f4ca95faea10a00e5af110be579a3b083043314e980bb0128226caffb5608
 SHA512 
b74becc4f696315cfabc016d1746e744b43e366de73bf1bffeec4fbab1e4815967594de8acb4af01f89d36a925f93672efbac205b89540161bd53ab7edebcf04
 DIST mtools-4.0.25.tar.bz2 421807 BLAKE2B 
54b0de421d5de003c6dff9a524af2a37d7fe0fb88361e195b000b8c8637ed894ec01ca295ea71ed0df781e9503d609f5e21b987a79c7e9d2c2e0c7176d5eb825
 SHA512 
91b879de6b41bf9fd6d9282d846e21fe58dbcd3461d97d2d6cae752a309a5129091a0e6ffda5b28ef062c33970a1c0a43ff1cf19106232866bdbdb762c64a143

diff --git a/sys-fs/mtools/files/mtools-4.0.18-attr.patch 
b/sys-fs/mtools/files/mtools-4.0.18-attr.patch
deleted file mode 100644
index 3cd770be8bd..000
--- a/sys-fs/mtools/files/mtools-4.0.18-attr.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From e8437f906ca86fd5b1cac20d240a0e114c5df7a9 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger 
-Date: Thu, 9 Mar 2017 16:06:54 -0800
-Subject: [PATCH] fix unused attribute in func definition
-
-UNUSED is for wrapping variable decls, not for variables in a function
-definition.  It will insert a semi-colon into the mix which makes clang
-upset:
-x86_64-cros-linux-gnu-clang  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc/mtools\" \
-   -DCPU_x86_64 -DVENDOR_cros -DOS_linux_gnu -O2 -pipe -O2 -pipe \
-   -march=x86-64 -msse3 -g -fno-exceptions -fno-unwind-tables \
-   -fno-asynchronous-unwind-tables  -clang-syntax -Wall \
-   -fno-strict-aliasing -I.  -I.  -c mainloop.c
-mainloop.c:89:15: error: expected ')'
-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
-  ^
-./sysincludes.h:106:47: note: expanded from macro 'UNUSED'
-  ^
-
-Arguably this should fail on gcc too, but it doesn't today.
-
-URL: https://crbug.com/644387

- mainloop.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/mainloop.c b/mainloop.c
-index f5f8349f1472..69af9a80c3e4 100644
 a/mainloop.c
-+++ b/mainloop.c
-@@ -86,7 +86,7 @@ static const char *fix_mcwd(char *ans)
- }
- 
- int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); 
--int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
-+int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg,
- int follow_dir_link);
- 
- static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
-@@ -95,7 +95,7 @@ static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
-   return unix_dir_loop(Dir, mp);
- }
- 
--int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp,
-+int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp,
- char *arg, int follow_dir_link)
- {
-   int ret;
--- 
-2.12.0
-

diff --git a/sys-fs/mtools/files/mtools-4.0.18-locking.patch 
b/sys-fs/mtools/files/mtools-4.0.18-locking.patch
deleted file mode 100644
index 3b53c73c645..000
--- a/sys-fs/mtools/files/mtools-4.0.18-locking.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-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
-command

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

2017-03-09 Thread Mike Frysinger
commit: 332268554a5fa329c3ebea901c2456fc7dc02980
Author: Mike Frysinger  gentoo  org>
AuthorDate: Fri Mar 10 00:41:10 2017 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Fri Mar 10 01:58:12 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33226855

sys-fs/mtools: fix builds w/clang for Chromium OS

 sys-fs/mtools/files/mtools-4.0.18-attr.patch   | 51 ++
 sys-fs/mtools/files/mtools-4.0.18-memset.patch | 27 
 ...ls-4.0.18-r1.ebuild => mtools-4.0.18-r2.ebuild} |  4 +-
 3 files changed, 81 insertions(+), 1 deletion(-)

diff --git a/sys-fs/mtools/files/mtools-4.0.18-attr.patch 
b/sys-fs/mtools/files/mtools-4.0.18-attr.patch
new file mode 100644
index 000..3cd770be8bd
--- /dev/null
+++ b/sys-fs/mtools/files/mtools-4.0.18-attr.patch
@@ -0,0 +1,51 @@
+From e8437f906ca86fd5b1cac20d240a0e114c5df7a9 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Thu, 9 Mar 2017 16:06:54 -0800
+Subject: [PATCH] fix unused attribute in func definition
+
+UNUSED is for wrapping variable decls, not for variables in a function
+definition.  It will insert a semi-colon into the mix which makes clang
+upset:
+x86_64-cros-linux-gnu-clang  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc/mtools\" \
+   -DCPU_x86_64 -DVENDOR_cros -DOS_linux_gnu -O2 -pipe -O2 -pipe \
+   -march=x86-64 -msse3 -g -fno-exceptions -fno-unwind-tables \
+   -fno-asynchronous-unwind-tables  -clang-syntax -Wall \
+   -fno-strict-aliasing -I.  -I.  -c mainloop.c
+mainloop.c:89:15: error: expected ')'
+int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
+  ^
+./sysincludes.h:106:47: note: expanded from macro 'UNUSED'
+  ^
+
+Arguably this should fail on gcc too, but it doesn't today.
+
+URL: https://crbug.com/644387
+---
+ mainloop.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mainloop.c b/mainloop.c
+index f5f8349f1472..69af9a80c3e4 100644
+--- a/mainloop.c
 b/mainloop.c
+@@ -86,7 +86,7 @@ static const char *fix_mcwd(char *ans)
+ }
+ 
+ int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); 
+-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg,
++int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg,
+ int follow_dir_link);
+ 
+ static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
+@@ -95,7 +95,7 @@ static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
+   return unix_dir_loop(Dir, mp);
+ }
+ 
+-int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp,
++int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp,
+ char *arg, int follow_dir_link)
+ {
+   int ret;
+-- 
+2.12.0
+

diff --git a/sys-fs/mtools/files/mtools-4.0.18-memset.patch 
b/sys-fs/mtools/files/mtools-4.0.18-memset.patch
new file mode 100644
index 000..cf8d724406d
--- /dev/null
+++ b/sys-fs/mtools/files/mtools-4.0.18-memset.patch
@@ -0,0 +1,27 @@
+From bafeabbc474a98314e8cecf42c8339e1da21fea2 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Thu, 9 Mar 2017 16:23:19 -0800
+Subject: [PATCH] fix typo in scsi_cmd setup
+
+The memset call ends up referring to the function scsi_cmd and
+clearing its memory instead of the local my_scsi_cmd variable.
+---
+ scsi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scsi.c b/scsi.c
+index 7510edcefe95..85ff3bc3dc55 100644
+--- a/scsi.c
 b/scsi.c
+@@ -170,7 +170,7 @@ int scsi_cmd(int fd, unsigned char *cdb, int cmdlen, 
scsi_io_mode_t mode,
+   /*
+   ** Init the command
+   */
+-  memset(&scsi_cmd,0,sizeof(scsi_cmd));
++  memset(&my_scsi_cmd,0,sizeof(my_scsi_cmd));
+   my_scsi_cmd.interface_id= 'S';
+   my_scsi_cmd.dxfer_direction = (mode == 
SCSI_IO_READ)?(SG_DXFER_FROM_DEV):(SG_DXFER_TO_DEV);
+   my_scsi_cmd.cmd_len = cmdlen;
+-- 
+2.12.0
+

diff --git a/sys-fs/mtools/mtools-4.0.18-r1.ebuild 
b/sys-fs/mtools/mtools-4.0.18-r2.ebuild
similarity index 88%
rename from sys-fs/mtools/mtools-4.0.18-r1.ebuild
rename to sys-fs/mtools/mtools-4.0.18-r2.ebuild
index 21dfc20509b..c58be8b13a7 100644
--- a/sys-fs/mtools/mtools-4.0.18-r1.ebuild
+++ b/sys-fs/mtools/mtools-4.0.18-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -30,6 +30,8 @@ src_prepare() {
sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die
 
epatch "${FILESDIR}"/${P}-locking.patch # https://crbug.com/508713
+   epatch "${FILESDIR}"/${P}-attr.patch # https://crbug.com/644387
+   epatch "${FILESDIR}"/${P}-memset.patch
 }
 
 src_configure() {