added my Recipes
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
From 455001cb0112f7324ab50f555aa5ed5eae1bb93b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 16 Jan 2023 19:23:18 -0800
|
||||
Subject: [PATCH] Replace std::ptr_fun for c++17
|
||||
|
||||
std::ptr_fun was deprecated in C++11, and removed completely in C++17.
|
||||
Similarly, std::not1 is deprecated since C++17.
|
||||
|
||||
Modern compilers like clang >= 16 have started to notice it
|
||||
|
||||
src/FatUtils.h:41:46: error: use of undeclared identifier 'ptr_fun'
|
||||
| s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
|
||||
|
||||
Therefore replace ptr_fun with lambda
|
||||
|
||||
Also use 'unsigned char' parameter to std::isspace, for reason see [1]
|
||||
|
||||
[1] https://en.cppreference.com/w/cpp/string/byte/isspace#Notes
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/Gregwar/fatcat/pull/36]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/FatUtils.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/FatUtils.h b/src/FatUtils.h
|
||||
index 5080f2a..a8d69ee 100644
|
||||
--- a/src/FatUtils.h
|
||||
+++ b/src/FatUtils.h
|
||||
@@ -32,13 +32,13 @@ using namespace std;
|
||||
|
||||
// trim from start
|
||||
static inline string ltrim(string s) {
|
||||
- s.erase(s.begin(), find_if(s.begin(), s.end(), not1(ptr_fun<int, int>(isspace))));
|
||||
+ s.erase(s.begin(), find_if(s.begin(), s.end(), [](unsigned char c) {return !isspace(c);}));
|
||||
return s;
|
||||
}
|
||||
|
||||
// trim from end
|
||||
static inline string rtrim(string s) {
|
||||
- s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
|
||||
+ s.erase(find_if(s.rbegin(), s.rend(), [](unsigned char c) {return !isspace(c);}).base(), s.end());
|
||||
return s;
|
||||
}
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 14ef83291096e019ebc48040cf63530a2574a26d Mon Sep 17 00:00:00 2001
|
||||
From: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
Date: Sun, 19 Jan 2020 16:03:21 +0000
|
||||
Subject: [PATCH] Use unistd.h not argp.h for all POSIX systems
|
||||
|
||||
getopt(3) is found in unistd.h on all POSIX systems and we make no use
|
||||
of any of the GNU specific argp extensions. Include unistd.h directly to
|
||||
allow building with musl on linux, whilst retaining compatibility with
|
||||
glibc and other unices.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/Gregwar/fatcat/pull/34]
|
||||
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
---
|
||||
src/fatcat.cpp | 8 ++------
|
||||
1 file changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/fatcat.cpp b/src/fatcat.cpp
|
||||
index ce23ca07bb99..b4427e465bde 100644
|
||||
--- a/src/fatcat.cpp
|
||||
+++ b/src/fatcat.cpp
|
||||
@@ -1,14 +1,10 @@
|
||||
#include <stdlib.h>
|
||||
-#include<string.h>
|
||||
-#ifdef __APPLE__
|
||||
-#include <unistd.h>
|
||||
-#else
|
||||
+#include <string.h>
|
||||
#ifdef __WIN__
|
||||
#include <ctype.h>
|
||||
#include "xgetopt/xgetopt.h"
|
||||
#else
|
||||
-#include <argp.h>
|
||||
-#endif
|
||||
+#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -0,0 +1,71 @@
|
||||
From 0383fff94471278c92ef2ad5edc14abbb40a9acd Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 16 Dec 2022 18:54:55 -0800
|
||||
Subject: [PATCH] Enable 64bit off_t
|
||||
|
||||
Ensure that off_t is always 64-bit by specifying -D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64 this will ensure that normal lseek() function is
|
||||
same as lseek64
|
||||
|
||||
This helps compiling on latest musl where lseek64 and friends are not
|
||||
available
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/Gregwar/fatcat/pull/34]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 2 ++
|
||||
src/core/FatSystem.cpp | 4 ++--
|
||||
src/core/FatSystem.h | 2 --
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d6a2649..4cdd1fb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -34,6 +34,8 @@ IF(DEFINE_WIN)
|
||||
add_definitions(-D__WIN__)
|
||||
ENDIF(DEFINE_WIN)
|
||||
|
||||
+add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)
|
||||
+
|
||||
include_directories("${CMAKE_SOURCE_DIR}/src")
|
||||
|
||||
add_executable(fatcat "src/fatcat.cpp" ${ALL_SOURCES})
|
||||
diff --git a/src/core/FatSystem.cpp b/src/core/FatSystem.cpp
|
||||
index 79cda8c..1f52e82 100644
|
||||
--- a/src/core/FatSystem.cpp
|
||||
+++ b/src/core/FatSystem.cpp
|
||||
@@ -90,7 +90,7 @@ int FatSystem::readData(unsigned long long address, char *buffer, int size)
|
||||
cerr << "! Trying to read outside the disk" << endl;
|
||||
}
|
||||
|
||||
- lseek64(fd, globalOffset+address, SEEK_SET);
|
||||
+ lseek(fd, globalOffset+address, SEEK_SET);
|
||||
|
||||
int n;
|
||||
int pos = 0;
|
||||
@@ -112,7 +112,7 @@ int FatSystem::writeData(unsigned long long address, const char *buffer, int siz
|
||||
throw string("Trying to write data while write mode is disabled");
|
||||
}
|
||||
|
||||
- lseek64(fd, globalOffset+address, SEEK_SET);
|
||||
+ lseek(fd, globalOffset+address, SEEK_SET);
|
||||
|
||||
int n;
|
||||
int pos = 0;
|
||||
diff --git a/src/core/FatSystem.h b/src/core/FatSystem.h
|
||||
index cd3c914..f9f2ca3 100644
|
||||
--- a/src/core/FatSystem.h
|
||||
+++ b/src/core/FatSystem.h
|
||||
@@ -11,11 +11,9 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define O_LARGEFILE 0
|
||||
-#define lseek64 lseek
|
||||
#endif
|
||||
#ifdef __WIN__
|
||||
#define O_LARGEFILE 0
|
||||
-#define lseek64 lseek
|
||||
#endif
|
||||
using namespace std;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
SUMMARY = "FAT filesystems explore, extract, repair, and forensic tool"
|
||||
DESCRIPTION = "This tool is designed to manipulate FAT filesystems, in order to \
|
||||
explore, extract, repair, recover and forensic them. It currently supports \
|
||||
FAT12, FAT16 and FAT32."
|
||||
HOMEPAGE = "https://github.com/Gregwar/fatcat"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=57fbbfebd0dd1d6ff21b8cecb552a03f"
|
||||
|
||||
SRC_URI = "git://github.com/Gregwar/fatcat.git;branch=master;protocol=https \
|
||||
file://0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch \
|
||||
file://0002-Enable-64bit-off_t.patch \
|
||||
file://0001-Replace-std-ptr_fun-for-c-17.patch \
|
||||
"
|
||||
|
||||
SRCREV = "99cb99fc86eb1601ac7ae27f5bba23add04d2543"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit cmake
|
||||
Reference in New Issue
Block a user