wok rev 20747
Up par2 (0.8.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Feb 10 12:08:41 2019 +0100 (2019-02-10) |
parents | ed2d66b3c838 |
children | e87d1c820fff |
files | linld/stuff/src/ISO9660.CPP linld/stuff/src/ISO9660.H linld/stuff/src/TAZBOOT.CPP par2/receipt par2/stuff/par2cmdline-0.4-gcc4.patch |
line diff
1.1 --- a/linld/stuff/src/ISO9660.CPP Sun Feb 10 10:49:22 2019 +0100 1.2 +++ b/linld/stuff/src/ISO9660.CPP Sun Feb 10 12:08:41 2019 +0100 1.3 @@ -5,6 +5,14 @@ 1.4 1.5 struct isostate isostate; 1.6 1.7 +#if 1 1.8 +#define setdirofs(to,sec) (*(int*)((char*)&(to)+1) = *(int*)&(sec)<<(SECTORBITS-8)) 1.9 +#define cpydirofs(to,from) (*(int*)((char*)&(to)+1) = *(int*)((char*)&(from)+1)) 1.10 +#else 1.11 +#define setdirofs(to,sec) (to = (sec)<<SECTORBITS) 1.12 +#define cpydirofs(to,from) ((to) = (from)) 1.13 +#endif 1.14 + 1.15 int isoreset(char *name) 1.16 { 1.17 static const unsigned long root = 16UL * 2048; 1.18 @@ -17,12 +25,12 @@ 1.19 //close(x->fd); 1.20 return -1; 1.21 } 1.22 - x->dirofs = (* (unsigned long *) (isostate.buffer + 0x9E)) << SECTORBITS; 1.23 + setdirofs(x->dirofs, (* (unsigned long *) (isostate.buffer + 0x9E))); 1.24 x->dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6)); 1.25 return 0; 1.26 } 1.27 1.28 -int isoreaddir(int restart) 1.29 +int isoreaddir(void) 1.30 { 1.31 int size; 1.32 char *p; 1.33 @@ -31,9 +39,9 @@ 1.34 #endif 1.35 struct isostate *x=&isostate; 1.36 1.37 - if (restart) { 1.38 + if (x->curdirsize == 0xFFFF) { 1.39 x->curdirsize = x->dirsize; 1.40 - x->curdirofs = x->dirofs; 1.41 + cpydirofs(x->curdirofs, x->dirofs); 1.42 goto restarted; 1.43 } 1.44 if (x->curpos >= SECTORSZ || * (short *) (x->buffer + x->curpos) == 0) { 1.45 @@ -102,7 +110,6 @@ 1.46 #define IS_DIR(x)( (*((char*) &x + 1) & (char)0676) == (char)0) 1.47 int isoopen(const char *filename) 1.48 { 1.49 - int restart; 1.50 char *name, *s, c; 1.51 char _64bits = cpuhaslm(); 1.52 struct isostate *x=&isostate; 1.53 @@ -115,7 +122,7 @@ 1.54 for (name = s; *s && *s != '/'; s++); 1.55 c = *s; 1.56 *s = 0; 1.57 - for (restart = 1; isoreaddir(restart) == 0; restart = 0) { 1.58 + for (x->curdirsize = 0xFFFF; isoreaddir() == 0;) { 1.59 const char *n = name, *i = x->filename; 1.60 if (_64bits) { 1.61 if (strhead(i, n)) continue; 1.62 @@ -125,7 +132,7 @@ 1.63 if (strcmp(i, n)) continue; 1.64 *s++ = c; 1.65 if (IS_DIR(x->filemod)) { 1.66 - x->dirofs = x->fileofs; 1.67 + cpydirofs(x->dirofs, x->fileofs); 1.68 x->dirsize = filesize2dirsize(x->filesize); 1.69 if (c) goto next; 1.70 }
2.1 --- a/linld/stuff/src/ISO9660.H Sun Feb 10 10:49:22 2019 +0100 2.2 +++ b/linld/stuff/src/ISO9660.H Sun Feb 10 12:08:41 2019 +0100 2.3 @@ -4,7 +4,7 @@ 2.4 //#define filesize2dirsize(x) (x) 2.5 //#define DIRSECTORSZ SECTORSZ 2.6 typedef unsigned dirsizetype; 2.7 -#define filesize2dirsize(x) (*(unsigned *)((char *)&(x)+1)) 2.8 +#define filesize2dirsize(x) (*(dirsizetype *)((char *)&(x)+1)) 2.9 #define DIRSECTORSZ (SECTORSZ/256) 2.10 extern struct isostate { 2.11 int fd; 2.12 @@ -29,6 +29,6 @@ 2.13 extern _fastcall int isoreadsector(const unsigned long *offset); 2.14 extern int isoreset(char *name); 2.15 extern int isoopen(const char *name); 2.16 -extern int isoreaddir(int restart); 2.17 +extern int isoreaddir(void); 2.18 #define isolabel() do { isofileofs=0x8028; isofilesize=32; } while (0) 2.19 #endif
3.1 --- a/linld/stuff/src/TAZBOOT.CPP Sun Feb 10 10:49:22 2019 +0100 3.2 +++ b/linld/stuff/src/TAZBOOT.CPP Sun Feb 10 12:08:41 2019 +0100 3.3 @@ -69,7 +69,6 @@ 3.4 const char *init = " rdinit=/init.exe", *mode="menu"; 3.5 char c; 3.6 static char rootfs[16], fallback[16], isknoppix, noauto; 3.7 - int restart; 3.8 unsigned long magic; 3.9 struct isostate *x=&isostate; 3.10 3.11 @@ -92,7 +91,7 @@ 3.12 break; 3.13 } 3.14 } while (isoopen("isolinux") >= 0); // Knoppix 3.15 - for (c = 0, restart = 1; isoreaddir(restart) == 0; restart = 0) { 3.16 + for (c = 0, x->curdirsize = 0xFFFF; isoreaddir() == 0;) { 3.17 if (strstr(x->filename, ".gz")) 3.18 strcpy(fallback, x->filename); 3.19 if (strhead(x->filename, "rootfs")
4.1 --- a/par2/receipt Sun Feb 10 10:49:22 2019 +0100 4.2 +++ b/par2/receipt Sun Feb 10 12:08:41 2019 +0100 4.3 @@ -2,25 +2,26 @@ 4.4 4.5 PACKAGE="par2" 4.6 SOURCE="par2cmdline" 4.7 -VERSION="0.4" 4.8 +VERSION="0.8.0" 4.9 CATEGORY="system-tools" 4.10 SHORT_DESC="Utility for posting and recovery of multi-part archives." 4.11 MAINTAINER="pascal.bellard@slitaz.org" 4.12 LICENSE="GPL2" 4.13 TARBALL="$SOURCE-$VERSION.tar.gz" 4.14 WEB_SITE="http://parchive.sourceforge.net/" 4.15 -WGET_URL="$SF_MIRROR/parchive/$TARBALL" 4.16 +WGET_URL="https://github.com/Parchive/par2cmdline/archive/v$VERSION.tar.gz" 4.17 +PROVIDE="par2cmdline" 4.18 4.19 DEPENDS="gcc-lib-base" 4.20 +BUILD_DEPENDS="automake" 4.21 4.22 # Rules to configure and make the package. 4.23 compile_rules() 4.24 { 4.25 - #http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch 4.26 - patch -p1 < $stuff/par2cmdline-0.4-gcc4.patch || true 4.27 - ./configure --prefix=/usr --infodir=/usr/share/info \ 4.28 - --mandir=/usr/share/man \ 4.29 - $CONFIGURE_ARGS && 4.30 + ./automake.sh 4.31 + ./configure --prefix=/usr \ 4.32 + --mandir=/usr/share/man \ 4.33 + $CONFIGURE_ARGS && 4.34 make && 4.35 make DESTDIR=$DESTDIR install 4.36 } 4.37 @@ -28,7 +29,7 @@ 4.38 # Rules to gen a SliTaz package suitable for Tazpkg. 4.39 genpkg_rules() 4.40 { 4.41 - cp -a $install/usr $fs 4.42 - mkdir -p $install/usr/share/doc 4.43 - cp $src/README $src/ROADMAP $install/usr/share/doc 4.44 + mkdir -p $fs/usr/share/doc 4.45 + cp $src/README $fs/usr/share/doc 4.46 + cp -a $install/usr/bin $fs/usr 4.47 }
5.1 --- a/par2/stuff/par2cmdline-0.4-gcc4.patch Sun Feb 10 10:49:22 2019 +0100 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,62 +0,0 @@ 5.4 -Fix compilation with gcc-4. 5.5 - 5.6 -Patch by Dirk-Jan Heijs. 5.7 - 5.8 -http://bugs.gentoo.org/102391 5.9 -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287904 5.10 - 5.11 ---- par2cmdline-0.4/reedsolomon.cpp 5.12 -+++ par2cmdline-0.4/reedsolomon.cpp 5.13 -@@ -51,7 +51,7 @@ 5.14 - } 5.15 - } 5.16 - 5.17 --bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present) 5.18 -+template <> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present) 5.19 - { 5.20 - inputcount = (u32)present.size(); 5.21 - 5.22 -@@ -80,7 +80,7 @@ 5.23 - return true; 5.24 - } 5.25 - 5.26 --bool ReedSolomon<Galois8>::SetInput(u32 count) 5.27 -+template <> bool ReedSolomon<Galois8>::SetInput(u32 count) 5.28 - { 5.29 - inputcount = count; 5.30 - 5.31 -@@ -101,7 +101,7 @@ 5.32 - return true; 5.33 - } 5.34 - 5.35 --bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 5.36 -+template <> bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 5.37 - { 5.38 - // Look up the appropriate element in the RS matrix 5.39 - Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; 5.40 -@@ -189,7 +189,7 @@ 5.41 - 5.42 - // Set which of the source files are present and which are missing 5.43 - // and compute the base values to use for the vandermonde matrix. 5.44 --bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present) 5.45 -+template <> bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present) 5.46 - { 5.47 - inputcount = (u32)present.size(); 5.48 - 5.49 -@@ -233,7 +233,7 @@ 5.50 - 5.51 - // Record that the specified number of source files are all present 5.52 - // and compute the base values to use for the vandermonde matrix. 5.53 --bool ReedSolomon<Galois16>::SetInput(u32 count) 5.54 -+template <> bool ReedSolomon<Galois16>::SetInput(u32 count) 5.55 - { 5.56 - inputcount = count; 5.57 - 5.58 -@@ -267,7 +267,7 @@ 5.59 - return true; 5.60 - } 5.61 - 5.62 --bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 5.63 -+template <> bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 5.64 - { 5.65 - // Look up the appropriate element in the RS matrix