1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

sysutils/dd_rescue: Update to 1.99.14

Replace "_" in the names of the patch files with "__" to conform to the
patch file name convention.
This commit is contained in:
MANTANI Nobutaka 2024-08-25 21:20:11 +09:00
parent ddd57b6891
commit 7e351a1d7b
20 changed files with 122 additions and 131 deletions

View File

@ -1,6 +1,5 @@
PORTNAME= dd_rescue
PORTVERSION= 1.99.13
PORTREVISION= 1
PORTVERSION= 1.99.14
CATEGORIES= sysutils
MASTER_SITES= http://www.garloff.de/kurt/linux/ddrescue/ \
http://fossies.org/unix/privat/

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1708181857
SHA256 (dd_rescue-1.99.13.tar.bz2) = f40fe9c770ff5d27d323297ee73d0bbed332d3eafac4e4732e542eadb1c5c1e8
SIZE (dd_rescue-1.99.13.tar.bz2) = 182574
TIMESTAMP = 1724579114
SHA256 (dd_rescue-1.99.14.tar.bz2) = 53a0a7f166ca74a146c137cb3dcfef320cf6c5e0f43208a75563b7c1db04d814
SIZE (dd_rescue-1.99.14.tar.bz2) = 188613

View File

@ -1,11 +1,11 @@
--- Makefile.orig 2023-02-24 08:28:08 UTC
--- Makefile.orig 2024-08-22 17:41:01 UTC
+++ Makefile
@@ -7,11 +7,7 @@ SRCDIR ?= .
DESTDIR =
SRCDIR ?= .
-CC = gcc
-SHELL = /bin/bash
-SHELL := bash
-RPM_OPT_FLAGS ?= -Os -Wall -g -D_FORTIFY_SOURCE=2
-CFLAGS = $(RPM_OPT_FLAGS) $(EXTRA_CFLAGS) -DHAVE_CONFIG_H -I .
-CFLAGS_OPT = $(CFLAGS) -O3

View File

