void-packages/srcpkgs/sleuthkit/patches/fix-libewf-v2-API.patch
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

26 lines
757 B
Diff

--- a/tsk/img/ewf.cpp
+++ b/tsk/img/ewf.cpp
@@ -64,7 +64,7 @@ ewf_image_read(TSK_IMG_INFO * img_info, TSK_OFF_T offset, char *buf,
tsk_take_lock(&(ewf_info->read_lock));
#if defined( HAVE_LIBEWF_V2_API )
- cnt = libewf_handle_read_random(ewf_info->handle,
+ cnt = libewf_handle_read_buffer_at_offset(ewf_info->handle,
buf, len, offset, &ewf_error);
if (cnt < 0) {
char *errmsg = NULL;
--- a/tsk/img/ewf.h
+++ b/tsk/img/ewf.h
@@ -20,9 +20,9 @@
#include <libewf.h>
-// libewf version 2 no longer defines LIBEWF_HANDLE
+// libewf version 2 no longer defines LIBEWF_OPEN_READ_WRITE
#undef HAVE_LIBEWF_V2_API
-#if !defined( LIBEWF_HANDLE )
+#if !defined( LIBEWF_OPEN_READ_WRITE )
#define HAVE_LIBEWF_V2_API
#endif