Hello community,

here is the log from the commit of package fatsort for openSUSE:Factory checked 
in at 2020-08-13 10:17:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fatsort (Old)
 and      /work/SRC/openSUSE:Factory/.fatsort.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fatsort"

Thu Aug 13 10:17:09 2020 rev:8 rq:826006 version:1.6.3.622

Changes:
--------
--- /work/SRC/openSUSE:Factory/fatsort/fatsort.changes  2020-06-11 
14:55:23.251405182 +0200
+++ /work/SRC/openSUSE:Factory/.fatsort.new.3399/fatsort.changes        
2020-08-13 10:19:41.170794708 +0200
@@ -1,0 +2,13 @@
+Wed Aug 12 11:03:50 UTC 2020 - Martin Pluskal <[email protected]>
+
+- Update to version 1.6.3.622:
+  * fatsort release file now includes precompiled makefile
+  * fixed support for macOS (thanks to Max for the fix)
+  * declared OPT_LOCALE as extern
+  * fixed uninitialized variable
+  * avoided some string truncation compiler warnings
+  * implemented platform independent transliteration for invalid
+    multi-byte characters during conversion
+  * test makefile now returns error code
+
+-------------------------------------------------------------------

Old:
----
  fatsort-1.6.2.605.tar.xz

New:
----
  fatsort-1.6.3.622.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fatsort.spec ++++++
--- /var/tmp/diff_new_pack.zxuEQa/_old  2020-08-13 10:19:46.914797068 +0200
+++ /var/tmp/diff_new_pack.zxuEQa/_new  2020-08-13 10:19:46.918797070 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           fatsort
-Version:        1.6.2.605
+Version:        1.6.3.622
 Release:        0
 Summary:        FAT Filesystem Sorting Utility
 License:        GPL-2.0-or-later
@@ -35,7 +35,7 @@
 %autosetup
 
 %build
-%make_build CFLAGS="%{optflags} -fcommon"
+%make_build CFLAGS="%{optflags}"
 
 %install
 install -Dpm 0755 -p src/%{name}   \

++++++ fatsort-1.6.2.605.tar.xz -> fatsort-1.6.3.622.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/CHANGES.md 
new/fatsort-1.6.3.622/CHANGES.md
--- old/fatsort-1.6.2.605/CHANGES.md    2019-11-29 22:11:52.000000000 +0100
+++ new/fatsort-1.6.3.622/CHANGES.md    2020-08-08 12:45:23.000000000 +0200
@@ -1,5 +1,14 @@
 # Changelog
 
+## v1.6.3 (August  8th, 2020)
+* fatsort release file now includes precompiled makefile
+* fixed support for macOS (thanks to Max for the fix)
+* declared OPT_LOCALE as extern
+* fixed uninitialized variable
+* avoided some string truncation compiler warnings
+* implemented platform independent transliteration for invalid multi-byte 
characters during conversion
+* test makefile now returns error code
+
 ## v1.6.2 (November 29, 2019)
 - FIX: multiple endianness issues with exFAT
 - now using /proc/self/mounts instead of /etc/mtab to check whether filesystem 
is mounted
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/Makefile 
new/fatsort-1.6.3.622/Makefile
--- old/fatsort-1.6.2.605/Makefile      2019-11-16 16:40:27.000000000 +0100
+++ new/fatsort-1.6.3.622/Makefile      2020-08-08 12:38:31.000000000 +0200
@@ -8,7 +8,7 @@
 INSTALL_FLAGS=-m 0755 -p
 endif
 
-all: man
+all: src
 
 src:
        $(MAKE) -C src/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/man/fatsort.1 
