Hi,

> mtools-4.0.27 have a problem that creating disk image with -C option.
> I found it creating SvarDOS's floppy disk image.
> The bug looks solved at 4.0.30 but I suggest modernize 4.0.47.

The problem (garbage at last sector) is still remain in 4.0.47
and I reported the problem at
https://lists.gnu.org/archive/html/info-mtools/2025-02/msg00018.html

This diff is modernize and fix garbage problem.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/mtools/Makefile,v
diff -u -p -r1.66 Makefile
--- Makefile    27 Sep 2023 17:16:31 -0000      1.66
+++ Makefile    16 Feb 2025 05:57:45 -0000
@@ -1,5 +1,5 @@
 COMMENT=       read/write/list/format DOS disks under Unix
-DISTNAME=      mtools-4.0.27
+DISTNAME=      mtools-4.0.47
 
 CATEGORIES=    sysutils
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/mtools/distinfo,v
diff -u -p -r1.16 distinfo
--- distinfo    1 May 2021 13:39:42 -0000       1.16
+++ distinfo    16 Feb 2025 05:57:45 -0000
@@ -1,2 +1,2 @@
-SHA256 (mtools-4.0.27.tar.gz) = maMnnC6mNTp5ebi9dlURS/pWiAVUk1mkHtczfwaYycU=
-SIZE (mtools-4.0.27.tar.gz) = 526480
+SHA256 (mtools-4.0.47.tar.gz) = 4BEdhj+e9VcVWC9Laaf/0mFkXgyJQXzv6zCM0IAALgQ=
+SIZE (mtools-4.0.47.tar.gz) = 560285
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/sysutils/mtools/patches/patch-Makefile_in,v
diff -u -p -r1.5 patch-Makefile_in
--- patches/patch-Makefile_in   11 Mar 2022 19:57:42 -0000      1.5
+++ patches/patch-Makefile_in   16 Feb 2025 05:57:45 -0000
@@ -1,7 +1,7 @@
 Index: Makefile.in
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -278,7 +278,7 @@ install-links: $(DESTDIR)$(bindir)/mtools
+@@ -264,7 +264,7 @@ install-links: $(DESTDIR)$(bindir)/mtools
  install-scripts: $(DESTDIR)$(bindir)/mtools
        @$(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
        @for j in $(SCRIPTS) ; do \
Index: patches/patch-mformat_c
===================================================================
RCS file: patches/patch-mformat_c
diff -N patches/patch-mformat_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mformat_c     16 Feb 2025 05:57:45 -0000
@@ -0,0 +1,19 @@
+--- mformat.c.orig     Sun Nov 17 08:51:54 2024
++++ mformat.c  Sun Feb 16 14:51:11 2025
+@@ -332,7 +332,7 @@ static void check_fs_params_and_set_fat(Fs_t *Fs, uint
+ 
+ #ifdef DEBUG
+       fprintf(stderr, "Num_clus=%d fat_len=%d nybbles=%d\n",
+-              Fs->num_clus, Fs->fat_len, fat_nybbles);
++              Fs->num_clus, Fs->fat_len, Fs->fat_bits / 4);
+ #endif
+ 
+ #ifdef HAVE_ASSERT_H
+@@ -922,6 +922,7 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
+       serial_set = 0;
+       serial = 0;
+       fsVersion = 0;
++      memset(&boot, '\0', sizeof(boot));
+ 
+       Fs = New(Fs_t);
+       if (!Fs) {
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/mtools/pkg/PLIST,v
diff -u -p -r1.12 PLIST
--- pkg/PLIST   11 Mar 2022 19:57:42 -0000      1.12
+++ pkg/PLIST   16 Feb 2025 05:57:45 -0000
@@ -6,12 +6,12 @@ bin/mbadblocks
 bin/mcat
 bin/mcd
 bin/mcheck
-bin/mclasserase
 bin/mcomp
 bin/mcopy
 bin/mdel
 bin/mdeltree
 bin/mdir
+bin/mdoctorfat
 bin/mdu
 bin/mformat
 bin/minfo
@@ -37,11 +37,11 @@ bin/uz
 @man man/man1/mbadblocks.1
 @man man/man1/mcat.1
 @man man/man1/mcd.1
-@man man/man1/mclasserase.1
 @man man/man1/mcopy.1
 @man man/man1/mdel.1
 @man man/man1/mdeltree.1
 @man man/man1/mdir.1
+@man man/man1/mdoctorfat.1
 @man man/man1/mdu.1
 @man man/man1/mformat.1
 @man man/man1/minfo.1

-- 
SASANO Takayoshi (JG1UAA) <u...@mx5.nisiq.net>

Reply via email to