# HG changeset patch # User Pascal Bellard # Date 1549796921 -3600 # Node ID 6f2188ee6be5f55423b7279e626ce35528ee15a6 # Parent ed2d66b3c838ea86ad23a872c09a6c635936aeab Up par2 (0.8.0) diff -r ed2d66b3c838 -r 6f2188ee6be5 linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Sun Feb 10 10:49:22 2019 +0100 +++ b/linld/stuff/src/ISO9660.CPP Sun Feb 10 12:08:41 2019 +0100 @@ -5,6 +5,14 @@ struct isostate isostate; +#if 1 +#define setdirofs(to,sec) (*(int*)((char*)&(to)+1) = *(int*)&(sec)<<(SECTORBITS-8)) +#define cpydirofs(to,from) (*(int*)((char*)&(to)+1) = *(int*)((char*)&(from)+1)) +#else +#define setdirofs(to,sec) (to = (sec)<fd); return -1; } - x->dirofs = (* (unsigned long *) (isostate.buffer + 0x9E)) << SECTORBITS; + setdirofs(x->dirofs, (* (unsigned long *) (isostate.buffer + 0x9E))); x->dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6)); return 0; } -int isoreaddir(int restart) +int isoreaddir(void) { int size; char *p; @@ -31,9 +39,9 @@ #endif struct isostate *x=&isostate; - if (restart) { + if (x->curdirsize == 0xFFFF) { x->curdirsize = x->dirsize; - x->curdirofs = x->dirofs; + cpydirofs(x->curdirofs, x->dirofs); goto restarted; } if (x->curpos >= SECTORSZ || * (short *) (x->buffer + x->curpos) == 0) { @@ -102,7 +110,6 @@ #define IS_DIR(x)( (*((char*) &x + 1) & (char)0676) == (char)0) int isoopen(const char *filename) { - int restart; char *name, *s, c; char _64bits = cpuhaslm(); struct isostate *x=&isostate; @@ -115,7 +122,7 @@ for (name = s; *s && *s != '/'; s++); c = *s; *s = 0; - for (restart = 1; isoreaddir(restart) == 0; restart = 0) { + for (x->curdirsize = 0xFFFF; isoreaddir() == 0;) { const char *n = name, *i = x->filename; if (_64bits) { if (strhead(i, n)) continue; @@ -125,7 +132,7 @@ if (strcmp(i, n)) continue; *s++ = c; if (IS_DIR(x->filemod)) { - x->dirofs = x->fileofs; + cpydirofs(x->dirofs, x->fileofs); x->dirsize = filesize2dirsize(x->filesize); if (c) goto next; } diff -r ed2d66b3c838 -r 6f2188ee6be5 linld/stuff/src/ISO9660.H --- a/linld/stuff/src/ISO9660.H Sun Feb 10 10:49:22 2019 +0100 +++ b/linld/stuff/src/ISO9660.H Sun Feb 10 12:08:41 2019 +0100 @@ -4,7 +4,7 @@ //#define filesize2dirsize(x) (x) //#define DIRSECTORSZ SECTORSZ typedef unsigned dirsizetype; -#define filesize2dirsize(x) (*(unsigned *)((char *)&(x)+1)) +#define filesize2dirsize(x) (*(dirsizetype *)((char *)&(x)+1)) #define DIRSECTORSZ (SECTORSZ/256) extern struct isostate { int fd; @@ -29,6 +29,6 @@ extern _fastcall int isoreadsector(const unsigned long *offset); extern int isoreset(char *name); extern int isoopen(const char *name); -extern int isoreaddir(int restart); +extern int isoreaddir(void); #define isolabel() do { isofileofs=0x8028; isofilesize=32; } while (0) #endif diff -r ed2d66b3c838 -r 6f2188ee6be5 linld/stuff/src/TAZBOOT.CPP --- a/linld/stuff/src/TAZBOOT.CPP Sun Feb 10 10:49:22 2019 +0100 +++ b/linld/stuff/src/TAZBOOT.CPP Sun Feb 10 12:08:41 2019 +0100 @@ -69,7 +69,6 @@ const char *init = " rdinit=/init.exe", *mode="menu"; char c; static char rootfs[16], fallback[16], isknoppix, noauto; - int restart; unsigned long magic; struct isostate *x=&isostate; @@ -92,7 +91,7 @@ break; } } while (isoopen("isolinux") >= 0); // Knoppix - for (c = 0, restart = 1; isoreaddir(restart) == 0; restart = 0) { + for (c = 0, x->curdirsize = 0xFFFF; isoreaddir() == 0;) { if (strstr(x->filename, ".gz")) strcpy(fallback, x->filename); if (strhead(x->filename, "rootfs") diff -r ed2d66b3c838 -r 6f2188ee6be5 par2/receipt --- a/par2/receipt Sun Feb 10 10:49:22 2019 +0100 +++ b/par2/receipt Sun Feb 10 12:08:41 2019 +0100 @@ -2,25 +2,26 @@ PACKAGE="par2" SOURCE="par2cmdline" -VERSION="0.4" +VERSION="0.8.0" CATEGORY="system-tools" SHORT_DESC="Utility for posting and recovery of multi-part archives." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" TARBALL="$SOURCE-$VERSION.tar.gz" WEB_SITE="http://parchive.sourceforge.net/" -WGET_URL="$SF_MIRROR/parchive/$TARBALL" +WGET_URL="https://github.com/Parchive/par2cmdline/archive/v$VERSION.tar.gz" +PROVIDE="par2cmdline" DEPENDS="gcc-lib-base" +BUILD_DEPENDS="automake" # Rules to configure and make the package. compile_rules() { - #http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch - patch -p1 < $stuff/par2cmdline-0.4-gcc4.patch || true - ./configure --prefix=/usr --infodir=/usr/share/info \ - --mandir=/usr/share/man \ - $CONFIGURE_ARGS && + ./automake.sh + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + $CONFIGURE_ARGS && make && make DESTDIR=$DESTDIR install } @@ -28,7 +29,7 @@ # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - cp -a $install/usr $fs - mkdir -p $install/usr/share/doc - cp $src/README $src/ROADMAP $install/usr/share/doc + mkdir -p $fs/usr/share/doc + cp $src/README $fs/usr/share/doc + cp -a $install/usr/bin $fs/usr } diff -r ed2d66b3c838 -r 6f2188ee6be5 par2/stuff/par2cmdline-0.4-gcc4.patch --- a/par2/stuff/par2cmdline-0.4-gcc4.patch Sun Feb 10 10:49:22 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -Fix compilation with gcc-4. - -Patch by Dirk-Jan Heijs. - -http://bugs.gentoo.org/102391 -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287904 - ---- par2cmdline-0.4/reedsolomon.cpp -+++ par2cmdline-0.4/reedsolomon.cpp -@@ -51,7 +51,7 @@ - } - } - --bool ReedSolomon::SetInput(const vector &present) -+template <> bool ReedSolomon::SetInput(const vector &present) - { - inputcount = (u32)present.size(); - -@@ -80,7 +80,7 @@ - return true; - } - --bool ReedSolomon::SetInput(u32 count) -+template <> bool ReedSolomon::SetInput(u32 count) - { - inputcount = count; - -@@ -101,7 +101,7 @@ - return true; - } - --bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) -+template <> bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) - { - // Look up the appropriate element in the RS matrix - Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; -@@ -189,7 +189,7 @@ - - // 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::SetInput(const vector &present) -+template <> bool ReedSolomon::SetInput(const vector &present) - { - inputcount = (u32)present.size(); - -@@ -233,7 +233,7 @@ - - // Record that the specified number of source files are all present - // and compute the base values to use for the vandermonde matrix. --bool ReedSolomon::SetInput(u32 count) -+template <> bool ReedSolomon::SetInput(u32 count) - { - inputcount = count; - -@@ -267,7 +267,7 @@ - return true; - } - --bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) -+template <> bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) - { - // Look up the appropriate element in the RS matrix