new/fatsort-1.6.3.622/man/fatsort.1
--- old/fatsort-1.6.2.605/man/fatsort.1 1970-01-01 01:00:00.000000000 +0100
+++ new/fatsort-1.6.3.622/man/fatsort.1 2020-08-08 12:47:13.000000000 +0200
@@ -0,0 +1,118 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.14.
+.TH FATSORT "1" "August 2020" "fatsort 1.6.3" "User Commands"
+.SH NAME
+fatsort \- FAT sorting tool
+.SH SYNOPSIS
+.B fatsort
+[\fI\,OPTIONS\/\fR] \fI\,DEVICE\/\fR
+.SH DESCRIPTION
+FATSort sorts directory structures of FAT file systems (FAT12, FAT16, FAT32 
and exFAT). Many MP3 hardware players don't sort files automatically but play 
them in the  order they were transferred to the device. FATSort can help here.
+.PP
+Sort options:
+.TP
+\fB\-a\fR
+Use ASCIIbetical order for sorting
+.TP
+\fB\-c\fR
+Ignore case of file names (default for most locales)
+.TP
+\fB\-I\fR PFX
+Ignore file name PFX
+.TP
+\fB\-n\fR
+Natural order sorting
+.HP
+\fB\-o\fR FLAG Sort order of files where FLAG is one of
+.IP
+d : directories first (default)
+.IP
+f : files first
+.IP
+a : files and directories are not differentiated
+.TP
+\fB\-r\fR
+Sort in reverse order
+.TP
+\fB\-R\fR
+Sort in random order
+.IP
+This options makes all other sort options obsolete.
+.TP
+\fB\-t\fR
+Sort by last modification date and time
+.PP
+The following options can be specified multiple times
+to select which directories shall be sorted:
+.TP
+\fB\-d\fR DIR
+Sort directory DIR only
+.TP
+\fB\-D\fR DIR
+Sort directory DIR and all subdirectories
+.TP
+\fB\-x\fR DIR
+Don't sort directory DIR
+.TP
+\fB\-X\fR DIR
+Don't sort directory DIR and its subdirectories
+.PP
+The following options can be specified multiple times
+to select which directories shall be sorted using
+POSIX.2 extended regular expressions:
+.TP
+\fB\-e\fR RE
+Only sort directories that match regular expression RE
+.TP
+\fB\-E\fR RE
+Don't sort directories that match regular expression RE
+.PP
+However, options \fB\-e\fR and \fB\-E\fR may not be used simultaneously with
+options \fB\-d\fR, \fB\-D\fR, \fB\-x\fR and \fB\-X\fR.
+.TP
+\fB\-L\fR LOC
+Use the locale LOC instead of the locale from the environment variables
+.PP
+More options:
+.TP
+\fB\-l\fR
+Print current order of files only
+.TP
+\fB\-i\fR
+Print file system information only
+.TP
+\fB\-f\fR
+Force sorting even if file system is mounted
+.HP
+\fB\-h\fR, \fB\-\-help\fR
+.IP
+Print some help
+.HP
+\fB\-v\fR, \fB\-\-version\fR
+.IP
+Print version information
+.TP
+\fB\-q\fR
+Be quiet
+.PP
+DEVICE must be a FAT12, FAT16, FAT32 or exFAT file system.
+.PP
+WARNING: THE FILESYSTEM MUST BE CONSISTENT (NO FILESYSTEM ERRORS).
+PLEASE BACKUP YOUR DATA BEFORE USING FATSORT. RISK OF CORRUPT FILESYSTEM!
+FATSORT USER ASSUMES ALL RISK. FATSORT WILL NOT BE HELD LIABLE FOR DATA LOSS!
+.SH EXAMPLES
+.TP
+fatsort /dev/sda
+Sort /dev/sda.
+.TP
+fatsort \-n /dev/sdb1
+Sort /dev/sdb1 with natural order.
+.SH AUTHOR
+Written by Boris Leidner.
+.SH "REPORTING BUGS"
+Report bugs to <[email protected]>.
+.SH COPYRIGHT
+Copyright \(co 2004\-2019 Boris Leidner.
+License GPLv2: GNU GPL version 2 (see LICENSE.txt)
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/FAT_fs.c 
new/fatsort-1.6.3.622/src/FAT_fs.c
--- old/fatsort-1.6.2.605/src/FAT_fs.c  2019-11-23 11:41:21.000000000 +0100
+++ new/fatsort-1.6.3.622/src/FAT_fs.c  2020-08-08 12:45:23.000000000 +0200
@@ -42,7 +42,7 @@
 // used to check if device is mounted
 #if defined(__LINUX__)
 #include <mntent.h>
-#elif defined (__BSD__)
+#elif defined (__BSD__) || defined (__OSX__)
 #include <sys/ucred.h>
 #include <sys/mount.h>
 #endif
@@ -85,7 +85,7 @@
 
        return ret;
 
-#elif defined(__BSD__)
+#elif defined(__BSD__) || defined(__OSX__)
        struct statfs *mntbuf;
        int i, mntsize;
        int32_t ret = 0;
@@ -1096,7 +1096,7 @@
                        switch (ret) {
                                case 0: break;  // filesystem not mounted
                                case 1:         // filesystem mounted
-                                       myerror("Filesystem is mounted!");
+                                       myerror("Filesystem is mounted. Please 
unmount!");
                                        return -1;
                                case -1:        // unable to check
                                default:
@@ -1247,7 +1247,7 @@
 
 #ifndef __WIN32__
        // convert utf 16 le to local charset
-       fs->cd = iconv_open("//TRANSLIT", "UTF-16LE");
+       fs->cd = iconv_open("", "UTF-16LE");
        if (fs->cd == (iconv_t)-1) {
                        myerror("iconv_open failed!");
        return -1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/deviceio.c 
new/fatsort-1.6.3.622/src/deviceio.c
--- old/fatsort-1.6.2.605/src/deviceio.c        2019-11-16 18:05:16.000000000 
+0100
+++ new/fatsort-1.6.3.622/src/deviceio.c        2020-04-12 11:01:37.000000000 
+0200
@@ -24,7 +24,7 @@
 
 #include "deviceio.h"
 
-#if defined __LINUX__ || defined __BSD__
+#if defined __LINUX__ || defined __BSD__ || defined __OSX__ 
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -59,7 +59,7 @@
 #include "mallocv.h"
 #include "errors.h"
 
-#if defined __LINUX__ || defined __BSD__
+#if defined __LINUX__ || defined __BSD__ || defined __OSX__ 
 
 DEVICE *device_open(const char *path) {
 
@@ -88,7 +88,7 @@
   assert(device != NULL);
   assert(offset >= 0);
 
-#if defined __BSD__
+#if defined __BSD__ || defined __OSX__ 
   return lseek(device->fd, (off_t) offset, SEEK_SET);
 #else
   return lseek64(device->fd, (off64_t) offset, SEEK_SET);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/deviceio.h 
new/fatsort-1.6.3.622/src/deviceio.h
--- old/fatsort-1.6.2.605/src/deviceio.h        2019-11-16 16:40:27.000000000 
+0100
+++ new/fatsort-1.6.3.622/src/deviceio.h        2020-04-12 11:01:37.000000000 
+0200
@@ -27,7 +27,7 @@
 
 #include <stdint.h>
 
-#if defined __LINUX__ || defined __BSD__
+#if defined __LINUX__ || defined __BSD__ || defined __OSX__ 
 
 #define DIRECTORY_SEPARATOR '/'
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/fatsort.c 
new/fatsort-1.6.3.622/src/fatsort.c
--- old/fatsort-1.6.2.605/src/fatsort.c 2019-11-29 22:11:52.000000000 +0100
+++ new/fatsort-1.6.3.622/src/fatsort.c 2020-04-12 11:01:37.000000000 +0200
@@ -45,7 +45,7 @@
 
 // program information
 #define INFO_PROGRAM           "fatsort"
-#define INFO_VERSION           "1.6.2"
+#define INFO_VERSION           "1.6.3"
 #define INFO_AUTHOR            "Written by Boris Leidner.\n"
 #define INFO_COPYRIGHT         "Copyright (C) 2004-2019 Boris Leidner.\n"
 #define INFO_LICENSE           "License GPLv2: GNU GPL version 2 (see 
LICENSE.txt)\n" \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/options.c 
new/fatsort-1.6.3.622/src/options.c
--- old/fatsort-1.6.2.605/src/options.c 2018-11-17 23:18:51.000000000 +0100
+++ new/fatsort-1.6.3.622/src/options.c 2020-03-13 08:12:53.000000000 +0100
@@ -55,7 +55,6 @@
        assert(stringList != NULL);
        assert(stringList->str == NULL);
        assert(str != NULL);
-       assert(strlen((char *)str) <= MAX_PATH_LEN);
 
        char *newStr;
 
@@ -77,14 +76,16 @@
        // copy string to new structure including missing slashes
        newStr[0] = '\0';
        if (prefix) newStr[0] = DIRECTORY_SEPARATOR;
-       strncat(newStr, (const char*) str, len);
+       memcpy(newStr+prefix, (const char*) str, len);
        if (suffix) newStr[prefix+len] = DIRECTORY_SEPARATOR; 
 
+/*
        if (prefix+len+suffix > MAX_PATH_LEN) {
                newStr[MAX_PATH_LEN] = '\0';
        } else {
                newStr[prefix+len+suffix] = '\0';
        }
+*/
 
        ret = addStringToStringList(stringList, newStr);
 
@@ -137,7 +138,7 @@
        parses command line options
 */
 
-       int8_t c;
+       int8_t c,len;
 
        static struct option longOpts[] = {
                // name, has_arg, flag, val
@@ -315,12 +316,13 @@
                        case 't' : OPT_MODIFICATION = 1; break;
                        case 'v' : OPT_VERSION = 1; break;
                        case 'L' :
-                               OPT_LOCALE=realloc(OPT_LOCALE, 
strlen(optarg)+1);
+                               len=strlen(optarg);
+                               OPT_LOCALE=realloc(OPT_LOCALE, len+1);
                                if (OPT_LOCALE == NULL) {
                                        stderror();
                                        return -1;
                                }
-                               strncpy(OPT_LOCALE, optarg, strlen(optarg)+1);
+                               memcpy(OPT_LOCALE, optarg, len+1);
                        break;
                        default :
                                myerror("Unknown option '%c'.", optopt);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/options.h 
new/fatsort-1.6.3.622/src/options.h
--- old/fatsort-1.6.2.605/src/options.h 2018-11-07 21:54:17.000000000 +0100
+++ new/fatsort-1.6.3.622/src/options.h 2020-03-12 19:56:12.000000000 +0100
@@ -35,7 +35,7 @@
 extern struct sStringList *OPT_INCL_DIRS, *OPT_EXCL_DIRS, *OPT_INCL_DIRS_REC, 
*OPT_EXCL_DIRS_REC, *OPT_IGNORE_PREFIXES_LIST;
 extern struct sRegExList *OPT_REGEX_INCL, *OPT_REGEX_EXCL;
 
-char *OPT_LOCALE;
+extern char *OPT_LOCALE;
 
 // parses command line options
 int32_t parse_options(int argc, char *argv[]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/sort.c 
new/fatsort-1.6.3.622/src/sort.c
--- old/fatsort-1.6.2.605/src/sort.c    2019-11-23 11:33:23.000000000 +0100
+++ new/fatsort-1.6.3.622/src/sort.c    2020-06-01 18:10:35.000000000 +0200
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <locale.h>
 #include <sys/param.h>
 #include "entrylist.h"
 #include "errors.h"
@@ -41,6 +42,24 @@
 #include "stringlist.h"
 #include "mallocv.h"
 
+char *getCharSet(void) {
+/*
+       find out character set
+*/
+       char *locale,*charset;
+       
+       locale=setlocale(LC_CTYPE, NULL);
+
+       if (locale != NULL) {
+               charset = strchr(locale, '.');
+               if (charset != NULL) { 
+                       return charset+1;
+               }
+       }
+       
+       return NULL;
+}
+
 int32_t parseLongFilenamePart(struct sLongDirEntry *lde, char *str, iconv_t 
cd) {
 /*
        retrieves a part of a long filename from a
@@ -88,15 +107,23 @@
        char *outptr = &(str[0]);
        char *inptr = &(utf16str[0]);
        size_t ret;
-
+       
        while (incount != 0) {
-    if ((ret=iconv(cd, &inptr, &incount, &outptr, &outcount)) == (size_t)-1) {
-                       stderror();
-                       myerror("WARNING: iconv failed!");
-                       break;
-    }
-  }
-       outptr[0]='\0';
+               if ((ret=iconv(cd, &inptr, &incount, &outptr, &outcount)) == 
(size_t)-1) {
+                       if (errno == EILSEQ) {
+                               outptr[0]='?';
+                               outptr++;
+                               incount+=2;
+                               outcount++;
+                               inptr+=2;
+                       } else {
+                               stderror();
+                               myerror("WARNING: iconv failed!");
+                               break;
+                       }
+               }
+       }
+       outptr[0]='\0';
 
 #endif
 
@@ -261,14 +288,15 @@
 
        struct sExFATDirEntry de;
        struct sExFATDirEntrySet *des;
-       struct sExFATDirEntryList *del;
+       struct sExFATDirEntryList *del=NULL;
 
        char name[MAX_PATH_LEN+1];
-       char str[32];
+       char str[31];
        char *outptr, *inptr;
        uint8_t nameLength=0;
 
-       size_t outcount, incount, iret;
+       size_t outcount=30;
+       size_t incount, iret;
 
        *direntrysets=0;
 
@@ -376,7 +404,7 @@
                                        }
                                        outptr[0]='\0';
 
-                                       strncat(name, str, 30);
+                                       strncat(name, str, 31);
 
                                        // we are done here
                                        if (entries == expected_entries) {
@@ -512,7 +540,7 @@
        union sDirEntry de;
        struct sDirEntryList *lnde;
        struct sLongDirEntryList *llist;
-       char tmp[MAX_PATH_LEN+1], dummy[MAX_PATH_LEN*2+1], 
sname[MAX_PATH_LEN+1], lname[MAX_PATH_LEN+1];
+       char tmp[MAX_PATH_LEN+1], dummy[MAX_PATH_LEN+1], sname[MAX_PATH_LEN+1], 
lname[MAX_PATH_LEN+1];
 
        *direntries=0;
 
@@ -589,8 +617,11 @@
                                        return -1;
                                }
 
-                               snprintf(dummy, MAX_PATH_LEN*2+1, "%s%s", tmp, 
lname);
-                               strncpy(lname, dummy, MAX_PATH_LEN);
+                               strncpy(dummy, tmp, MAX_PATH_LEN);
+                               dummy[MAX_PATH_LEN]='\0';
+                               strncat(dummy, lname, MAX_PATH_LEN - 
strlen(dummy));
+                               dummy[MAX_PATH_LEN]='\0';
+                               strncpy(lname, dummy, MAX_PATH_LEN+1);
 
                                break;
                        default:
@@ -708,8 +739,8 @@
                        dummy[MAX_PATH_LEN]='\0';
                        strncat(dummy, lname, MAX_PATH_LEN - strlen(dummy));
                        dummy[MAX_PATH_LEN]='\0';
-                       strncpy(lname, dummy, MAX_PATH_LEN);
-                       dummy[MAX_PATH_LEN]='\0';
+                       strncpy(lname, dummy, MAX_PATH_LEN+1);
+                       //dummy[MAX_PATH_LEN]='\0';
                        break;
                default:
                        myerror("Unhandled return code!");
@@ -1398,7 +1429,7 @@
 
        uint32_t mode = FS_MODE_RW;
 
-       struct sFileSystem fs = {0};
+       struct sFileSystem fs;
 
        const char rootDir[2] = {DIRECTORY_SEPARATOR, '\0'};
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/src/stringlist.c 
new/fatsort-1.6.3.622/src/stringlist.c
--- old/fatsort-1.6.2.605/src/stringlist.c      2018-09-29 17:42:55.000000000 
+0200
+++ new/fatsort-1.6.3.622/src/stringlist.c      2020-03-13 07:53:59.000000000 
+0100
@@ -78,8 +78,7 @@
                return -1;
        }
 
-       strncpy(stringList->next->str, str, len);
-       stringList->next->str[len] = '\0';
+       memcpy(stringList->next->str, str, len+1);
 
        return 0;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fatsort-1.6.2.605/tests/Makefile 
new/fatsort-1.6.3.622/tests/Makefile
--- old/fatsort-1.6.2.605/tests/Makefile        2019-11-16 11:25:33.000000000 
+0100
+++ new/fatsort-1.6.3.622/tests/Makefile        2020-05-16 00:50:12.000000000 
+0200
@@ -19,7 +19,7 @@
                if [ ! -f $$i/passed ]; then \
                        printf "%.70s" "Test case $$i...                        
                                         "; \
                        printf "[ \e[1;33mWAIT \e[0m]"; \
-                       ${MAKE} -C $$i &>> /dev/null; \
+                       ${MAKE} -C $$i &> /dev/null; \
                        ret=$$?; \
                        printf "\r%.70s" "Test case $$i...                      
                                           "; \
                        if [ $$ret -eq 0 ]; then \
@@ -39,7 +39,8 @@
        echo "All" $$tests "tests passed ("$$new "in this round) in $$ELAPSED." 
| tee -a ${LOGFILE}; \
        else \
        echo $$failed"/"$$tests "tests failed! ("$$new "in this round) in 
$$ELAPSED." | tee -a ${LOGFILE}; \
-       fi
+       fi; \
+       [ "$$failed" -eq "0" ]
 
 clean:
        rm -f *.log
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fatsort-1.6.2.605/tests/tc_pos_char_enc_C/stdout_expected.txt 
new/fatsort-1.6.3.622/tests/tc_pos_char_enc_C/stdout_expected.txt
--- old/fatsort-1.6.2.605/tests/tc_pos_char_enc_C/stdout_expected.txt   
2017-07-29 20:58:56.000000000 +0200
+++ new/fatsort-1.6.3.622/tests/tc_pos_char_enc_C/stdout_expected.txt   
2020-05-16 00:26:46.000000000 +0200
@@ -5,11 +5,11 @@
 B?chse
 B?rbel
 Br?tchen
-Stosszahn
+Sto?zahn
 
 /Directory1/
 B?chse
 B?rbel
 Br?tchen
-Stosszahn
+Sto?zahn
 


Reply via email to