Date: Wed, 24 Aug 2016 12:41:31 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420787 - in head/devel: android-tools-adb android-tools-adb-devel/files android-tools-adb/files android-tools-fastboot android-tools-fastboot-devel/files android-tools-fastboot/files Message-ID: <201608241241.u7OCfVMa025557@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Wed Aug 24 12:41:31 2016 New Revision: 420787 URL: https://svnweb.freebsd.org/changeset/ports/420787 Log: devel/android-tools-{adb,fastboot}: update to 7.0.0.r1 (nougat) Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.1_r24..android-7.0.0_r1/adb Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.0_r26..android-7.0.0_r1/fastboot Added: head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp head/devel/android-tools-adb/files/patch-adb_sysdeps.h (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h (contents, props changed) head/devel/android-tools-adb/files/patch-base_file.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-base_file.cpp head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h head/devel/android-tools-adb/files/patch-base_logging.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-base_logging.cpp head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp head/devel/android-tools-adb/files/patch-liblog_logger__write.c (contents, props changed) - copied, changed from r420786, head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp head/devel/android-tools-fastboot/files/patch-base_file.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp head/devel/android-tools-fastboot/files/patch-fastboot_socket.h (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c (contents, props changed) - copied, changed from r420786, head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c Deleted: head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h head/devel/android-tools-adb-devel/files/patch-base_file.cpp head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h head/devel/android-tools-adb-devel/files/patch-base_logging.cpp head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c head/devel/android-tools-adb/files/extra-patch-base_file.cpp head/devel/android-tools-adb/files/extra-patch-base_file__test.cpp head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h head/devel/android-tools-adb/files/extra-patch-base_logging.cpp head/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c head/devel/android-tools-fastboot/files/extra-patch-base_file.cpp head/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c Modified: head/devel/android-tools-adb/Makefile (contents, props changed) head/devel/android-tools-adb/distinfo (contents, props changed) head/devel/android-tools-adb/files/Makefile (contents, props changed) head/devel/android-tools-adb/files/usb_libusb.cpp head/devel/android-tools-fastboot/Makefile (contents, props changed) head/devel/android-tools-fastboot/distinfo (contents, props changed) head/devel/android-tools-fastboot/files/Makefile (contents, props changed) head/devel/android-tools-fastboot/files/usb_freebsd.cpp Modified: head/devel/android-tools-adb/Makefile ============================================================================== --- head/devel/android-tools-adb/Makefile Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-adb/Makefile Wed Aug 24 12:41:31 2016 (r420787) @@ -2,7 +2,7 @@ PORTNAME= android-tools-adb DISTVERSIONPREFIX= android- -DISTVERSION?= 6.0.1_r24 +DISTVERSION?= 7.0.0_r1 PORTREVISION?= 0 CATEGORIES= devel @@ -19,19 +19,11 @@ GH_PROJECT= platform_system_core .ifdef DISTVERSIONSUFFIX GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot .else -GH_REVISION= 2a288d0f331c # generated by: make update-revision +GH_REVISION= 88f64719d756 # generated by: make update-revision .endif CONFLICTS_INSTALL?= ${PORTNAME}-devel-* -.ifndef EXTRA_PATCHES -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_include_base_logging.h -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file__test.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_logging.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c -.endif - USES= compiler:c++11-lib uidfix USE_OPENSSL= yes BUILD_WRKSRC= ${WRKSRC}/adb @@ -55,7 +47,7 @@ OPTIONS_SUB= yes BASH_GH_ACCOUNT= mbrubeck:bashcomp BASH_GH_PROJECT= android-completion:bashcomp -BASH_GH_TAGNAME= 3b0fabe:bashcomp +BASH_GH_TAGNAME= c1b0656:bashcomp BASH_PLIST_FILES= etc/bash_completion.d/adb BASH_VARS= LICENSE+=MIT LICENSE_COMB=multi Modified: head/devel/android-tools-adb/distinfo ============================================================================== --- head/devel/android-tools-adb/distinfo Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-adb/distinfo Wed Aug 24 12:41:31 2016 (r420787) @@ -1,4 +1,5 @@ -SHA256 (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = f335756cc7f2ad3b6870dee7fb4641fd97df0a4d51c89bd508dce34802815b1e -SIZE (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = 1184987 -SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc -SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 +TIMESTAMP = 1472009581 +SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4 +SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346 +SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c +SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967 Modified: head/devel/android-tools-adb/files/Makefile ============================================================================== --- head/devel/android-tools-adb/files/Makefile Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-adb/files/Makefile Wed Aug 24 12:41:31 2016 (r420787) @@ -13,23 +13,33 @@ SRCS+= adb_auth_host.cpp SRCS+= adb_client.cpp SRCS+= adb_io.cpp SRCS+= adb_listeners.cpp -SRCS+= adb_main.cpp +SRCS+= adb_trace.cpp SRCS+= adb_utils.cpp SRCS+= commandline.cpp SRCS+= console.cpp +SRCS+= diagnose_usb.cpp SRCS+= fdevent.cpp SRCS+= file_sync_client.cpp +SRCS+= line_printer.cpp SRCS+= services.cpp -# XXX SuffFindDeps may fail to restore suffix lost in transformation +SRCS+= shell_service_protocol.cpp SRCS+= ../adb/sockets.cpp +SRCS+= sysdeps_unix.cpp SRCS+= transport.cpp SRCS+= transport_local.cpp SRCS+= transport_usb.cpp TEST_SRCS+= adb_io_test.cpp TEST_SRCS+= adb_utils_test.cpp +TEST_SRCS+= fdevent_test.cpp +TEST_SRCS+= shell_service_protocol_test.cpp +TEST_SRCS+= socket_test.cpp +TEST_SRCS+= sysdeps_test.cpp TEST_SRCS+= transport_test.cpp +.PATH: ${.CURDIR}/client +SRCS+= main.cpp + .PATH: ${EXTRADIR} SRCS+= get_my_path_freebsd.cpp SRCS+= usb_libusb.cpp @@ -37,30 +47,39 @@ SRCS+= usb_libusb.cpp .PATH: ${.CURDIR}/../base SRCS+= file.cpp SRCS+= logging.cpp -SRCS+= strings.cpp +SRCS+= parsenetaddress.cpp SRCS+= stringprintf.cpp +SRCS+= strings.cpp TEST_SRCS+= file_test.cpp TEST_SRCS+= logging_test.cpp +TEST_SRCS+= parsenetaddress_test.cpp TEST_SRCS+= stringprintf_test.cpp TEST_SRCS+= strings_test.cpp TEST_SRCS+= test_main.cpp TEST_SRCS+= test_utils.cpp .PATH: ${.CURDIR}/../libcutils -SRCS+= socket_inaddr_any_server.c -SRCS+= socket_local_client.c -SRCS+= socket_local_server.c -SRCS+= socket_loopback_client.c -SRCS+= socket_loopback_server.c -SRCS+= socket_network_client.c +SRCS+= socket_inaddr_any_server_unix.c +SRCS+= socket_local_client_unix.c +SRCS+= socket_local_server_unix.c +SRCS+= socket_loopback_client_unix.c +SRCS+= socket_loopback_server_unix.c +SRCS+= socket_network_client_unix.c +SRCS+= ../libcutils/sockets.cpp SRCS+= load_file.c SRCS+= threads.c +# XXX Obsolete after 10.2 or r279980/r280329 +CPPFLAGS.sockets.cpp+= -o ${.TARGET} # required by base/file.cpp .PATH: ${.CURDIR}/../liblog +SRCS+= config_write.c SRCS+= fake_log_device.c -SRCS+= logd_write.c -CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1 +SRCS+= fake_writer.c +SRCS+= logger_lock.c +SRCS+= logger_name.c +SRCS+= logger_write.c +CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1 REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown) @@ -110,5 +129,5 @@ beforeinstall: test: ${PROG}_test @for f in ${.ALLSRC}; do ./$$f; done -${PROG}_test: ${OBJS:Nadb_main.o:Ncommandline.o} ${TEST_OBJS} +${PROG}_test: ${OBJS:Nmain.o:Ncommandline.o} ${TEST_OBJS} ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} Copied and modified: head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp (from r420786, head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp) ============================================================================== Copied and modified: head/devel/android-tools-adb/files/patch-adb_sysdeps.h (from r420786, head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h) ============================================================================== Added: head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h Wed Aug 24 12:41:31 2016 (r420787) @@ -0,0 +1,9 @@ +--- adb/sysdeps/mutex.h.orig 2016-06-23 07:04:56 UTC ++++ adb/sysdeps/mutex.h +@@ -104,4 +104,6 @@ + + } + ++#else ++#include <mutex> + #endif Copied and modified: head/devel/android-tools-adb/files/patch-base_file.cpp (from r420786, head/devel/android-tools-adb-devel/files/patch-base_file.cpp) ============================================================================== Copied and modified: head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h (from r420786, head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h) ============================================================================== Copied and modified: head/devel/android-tools-adb/files/patch-base_logging.cpp (from r420786, head/devel/android-tools-adb-devel/files/patch-base_logging.cpp) ============================================================================== Copied and modified: head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp (from r420786, head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp) ============================================================================== Copied and modified: head/devel/android-tools-adb/files/patch-liblog_logger__write.c (from r420786, head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c) ============================================================================== Modified: head/devel/android-tools-adb/files/usb_libusb.cpp ============================================================================== --- head/devel/android-tools-adb/files/usb_libusb.cpp Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-adb/files/usb_libusb.cpp Wed Aug 24 12:41:31 2016 (r420787) @@ -17,7 +17,7 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_USB +#define TRACE_TAG USB #include "sysdeps.h" @@ -58,7 +58,7 @@ static usb_handle handle_list = { .next = &handle_list, }; -void +static void usb_cleanup() { libusb_exit(ctx); @@ -600,9 +600,10 @@ scan_usb_devices() libusb_free_device_list(devs, 1); } -static void * -device_poll_thread(void* unused) +static void +device_poll_thread(void*) { + adb_thread_setname("USB scan"); D("device_poll_thread(): Created USB scan thread"); for (;;) { @@ -610,9 +611,6 @@ device_poll_thread(void* unused) kick_disconnected(); scan_usb_devices(); } - - /* never reaching this point */ - return (NULL); } static void @@ -625,7 +623,6 @@ void usb_init() { D("usb_init(): started"); - adb_thread_t tid; struct sigaction actions; atexit(usb_cleanup); @@ -648,7 +645,7 @@ usb_init() scan_usb_devices(); /* starting USB event polling thread */ - if (adb_thread_create(&tid, device_poll_thread, nullptr)) { + if (!adb_thread_create(device_poll_thread, nullptr)) { fatal_errno("cannot create USB scan thread"); } Modified: head/devel/android-tools-fastboot/Makefile ============================================================================== --- head/devel/android-tools-fastboot/Makefile Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-fastboot/Makefile Wed Aug 24 12:41:31 2016 (r420787) @@ -2,7 +2,7 @@ PORTNAME= android-tools-fastboot DISTVERSIONPREFIX= android- -DISTVERSION?= 6.0.0_r26 +DISTVERSION?= 7.0.0_r1 PORTREVISION?= 0 CATEGORIES= devel MASTER_SITES= https://anonscm.debian.org/cgit/android-tools/android-tools.git/plain/debian/:manpage @@ -27,16 +27,11 @@ GH_PROJECT= platform_system_core platfor .ifdef DISTVERSIONSUFFIX GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot .else -GH_REVISION= f7f765fd62bf # generated by: make update-revision +GH_REVISION= 88f64719d756 # generated by: make update-revision .endif CONFLICTS_INSTALL?= ${PORTNAME}-devel-* -.ifndef EXTRA_PATCHES -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c -.endif - USES= compiler:c++11-lib pkgconfig uidfix BUILD_WRKSRC= ${WRKSRC}/fastboot INSTALL_WRKSRC= ${BUILD_WRKSRC} @@ -59,7 +54,7 @@ OPTIONS_SUB= yes BASH_GH_ACCOUNT= mbrubeck:bashcomp BASH_GH_PROJECT= android-completion:bashcomp -BASH_GH_TAGNAME= 3b0fabe:bashcomp +BASH_GH_TAGNAME= c1b0656:bashcomp BASH_PLIST_FILES= etc/bash_completion.d/fastboot BASH_VARS= LICENSE+=MIT Modified: head/devel/android-tools-fastboot/distinfo ============================================================================== --- head/devel/android-tools-fastboot/distinfo Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-fastboot/distinfo Wed Aug 24 12:41:31 2016 (r420787) @@ -1,10 +1,11 @@ +TIMESTAMP = 1472009581 SHA256 (fastboot.1?id=706e754) = 2af01b064440952a82f1602691a0fecc030302722a71444946fb70d9c423d283 SIZE (fastboot.1?id=706e754) = 5906 -SHA256 (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 75c3135b44874e1a6d6b98cf7fc2c7513f77bd41b0302cd1f8d0a5a9ade46a36 -SIZE (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 1182157 -SHA256 (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 2364ecc2c91209af7ecab294bee0a6e8e12e4faf54b33ab3559e53ad9e44634c -SIZE (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 650471 -SHA256 (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 735a4be6b2c80b43ff19f7fa29c6aac7c361e4e8c0e5f65b70ec74ea5bfc3c18 -SIZE (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 50960 -SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc -SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 +SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4 +SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346 +SHA256 (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = ff2ea6db032da70374edcd6867bd11d765a475a32d732b983d0dad6ae16e209b +SIZE (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = 79621110 +SHA256 (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = bf335619fb77fc523e33d08523d20795de17a6a906b87e16fd7d79911f186a15 +SIZE (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = 59544 +SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c +SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967 Modified: head/devel/android-tools-fastboot/files/Makefile ============================================================================== --- head/devel/android-tools-fastboot/files/Makefile Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-fastboot/files/Makefile Wed Aug 24 12:41:31 2016 (r420787) @@ -7,19 +7,30 @@ FILESDIR?=${DOCDIR}/${PROG} FILES= *.[Tt][Xx][Tt] SRCS+= bootimg_utils.cpp -SRCS+= engine.c +SRCS+= engine.cpp SRCS+= fastboot.cpp -SRCS+= fs.c -SRCS+= protocol.c -SRCS+= util.c +SRCS+= ../fastboot/fs.cpp +SRCS+= protocol.cpp +SRCS+= socket.cpp +SRCS+= tcp.cpp +SRCS+= udp.cpp +SRCS+= util.cpp .PATH: ${EXTRADIR} SRCS+= usb_freebsd.cpp SRCS+= util_freebsd.cpp -# required by libziparchive +# required by fastboot +.PATH: ${.CURDIR}/../adb +SRCS+= diagnose_usb.cpp + +# required by fastboot, diagnose_usb and libziparchive .PATH: ${.CURDIR}/../base +SRCS+= errors_unix.cpp SRCS+= file.cpp +SRCS+= parsenetaddress.cpp +SRCS+= stringprintf.cpp +SRCS+= strings.cpp # required by fastboot .PATH: ${.CURDIR}/../ext4_utils @@ -35,11 +46,23 @@ SRCS+= make_ext4fs.c SRCS+= sha1.c SRCS+= wipe.c +# required by fastboot +.PATH: ${.CURDIR}/../libcutils +SRCS+= ../libcutils/sockets.cpp +SRCS+= socket_inaddr_any_server_unix.c +SRCS+= socket_network_client_unix.c +SRCS+= sockets_unix.cpp +CPPFLAGS.sockets.cpp+= -o ${.TARGET} # XXX pre-r279980 + # required by base and libutils .PATH: ${.CURDIR}/../liblog +SRCS+= config_write.c SRCS+= fake_log_device.c -SRCS+= logd_write.c -CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1 +SRCS+= fake_writer.c +SRCS+= logger_lock.c +SRCS+= logger_name.c +SRCS+= logger_write.c +CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1 # required by ext4_utils .PATH: ${.CURDIR}/../libselinux/src @@ -50,6 +73,8 @@ SRCS+= init.c SRCS+= label.c SRCS+= label_android_property.c SRCS+= label_file.c +SRCS+= label_support.c +CPPFLAGS.label_file.c+= -D_WITH_GETLINE # required by fastboot and ext4_utils .PATH: ${.CURDIR}/../libsparse @@ -78,6 +103,7 @@ CPPFLAGS+= -Dmmap64=mmap CPPFLAGS+= -Dpread64=pread CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/../include +CPPFLAGS+= -I${.CURDIR}/../adb CPPFLAGS+= -I${.CURDIR}/../mkbootimg CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= -I${.CURDIR}/../ext4_utils Copied and modified: head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h (from r420786, head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp (from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-base_file.cpp (from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h (from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp (from r420786, head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-fastboot_socket.h (from r420786, head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h) ============================================================================== Copied and modified: head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c (from r420786, head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c) ============================================================================== Modified: head/devel/android-tools-fastboot/files/usb_freebsd.cpp ============================================================================== --- head/devel/android-tools-fastboot/files/usb_freebsd.cpp Wed Aug 24 11:55:47 2016 (r420786) +++ head/devel/android-tools-fastboot/files/usb_freebsd.cpp Wed Aug 24 12:41:31 2016 (r420787) @@ -30,6 +30,8 @@ #include <string.h> #include <libusb.h> +#include <memory> + #include "usb.h" struct usb_handle { @@ -40,8 +42,24 @@ struct usb_handle { unsigned char iface; }; +class LibusbUsbTransport : public Transport { +public: + explicit LibusbUsbTransport(std::unique_ptr<usb_handle> handle): + h(std::move(handle)) {} + ~LibusbUsbTransport() override = default; + + ssize_t Read(void *_data, size_t len) override; + ssize_t Write(const void *_data, size_t len) override; + int Close() override; + +private: + std::unique_ptr<usb_handle> h; + + DISALLOW_COPY_AND_ASSIGN(LibusbUsbTransport); +}; + static int -probe(usb_handle *h, ifc_match_func callback) +probe(std::unique_ptr<usb_handle> &h, ifc_match_func callback) { usb_ifc_info info; libusb_device_descriptor ddesc; @@ -120,26 +138,22 @@ probe(usb_handle *h, ifc_match_func call return (-1); } -static usb_handle * +static std::unique_ptr<usb_handle> enumerate(ifc_match_func callback) { static libusb_context *ctx = NULL; - usb_handle *h; + std::unique_ptr<usb_handle> h; libusb_device **ppdev; ssize_t ndev; ssize_t x; - h = reinterpret_cast<usb_handle*>(malloc(sizeof(*h))); - if (h == NULL) - return (h); - if (ctx == NULL) libusb_init(&ctx); ndev = libusb_get_device_list(ctx, &ppdev); for (x = 0; x < ndev; x++) { - memset(h, 0, sizeof(*h)); + h.reset(new usb_handle); h->dev = ppdev[x]; @@ -149,13 +163,13 @@ enumerate(ifc_match_func callback) return (h); } } - free(h); + h.reset(); libusb_free_device_list(ppdev, 1); - return (NULL); + return (nullptr); } -int -usb_write(usb_handle * h, const void *_data, int len) +ssize_t +LibusbUsbTransport::Write(const void *_data, size_t len) { int actlen; @@ -165,8 +179,8 @@ usb_write(usb_handle * h, const void *_d return (actlen); } -int -usb_read(usb_handle * h, void *_data, int len) +ssize_t +LibusbUsbTransport::Read(void *_data, size_t len) { int actlen; @@ -176,25 +190,19 @@ usb_read(usb_handle * h, void *_data, in return (actlen); } -int -usb_close(usb_handle * h) +int +LibusbUsbTransport::Close() { libusb_close(h->handle); h->handle = NULL; libusb_unref_device(h->dev); - free(h); + h.reset(); return (0); } -usb_handle * +Transport * usb_open(ifc_match_func callback) { - return (enumerate(callback)); -} - -int -usb_wait_for_disconnect(usb_handle * h) -{ - /* TODO: Punt for now */ - return 0; + std::unique_ptr<usb_handle> h = enumerate(callback); + return (h ? new LibusbUsbTransport(std::move(h)) : nullptr); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608241241.u7OCfVMa025557>