public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/files/, sys-fs/mtools/
@ 2020-10-26  9:18 Lars Wendler
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Wendler @ 2020-10-26  9:18 UTC (permalink / raw
  To: gentoo-commits

commit:     6bede4b47335b52eb82ef28a06f8e289a41344cd
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 26 09:18:11 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Oct 26 09:18:21 2020 +0000
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 <polynomial-c <AT> 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..00000000000
--- 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 <vapier@gentoo.org>
-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..00000000000
--- 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/msg00000.html
-
-From 04df65ed797e47da5b423c7f9aec99d82dfde400 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@chromium.org>
-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="yyyy-mm-dd";
- char *country_string=0;
-@@ -90,6 +91,7 @@ static switches_t global_switches[] = {
-       (caddr_t) &mtools_twenty_four_hour_clock, T_UINT },
-     { "MTOOLS_DATE_STRING",
-       (caddr_t) &mtools_date_string, T_STRING },
-+    { "MTOOLS_LOCK_TIMEOUT", (caddr_t) &mtools_lock_timeout, T_UINT },
-     { "DEFAULT_CODEPAGE", (caddr_t) &mtools_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 for a locked device to become free.
-+Defaults to 30.
- .PP
- Example:
- Inserting the following line into your configuration file instructs
-diff --git a/plain_io.c b/plain_io.c
-index c9d8418b8b4d..3dc035c9ce92 100644
---- a/plain_io.c
-+++ b/plain_io.c
-@@ -632,7 +632,17 @@ APIRET rc;
- #ifndef __CYGWIN__
- #ifndef OS_mingw32msvc
- 	/* lock the device on writes */
-+ retry:
- 	if (locked && lock_dev(This->fd, mode == O_RDWR, dev)) {
-+		/* retry the lock in case another system process (e.g. udev)
-+		 * has temporarily locked the device.  this happens when you
-+		 * run multiple mtools commands at once which triggers the
-+		 * system to lock/rescan/unlock. */
-+		static int retries = 0;
-+		if (errno == EAGAIN && retries++ < mtools_lock_timeout * 10) {
-+			usleep(100);
-+			goto retry;
-+		}
- 		if(errmsg)
- #ifdef HAVE_SNPRINTF
- 			snprintf(errmsg,199,
-diff --git a/xdf_io.c b/xdf_io.c
-index f0db3b3d9f38..8f64f6348f0c 100644
---- a/xdf_io.c
-+++ b/xdf_io.c
-@@ -638,7 +638,18 @@ Stream_t *XdfOpen(struct device *dev, char *name,
- 		goto exit_2;
- 
- 	/* lock the device on writes */
-+ retry:
- 	if (lock_dev(This->fd, mode == O_RDWR, dev)) {
-+		/* retry the lock in case another system process (e.g. udev)
-+		 * has temporarily locked the device.  this happens when you
-+		 * run multiple mtools commands at once which triggers the
-+		 * system to lock/rescan/unlock. */
-+		static int retries = 0;
-+		if (errno == EAGAIN && retries++ < mtools_lock_timeout * 10) {
-+			usleep(100);
-+			goto retry;
-+		}
-+
- #ifdef HAVE_SNPRINTF
- 		snprintf(errmsg,199,"xdf floppy: device \"%s\" busy:", 
- 			dev->name);
--- 
-2.9.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
deleted file mode 100644
index cf8d724406d..00000000000
--- a/sys-fs/mtools/files/mtools-4.0.18-memset.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From bafeabbc474a98314e8cecf42c8339e1da21fea2 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-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-r2.ebuild b/sys-fs/mtools/mtools-4.0.18-r2.ebuild
deleted file mode 100644
index 92c1a95bfe1..00000000000
--- a/sys-fs/mtools/mtools-4.0.18-r2.ebuild
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit flag-o-matic eutils
-
-DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
-HOMEPAGE="https://www.gnu.org/software/mtools/ https://savannah.gnu.org/projects/mtools"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm ~hppa ppc ppc64 sparc x86 ~x64-macos ~x64-solaris"
-IUSE="X elibc_glibc"
-
-RDEPEND="
-	!elibc_glibc? ( virtual/libiconv )
-	X? (
-		x11-libs/libICE
-		x11-libs/libXau
-		x11-libs/libSM
-		x11-libs/libX11
-		x11-libs/libXt
-	)"
-DEPEND="${RDEPEND}
-	sys-apps/texinfo"
-# texinfo is required because we patch mtools.texi
-# drop it when mtools-4.0.18-locking.patch is no longer applied
-
-src_prepare() {
-	# Don't throw errors on existing directories
-	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() {
-	# 447688
-	use !elibc_glibc && use !elibc_musl && append-libs "-liconv"
-	econf \
-		--sysconfdir="${EPREFIX}"/etc/mtools \
-		$(use_with X x)
-}
-
-src_install() {
-	emake DESTDIR="${D}" install
-	dodoc README* Release.notes
-
-	insinto /etc/mtools
-	doins mtools.conf
-	# default is fine
-	sed -i -e '/^SAMPLE FILE$/s:^:#:' "${ED}"/etc/mtools/mtools.conf || die
-}

diff --git a/sys-fs/mtools/mtools-4.0.23.ebuild b/sys-fs/mtools/mtools-4.0.23.ebuild
deleted file mode 100644
index 03496c70b5b..00000000000
--- a/sys-fs/mtools/mtools-4.0.23.ebuild
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-inherit flag-o-matic
-
-DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
-HOMEPAGE="https://www.gnu.org/software/mtools/ https://savannah.gnu.org/projects/mtools"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm ~hppa ppc ppc64 ~sparc x86 ~x64-macos ~x64-solaris"
-IUSE="X elibc_glibc"
-
-RDEPEND="
-	!elibc_glibc? ( virtual/libiconv )
-	X? (
-		x11-libs/libICE
-		x11-libs/libXau
-		x11-libs/libSM
-		x11-libs/libX11
-		x11-libs/libXt
-	)"
-DEPEND="${RDEPEND}"
-
-src_prepare() {
-	default
-
-	# Don't throw errors on existing directories
-	sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die
-}
-
-src_configure() {
-	# 447688
-	use !elibc_glibc && use !elibc_musl && append-libs "-liconv"
-	local myeconfargs=(
-		--sysconfdir="${EPREFIX}"/etc/mtools
-		$(use_with X x)
-	)
-	econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	local -a DOCS=( README* Release.notes )
-	default
-
-	insinto /etc/mtools
-	doins mtools.conf
-
-	# default is fine
-	sed -i -e '/^SAMPLE FILE$/s:^:#:' "${ED%/}"/etc/mtools/mtools.conf || die
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/files/, sys-fs/mtools/
@ 2022-03-06  4:34 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-03-06  4:34 UTC (permalink / raw
  To: gentoo-commits

commit:     0b01c1ac7d47153853e1ec678d7eb52d245c6b82
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  6 02:46:37 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar  6 04:34:28 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b01c1ac

sys-fs/mtools: add 4.0.38

Signed-off-by: Sam James <sam <AT> 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 000000000000..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/msg00001.html
+
+From d36dea2ea7f246f28719dcb01b7a8ad7ad8ed1f6 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Mar 2022 02:36:03 +0000
+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 <sam@gentoo.org>
+---
+ 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 **endptr, int base);
+-#endif
+ unsigned long atoul(const char *nptr);
+ uint8_t strtou8(const char *nptr, char **endptr, int base);
+ uint8_t atou8(const char *str);
+diff --git a/sysincludes.h b/sysincludes.h
+index 6dccded..0c17fb5 100644
+--- a/sysincludes.h
++++ b/sysincludes.h
+@@ -169,10 +169,6 @@ typedef unsigned char _Bool;
+ # define __bool_true_false_are_defined 1
+ #endif
+ 
+-#ifdef HAVE_INTTYPES_H
+-# include <inttypes.h>
+-#endif
+-
+ #ifdef HAVE_STDLIB_H
+ # include <stdlib.h>
+ #endif
+-- 
+2.35.1
+

diff --git a/sys-fs/mtools/mtools-4.0.38.ebuild b/sys-fs/mtools/mtools-4.0.38.ebuild
new file mode 100644
index 000000000000..18ce60a45f39
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.38.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="https://www.gnu.org/software/mtools/ https://savannah.gnu.org/projects/mtools"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x64-solaris"
+IUSE="X"
+
+RDEPEND="!elibc_glibc? ( virtual/libiconv )
+	X? (
+		x11-libs/libICE
+		x11-libs/libXau
+		x11-libs/libSM
+		x11-libs/libX11
+		x11-libs/libXt
+	)"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.0.38-strtoi-definition.patch
+)
+
+src_prepare() {
+	default
+
+	# Only needed for strtoi patch
+	eautoreconf
+}
+
+src_configure() {
+	if ! use elibc_glibc && ! use elibc_musl ; then
+		# bug #447688
+		append-libs "-liconv"
+	fi
+
+	local myeconfargs=(
+		--sysconfdir="${EPREFIX}"/etc/mtools
+		$(use_with X x)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	local -a DOCS=( README* Release.notes )
+	default
+
+	insinto /etc/mtools
+	doins mtools.conf
+
+	# Default is fine
+	sed -i -e '/^SAMPLE FILE$/s:^:#:' "${ED}"/etc/mtools/mtools.conf || die
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/files/, sys-fs/mtools/
@ 2017-03-10  1:58 Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2017-03-10  1:58 UTC (permalink / raw
  To: gentoo-commits

commit:     332268554a5fa329c3ebea901c2456fc7dc02980
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 10 00:41:10 2017 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Mar 10 01:58:12 2017 +0000
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 00000000000..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 <vapier@gentoo.org>
+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 00000000000..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 <vapier@gentoo.org>
+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() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-06  4:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-26  9:18 [gentoo-commits] repo/gentoo:master commit in: sys-fs/mtools/files/, sys-fs/mtools/ Lars Wendler
  -- strict thread matches above, loose matches on Subject: below --
2022-03-06  4:34 Sam James
2017-03-10  1:58 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox