mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-02-27 00:10:29 +00:00
removed aur/par2cmdline, now tracked in [community] upstream
This commit is contained in:
parent
854d71a5a4
commit
1f1e538489
15 changed files with 0 additions and 870 deletions
|
@ -1,59 +0,0 @@
|
||||||
--- a/diskfile.cpp
|
|
||||||
+++ b/diskfile.cpp
|
|
||||||
@@ -340,7 +340,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
|
|
||||||
return matches;
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
+u64 DiskFile::GetFileSize(string filename)
|
|
||||||
+{
|
|
||||||
+ struct _stati64 st;
|
|
||||||
+ if ((0 == _stati64(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
||||||
+ {
|
|
||||||
+ return st.st_size;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -689,6 +700,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
|
|
||||||
return matches;
|
|
||||||
}
|
|
||||||
|
|
||||||
+u64 DiskFile::GetFileSize(string filename)
|
|
||||||
+{
|
|
||||||
+ struct stat st;
|
|
||||||
+ if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
||||||
+ {
|
|
||||||
+ return st.st_size;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -802,18 +825,6 @@ bool DiskFile::FileExists(string filename)
|
|
||||||
return ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)));
|
|
||||||
}
|
|
||||||
|
|
||||||
-u64 DiskFile::GetFileSize(string filename)
|
|
||||||
-{
|
|
||||||
- struct stat st;
|
|
||||||
- if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
||||||
- {
|
|
||||||
- return st.st_size;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
--- a/par1repairer.cpp
|
|
||||||
+++ b/par1repairer.cpp
|
|
||||||
@@ -710,7 +710,13 @@ bool Par1Repairer::VerifyDataFile(DiskFile *diskfile, Par1RepairerSourceFile *so
|
|
||||||
u64 filesize = diskfile->FileSize();
|
|
||||||
|
|
||||||
if (filesize == 0)
|
|
||||||
+ {
|
|
||||||
+ if (noiselevel > CommandLine::nlSilent)
|
|
||||||
+ {
|
|
||||||
+ cout << "Target: \"" << name << "\" - empty." << endl;
|
|
||||||
+ }
|
|
||||||
return true;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
// Search for the first file that is the correct size
|
|
||||||
vector<Par1RepairerSourceFile*>::iterator sourceiterator = sourcefiles.begin();
|
|
||||||
--- a/par2repairer.cpp
|
|
||||||
+++ b/par2repairer.cpp
|
|
||||||
@@ -1415,17 +1415,28 @@ bool Par2Repairer::ScanDataFile(DiskFile *diskfile, // [in]
|
|
||||||
|
|
||||||
matchtype = eNoMatch;
|
|
||||||
|
|
||||||
+ string path;
|
|
||||||
+ string name;
|
|
||||||
+ DiskFile::SplitFilename(diskfile->FileName(), path, name);
|
|
||||||
+
|
|
||||||
// Is the file empty
|
|
||||||
if (diskfile->FileSize() == 0)
|
|
||||||
{
|
|
||||||
// If the file is empty, then just return
|
|
||||||
+ if (noiselevel > CommandLine::nlSilent)
|
|
||||||
+ {
|
|
||||||
+ if (originalsourcefile != 0)
|
|
||||||
+ {
|
|
||||||
+ cout << "Target: \"" << name << "\" - empty." << endl;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ cout << "File: \"" << name << "\" - empty." << endl;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- string path;
|
|
||||||
- string name;
|
|
||||||
- DiskFile::SplitFilename(diskfile->FileName(), path, name);
|
|
||||||
-
|
|
||||||
string shortname;
|
|
||||||
if (name.size() > 56)
|
|
||||||
{
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- a/par2creatorsourcefile.cpp
|
|
||||||
+++ b/par2creatorsourcefile.cpp
|
|
||||||
@@ -319,7 +319,7 @@ void Par2CreatorSourceFile::UpdateHashes(u32 blocknumber, const void *buffer, si
|
|
||||||
|
|
||||||
|
|
||||||
// Update the full file hash, but don't go beyond the end of the file
|
|
||||||
- if (length > filesize - blocknumber * length)
|
|
||||||
+ if ((u64)length > filesize - blocknumber * (u64)length)
|
|
||||||
{
|
|
||||||
length = (size_t)(filesize - blocknumber * (u64)length);
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
--- a/par2creatorsourcefile.cpp
|
|
||||||
+++ b/par2creatorsourcefile.cpp
|
|
||||||
@@ -224,6 +224,10 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma
|
|
||||||
cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ offset += want;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Did we finish the last block
|
|
|
@ -1,59 +0,0 @@
|
||||||
--- a/commandline.cpp
|
|
||||||
+++ b/commandline.cpp
|
|
||||||
@@ -642,30 +642,34 @@ bool CommandLine::Parse(int argc, char *argv[])
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- // All other files must exist
|
|
||||||
+ // Originally, all specified files were supposed to exist, or the program
|
|
||||||
+ // would stop with an error message. This was not practical, for example in
|
|
||||||
+ // a directory with files appearing and disappearing (an active download directory).
|
|
||||||
+ // So the new rule is: when a specified file doesn't exist, it is silently skipped.
|
|
||||||
if (!DiskFile::FileExists(filename))
|
|
||||||
{
|
|
||||||
- cerr << "The source file does not exist: " << filename << endl;
|
|
||||||
- return false;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- u64 filesize = DiskFile::GetFileSize(filename);
|
|
||||||
-
|
|
||||||
- // Ignore all 0 byte files
|
|
||||||
- if (filesize > 0)
|
|
||||||
- {
|
|
||||||
- extrafiles.push_back(ExtraFile(filename, filesize));
|
|
||||||
-
|
|
||||||
- // track the total size of the source files and how
|
|
||||||
- // big the largest one is.
|
|
||||||
- totalsourcesize += filesize;
|
|
||||||
- if (largestsourcesize < filesize)
|
|
||||||
- largestsourcesize = filesize;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- cout << "Skipping 0 byte file: " << filename << endl;
|
|
||||||
- }
|
|
||||||
+ cout << "Ignoring non-existent source file: " << filename << endl;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ u64 filesize = DiskFile::GetFileSize(filename);
|
|
||||||
+
|
|
||||||
+ // Ignore all 0 byte files
|
|
||||||
+ if (filesize > 0)
|
|
||||||
+ {
|
|
||||||
+ extrafiles.push_back(ExtraFile(filename, filesize));
|
|
||||||
+
|
|
||||||
+ // track the total size of the source files and how
|
|
||||||
+ // big the largest one is.
|
|
||||||
+ totalsourcesize += filesize;
|
|
||||||
+ if (largestsourcesize < filesize)
|
|
||||||
+ largestsourcesize = filesize;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ cout << "Skipping 0 byte file: " << filename << endl;
|
|
||||||
+ }
|
|
||||||
+ } //end file exists
|
|
||||||
}
|
|
||||||
|
|
||||||
++fn;
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/par2creatorsourcefile.cpp
|
|
||||||
+++ b/par2creatorsourcefile.cpp
|
|
||||||
@@ -213,21 +213,22 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Define MPDL to skip reporting; speeds up things considerably
|
|
||||||
+#ifndef MPDL
|
|
||||||
if (noiselevel > CommandLine::nlQuiet)
|
|
||||||
{
|
|
||||||
// Display progress
|
|
||||||
u32 oldfraction = (u32)(1000 * offset / filesize);
|
|
||||||
- offset += want;
|
|
||||||
- u32 newfraction = (u32)(1000 * offset / filesize);
|
|
||||||
+ // The original source had here: offset += want;
|
|
||||||
+ // That's definitely an error, because offset must always be incremented!
|
|
||||||
+ u32 newfraction = (u32)(1000 * (offset + want) / filesize);
|
|
||||||
if (oldfraction != newfraction)
|
|
||||||
{
|
|
||||||
cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- offset += want;
|
|
||||||
- }
|
|
||||||
+#endif
|
|
||||||
+ offset += want;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Did we finish the last block
|
|
|
@ -1,152 +0,0 @@
|
||||||
--- a/reedsolomon.cpp
|
|
||||||
+++ b/reedsolomon.cpp
|
|
||||||
@@ -51,7 +51,7 @@ u32 gcd(u32 a, u32 b)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
|
|
||||||
+template<> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
|
|
||||||
{
|
|
||||||
inputcount = (u32)present.size();
|
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-bool ReedSolomon<Galois8>::SetInput(u32 count)
|
|
||||||
+template<> bool ReedSolomon<Galois8>::SetInput(u32 count)
|
|
||||||
{
|
|
||||||
inputcount = count;
|
|
||||||
|
|
||||||
@@ -101,15 +101,8 @@ bool ReedSolomon<Galois8>::SetInput(u32 count)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
|
|
||||||
+template<> bool ReedSolomon<Galois8>::InternalProcess(const Galois8 &factor, size_t size, const void *inputbuffer, void *outputbuffer)
|
|
||||||
{
|
|
||||||
- // Look up the appropriate element in the RS matrix
|
|
||||||
- Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex];
|
|
||||||
-
|
|
||||||
- // Do nothing if the factor happens to be 0
|
|
||||||
- if (factor == 0)
|
|
||||||
- return eSuccess;
|
|
||||||
-
|
|
||||||
#ifdef LONGMULTIPLY
|
|
||||||
// The 8-bit long multiplication tables
|
|
||||||
Galois8 *table = glmt->tables;
|
|
||||||
@@ -189,7 +182,7 @@ bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inpu
|
|
||||||
|
|
||||||
// Set which of the source files are present and which are missing
|
|
||||||
// and compute the base values to use for the vandermonde matrix.
|
|
||||||
-bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
|
|
||||||
+template<> bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
|
|
||||||
{
|
|
||||||
inputcount = (u32)present.size();
|
|
||||||
|
|
||||||
@@ -233,7 +226,7 @@ bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
|
|
||||||
|
|
||||||
// Record that the specified number of source files are all present
|
|
||||||
// and compute the base values to use for the vandermonde matrix.
|
|
||||||
-bool ReedSolomon<Galois16>::SetInput(u32 count)
|
|
||||||
+template<> bool ReedSolomon<Galois16>::SetInput(u32 count)
|
|
||||||
{
|
|
||||||
inputcount = count;
|
|
||||||
|
|
||||||
@@ -267,15 +260,8 @@ bool ReedSolomon<Galois16>::SetInput(u32 count)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
|
|
||||||
+template<> bool ReedSolomon<Galois16>::InternalProcess(const Galois16 &factor, size_t size, const void *inputbuffer, void *outputbuffer)
|
|
||||||
{
|
|
||||||
- // Look up the appropriate element in the RS matrix
|
|
||||||
-
|
|
||||||
- Galois16 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex];
|
|
||||||
- // Do nothing if the factor happens to be 0
|
|
||||||
- if (factor == 0)
|
|
||||||
- return eSuccess;
|
|
||||||
-
|
|
||||||
#ifdef LONGMULTIPLY
|
|
||||||
// The 8-bit long multiplication tables
|
|
||||||
Galois16 *table = glmt->tables;
|
|
||||||
--- a/reedsolomon.h
|
|
||||||
+++ b/reedsolomon.h
|
|
||||||
@@ -64,7 +64,8 @@ public:
|
|
||||||
const void *inputbuffer, // Buffer containing input data
|
|
||||||
u32 outputindex, // The row in the RS matrix
|
|
||||||
void *outputbuffer); // Buffer containing output data
|
|
||||||
-
|
|
||||||
+private:
|
|
||||||
+ bool InternalProcess(const g &factor, size_t size, const void *inputbuffer, void *outputbuffer); // Optimization
|
|
||||||
protected:
|
|
||||||
// Perform Gaussian Elimination
|
|
||||||
bool GaussElim(CommandLine::NoiseLevel noiselevel,
|
|
||||||
@@ -146,6 +147,20 @@ inline ReedSolomon<g>::~ReedSolomon(void)
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
+template<class g>
|
|
||||||
+inline bool ReedSolomon<g>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
|
|
||||||
+{
|
|
||||||
+ // Optimization: it occurs frequently the function exits early on, so inline the start.
|
|
||||||
+ // This resulted in a speed gain of approx. 8% in repairing.
|
|
||||||
+
|
|
||||||
+ // Look up the appropriate element in the RS matrix
|
|
||||||
+ g factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex];
|
|
||||||
+ // Do nothing if the factor happens to be 0
|
|
||||||
+ if (factor == 0)
|
|
||||||
+ return eSuccess;
|
|
||||||
+ return this->InternalProcess (factor, size, inputbuffer, outputbuffer);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
u32 gcd(u32 a, u32 b);
|
|
||||||
|
|
||||||
// Record whether the recovery block with the specified
|
|
||||||
@@ -242,11 +257,14 @@ inline bool ReedSolomon<g>::Compute(CommandLine::NoiseLevel noiselevel)
|
|
||||||
// One row for each present recovery block that will be used for a missing data block
|
|
||||||
for (unsigned int row=0; row<datamissing; row++)
|
|
||||||
{
|
|
||||||
+ // Define MPDL to skip reporting and speed things up
|
|
||||||
+#ifndef MPDL
|
|
||||||
if (noiselevel > CommandLine::nlQuiet)
|
|
||||||
{
|
|
||||||
int progress = row * 1000 / (datamissing+parmissing);
|
|
||||||
cout << "Constructing: " << progress/10 << '.' << progress%10 << "%\r" << flush;
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
// Get the exponent of the next present recovery block
|
|
||||||
while (!outputrow->present)
|
|
||||||
@@ -286,11 +304,14 @@ inline bool ReedSolomon<g>::Compute(CommandLine::NoiseLevel noiselevel)
|
|
||||||
outputrow = outputrows.begin();
|
|
||||||
for (unsigned int row=0; row<parmissing; row++)
|
|
||||||
{
|
|
||||||
+ // Define MPDL to skip reporting and speed things up
|
|
||||||
+#ifndef MPDL
|
|
||||||
if (noiselevel > CommandLine::nlQuiet)
|
|
||||||
{
|
|
||||||
int progress = (row+datamissing) * 1000 / (datamissing+parmissing);
|
|
||||||
cout << "Constructing: " << progress/10 << '.' << progress%10 << "%\r" << flush;
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
// Get the exponent of the next missing recovery block
|
|
||||||
while (outputrow->present)
|
|
||||||
@@ -420,6 +441,8 @@ inline bool ReedSolomon<g>::GaussElim(CommandLine::NoiseLevel noiselevel, unsign
|
|
||||||
// For every other row in the matrix
|
|
||||||
for (unsigned int row2=0; row2<rows; row2++)
|
|
||||||
{
|
|
||||||
+ // Define MPDL to skip reporting and speed things up
|
|
||||||
+#ifndef MPDL
|
|
||||||
if (noiselevel > CommandLine::nlQuiet)
|
|
||||||
{
|
|
||||||
int newprogress = (row*rows+row2) * 1000 / (datamissing*rows);
|
|
||||||
@@ -429,6 +452,7 @@ inline bool ReedSolomon<g>::GaussElim(CommandLine::NoiseLevel noiselevel, unsign
|
|
||||||
cout << "Solving: " << progress/10 << '.' << progress%10 << "%\r" << flush;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (row != row2)
|
|
||||||
{
|
|
|
@ -1,34 +0,0 @@
|
||||||
--- a/commandline.cpp
|
|
||||||
+++ b/commandline.cpp
|
|
||||||
@@ -537,21 +537,18 @@ bool CommandLine::Parse(int argc, char *argv[])
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list<string> *filenames;
|
|
||||||
+ filenames = new list<string>;
|
|
||||||
|
|
||||||
- // If the argument includes wildcard characters,
|
|
||||||
- // search the disk for matching files
|
|
||||||
- if (strchr(argv[0], '*') || strchr(argv[0], '?'))
|
|
||||||
+ if (argv[0][0] == '-')
|
|
||||||
{
|
|
||||||
- string path;
|
|
||||||
- string name;
|
|
||||||
- DiskFile::SplitFilename(argv[0], path, name);
|
|
||||||
-
|
|
||||||
- filenames = DiskFile::FindFiles(path, name);
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- filenames = new list<string>;
|
|
||||||
- filenames->push_back(argv[0]);
|
|
||||||
+ while(true)
|
|
||||||
+ {
|
|
||||||
+ string filename;
|
|
||||||
+ if (std::getline(cin, filename))
|
|
||||||
+ filenames->push_back(filename);
|
|
||||||
+ else
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
list<string>::iterator fn = filenames->begin();
|
|
|
@ -1,20 +0,0 @@
|
||||||
--- a/commandline.cpp
|
|
||||||
+++ b/commandline.cpp
|
|
||||||
@@ -539,7 +539,7 @@ bool CommandLine::Parse(int argc, char *argv[])
|
|
||||||
list<string> *filenames;
|
|
||||||
filenames = new list<string>;
|
|
||||||
|
|
||||||
- if (argv[0][0] == '-')
|
|
||||||
+ if (argv[0][0] == '-' && argv[0][1] == '\0')
|
|
||||||
{
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
@@ -550,6 +550,8 @@ bool CommandLine::Parse(int argc, char *argv[])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ else
|
|
||||||
+ filenames->push_back(argv[0]);
|
|
||||||
|
|
||||||
list<string>::iterator fn = filenames->begin();
|
|
||||||
while (fn != filenames->end())
|
|
|
@ -1,69 +0,0 @@
|
||||||
--- a/md5.h
|
|
||||||
+++ b/md5.h
|
|
||||||
@@ -20,6 +20,13 @@
|
|
||||||
#ifndef __MD5_H__
|
|
||||||
#define __MD5_H__
|
|
||||||
|
|
||||||
+#ifdef WIN32
|
|
||||||
+#pragma pack(push, 1)
|
|
||||||
+#define PACKED
|
|
||||||
+#else
|
|
||||||
+#define PACKED __attribute__ ((packed))
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
// This file defines the MD5Hash and MD5Context objects which are used
|
|
||||||
// to compute and manipulate the MD5 Hash values for a block of data.
|
|
||||||
|
|
||||||
@@ -35,12 +42,11 @@
|
|
||||||
|
|
||||||
// MD5 Hash value
|
|
||||||
|
|
||||||
-class MD5Hash
|
|
||||||
-{
|
|
||||||
-public:
|
|
||||||
- // Constructor does not initialise the value
|
|
||||||
- MD5Hash(void) {};
|
|
||||||
+struct MD5Hash;
|
|
||||||
+ostream& operator<<(ostream &s, const MD5Hash &hash);
|
|
||||||
|
|
||||||
+struct MD5Hash
|
|
||||||
+{
|
|
||||||
// Comparison operators
|
|
||||||
bool operator==(const MD5Hash &other) const;
|
|
||||||
bool operator!=(const MD5Hash &other) const;
|
|
||||||
@@ -54,13 +60,8 @@ public:
|
|
||||||
friend ostream& operator<<(ostream &s, const MD5Hash &hash);
|
|
||||||
string print(void) const;
|
|
||||||
|
|
||||||
- // Copy and assignment
|
|
||||||
- MD5Hash(const MD5Hash &other);
|
|
||||||
- MD5Hash& operator=(const MD5Hash &other);
|
|
||||||
-
|
|
||||||
-public:
|
|
||||||
u8 hash[16]; // 16 byte MD5 Hash value
|
|
||||||
-};
|
|
||||||
+} PACKED;
|
|
||||||
|
|
||||||
// Intermediate computation state
|
|
||||||
|
|
||||||
@@ -144,16 +145,9 @@ inline bool MD5Hash::operator<=(const MD5Hash &other) const
|
|
||||||
return !other.operator<(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
-inline MD5Hash::MD5Hash(const MD5Hash &other)
|
|
||||||
-{
|
|
||||||
- memcpy(&hash, &other.hash, sizeof(hash));
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline MD5Hash& MD5Hash::operator=(const MD5Hash &other)
|
|
||||||
-{
|
|
||||||
- memcpy(&hash, &other.hash, sizeof(hash));
|
|
||||||
-
|
|
||||||
- return *this;
|
|
||||||
-}
|
|
||||||
+#ifdef WIN32
|
|
||||||
+#pragma pack(pop)
|
|
||||||
+#endif
|
|
||||||
+#undef PACKED
|
|
||||||
|
|
||||||
#endif // __MD5_H__
|
|
|
@ -1,148 +0,0 @@
|
||||||
--- a/letype.h
|
|
||||||
+++ b/letype.h
|
|
||||||
@@ -28,44 +28,15 @@ typedef u64 leu64;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
-class leu16
|
|
||||||
+struct leu16
|
|
||||||
{
|
|
||||||
-public:
|
|
||||||
- leu16(void);
|
|
||||||
-
|
|
||||||
- leu16(const leu16 &other);
|
|
||||||
- leu16& operator=(const leu16 &other);
|
|
||||||
-
|
|
||||||
- leu16(const u16 &other);
|
|
||||||
leu16& operator=(const u16 &other);
|
|
||||||
|
|
||||||
operator u16(void) const;
|
|
||||||
|
|
||||||
-protected:
|
|
||||||
u16 value;
|
|
||||||
};
|
|
||||||
|
|
||||||
-inline leu16::leu16(void)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu16::leu16(const leu16 &other)
|
|
||||||
-: value(other.value)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu16& leu16::operator =(const leu16 &other)
|
|
||||||
-{
|
|
||||||
- value = other.value;
|
|
||||||
- return *this;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu16::leu16(const u16 &other)
|
|
||||||
-{
|
|
||||||
- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
inline leu16& leu16::operator=(const u16 &other)
|
|
||||||
{
|
|
||||||
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
||||||
@@ -81,46 +52,15 @@ inline leu16::operator u16(void) const
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-class leu32
|
|
||||||
+struct leu32
|
|
||||||
{
|
|
||||||
-public:
|
|
||||||
- leu32(void);
|
|
||||||
-
|
|
||||||
- leu32(const leu32 &other);
|
|
||||||
- leu32& operator=(const leu32 &other);
|
|
||||||
-
|
|
||||||
- leu32(const u32 &other);
|
|
||||||
leu32& operator=(const u32 &other);
|
|
||||||
|
|
||||||
operator u32(void) const;
|
|
||||||
|
|
||||||
-protected:
|
|
||||||
u32 value;
|
|
||||||
};
|
|
||||||
|
|
||||||
-inline leu32::leu32(void)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu32::leu32(const leu32 &other)
|
|
||||||
-: value(other.value)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu32& leu32::operator =(const leu32 &other)
|
|
||||||
-{
|
|
||||||
- value = other.value;
|
|
||||||
- return *this;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu32::leu32(const u32 &other)
|
|
||||||
-{
|
|
||||||
- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
inline leu32& leu32::operator=(const u32 &other)
|
|
||||||
{
|
|
||||||
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
||||||
@@ -140,50 +80,15 @@ inline leu32::operator u32(void) const
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-class leu64
|
|
||||||
+struct leu64
|
|
||||||
{
|
|
||||||
-public:
|
|
||||||
- leu64(void);
|
|
||||||
-
|
|
||||||
- leu64(const leu64 &other);
|
|
||||||
- leu64& operator=(const leu64 &other);
|
|
||||||
-
|
|
||||||
- leu64(const u64 &other);
|
|
||||||
leu64& operator=(const u64 &other);
|
|
||||||
|
|
||||||
operator u64(void) const;
|
|
||||||
|
|
||||||
-protected:
|
|
||||||
u64 value;
|
|
||||||
};
|
|
||||||
|
|
||||||
-inline leu64::leu64(void)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu64::leu64(const leu64 &other)
|
|
||||||
-: value(other.value)
|
|
||||||
-{
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu64& leu64::operator =(const leu64 &other)
|
|
||||||
-{
|
|
||||||
- value = other.value;
|
|
||||||
- return *this;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-inline leu64::leu64(const u64 &other)
|
|
||||||
-{
|
|
||||||
- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[4] = (unsigned char)((other >> 32) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[5] = (unsigned char)((other >> 40) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[6] = (unsigned char)((other >> 48) & 0xff);
|
|
||||||
- ((unsigned char*)&value)[7] = (unsigned char)((other >> 56) & 0xff);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
inline leu64& leu64::operator=(const u64 &other)
|
|
||||||
{
|
|
||||||
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
|
|
|
@ -1,22 +0,0 @@
|
||||||
--- a/par2cmdline.h
|
|
||||||
+++ b/par2cmdline.h
|
|
||||||
@@ -132,6 +132,10 @@ typedef unsigned int u32;
|
|
||||||
typedef unsigned long long u64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+// FIXME: this is not done right w/ autoconf
|
|
||||||
+#include <sys/ioctl.h>
|
|
||||||
+#include <sys/mount.h>
|
|
||||||
+
|
|
||||||
#if HAVE_SYS_STAT_H
|
|
||||||
# include <sys/stat.h>
|
|
||||||
#endif
|
|
||||||
@@ -179,6 +183,8 @@ typedef unsigned long long u64;
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
+#include <sys/ioctl.h>
|
|
||||||
+#include <sys/mount.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
--- a/Makefile.am
|
|
||||||
+++ b/Makefile.am
|
|
||||||
@@ -55,9 +55,9 @@ EXTRA_DIST = PORTING ROADMAP par2cmdline.sln par2cmdline.vcproj \
|
|
||||||
TESTS = pretest test1 test2 test3 test4 test5 test6 posttest
|
|
||||||
|
|
||||||
install-exec-hook :
|
|
||||||
- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT)
|
|
||||||
- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2verify$(EXEEXT)
|
|
||||||
- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2repair$(EXEEXT)
|
|
||||||
+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT)
|
|
||||||
+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2verify$(EXEEXT)
|
|
||||||
+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2repair$(EXEEXT)
|
|
||||||
|
|
||||||
uninstall-hook :
|
|
||||||
rm -f $(DESTDIR)$(bindir)/par2create$(EXEEXT)
|
|
|
@ -1,106 +0,0 @@
|
||||||
--- a/verificationhashtable.h 2003-06-03 13:48:52.000000000 +0200
|
|
||||||
+++ b/verificationhashtable.h.new 2010-02-10 20:48:50.425580166 +0100
|
|
||||||
@@ -66,11 +66,11 @@ public:
|
|
||||||
// Comparison operators for searching
|
|
||||||
bool operator <(const VerificationHashEntry &r) const
|
|
||||||
{
|
|
||||||
- return crc < r.crc || crc == r.crc && hash < r.hash;
|
|
||||||
+ return crc < r.crc || ( crc == r.crc && hash < r.hash );
|
|
||||||
}
|
|
||||||
bool operator >(const VerificationHashEntry &r) const
|
|
||||||
{
|
|
||||||
- return crc > r.crc || crc == r.crc && hash > r.hash;
|
|
||||||
+ return crc > r.crc || ( crc == r.crc && hash > r.hash );
|
|
||||||
}
|
|
||||||
bool operator ==(const VerificationHashEntry &r) const
|
|
||||||
{
|
|
||||||
@@ -183,11 +183,11 @@ inline const VerificationHashEntry* Veri
|
|
||||||
|
|
||||||
while (entry)
|
|
||||||
{
|
|
||||||
- if (entry->crc < crc || entry->crc == crc && entry->hash < hash)
|
|
||||||
+ if (entry->crc < crc || ( entry->crc == crc && entry->hash < hash ) )
|
|
||||||
{
|
|
||||||
entry = entry->right;
|
|
||||||
}
|
|
||||||
- else if (entry->crc > crc || entry->crc == crc && entry->hash > hash)
|
|
||||||
+ else if (entry->crc > crc || ( entry->crc == crc && entry->hash > hash ) )
|
|
||||||
{
|
|
||||||
entry = entry->left;
|
|
||||||
}
|
|
||||||
@@ -402,14 +402,14 @@ inline const VerificationHashEntry* Veri
|
|
||||||
// have already been matched, or ones that are the wrong length
|
|
||||||
while (currententry && (currententry->SourceFile() != sourcefile ||
|
|
||||||
currententry->IsSet() ||
|
|
||||||
- checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength()
|
|
||||||
+ ( checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// If we found an unused entry (which was presumably for the wrong
|
|
||||||
// source file) remember it (providing it is the correct length).
|
|
||||||
- if (0 == nextentry && !(currententry->IsSet() ||
|
|
||||||
- checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength()
|
|
||||||
+ if ( ( ( 0 == nextentry && !(currententry->IsSet() ) ) ||
|
|
||||||
+ ( checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
@@ -425,8 +425,8 @@ inline const VerificationHashEntry* Veri
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for an unused entry which is the correct length
|
|
||||||
- while (nextentry && (nextentry->IsSet() ||
|
|
||||||
- checksummer.ShortBlock() && checksummer.BlockLength() != nextentry->GetDataBlock()->GetLength()
|
|
||||||
+ while ( ( ( nextentry && (nextentry->IsSet() ) ) ||
|
|
||||||
+ ( checksummer.ShortBlock() && checksummer.BlockLength() != nextentry->GetDataBlock()->GetLength() )
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
--- a/par1repairer.cpp 2004-04-15 15:40:48.000000000 +0200
|
|
||||||
+++ b/par1repairer.cpp.new 2010-02-10 21:04:43.288702325 +0100
|
|
||||||
@@ -324,7 +324,7 @@ bool Par1Repairer::LoadRecoveryFile(stri
|
|
||||||
||
|
|
||||||
(fileheader.datasize && (fileheader.dataoffset < sizeof(fileheader) || fileheader.dataoffset + fileheader.datasize > filesize))
|
|
||||||
||
|
|
||||||
- (fileheader.datasize && (fileheader.filelistoffset <= fileheader.dataoffset && fileheader.dataoffset < fileheader.filelistoffset+fileheader.filelistsize || fileheader.dataoffset <= fileheader.filelistoffset && fileheader.filelistoffset < fileheader.dataoffset + fileheader.datasize)))
|
|
||||||
+ (fileheader.datasize && ( ( fileheader.filelistoffset <= fileheader.dataoffset && fileheader.dataoffset < fileheader.filelistoffset+fileheader.filelistsize ) || ( fileheader.dataoffset <= fileheader.filelistoffset && fileheader.filelistoffset < fileheader.dataoffset + fileheader.datasize ) )))
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Check the size of the file list
|
|
||||||
@@ -518,9 +518,9 @@ bool Par1Repairer::LoadOtherRecoveryFile
|
|
||||||
// Check the the file extension is the correct form
|
|
||||||
if ((tail[0] == 'P' || tail[0] == 'p') &&
|
|
||||||
(
|
|
||||||
- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r')
|
|
||||||
+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') )
|
|
||||||
||
|
|
||||||
- isdigit(tail[1]) && isdigit(tail[2])
|
|
||||||
+ ( isdigit(tail[1]) && isdigit(tail[2]) )
|
|
||||||
))
|
|
||||||
{
|
|
||||||
LoadRecoveryFile(filename);
|
|
||||||
@@ -549,9 +549,9 @@ bool Par1Repairer::LoadExtraRecoveryFile
|
|
||||||
// Check the the file extension is the correct form
|
|
||||||
if ((tail[0] == 'P' || tail[0] == 'p') &&
|
|
||||||
(
|
|
||||||
- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r')
|
|
||||||
+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') )
|
|
||||||
||
|
|
||||||
- isdigit(tail[1]) && isdigit(tail[2])
|
|
||||||
+ ( isdigit(tail[1]) && isdigit(tail[2]) )
|
|
||||||
))
|
|
||||||
{
|
|
||||||
LoadRecoveryFile(filename);
|
|
||||||
@@ -652,9 +652,9 @@ bool Par1Repairer::VerifyExtraFiles(cons
|
|
||||||
// Check the the file extension is the correct form
|
|
||||||
if ((tail[0] == 'P' || tail[0] == 'p') &&
|
|
||||||
(
|
|
||||||
- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r')
|
|
||||||
+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') )
|
|
||||||
||
|
|
||||||
- isdigit(tail[1]) && isdigit(tail[2])
|
|
||||||
+ ( isdigit(tail[1]) && isdigit(tail[2]) )
|
|
||||||
))
|
|
||||||
{
|
|
||||||
skip = true;
|
|
|
@ -1,80 +0,0 @@
|
||||||
# Maintainer: BlackEagle < ike DOT devolder AT gmail DOT com >
|
|
||||||
|
|
||||||
plugrel=1
|
|
||||||
|
|
||||||
pkgname=par2cmdline
|
|
||||||
pkgver=0.4
|
|
||||||
pkgrel=18
|
|
||||||
pkgdesc="Providing a tool to apply the data-recovery capability concepts of RAID-like systems to the posting & recovery of multi-part archives on Usenet."
|
|
||||||
url="http://sourceforge.net/projects/parchive/"
|
|
||||||
license="GPL"
|
|
||||||
depends=('gcc-libs')
|
|
||||||
makedepends=()
|
|
||||||
arch=('i686' 'x86_64')
|
|
||||||
source=(
|
|
||||||
"http://downloads.sourceforge.net/sourceforge/parchive/${pkgname}-${pkgver}.tar.gz"
|
|
||||||
"01-Use-_stati64-under-WIN32-to-get-file-size.patch"
|
|
||||||
"02-Report-empty-files-when-verifying.patch"
|
|
||||||
"03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch"
|
|
||||||
"04-offset-must-always-be-updated-even-when-progress-is-.patch"
|
|
||||||
"05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch"
|
|
||||||
"06-Introduced-conditional-compilation-to-speed-up-thing.patch"
|
|
||||||
"07-Optimization-by-inlining.patch"
|
|
||||||
"08-Allowing-commandline-passing-of-files.patch"
|
|
||||||
"09-Fixing-processing-of-the-first-file-parameter-the-ou.patch"
|
|
||||||
"10-Pack-and-simplify-MD5Hash.patch"
|
|
||||||
"11-Use-autogenerated-methods-in-letype.patch"
|
|
||||||
"12-Fix-headers-in-par2cmdline.h.patch"
|
|
||||||
"13-hardlinks.patch"
|
|
||||||
"14-fixes-stupid-warnings.patch"
|
|
||||||
)
|
|
||||||
sha256sums=(
|
|
||||||
'9e32b7dbcf7bca8249f98824757d4868714156fe2276516504cd26f736e9f677'
|
|
||||||
'ece2cacec41d820d697e8fb5838b39e5ea1be1ced2a4cbe93d739a05a94db33a'
|
|
||||||
'd4976200ea20b44d0efbc8225ed510157a59b921b710a9cf353052df8f7d2175'
|
|
||||||
'1024c6dbfc7b8993a683c28a91d156552190ae33c925b217864ea874c8135eeb'
|
|
||||||
'f6e6c1bb8fbc6eb40947dbc9f14fcf4856de840fa970d3482900408d9aaa2f43'
|
|
||||||
'00efeff75f8a8cf61d47763b9a86ba92c68a7201d1ec50915830802b08f466e2'
|
|
||||||
'a472bc0321cde509d0bfe1d0887a3209ba4997673d7e5a49c31cf225546da802'
|
|
||||||
'ff9aba8c2b5e5050f811e11331637241db2fed48c2bbf5a34c970b70d45b6179'
|
|
||||||
'3076b42f152c447a24f119b5586ef702a994efa6f4fbb3a3a51d1122effef435'
|
|
||||||
'4e5c70345b1bd40019c58c0f334a76d9ece5bbb3cd08e1fb1a16b614c8e2e0cb'
|
|
||||||
'4f562411d3d431af99560789cfd69f4d6c72ca82986d4999f8ab7e6c0db7f912'
|
|
||||||
'3b7c0644143b6498ca21cb6b892b645346092f79aa5d0bc0e56fbd6181eb2e31'
|
|
||||||
'13ce51e827cd6c959a6cd92322e79df26e59f4177d831530239be491b8ffc9ff'
|
|
||||||
'a1f6f551acf5d05f2173d6ac328a30044f2af2f2f15e87547e69fad5250a2653'
|
|
||||||
'0c2413f0d1c024127063b5cbb0a403fe12555ec820190f7981db4a5a82be7b62'
|
|
||||||
)
|
|
||||||
|
|
||||||
build() {
|
|
||||||
cd ${pkgname}-${pkgver}
|
|
||||||
for patch in ${startdir}/[0-9][0-9]*.patch; do
|
|
||||||
msg ${patch}
|
|
||||||
patch -Np1 -i ${patch}
|
|
||||||
done
|
|
||||||
msg "remove old files"
|
|
||||||
rm -f Makefile.in \
|
|
||||||
aclocal.m4 \
|
|
||||||
config.guess \
|
|
||||||
config.h.in \
|
|
||||||
config.sub \
|
|
||||||
configure \
|
|
||||||
depcomp \
|
|
||||||
install-sh \
|
|
||||||
missing \
|
|
||||||
mkinstalldirs
|
|
||||||
msg "run autotools stuff"
|
|
||||||
aclocal --force
|
|
||||||
autoconf --force
|
|
||||||
autoheader --force
|
|
||||||
automake --foreign --add-missing --copy --force-missing
|
|
||||||
msg "Configure"
|
|
||||||
./configure --prefix=/usr
|
|
||||||
msg "Make"
|
|
||||||
make
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
|
||||||
cd ${pkgname}-${pkgver}
|
|
||||||
make DESTDIR=$startdir/pkg install
|
|
||||||
}
|
|
Loading…
Reference in a new issue