@ -0,0 +1,71 @@
--- dd_rescue.c.orig 2024-08-22 17:41:01 UTC
+++ dd_rescue.c
@@ -144,12 +144,11 @@
# include <fallocate.h>
#else
# ifdef HAVE_FALLOCATE64
-# include <linux/falloc.h>
typedef off64_t __off64_t;
# endif
#endif
-#if defined(HAVE_DLFCN_H) && !defined(NO_LIBDL)
+#if defined(HAVE_DLFCN_H) && !defined(NO_LIBDL) && !defined(__FreeBSD__)
#include <dlfcn.h>
void* libfalloc = (void*)0;
#define USE_LIBDL 1
@@ -177,7 +176,7 @@ void* libfalloc = (void*)0;
#endif
/* Handle lack of stat64 */
-#ifdef HAVE_STAT64
+#if defined(HAVE_STAT64) && !defined(__FreeBSD__)
# define STAT64 stat64
# define FSTAT64 fstat64
#else
@@ -186,17 +185,17 @@ void* libfalloc = (void*)0;
# warning We lack stat64, may not handle >2GB files correctly
#endif
-#ifndef HAVE_LSEEK64
+#if !defined(HAVE_LSEEK64) || defined(__FreeBSD__)
# define lseek64 lseek
# warning We lack lseek64, may not handle >2GB files correctly
#endif
/* This is not critical -- most platforms have an internal 64bit offset with plain open() */
-#ifndef HAVE_OPEN64
+#if !defined(HAVE_OPEN64 ) || defined(__FreeBSD__)
# define open64 open
#endif
-#if !defined(HAVE_PREAD64) || defined(TEST_SYSCALL)
+#if !defined(HAVE_PREAD64) || defined(TEST_SYSCALL) || defined(__FreeBSD__)
#include "pread64.h"
#endif
@@ -698,7 +697,7 @@ static void unload_plugins() {};
static void unload_plugins() {};
#endif
-#if defined(HAVE_POSIX_FADVISE) && !defined(HAVE_POSIX_FADVISE64)
+#if defined(HAVE_POSIX_FADVISE) && !defined(HAVE_POSIX_FADVISE64) || defined(__FreeBSD__)
#define posix_fadvise64 posix_fadvise
#endif
#ifdef HAVE_POSIX_FADVISE
@@ -1055,13 +1054,13 @@ static void do_fallocate(int fd, const char* onm, opt_
op->init_opos, to_falloc);
#ifdef HAVE_FALLOCATE64
else
- rc = fallocate64(fd, 1, op->init_opos, to_falloc);
+ rc = posix_fallocate(fd, op->init_opos, to_falloc);
#endif
#elif defined(HAVE_LIBFALLOCATE)
rc = linux_fallocate64(fd, FALLOC_FL_KEEP_SIZE,
op->init_opos, to_falloc);
#else /* HAVE_FALLOCATE64 */
- rc = fallocate64(fd, 1, op->init_opos, to_falloc);
+ rc = posix_fallocate(fd, op->init_opos, to_falloc);
#endif
if (rc)
fplog(stderr, WARN, "fallocate %s (%sk, %sk) failed: %s\n",

View File

@ -1,32 +0,0 @@
--- dd_rescue.c.orig 2023-02-23 21:51:27 UTC
+++ dd_rescue.c
@@ -116,6 +116,7 @@
#include "list.h"
#include "fmt_no.h"
#include "find_nonzero.h"
+#include "ffs.h"
#include "fstrim.h"
@@ -2730,7 +2731,9 @@ const char* retstrdupcat3(const char* dir, char dirsep
const char* retstrdupcat3(const char* dir, char dirsep, const char* inm)
{
- char* ibase = basename(strdupa(inm));
+ char* str = alloca(strlen(inm) + 1);
+ strcpy(str, inm);
+ char* ibase = basename(str);
const int dlen = strlen(dir) + (dirsep>0? 1: dirsep);
char* ret = (char*)malloc(dlen + strlen(inm) + 1);
strcpy(ret, dir);
@@ -2749,7 +2752,9 @@ const char* dirappfile(const char* onm, opt_t *op)
{
size_t oln = strlen(onm);
if (!strcmp(onm, ".")) {
- char* ret = strdup(basename(strdupa(op->iname)));
+ char* str = alloca(strlen(op->iname) + 1);
+ strcpy(str, op->iname);
+ char* ret = strdup(basename(str));
LISTAPPEND(freenames, ret, charp);
return ret;
}

View File

@ -1,11 +1,11 @@
--- ffs.h.orig 2023-02-23 21:51:27 UTC
--- ffs.h.orig 2024-08-22 17:41:01 UTC
+++ ffs.h
@@ -27,7 +27,15 @@
#ifdef HAVE_ENDIAN_H
#include <endian.h>
@@ -32,6 +32,16 @@
#include <sys/reg.h>
#endif
+#include <stdint.h>
+#include <stdint.h>
+
+#ifndef __WORDSIZE
+#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX)
+#define __WORDSIZE 64
@ -13,10 +13,11 @@
+#define __WORDSIZE 32
+#endif
+#endif
+
#ifdef HAVE_FFS
# define myffs(x) ffs(x)
@@ -54,12 +62,9 @@
# if __WORDSIZE == 32
@@ -57,12 +67,9 @@
# define myffsl(x) myffsl_c(x)
#endif
@ -30,7 +31,7 @@
//#ifndef HAVE_FFS
#ifdef NEED_FFSL_C
@@ -93,7 +98,7 @@ static int myffsl_c(unsigned long val)
@@ -96,7 +103,7 @@ static int myffsl_c(unsigned long val)
}
#endif
@ -39,7 +40,7 @@
/** Find last (highest) bit set in word val, returns a val b/w __WORDSIZE and 1, 0 if no bit is set */
static int myflsl(unsigned long val)
{
@@ -138,6 +143,8 @@ void probe_sse42();
@@ -141,6 +148,8 @@ void probe_sse42();
int myffs_sse42(unsigned long);
int myffsl_sse42(unsigned long);
void probe_sse42();

View File

@ -1,6 +1,6 @@
--- fiemap.c.orig 2015-04-15 08:56:38 UTC
--- fiemap.c.orig 2024-08-22 17:41:01 UTC
+++ fiemap.c
@@ -286,7 +286,6 @@ char* strippart(const char* partname)
@@ -288,7 +288,6 @@ char* strippart(const char* partname)
return _fulldevnm;
}

View File

@ -1,11 +1,10 @@
--- fmt_no.h.orig 2017-11-09 13:09:58 UTC
--- fmt_no.h.orig 2024-08-25 09:59:11 UTC
+++ fmt_no.h
@@ -4,6 +4,8 @@
#define _FMT_NO_H
#include <sys/types.h>
@@ -8,6 +8,7 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#include "ddr_ctrl.h"
+
char* fmt_int_b(unsigned char pre, unsigned char post, unsigned int scale,
loff_t no, const char* bold, const int blen,
const char* norm, const int nlen,

View File

@ -1,6 +1,6 @@
--- libddr_hash.c.orig 2021-04-14 08:23:02 UTC
--- libddr_hash.c.orig 2024-08-22 17:41:01 UTC
+++ libddr_hash.c
@@ -35,7 +35,7 @@
@@ -34,7 +34,7 @@
#include <fcntl.h>
#include <netinet/in.h> /* For ntohl/htonl */

View File

@ -0,0 +1,10 @@
--- libddr_lzo.c.orig 2024-08-22 17:41:01 UTC
+++ libddr_lzo.c
@@ -13,6 +13,7 @@
#define _LARGEFILE64_SOURCE 1
#define _FILE_OFFSET_BITS 64
+#include "config.h"
#include "ddr_plugin.h"
#include "ddr_ctrl.h"
#include "mybasename.h"

View File

@ -1,19 +0,0 @@
--- libddr_lzo.c.orig 2022-07-26 13:53:37 UTC
+++ libddr_lzo.c
@@ -13,6 +13,8 @@
#define _LARGEFILE64_SOURCE 1
#define _FILE_OFFSET_BITS 64
+#include "config.h"
+
#include "ddr_plugin.h"
#include "ddr_ctrl.h"
@@ -48,6 +50,7 @@
#error __WORDSIZE unknown
#endif
+#define HAVE_BASENAME 1
#ifdef HAVE_BASENAME
//char* basename(char*);
#else

View File

@ -1,11 +1,11 @@
--- pread64.h.orig 2015-04-15 08:56:38 UTC
--- pread64.h.orig 2024-08-25 11:50:36 UTC
+++ pread64.h
@@ -94,7 +94,7 @@ static inline ssize_t pread64(int fd, vo
{
return pread(fd, buf, sz, off);
}
-static inline ssize_t pwrite(int fd, const void *buf, size_t sz, loff_t off)
+static inline ssize_t pwrite64(int fd, const void *buf, size_t sz, loff_t off)
{
return pwrite(fd, buf, sz, off);
}
@@ -18,7 +18,7 @@
# include <sys/reg.h>
#endif
-#if !defined(HAVE_PREAD64) && __WORDSIZE == 64 && !defined(TEST_SYSCALL) && defined(HAVE_PREAD)
+#if defined(__FreeBSD__) || !defined(HAVE_PREAD64) && __WORDSIZE == 64 && !defined(TEST_SYSCALL) && defined(HAVE_PREAD)
#define pread64 pread
#define pwrite64 pwrite
#define HAVE_PREAD64

View File

@ -1,6 +1,6 @@
--- secmem.c.orig 2021-05-04 08:16:41 UTC
--- secmem.c.orig 2024-08-22 17:41:01 UTC
+++ secmem.c
@@ -10,6 +10,7 @@
@@ -11,6 +11,7 @@
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>

View File

@ -1,20 +0,0 @@
--- sha256.c.orig 2024-02-17 15:17:02 UTC
+++ sha256.c
@@ -108,7 +108,7 @@ void sha256_64(const uint8_t* msg, hash_t* ctx)
#endif
#endif
/* Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array: */
- for (int i = 16; i < 64; ++i) {
+ for (i = 16; i < 64; ++i) {
const uint32_t s0 = RIGHTROTATE(w[i-15], 7) ^ RIGHTROTATE(w[i-15], 18) ^ (w[i-15] >> 3);
const uint32_t s1 = RIGHTROTATE(w[i-2], 17) ^ RIGHTROTATE(w[i-2] , 19) ^ (w[i-2] >> 10);
w[i] = w[i-16] + s0 + w[i-7] + s1;
@@ -117,7 +117,7 @@ void sha256_64(const uint8_t* msg, hash_t* ctx)
uint32_t a = ctx->sha256_h[0], b = ctx->sha256_h[1], c = ctx->sha256_h[2], d = ctx->sha256_h[3];
uint32_t e = ctx->sha256_h[4], f = ctx->sha256_h[5], g = ctx->sha256_h[6], h = ctx->sha256_h[7];
/* Compression function main loop: */
- for (int i = 0; i < 64; ++i) {
+ for (i = 0; i < 64; ++i) {
const uint32_t S1 = RIGHTROTATE(e, 6) ^ RIGHTROTATE(e, 11) ^ RIGHTROTATE(e, 25);
//const uint32_t ch = (e & f) ^ ((~e) & g);
const uint32_t ch = g ^ (e & (f ^ g));

View File

@ -1,4 +1,4 @@
--- sha512.c.orig 2023-02-23 21:51:27 UTC
--- sha512.c.orig 2024-08-22 17:41:01 UTC
+++ sha512.c
@@ -13,13 +13,14 @@
#endif
@ -14,23 +14,5 @@
-#include <endian.h>
+#include <machine/endian.h>
/*
Note 1: All variables are 64 bit unsigned integers and addition is calculated modulo 2^64
@@ -138,7 +139,7 @@ void sha512_128(const uint8_t* msg, hash_t* ctx)
#endif
#endif
/* Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array: */
- for (int i = 16; i < 80; ++i) {
+ for (i = 16; i < 80; ++i) {
const uint64_t s0 = RIGHTROTATE(w[i-15], 1) ^ RIGHTROTATE(w[i-15], 8) ^ (w[i-15] >> 7);
const uint64_t s1 = RIGHTROTATE(w[i-2], 19) ^ RIGHTROTATE(w[i-2] ,61) ^ (w[i-2] >> 6);
w[i] = w[i-16] + s0 + w[i-7] + s1;
@@ -147,7 +148,7 @@ void sha512_128(const uint8_t* msg, hash_t* ctx)
uint64_t a = ctx->sha512_h[0], b = ctx->sha512_h[1], c = ctx->sha512_h[2], d = ctx->sha512_h[3];
uint64_t e = ctx->sha512_h[4], f = ctx->sha512_h[5], g = ctx->sha512_h[6], h = ctx->sha512_h[7];
/* Compression function main loop: */
- for (int i = 0; i < 80; ++i) {
+ for (i = 0; i < 80; ++i) {
const uint64_t S1 = RIGHTROTATE(e, 14) ^ RIGHTROTATE(e, 18) ^ RIGHTROTATE(e, 41);
//const uint64_t ch = (e & f) ^ ((~e) & g);
const uint64_t ch = g ^ (e & (f ^ g));
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>