aboutsummaryrefslogtreecommitdiff
path: root/sysutils/hdrecover
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2013-07-28 17:24:23 +0000
committerCy Schubert <cy@FreeBSD.org>2013-07-28 17:24:23 +0000
commit3626d99b5f88e9782ef5734bf6d0c95fc43c51f4 (patch)
tree3a92290f0889c03521bd245d2c100ae51cfbff60 /sysutils/hdrecover
parentc9bb38b87405c96fe6237e2de1fabf25ad5eedb8 (diff)
downloadports-3626d99b5f88e9782ef5734bf6d0c95fc43c51f4.tar.gz
ports-3626d99b5f88e9782ef5734bf6d0c95fc43c51f4.zip
Notes
Diffstat (limited to 'sysutils/hdrecover')
-rw-r--r--sysutils/hdrecover/Makefile3
-rw-r--r--sysutils/hdrecover/distinfo4
-rw-r--r--sysutils/hdrecover/files/patch-hdrecover.cpp64
3 files changed, 63 insertions, 8 deletions
diff --git a/sysutils/hdrecover/Makefile b/sysutils/hdrecover/Makefile
index 257aaa688cf5..d2c454a00a4c 100644
--- a/sysutils/hdrecover/Makefile
+++ b/sysutils/hdrecover/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= hdrecover
-PORTVERSION= 0.4
-PORTREVISION= 1
+PORTVERSION= 0.5
CATEGORIES= sysutils
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
diff --git a/sysutils/hdrecover/distinfo b/sysutils/hdrecover/distinfo
index f17c25ac1853..6f45924b1abb 100644
--- a/sysutils/hdrecover/distinfo
+++ b/sysutils/hdrecover/distinfo
@@ -1,2 +1,2 @@
-SHA256 (hdrecover-0.4.tar.gz) = 609a0755dbda744e3dc89bffd1c673fd5c370448aa43e426d90ff35faa74a20d
-SIZE (hdrecover-0.4.tar.gz) = 85409
+SHA256 (hdrecover-0.5.tar.gz) = 5daa11caaa8c597778a4a7a76b022372ddb315a90c527405972a2380668ad3f8
+SIZE (hdrecover-0.5.tar.gz) = 86486
diff --git a/sysutils/hdrecover/files/patch-hdrecover.cpp b/sysutils/hdrecover/files/patch-hdrecover.cpp
index 9f8f937632a7..ea82265f1c25 100644
--- a/sysutils/hdrecover/files/patch-hdrecover.cpp
+++ b/sysutils/hdrecover/files/patch-hdrecover.cpp
@@ -1,6 +1,6 @@
---- hdrecover.cpp.orig 2011-09-25 04:48:10.000000000 -0700
-+++ hdrecover.cpp 2012-06-29 16:02:39.000000000 -0700
-@@ -26,7 +26,11 @@
+--- hdrecover.cpp.orig 2013-07-27 04:37:04.000000000 -0700
++++ hdrecover.cpp 2013-07-28 08:04:06.970389678 -0700
+@@ -26,12 +26,20 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
@@ -12,7 +12,63 @@
#include <errno.h>
#include <string.h>
#include <time.h>
-@@ -260,7 +264,7 @@
+ #include <sys/ioctl.h>
++#ifdef __FreeBSD_cc_version
++static int secsize = 0; /* the sensed sector size */
++#else
+ #include <linux/fs.h>
++#endif
+
+ int badblocks = 0;
+ int recovered = 0;
+@@ -47,6 +55,34 @@
+
+ unsigned long long length = 0;
+
++#ifdef __FreeBSD_cc_version
++static ssize_t
++get_sec_size()
++{
++
++#define MAX_SEC_SIZE 2048 /* maximum section size that is supported */
++#define MIN_SEC_SIZE 512 /* the sector size to start sensing at */
++
++ char buf[MAX_SEC_SIZE];
++
++ lseek(fd, (0), 0);
++ if (secsize == 0)
++ for (secsize = MIN_SEC_SIZE; secsize <= MAX_SEC_SIZE;
++ secsize *= 2) {
++ /* try the read */
++ int size = read(fd, buf, secsize);
++ if (size == secsize)
++ /* it worked so return */
++ return secsize;
++ }
++ else
++ return read(fd, buf, secsize);
++
++ /* we failed to read at any of the sizes */
++ return -1;
++}
++#endif
++
+ int correctsector(unsigned long long sectornum)
+ {
+ int ret = 0;
+@@ -178,7 +214,11 @@
+ return 1;
+ }
+
++#ifdef __FreeBSD_cc_version
++ if ((phys_block_size = get_sec_size()) == -1) {
++#else
+ if (ioctl(fd, BLKPBSZGET, &phys_block_size) == -1) {
++#endif
+ printf("Failed to get physical block size of device\n");
+ return 1;
+ }
+@@ -268,7 +308,7 @@
sprintf(p, "%d seconds", remaining);
}
printf("Sector %Ld (%02d%%) ETR: %s\n",