Hello community, here is the log from the commit of package libmtp for openSUSE:Factory checked in at 2020-10-14 15:36:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libmtp (Old) and /work/SRC/openSUSE:Factory/.libmtp.new.3486 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libmtp" Wed Oct 14 15:36:07 2020 rev:81 rq:841029 version:1.1.18 Changes: -------- --- /work/SRC/openSUSE:Factory/libmtp/libmtp.changes 2020-02-06 13:06:03.840265592 +0100 +++ /work/SRC/openSUSE:Factory/.libmtp.new.3486/libmtp.changes 2020-10-14 15:37:11.730320571 +0200 @@ -1,0 +2,8 @@ +Sun Oct 11 11:59:58 UTC 2020 - Marcus Meissner <meiss...@suse.com> + +- updated to 1.1.18 release + - new USB ids + - mtp-getfile and mtp-delfile new parameter + - report "error 6" as "busy / blocked by another device" + +------------------------------------------------------------------- Old: ---- libmtp-1.1.17.tar.gz libmtp-1.1.17.tar.gz.asc New: ---- libmtp-1.1.18.tar.gz libmtp-1.1.18.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libmtp.spec ++++++ --- /var/tmp/diff_new_pack.8Ounu4/_old 2020-10-14 15:37:14.706321610 +0200 +++ /var/tmp/diff_new_pack.8Ounu4/_new 2020-10-14 15:37:14.710321611 +0200 @@ -1,7 +1,7 @@ # # spec file for package libmtp # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d } %{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev) } Name: libmtp -Version: 1.1.17 +Version: 1.1.18 Release: 0 Summary: Commandline utilities for access to MTP Players License: LGPL-2.1-or-later ++++++ libmtp-1.1.17.tar.gz -> libmtp-1.1.18.tar.gz ++++++ ++++ 2334 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/configure.ac new/libmtp-1.1.18/configure.ac --- old/libmtp-1.1.17/configure.ac 2020-02-02 13:21:07.000000000 +0100 +++ new/libmtp-1.1.18/configure.ac 2020-10-11 13:28:36.000000000 +0200 @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT([libmtp], [1.1.17], [libmtp-disc...@lists.sourceforge.net]) +AC_INIT([libmtp], [1.1.18], [libmtp-disc...@lists.sourceforge.net]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_SRCDIR([src/libmtp.c]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/doc/Doxyfile.in new/libmtp-1.1.18/doc/Doxyfile.in --- old/libmtp-1.1.17/doc/Doxyfile.in 2013-03-17 09:04:49.000000000 +0100 +++ new/libmtp-1.1.18/doc/Doxyfile.in 2020-02-08 09:23:21.000000000 +0100 @@ -96,7 +96,7 @@ # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/examples/connect.c new/libmtp-1.1.18/examples/connect.c --- old/libmtp-1.1.17/examples/connect.c 2013-03-17 09:04:49.000000000 +0100 +++ new/libmtp-1.1.18/examples/connect.c 2020-07-22 10:57:52.000000000 +0200 @@ -69,7 +69,13 @@ fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); - device = LIBMTP_Get_First_Device(); + if ((strncmp(basename(argv[0]),"mtp-delfile",11) == 0) || (strncmp(basename(argv[0]),"delfile",7) == 0)) + device = delfile_device(argc,argv); + else if ((strncmp(basename(argv[0]),"mtp-getfile",11) == 0) || (strncmp(basename(argv[0]),"getfile",7) == 0)) + device = getfile_device(argc,argv); + else + device = LIBMTP_Get_First_Device(); + if (device == NULL) { printf("No devices.\n"); return 0; @@ -79,11 +85,11 @@ if ((strncmp(basename(argv[0]),"mtp-delfile",11) == 0) || (strncmp(basename(argv[0]),"delfile",7) == 0)) { ret = delfile_command(argc,argv); - } else if ((strncmp(basename(argv[0]),"mtp-getfile",13) == 0) || (strncmp(basename(argv[0]),"getfile",9) == 0)) { + } else if ((strncmp(basename(argv[0]),"mtp-getfile",11) == 0) || (strncmp(basename(argv[0]),"getfile",7) == 0)) { ret = getfile_command(argc,argv); } else if ((strncmp(basename(argv[0]),"mtp-newfolder",13) == 0) || (strncmp(basename(argv[0]),"newfolder",9) == 0)) { ret = newfolder_command(argc,argv); - } else if ((strncmp(basename(argv[0]),"mtp-sendfile",11) == 0) || (strncmp(basename(argv[0]),"sendfile",7) == 0)) { + } else if ((strncmp(basename(argv[0]),"mtp-sendfile",12) == 0) || (strncmp(basename(argv[0]),"sendfile",8) == 0)) { ret = sendfile_command(argc, argv); } else if ((strncmp(basename(argv[0]),"mtp-sendtr",10) == 0) || (strncmp(basename(argv[0]),"sendtr",6) == 0)) { ret = sendtrack_command(argc, argv); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/examples/connect.h new/libmtp-1.1.18/examples/connect.h --- old/libmtp-1.1.17/examples/connect.h 2013-03-17 09:04:49.000000000 +0100 +++ new/libmtp-1.1.18/examples/connect.h 2020-07-22 10:57:52.000000000 +0200 @@ -21,6 +21,7 @@ * Boston, MA 02111-1307, USA. */ int delfile_function(char *); +LIBMTP_mtpdevice_t *delfile_device(int, char **); int delfile_command(int, char **); void delfile_usage(void); int sendtrack_function (char *, char *, char *, char *, char *, char *, char *, char *, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t); @@ -30,6 +31,7 @@ int sendfile_command(int, char **); void sendfile_usage(void); int getfile_function(char *,char *); +LIBMTP_mtpdevice_t *getfile_device(int, char **); int getfile_command(int, char **); void getfile_usage(void); int newfolder_function(char *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/examples/delfile.c new/libmtp-1.1.18/examples/delfile.c --- old/libmtp-1.1.17/examples/delfile.c 2013-03-17 09:04:49.000000000 +0100 +++ new/libmtp-1.1.18/examples/delfile.c 2020-07-22 10:57:52.000000000 +0200 @@ -34,7 +34,7 @@ void delfile_usage(void) { - printf("Usage: delfile [-n] <fileid/trackid> | -f <filename>\n"); + printf("Usage: delfile [<deviceid>] -n <fileid/trackid> | -f <filename> ...\n"); } int @@ -56,21 +56,46 @@ return 0; } +LIBMTP_mtpdevice_t *delfile_device(int argc, char **argv) +{ + if (argc >= 3 && argv[1][0] == '-') + return LIBMTP_Get_First_Device(); + + if (argc >= 4) { + uint32_t id; + char *endptr; + + // Sanity check device ID + id = strtoul(argv[1], &endptr, 10); + if ( *endptr != 0 ) { + fprintf(stderr, "illegal value %s\n", argv[1]); + return NULL; + } + + return LIBMTP_Get_Device(id); + } + + delfile_usage(); + + return NULL; +} + int delfile_command(int argc, char **argv) { int FILENAME = 1; int ITEMID = 2; int field_type = 0; int i; + int off = (argc >= 4 && argv[1][0] != '-' ? 1 : 0); int ret = 0; if ( argc > 2 ) { - if (strncmp(argv[1],"-f",2) == 0) { + if (strncmp(argv[1 + off],"-f",2) == 0) { field_type = FILENAME; - strcpy(argv[1],""); - } else if (strncmp(argv[1],"-n",2) == 0) { + strcpy(argv[1 + off],""); + } else if (strncmp(argv[1 + off],"-n",2) == 0) { field_type = ITEMID; - strcpy(argv[1],"0"); + strcpy(argv[1 + off],"0"); } else { delfile_usage(); return 0; @@ -80,7 +105,7 @@ return 0; } - for (i=1;i<argc;i++) { + for (i=1+off;i<argc;i++) { uint32_t id; char *endptr; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/examples/getfile.c new/libmtp-1.1.18/examples/getfile.c --- old/libmtp-1.1.17/examples/getfile.c 2017-04-02 21:26:15.000000000 +0200 +++ new/libmtp-1.1.18/examples/getfile.c 2020-07-20 13:00:55.000000000 +0200 @@ -33,7 +33,7 @@ void getfile_usage (void) { - fprintf(stderr, "getfile <fileid/trackid> <filename>\n"); + fprintf(stderr, "getfile [<deviceid>] <fileid/trackid> <filename>\n"); } int @@ -52,32 +52,56 @@ return 0; } +LIBMTP_mtpdevice_t *getfile_device(int argc, char **argv) +{ + if (argc == 3) + return LIBMTP_Get_First_Device(); + + if (argc == 4) { + uint32_t id; + char *endptr; + + // Sanity check device ID + id = strtoul(argv[1], &endptr, 10); + if ( *endptr != 0 ) { + fprintf(stderr, "illegal value %s\n", argv[1]); + return NULL; + } + + return LIBMTP_Get_Device(id); + } + + getfile_usage(); + + return NULL; +} int getfile_command(int argc, char **argv) { uint32_t id; char *endptr; char *file; + int off = (argc == 4 ? 1 : 0); int ret = 0; - // We need file ID and filename - if ( argc != 3 ) { + // We need file ID and filename (device ID is optional) + if ( argc != 3 && argc != 4 ) { getfile_usage(); return 0; } // Sanity check song ID - id = strtoul(argv[1], &endptr, 10); + id = strtoul(argv[1 + off], &endptr, 10); if ( *endptr != 0 ) { - fprintf(stderr, "illegal value %s\n", argv[1]); + fprintf(stderr, "illegal value %s\n", argv[1 + off]); return 1; } else if ( ! id ) { fprintf(stderr, "bad file/track id %u\n", id); return 1; - } + } // Filename, e.g. "foo.mp3" - file = argv[2]; + file = argv[2 + off]; printf("Getting file/track %d to local file %s\n", id, file); // This function will also work just as well for tracks. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/libmtp.pc new/libmtp-1.1.18/libmtp.pc --- old/libmtp-1.1.17/libmtp.pc 2020-02-02 13:21:29.000000000 +0100 +++ new/libmtp-1.1.18/libmtp.pc 2020-10-11 13:28:57.000000000 +0200 @@ -7,7 +7,7 @@ Name: libmtp Description: libmtp is a library for accessing Media Transfer Protocol devices -Version: 1.1.17 +Version: 1.1.18 Requires.private: libusb-1.0 Conflicts: Libs: -L${libdir} -lmtp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/libmtp.c new/libmtp-1.1.18/src/libmtp.c --- old/libmtp-1.1.17/src/libmtp.c 2020-01-25 12:19:14.000000000 +0100 +++ new/libmtp-1.1.18/src/libmtp.c 2020-07-26 10:37:09.000000000 +0200 @@ -1680,13 +1680,13 @@ } /** - * Get the first (as in "first in the list of") connected MTP device. + * Get connected MTP device by list position. * @return a device pointer. * @see LIBMTP_Get_Connected_Devices() */ -LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void) +LIBMTP_mtpdevice_t *LIBMTP_Get_Device(int device_nr) { - LIBMTP_mtpdevice_t *first_device = NULL; + LIBMTP_mtpdevice_t *device = NULL; LIBMTP_raw_device_t *devices; int numdevs; LIBMTP_error_number_t ret; @@ -1701,9 +1701,24 @@ return NULL; } - first_device = LIBMTP_Open_Raw_Device(&devices[0]); + if (device_nr < 0 || device_nr >= numdevs) { + free(devices); + return NULL; + } + + device = LIBMTP_Open_Raw_Device(&devices[device_nr]); free(devices); - return first_device; + return device; +} + +/** + * Get the first (as in "first in the list of") connected MTP device. + * @return a device pointer. + * @see LIBMTP_Get_Connected_Devices() + */ +LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void) +{ + return LIBMTP_Get_Device(0); } /** @@ -5271,6 +5286,7 @@ } if (mtpfile->filetype == LIBMTP_FILETYPE_FOLDER) { add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Get_File_To_File_Descriptor(): Bad object format."); + LIBMTP_destroy_file_t (mtpfile); return -1; } @@ -5338,6 +5354,7 @@ } if (mtpfile->filetype == LIBMTP_FILETYPE_FOLDER) { add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Get_File_To_File_Descriptor(): Bad object format."); + LIBMTP_destroy_file_t (mtpfile); return -1; } @@ -9098,6 +9115,10 @@ if (offset + maxbytes > mtpfile->filesize) { maxbytes = mtpfile->filesize - offset; } + + /* do not need it anymore */ + LIBMTP_destroy_file_t (mtpfile); + /* The MTP stack of Samsung Galaxy devices has a mysterious bug in * GetPartialObject. When GetPartialObject is invoked to read the * last bytes of a file and the amount of data to read is such that diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/libmtp.h new/libmtp-1.1.18/src/libmtp.h --- old/libmtp-1.1.17/src/libmtp.h 2020-02-02 13:21:29.000000000 +0100 +++ new/libmtp-1.1.18/src/libmtp.h 2020-10-11 13:28:57.000000000 +0200 @@ -29,14 +29,16 @@ #ifndef LIBMTP_H_INCLUSION_GUARD #define LIBMTP_H_INCLUSION_GUARD -#define LIBMTP_VERSION 1.1.17 -#define LIBMTP_VERSION_STRING "1.1.17" +#define LIBMTP_VERSION 1.1.18 +#define LIBMTP_VERSION_STRING "1.1.18" /* This handles MSVC pecularities */ #ifdef _MSC_VER #include <windows.h> #define __WIN32__ +#if _MSC_VER < 1900 #define snprintf _snprintf +#endif #define ssize_t SSIZE_T /* * Types that do not exist in Windows @@ -840,6 +842,7 @@ LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *); LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device_Uncached(LIBMTP_raw_device_t *); /* Begin old, legacy interface */ +LIBMTP_mtpdevice_t *LIBMTP_Get_Device(int); LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void); LIBMTP_error_number_t LIBMTP_Get_Connected_Devices(LIBMTP_mtpdevice_t **); uint32_t LIBMTP_Number_Devices_In_List(LIBMTP_mtpdevice_t *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/libmtp.h.in new/libmtp-1.1.18/src/libmtp.h.in --- old/libmtp-1.1.17/src/libmtp.h.in 2019-03-25 07:02:39.000000000 +0100 +++ new/libmtp-1.1.18/src/libmtp.h.in 2020-07-20 13:00:55.000000000 +0200 @@ -36,7 +36,9 @@ #ifdef _MSC_VER #include <windows.h> #define __WIN32__ +#if _MSC_VER < 1900 #define snprintf _snprintf +#endif #define ssize_t SSIZE_T /* * Types that do not exist in Windows @@ -840,6 +842,7 @@ LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *); LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device_Uncached(LIBMTP_raw_device_t *); /* Begin old, legacy interface */ +LIBMTP_mtpdevice_t *LIBMTP_Get_Device(int); LIBMTP_mtpdevice_t *LIBMTP_Get_First_Device(void); LIBMTP_error_number_t LIBMTP_Get_Connected_Devices(LIBMTP_mtpdevice_t **); uint32_t LIBMTP_Number_Devices_In_List(LIBMTP_mtpdevice_t *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/libmtp.sym new/libmtp-1.1.18/src/libmtp.sym --- old/libmtp-1.1.17/src/libmtp.sym 2018-03-17 09:21:17.000000000 +0100 +++ new/libmtp-1.1.18/src/libmtp.sym 2020-07-20 13:00:55.000000000 +0200 @@ -5,6 +5,7 @@ LIBMTP_Check_Specific_Device LIBMTP_Open_Raw_Device LIBMTP_Open_Raw_Device_Uncached +LIBMTP_Get_Device LIBMTP_Get_First_Device LIBMTP_Get_Connected_Devices LIBMTP_Number_Devices_In_List diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/libusb1-glue.c new/libmtp-1.1.18/src/libusb1-glue.c --- old/libmtp-1.1.17/src/libusb1-glue.c 2019-03-25 07:02:39.000000000 +0100 +++ new/libmtp-1.1.18/src/libusb1-glue.c 2020-06-06 09:34:55.000000000 +0200 @@ -1966,7 +1966,10 @@ usbresult = libusb_claim_interface(device_handle, ptp_usb->interface); if (usbresult != 0) { - fprintf(stderr, "error returned by libusb_claim_interface() = %d", usbresult); + if (usbresult == LIBUSB_ERROR_BUSY) + fprintf(stderr, "libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling already"); + else + fprintf(stderr, "error returned by libusb_claim_interface() = %d", usbresult); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/music-players.h new/libmtp-1.1.18/src/music-players.h --- old/libmtp-1.1.17/src/music-players.h 2020-02-02 13:22:33.000000000 +0100 +++ new/libmtp-1.1.18/src/music-players.h 2020-10-11 10:07:30.000000000 +0200 @@ -637,6 +637,9 @@ /* https://sourceforge.net/p/libmtp/support-requests/279/ */ { "Acer", 0x0502, "B3-A20", 0x3841, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/298/ */ + { "Acer", 0x0502, "A3-A40", 0x387a, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1733/ */ { "Acer", 0x0502, "Liquid Zest 4G", 0x38a5, DEVICE_FLAGS_ANDROID_BUGS }, @@ -870,6 +873,10 @@ { "iRiver", 0x4102, "AK70", 0x1200, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | DEVICE_FLAG_OGG_IS_UNKNOWN }, + /* https://bugzilla.suse.com/show_bug.cgi?id=1176588 ... */ + { "A&K", 0x4102, "SR15", 0x1213, + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | + DEVICE_FLAG_OGG_IS_UNKNOWN }, // Reported by Scott Call // Assume this actually supports OGG though it reports it doesn't. { "iRiver", 0x4102, "H10 20GB", 0x2101, @@ -1243,6 +1250,8 @@ { "Nokia", 0x0421, "N9", 0x051a, DEVICE_FLAG_NONE }, /* https://sourceforge.net/p/libmtp/bugs/1308/ */ { "Nokia", 0x0421, "N300", 0x0524, DEVICE_FLAG_NONE }, + /* https://sourceforge.net/p/libmtp/bugs/1885/ */ + { "Nokia", 0x0421, "701", 0x0530, DEVICE_FLAG_NONE }, { "Nokia", 0x0421, "C5-00", 0x0592, DEVICE_FLAG_NONE }, /* https://sourceforge.net/p/libmtp/bugs/1457/ */ { "Nokia", 0x0421, "C5-00 (ID2)", 0x0595, DEVICE_FLAG_NONE }, @@ -1293,8 +1302,9 @@ 0x6765, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1377/ */ - { "Qualcomm (for Xolo)", 0x901b, "Xolo Black (MTP)", - 0x9039, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://github.com/libmtp/libmtp/issues/44 */ + { "Qualcomm (for Xolo)", 0x05c6, "Xolo Black (MTP)", + 0x901b, DEVICE_FLAGS_ANDROID_BUGS }, { "Qualcomm (for PhiComm)", 0x05c6, "C230w (MTP)", 0x9039, DEVICE_FLAGS_ANDROID_BUGS }, @@ -1398,7 +1408,7 @@ // DEVICE_FLAG_UNLOAD_DRIVER }, // Reported by Anonymous SourceForge user {"TrekStor", 0x1e68, "i.Beat Organix 2.0", 0x0002, - DEVICE_FLAG_UNLOAD_DRIVER }, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, /* Also Thalia Toline. https://sourceforge.net/p/libmtp/bugs/1156/ */ {"iRiver", 0x1e68, "Tolino Tab 7", 0x1002, @@ -1678,6 +1688,8 @@ /* https://sourceforge.net/p/libmtp/bugs/1540/ */ { "Sony", 0x054c, "NWZ-E474", 0x06a9, DEVICE_FLAGS_SONY_NWZ_BUGS }, + { "Sony", 0x054c, "Xperia Tablet S - SGPT12", 0x06ac, + DEVICE_FLAGS_SONY_NWZ_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1688/ */ { "Sony", 0x054c, "NWZ-E384", 0x0882, DEVICE_FLAGS_SONY_NWZ_BUGS }, @@ -1978,6 +1990,8 @@ /* https://sourceforge.net/p/libmtp/bugs/1854/ */ { "SONY", 0x0fce, "Xperia XZ2 Premium", 0x01fb, DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia XZ3 Dual Sim (H9436)", 0x01ff, + DEVICE_FLAG_NONE }, /* https://sourceforge.net/p/libmtp/bugs/1853/ */ { "SONY", 0x0fce, "Xperia 10 (I4113)", 0x0201, DEVICE_FLAG_NONE }, @@ -2131,6 +2145,8 @@ DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia XZ2 Premium MTP+CDROM", 0x41fb, DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia XZ3 Dual Sim (H9436) MTP+CDROM", 0x41ff, + DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia 10 (I4113) MTP+CDROM", 0x4201, DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia 1 (J9110) MTP+CDROM", 0x4205, @@ -2247,7 +2263,7 @@ DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia E3 MTP+ADB", 0x51bc, DEVICE_FLAG_NONE }, - { "SONY", 0x0fce, "Xperia Z3 Tablet MTP+ADB", 0x41c0, + { "SONY", 0x0fce, "Xperia Z3 Tablet MTP+ADB", 0x51c0, DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "XPeria M4 Aqua Dual MTP+ADB", 0x51c4, DEVICE_FLAG_NONE }, @@ -2301,6 +2317,8 @@ DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia XZ2 Premium MTP+ADB", 0x51fb, DEVICE_FLAG_NONE }, + { "SONY", 0x0fce, "Xperia XZ3 Dual Sim (H9436) MTP+ADB", 0x51ff, + DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia 10 (I4113) MTP+ADB", 0x5201, DEVICE_FLAG_NONE }, { "SONY", 0x0fce, "Xperia 1 (J9110) MTP+ADB", 0x5205, @@ -3057,12 +3075,21 @@ /* Marcus parents */ { "Lenovo", 0x17ef, "Tab 10", 0x7a50, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://github.com/libmtp/libmtp/issues/33 */ + { "Lenovo", 0x17ef, "Tab4 10 Plus", 0x7ad0, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/support-requests/262/ */ { "Lenovo", 0x17ef, "Tab4 10", 0x7ac5, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/296/ */ + { "Lenovo", 0x17ef, "TB-7304I", 0x7b3c, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1831/ */ { "Lenovo", 0x17ef, "Tab4 10 (2nd ID)", 0x7bc7, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1873/ */ + { "Lenovo", 0x17ef, "Tab P10", 0x7bd3, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1736/ */ { "Lenovo", 0x17ef, "P1060X", 0x9039, DEVICE_FLAGS_ANDROID_BUGS }, @@ -3376,6 +3403,9 @@ /* https://sourceforge.net/p/libmtp/bugs/1447/ */ { "nVidia", 0x0955, "Shield (MTP)", 0xb401, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/297/ */ + { "nVidia", 0x0955, "Shield Android TV pro (MTP)", 0xb42a, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1087/ */ { "nVidia", 0x0955, "Tegra Note", 0xcf02, DEVICE_FLAGS_ANDROID_BUGS }, @@ -3431,6 +3461,10 @@ /* https://sourceforge.net/p/libmtp/bugs/1353/ */ { "Amazon", 0x1949, "Kindle Fire HD6", 0x00f2, DEVICE_FLAGS_ANDROID_BUGS }, + /* R Billing tested one unit rbilling@tanglewood.online + * https://github.com/gphoto/libgphoto2/issues/473 */ + { "Amazon", 0x1949, "Kindle Fire 7 (3rd ID)", 0x0121, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1460/ */ { "Amazon", 0x1949, "Kindle Fire 8", 0x0211, DEVICE_FLAGS_ANDROID_BUGS }, @@ -3458,11 +3492,20 @@ /* https://github.com/libmtp/libmtp/issues/21 */ { "Amazon", 0x1949, "Kindle Fire 8 HD (2nd ID)", 0x0331, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/feature-requests/300/ */ + { "Amazon", 0x1949, "Kindle Fire 8 HD (3rd ID)", 0x0332, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/support-requests/293/ */ { "Amazon", 0x1949, "Kindle Fire Tablet 10 HD (2nd ID)", 0x03f1, DEVICE_FLAGS_ANDROID_BUGS }, + + { "Amazon", 0x1949, "Kindle Fire HD8 Plus", 0x0581, + DEVICE_FLAGS_ANDROID_BUGS }, { "Amazon", 0x1949, "Fire Phone", 0x0800, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1876/ */ + { "Amazon", 0x1949, "Kindle Fire (ID 8)", 0x0c31, + DEVICE_FLAGS_ANDROID_BUGS }, /* * Barnes&Noble @@ -3606,7 +3649,10 @@ { "SHARP Corporation", 0x04dd, "SH-06E", 0x96ca, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/192/ */ - { "SHARP Corporation", 0x04dd, "SHV35 AQUOS U ", 0x99d2, + { "SHARP Corporation", 0x04dd, "SHV35 AQUOS U", 0x99d2, + DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1883/ */ + { "SHARP Corporation", 0x04dd, "AndroidOne S5", 0x9c90, DEVICE_FLAGS_ANDROID_BUGS }, /* @@ -3740,11 +3786,18 @@ { "Garmin", 0x091e, "Fenix 5/5S/5X Plus", 0x4b54, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/271/ */ { "Garmin", 0x091e, "Vivoactive 3", 0x4bac, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1884/ */ + { "Garmin", 0x091e, "Forerunner 245 Music ", 0x4c05, DEVICE_FLAGS_ANDROID_BUGS }, + { "Garmin", 0x091e, "Vivoactive 4S", 0x4c98, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://github.com/libmtp/libmtp/issues/51 */ + { "Garmin", 0x091e, "Vivoactive 4", 0x4c99, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1864/ */ { "Garmin", 0x091e, "Venu", 0x4c9a, DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/bugs/1852/ */ { "Garmin", 0x091e, "Fenix 6", 0x4cda, DEVICE_FLAGS_ANDROID_BUGS }, { "Garmin", 0x091e, "Fenix 6 Sapphire", 0x4cdb, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1887/ */ + { "Garmin", 0x091e, "Zumo XT", 0x4d9c, DEVICE_FLAGS_ANDROID_BUGS }, /* * Wacom @@ -3796,6 +3849,9 @@ /* https://sourceforge.net/p/libmtp/support-requests/269/ */ { "bq", 0x2a47, "Aquarius U", 0x9039, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1874/ */ + { "bq", 0x2a47, "Aquarius U (2nd id)", 0x903a, + DEVICE_FLAGS_ANDROID_BUGS }, /* https://sourceforge.net/p/libmtp/feature-requests/231/ */ { "bq", 0x2a47, "U Plus", 0xf003, DEVICE_FLAGS_ANDROID_BUGS }, @@ -4049,9 +4105,15 @@ /* https://sourceforge.net/p/libmtp/bugs/1822/ */ { "vtevch" , 0x0f88, "Storio Max XL 2.0", 0x0684, DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1889/ */ + { "Tolino" , 0x1f85, "Vision 4 HD", 0x6056 , DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1846/ */ { "Netronix" , 0x1f85, "E60QH2", 0x6a12 , DEVICE_FLAGS_ANDROID_BUGS }, + /* https://sourceforge.net/p/libmtp/bugs/1871/ */ + { "Doro" , 0x2b43, "Phone 8030 DSB-0010", 0x0006 , DEVICE_FLAGS_ANDROID_BUGS }, + /* * Other strange stuff. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/src/unicode.c new/libmtp-1.1.18/src/unicode.c --- old/libmtp-1.1.17/src/unicode.c 2019-05-05 18:17:37.000000000 +0200 +++ new/libmtp-1.1.18/src/unicode.c 2020-05-29 15:53:15.000000000 +0200 @@ -35,8 +35,6 @@ #include <string.h> #ifdef HAVE_ICONV #include "iconv.h" -#else -#error "libmtp unicode.c needs fixing to work without iconv()!" #endif #include "libmtp.h" #include "unicode.h" @@ -87,12 +85,14 @@ size_t convmax = STRING_BUFFER_LENGTH*3; loclstr[0]='\0'; + #if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H) /* Do the conversion. */ nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax); if (nconv == (size_t) -1) { // Return partial string anyway. *locp = '\0'; } + #endif loclstr[STRING_BUFFER_LENGTH*3] = '\0'; // Strip off any BOM, it's totally useless... if ((uint8_t) loclstr[0] == 0xEFU && (uint8_t) loclstr[1] == 0xBBU && (uint8_t) loclstr[2] == 0xBFU) { @@ -122,9 +122,11 @@ unicstr[0]='\0'; unicstr[1]='\0'; + #if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H) /* Do the conversion. */ nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax); - + #endif + if (nconv == (size_t) -1) { // Return partial string anyway. unip[0] = '\0'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmtp-1.1.17/util/mtp-hotplug.c new/libmtp-1.1.18/util/mtp-hotplug.c --- old/libmtp-1.1.17/util/mtp-hotplug.c 2019-02-10 11:58:29.000000000 +0100 +++ new/libmtp-1.1.18/util/mtp-hotplug.c 2020-07-26 10:43:45.000000000 +0200 @@ -50,6 +50,9 @@ style_hwdb }; +#define UDEV_ACTION "SYMLINK+=\"libmtp-%k\"" +#define FULL_UDEV_ACTION UDEV_ACTION ", ENV{ID_MTP_DEVICE}=\"1\", ENV{ID_MEDIA_PLAYER}=\"1\"" + int main (int argc, char **argv) { LIBMTP_device_entry_t *entries; @@ -60,7 +63,6 @@ int opt; extern int optind; extern char *optarg; - char *udev_action = NULL; /* * You could tag on MODE="0666" here to enfore writeable * device nodes, use the command line argument for that. @@ -68,17 +70,17 @@ * with ENV{ID_MEDIA_PLAYER}=1 writable for the console * user. */ - char default_udev_action[] = "SYMLINK+=\"libmtp-%k\", ENV{ID_MTP_DEVICE}=\"1\", ENV{ID_MEDIA_PLAYER}=\"1\""; - char *action; // To hold the action actually used. + + char *action = NULL; // To hold the action when specified by the user. uint16_t last_vendor = 0x0000U; - char mtp_probe_dir[256]; + char mtp_probe_dir[256] = "/usr/lib/udev/"; char *udev_group= NULL; char *udev_mode = NULL; while ( (opt = getopt(argc, argv, "wuoiHa:p:g:m:")) != -1 ) { switch (opt) { case 'a': - udev_action = strdup(optarg); + action = optarg; break; case 'u': style = style_udev; @@ -127,12 +129,6 @@ } } - if (udev_action != NULL) { - action = udev_action; - } else { - action = default_udev_action; - } - LIBMTP_Init(); ret = LIBMTP_Get_Supported_Devices_List(&entries, &numentries); if (ret == 0) { @@ -145,6 +141,14 @@ printf("SUBSYSTEM==\"usb\", GOTO=\"libmtp_usb_rules\"\n" "GOTO=\"libmtp_rules_end\"\n\n" "LABEL=\"libmtp_usb_rules\"\n\n"); + + printf("# If we have a hwdb entry for this device, act immediately!\n"); + printf("ENV{ID_MTP_DEVICE}==\"1\", %s", action ?: UDEV_ACTION); + if (udev_group != NULL) printf(", GROUP=\"%s\"", udev_group); + if (udev_mode != NULL) printf(", MODE=\"%s\"", udev_mode); + printf(", GOTO=\"libmtp_rules_end\"\n\n"); + + printf("# Fall back to probing.\n"); printf("# Some sensitive devices we surely don\'t wanna probe\n"); printf("# Color instruments\n"); printf("ATTR{idVendor}==\"0670\", GOTO=\"libmtp_rules_end\"\n"); @@ -163,6 +167,10 @@ printf("ATTR{idVendor}==\"0471\", ATTR{idProduct}==\"083f\", GOTO=\"libmtp_rules_end\"\n"); printf("# DUALi NFC readers\n"); printf("ATTR{idVendor}==\"1db2\", ATTR{idProduct}==\"060*\", GOTO=\"libmtp_rules_end\"\n"); + printf("# HP printers\n"); + printf("ATTR{idVendor}==\"03f0\", ENV{ID_USB_INTERFACES}==\"*:0701??:*|*:ffcc00:\", GOTO=\"libmtp_rules_end\"\n"); + printf("# Printers\n"); + printf("ENV{ID_USB_INTERFACES}==\"*:0701??:*\", GOTO=\"libmtp_rules_end\"\n"); break; case style_udev_old: printf("# UDEV-style hotplug map for libmtp\n"); @@ -196,10 +204,10 @@ LIBMTP_device_entry_t * entry = &entries[i]; switch (style) { - case style_udev: case style_udev_old: printf("# %s %s\n", entry->vendor, entry->product); - printf("ATTR{idVendor}==\"%04x\", ATTR{idProduct}==\"%04x\", %s", entry->vendor_id, entry->product_id, action); + printf("ATTR{idVendor}==\"%04x\", ATTR{idProduct}==\"%04x\", %s", + entry->vendor_id, entry->product_id, action ?: FULL_UDEV_ACTION); if (udev_group != NULL) printf(", GROUP=\"%s\"", udev_group); if (udev_mode != NULL) printf(", MODE=\"%s\"", udev_mode); printf("\n"); @@ -251,7 +259,7 @@ break; case style_hwdb: printf("# %s %s\n", entry->vendor, entry->product); - printf("usb:v%04xp%04x*\n", entry->vendor_id, entry->product_id); + printf("usb:v%04Xp%04X*\n", entry->vendor_id, entry->product_id); printf(" ID_MEDIA_PLAYER=1\n"); printf(" ID_MTP_DEVICE=1\n"); printf("\n"); @@ -277,7 +285,8 @@ * also dont run probe if gphoto2 already matched it as camera. */ printf("\n# Autoprobe vendor-specific, communication and PTP devices\n"); - printf("ENV{ID_MTP_DEVICE}!=\"1\", ENV{MTP_NO_PROBE}!=\"1\", ENV{COLOR_MEASUREMENT_DEVICE}!=\"1\", ENV{ID_GPHOTO}!=\"1\", ENV{libsane_matched}!=\"yes\", ATTR{bDeviceClass}==\"00|02|06|ef|ff\", PROGRAM=\"%smtp-probe /sys$env{DEVPATH} $attr{busnum} $attr{devnum}\", RESULT==\"1\", %s", mtp_probe_dir, action); + printf("ENV{ID_MTP_DEVICE}!=\"1\", ENV{MTP_NO_PROBE}!=\"1\", ENV{COLOR_MEASUREMENT_DEVICE}!=\"1\", ENV{ID_GPHOTO}!=\"1\", ENV{libsane_matched}!=\"yes\", ATTR{bDeviceClass}==\"00|02|06|ef|ff\", PROGRAM=\"%smtp-probe /sys$env{DEVPATH} $attr{busnum} $attr{devnum}\", RESULT==\"1\", %s", + mtp_probe_dir, action ?: FULL_UDEV_ACTION); if (udev_group != NULL) printf(", GROUP=\"%s\"", udev_group); if (udev_mode != NULL) printf(", MODE=\"%s\"", udev_mode); printf("\n");