FreeBSD Bugzilla – Attachment 243125 Details for
Bug 272311
graphics/exiv2: upgrade to v0.28
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix exiv2 part in bulk_extractor, and update while here, and enable "make test"
0002-sysutils-bulk_extractor-fix-for-exiv2-0.28-update-2..patch (text/plain), 9.72 KB, created by
Matthias Andree
on 2023-07-02 10:59:23 UTC
(
hide
)
Description:
patch to fix exiv2 part in bulk_extractor, and update while here, and enable "make test"
Filename:
MIME Type:
Creator:
Matthias Andree
Created:
2023-07-02 10:59:23 UTC
Size:
9.72 KB
patch
obsolete
>From de43a229980a9ba1fe85d99727860522880ad708 Mon Sep 17 00:00:00 2001 >From: Matthias Andree <mandree@FreeBSD.org> >Date: Sun, 2 Jul 2023 12:56:10 +0200 >Subject: [PATCH 2/2] =?UTF-8?q?sysutils/bulk=5Fextractor:=20fix=20for=20ex?= > =?UTF-8?q?iv2=200.28,=20update=20=E2=86=92=202.0.3?= >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Caused by: >PR: 272311 >--- > sysutils/bulk_extractor/Makefile | 6 +- > sysutils/bulk_extractor/distinfo | 6 +- > ...c_be20__api_dfxml__cpp_src_dfxml__writer.h | 13 ++ > .../files/patch-src_scan__exiv2.cpp | 125 ++++++++++++++++++ > 4 files changed, 145 insertions(+), 5 deletions(-) > create mode 100644 sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h > create mode 100644 sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp > >diff --git a/sysutils/bulk_extractor/Makefile b/sysutils/bulk_extractor/Makefile >index 397649f9add5..69289c54e45f 100644 >--- a/sysutils/bulk_extractor/Makefile >+++ b/sysutils/bulk_extractor/Makefile >@@ -1,47 +1,49 @@ > PORTNAME= bulk_extractor >-PORTVERSION= 2.0.0 >+PORTVERSION= 2.0.3 > DISTVERSIONPREFIX= v >-PORTREVISION= 5 >+PORTREVISION= 0 > CATEGORIES= sysutils > > MAINTAINER= nobutaka@FreeBSD.org > COMMENT= Program that scans a disk image and extracts useful information > WWW= https://github.com/simsong/bulk_extractor > > LICENSE= MIT > LICENSE_FILE= ${WRKSRC}/COPYING > > LIB_DEPENDS= libafflib.so:sysutils/afflib \ > libboost_system.so:devel/boost-libs \ > libewf.so:devel/libewf \ > libexiv2.so:graphics/exiv2 \ > libexpat.so:textproc/expat2 \ > libgcrypt.so:security/libgcrypt \ > libgpg-error.so:security/libgpg-error > > USES= autoreconf compiler:c++17-lang gnome iconv:wchar_t localbase \ > sqlite ssl > USE_GITHUB= yes > USE_GNOME= libxml2 > > GH_ACCOUNT= simsong > GH_TUPLE= simsong:be20_api:${GH_TAG_BE20_API}:be20_api \ > dfxml-working-group:dfxml_cpp:${GH_TAG_DFXML_CPP}:dfxml_cpp \ > dfxml-working-group:dfxml_schema:${GH_TAG_DFXML_SCHEMA}:dfxml_schema > GH_TAG_BE20_API= f63dcd5 > GH_TAG_DFXML_CPP= 09030bc > GH_TAG_DFXML_SCHEMA= f2a702e > > GNU_CONFIGURE= yes > CXXFLAGS_powerpc= -DBIG_ENDIAN > CXXFLAGS_powerpcspe= -DBIG_ENDIAN > CONFIGURE_ARGS= --enable-exiv2=true > >+TEST_TARGET= check >+ > PLIST_FILES= bin/bulk_extractor bin/test_be man/man1/bulk_extractor.1.gz > > post-extract: > ${CP} -R ${WRKSRC_be20_api}/* ${WRKSRC}/src/be20_api/ > ${CP} -R ${WRKSRC_dfxml_cpp}/* ${WRKSRC}/src/be20_api/dfxml_cpp/ > ${CP} -R ${WRKSRC_dfxml_schema}/* ${WRKSRC}/dfxml_schema/ > > .include <bsd.port.mk> >diff --git a/sysutils/bulk_extractor/distinfo b/sysutils/bulk_extractor/distinfo >index 891d74b044f8..62bf07914da9 100644 >--- a/sysutils/bulk_extractor/distinfo >+++ b/sysutils/bulk_extractor/distinfo >@@ -1,9 +1,9 @@ >-TIMESTAMP = 1645265605 >-SHA256 (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 57efb6fac52fdd70f9778bfad96f76ce01466b48e4a0bb732a39b66abb698cfb >-SIZE (simsong-bulk_extractor-v2.0.0_GH0.tar.gz) = 42333931 >+TIMESTAMP = 1688292189 >+SHA256 (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42c16b0d5708c3bda0bb44eec14dc06b69590496ede550ee736100597a43710f >+SIZE (simsong-bulk_extractor-v2.0.3_GH0.tar.gz) = 42335471 > SHA256 (simsong-be20_api-f63dcd5_GH0.tar.gz) = 76713af7d1430d5ade05603f218f5a0d9523357b292319e935ef941033a8b4c2 > SIZE (simsong-be20_api-f63dcd5_GH0.tar.gz) = 485552 > SHA256 (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = caf43f6b8440fb7acc3069602d513d36886c7413209043274cc88f6615363502 > SIZE (dfxml-working-group-dfxml_cpp-09030bc_GH0.tar.gz) = 177520 > SHA256 (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = ce7034f36dda27b7dd4192a05545c87f69a68bcc1321e7ffdaeb638bf41919be > SIZE (dfxml-working-group-dfxml_schema-f2a702e_GH0.tar.gz) = 10421 >diff --git a/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h b/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h >new file mode 100644 >index 000000000000..c01216240489 >--- /dev/null >+++ b/sysutils/bulk_extractor/files/patch-src_be20__api_dfxml__cpp_src_dfxml__writer.h >@@ -0,0 +1,13 @@ >+--- src/be20_api/dfxml_cpp/src/dfxml_writer.h.orig 2023-07-02 09:24:33 UTC >++++ src/be20_api/dfxml_cpp/src/dfxml_writer.h >+@@ -96,6 +96,10 @@ >+ #include <uuid/uuid.h> >+ #endif >+ >++#ifdef HAVE_EXIV2 >++#include <exiv2/exiv2.hpp> >++#endif >++ >+ #include "cpuid.h" >+ >+ class dfxml_writer { >diff --git a/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp b/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp >new file mode 100644 >index 000000000000..ae9c9d6cd03c >--- /dev/null >+++ b/sysutils/bulk_extractor/files/patch-src_scan__exiv2.cpp >@@ -0,0 +1,125 @@ >+--- src/scan_exiv2.cpp.orig 2023-04-07 18:27:14 UTC >++++ src/scan_exiv2.cpp >+@@ -33,6 +33,8 @@ >+ #pragma GCC diagnostic ignored "-Weffc++" >+ #endif >+ >++using std::string; >++ >+ #include <exiv2/image.hpp> >+ #include <exiv2/exif.hpp> >+ #include <exiv2/error.hpp> >+@@ -90,7 +92,7 @@ static string fix_gps(string s) >+ std::vector<std::string> parts = split(s,' '); >+ if(parts.size()!=3) return s; // return the original >+ double res = rational(parts[0]) + rational(parts[1])/60.0 + rational(parts[2])/3600.0; >+- s = dtos(res); >++ s = std::to_string(res); >+ return s; >+ } >+ >+@@ -106,7 +108,7 @@ void scan_exiv2(struct scanner_params &sp) >+ { >+ sp.check_version(); >+ if(sp.phase==scanner_params::PHASE_INIT){ >+- sp.info.set_name("exiv2" ); >++ sp.info->set_name("exiv2" ); >+ sp.info->author = "Simson L. Garfinkel"; >+ sp.info->description = "Searches for EXIF information using exiv2. Use exif scanner if this is not available or if this crashes."; >+ sp.info->scanner_flags.default_enabled = false; >+@@ -117,7 +119,7 @@ void scan_exiv2(struct scanner_params &sp) >+ } >+ if(sp.phase==scanner_params::PHASE_SCAN){ >+ >+- const sbuf_t &sbuf = sp.sbuf; >++ const sbuf_t *sbuf = sp.sbuf; >+ feature_recorder &exif_recorder = sp.named_feature_recorder("exif"); >+ feature_recorder &gps_recorder = sp.named_feature_recorder("gps"); >+ >+@@ -127,23 +129,23 @@ void scan_exiv2(struct scanner_params &sp) >+ #endif >+ >+ size_t pos_max = 1; // by default, just scan 1 byte >+- if(sbuf.bufsize > min_exif_size){ >+- pos_max = sbuf.bufsize - min_exif_size; // we can scan more! >++ if(sbuf->bufsize > min_exif_size){ >++ pos_max = sbuf->bufsize - min_exif_size; // we can scan more! >+ } >+ >+ /* Loop through all possible locations in the buffer */ >+ for(size_t pos=0;pos<pos_max;pos++){ >+ size_t count = exif_gulp_size; >+- count = min(count,sbuf.bufsize-pos); >+- //size_t count = sbuf.bufsize-pos; // use all to end >++ count = min(count,sbuf->bufsize-pos); >++ //size_t count = sbuf->bufsize-pos; // use all to end >+ >+ /* Explore the beginning of each 512-byte block as well as the starting location >+ * of any JPEG on any boundary. This will cause processing of any multimedia file >+ * that Exiv2 recognizes (for which I do not know all the headers. >+ */ >+- if(pos%512==0 || jpeg_start(sbuf+pos)){ >++ if(pos%512==0 || jpeg_start(sbuf->slice(pos))){ >+ try { >+- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(sbuf.buf+pos,count); >++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(sbuf->slice(pos).get_buf(),count); >+ if(image->good()){ >+ image->readMetadata(); >+ >+@@ -153,8 +155,8 @@ void scan_exiv2(struct scanner_params &sp) >+ /* >+ * Create the MD5 of the first 4K to use as a unique identifier. >+ */ >+- sbuf_t tohash(sbuf,0,4096); >+- string md5_hex = exif_recorder->fs.hasher.func(tohash.buf,tohash.bufsize); >++ sbuf_t tohash(*sbuf,0,4096); >++ string md5_hex = exif_recorder.hash(tohash.slice(0, tohash.bufsize)); >+ >+ char xmlbuf[1024]; >+ snprintf(xmlbuf,sizeof(xmlbuf), >+@@ -250,10 +252,10 @@ void scan_exiv2(struct scanner_params &sp) >+ gps_lat = fix_gps(i->value().toString()); >+ } else if(key=="Exif.GPSInfo.GPSAltitude"){ >+ has_gps = true; >+- gps_ele = dtos(rational(i->value().toString())); >++ gps_ele = std::to_string(rational(i->value().toString())); >+ } else if(key=="Exif.GPSInfo.GPSSpeed"){ >+ has_gps = true; >+- gps_speed = dtos(rational(i->value().toString())); >++ gps_speed = std::to_string(rational(i->value().toString())); >+ } else if(key=="Exif.GPSInfo.GPSTrack"){ >+ has_gps = true; >+ gps_course = i->value().toString(); >+@@ -262,20 +264,20 @@ void scan_exiv2(struct scanner_params &sp) >+ xml.append("</exiv2>"); >+ >+ // record EXIF >+- exif_recorder->write(sp.sbuf.pos0+pos,md5_hex,xml); >++ exif_recorder.write(sp.sbuf->pos0+pos,md5_hex,xml); >+ >+ // record GPS >+ if (has_gps) { >+ if (has_gps_date) { >+ // record the GPS entry using the GPS date >+- gps_recorder->write(sp.sbuf.pos0+pos,md5_hex, >++ gps_recorder.write(sp.sbuf->pos0+pos,md5_hex, >+ gps_date+"T"+gps_time+","+gps_lat_ref+gps_lat+"," >+ +gps_lon_ref+gps_lon+"," >+ +gps_ele+","+gps_speed+","+gps_course); >+ >+ } else { >+ // record the GPS entry using the date obtained from Photo >+- gps_recorder->write(sp.sbuf.pos0+pos,md5_hex, >++ gps_recorder.write(sp.sbuf->pos0+pos,md5_hex, >+ photo_time+","+gps_lat_ref+gps_lat+"," >+ +gps_lon_ref+gps_lon+"," >+ +gps_ele+","+gps_speed+","+gps_course); >+@@ -283,7 +285,7 @@ void scan_exiv2(struct scanner_params &sp) >+ } >+ } >+ } >+- catch (Exiv2::AnyError &e) { } >++ catch (Exiv2::Error &e) { } >+ catch (std::exception &e) { } >+ } >+ } >-- >2.41.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mandree
:
maintainer-approval?
(
nobutaka
)
Actions:
View
|
Diff
Attachments on
bug 272311
:
243098
|
243100
|
243103
|
243104
|
243106
|
243111
|
243124
| 243125 |
243135
|
243136
|
243137
|
243138
|
243139
|
243140
|
243141
|
243142
|
243143
|
243144
|
243145
|
243146
|
243147
|
243148
|
243154
|
243155
|
243156
|
243157
|
243158
|
243159
|
243160
|
243166
|
243167
|
243168
|
243169
|
243170
|
243171
|
243172
|
243175
|
243176