# HG changeset patch # User Aleksej Bobylev # Date 1525975920 -10800 # Node ID d6378d45533817c23504c6a8eba36dfb860a3e2d # Parent c7b121a4ffd9c601af2470da4c258b369fcfd448 Unification of the patch system diff -r c7b121a4ffd9 -r d6378d455338 barcode/receipt --- a/barcode/receipt Wed May 09 17:03:28 2018 +0300 +++ b/barcode/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,7 +15,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/barcode.patch autoreconf -fi sed -i 's|/info|/share&|' Makefile* ./configure $CONFIGURE_ARGS && make && make install diff -r c7b121a4ffd9 -r d6378d455338 barcode/stuff/barcode.patch --- a/barcode/stuff/barcode.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ ---- a/Makefile.in -+++ b/Makefile.in -@@ -14,8 +14,8 @@ - BINDIR = $(prefix)/bin - LIBDIR = $(prefix)/lib - INCDIR = $(prefix)/include --MAN1DIR = $(prefix)/man/man1 --MAN3DIR = $(prefix)/man/man3 -+MAN1DIR = $(prefix)/share/man/man1 -+MAN3DIR = $(prefix)/share/man/man3 - INFODIR = $(prefix)/info - - # getopt may be installed or not, if not take our copy -@@ -63,14 +63,14 @@ - cd doc && $(MAKE) - - install: -- $(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \ -- $(MAN3DIR) $(INFODIR) -- $(INSTALL) -c $(TARGET) $(BINDIR) -- $(INSTALL) -c -m 0644 $(HEADER) $(INCDIR) -- $(INSTALL) -c -m 0644 $(LIBRARY) $(LIBDIR) -- $(INSTALL) -c -m 0644 $(MAN1) $(MAN1DIR) -- $(INSTALL) -c -m 0644 $(MAN3) $(MAN3DIR) -- $(INSTALL) -c -m 0644 $(INFO) $(INFODIR) -+ $(INSTALL) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) \ -+ $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INFODIR) -+ $(INSTALL) -c $(TARGET) $(DESTDIR)$(BINDIR) -+ $(INSTALL) -c -m 0644 $(HEADER) $(DESTDIR)$(INCDIR) -+ $(INSTALL) -c -m 0644 $(LIBRARY) $(DESTDIR)$(LIBDIR) -+ $(INSTALL) -c -m 0644 $(MAN1) $(DESTDIR)$(MAN1DIR) -+ $(INSTALL) -c -m 0644 $(MAN3) $(DESTDIR)$(MAN3DIR) -+ $(INSTALL) -c -m 0644 $(INFO) $(DESTDIR)$(INFODIR) - - uninstall: - $(RM) -f $(BINDIR)/$(TARGET) diff -r c7b121a4ffd9 -r d6378d455338 barcode/stuff/patches/barcode.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/barcode/stuff/patches/barcode.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,36 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -14,8 +14,8 @@ + BINDIR = $(prefix)/bin + LIBDIR = $(prefix)/lib + INCDIR = $(prefix)/include +-MAN1DIR = $(prefix)/man/man1 +-MAN3DIR = $(prefix)/man/man3 ++MAN1DIR = $(prefix)/share/man/man1 ++MAN3DIR = $(prefix)/share/man/man3 + INFODIR = $(prefix)/info + + # getopt may be installed or not, if not take our copy +@@ -63,14 +63,14 @@ + cd doc && $(MAKE) + + install: +- $(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \ +- $(MAN3DIR) $(INFODIR) +- $(INSTALL) -c $(TARGET) $(BINDIR) +- $(INSTALL) -c -m 0644 $(HEADER) $(INCDIR) +- $(INSTALL) -c -m 0644 $(LIBRARY) $(LIBDIR) +- $(INSTALL) -c -m 0644 $(MAN1) $(MAN1DIR) +- $(INSTALL) -c -m 0644 $(MAN3) $(MAN3DIR) +- $(INSTALL) -c -m 0644 $(INFO) $(INFODIR) ++ $(INSTALL) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) \ ++ $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INFODIR) ++ $(INSTALL) -c $(TARGET) $(DESTDIR)$(BINDIR) ++ $(INSTALL) -c -m 0644 $(HEADER) $(DESTDIR)$(INCDIR) ++ $(INSTALL) -c -m 0644 $(LIBRARY) $(DESTDIR)$(LIBDIR) ++ $(INSTALL) -c -m 0644 $(MAN1) $(DESTDIR)$(MAN1DIR) ++ $(INSTALL) -c -m 0644 $(MAN3) $(DESTDIR)$(MAN3DIR) ++ $(INSTALL) -c -m 0644 $(INFO) $(DESTDIR)$(INFODIR) + + uninstall: + $(RM) -f $(BINDIR)/$(TARGET) diff -r c7b121a4ffd9 -r d6378d455338 barcode/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/barcode/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|barcode.patch diff -r c7b121a4ffd9 -r d6378d455338 blackbox/receipt --- a/blackbox/receipt Wed May 09 17:03:28 2018 +0300 +++ b/blackbox/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,10 +17,6 @@ # to let user use the wm via slim/F1 or by default with 'tazx blackbox'. compile_rules() { - patch -p1 < $stuff/blackbox-0.70.1-gcc-4.3.patch - patch -p0 < $stuff/blackbox-0.70.1-asneeded.patch - patch -p1 < $stuff/textpropertytostring-unconditional.patch - ./configure \ --libexecdir=/usr/bin \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/blackbox-0.70.1-asneeded.patch --- a/blackbox/stuff/blackbox-0.70.1-asneeded.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -Fixing build with as-needed. Enabling shared libs. - -http://bugs.gentoo.org/show_bug.cgi?id=248549 - ---- src/Makefile.am -+++ src/Makefile.am -@@ -22,7 +22,7 @@ - - DEFAULT_MENU = $(pkgdatadir)/menu - DEFAULT_STYLE = $(pkgdatadir)/styles/Gray --CPPFLAGS = @CPPFLAGS@ @SHAPE@ @XFT@ @DEBUG@ @NLS@ \ -+AM_CPPFLAGS = @SHAPE@ @XFT@ @DEBUG@ @NLS@ \ - -DLOCALEPATH=\"$(pkgdatadir)/nls\" \ - -DDEFAULTMENU=\"$(DEFAULT_MENU)\" \ - -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \ ---- lib/Makefile.am -+++ lib/Makefile.am -@@ -62,7 +62,8 @@ - Util.hh \ - XDG.hh - --libbt_la_LIBADD = @ICONV@ @LOCALE@ -+libbt_la_LIBADD = @ICONV@ @LOCALE@ @xft_LIBS@ -+libbt_la_CFLAGS = @xft_CFLAGS@ - - pkgconfigdir = $(libdir)/pkgconfig - nodist_pkgconfig_DATA = libbt.pc ---- util/Makefile.am -+++ util/Makefile.am -@@ -21,7 +21,7 @@ - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - # DEALINGS IN THE SOFTWARE. - --CPPFLAGS = @CPPFLAGS@ @DEBUG@ @NLS@ \ -+AM_CPPFLAGS = @DEBUG@ @NLS@ \ - -I$(top_srcdir)/lib - - bin_SCRIPTS = bsetbg ---- configure.ac -+++ configure.ac -@@ -29,7 +29,7 @@ - AC_PROG_INSTALL - - dnl libbt shouldn't be shared by default (yet) --AC_DISABLE_SHARED -+dnl AC_DISABLE_SHARED - AC_PROG_LIBTOOL - AC_SUBST(LIBTOOL_DEPS) - diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/blackbox-0.70.1-gcc-4.3.patch --- a/blackbox/stuff/blackbox-0.70.1-gcc-4.3.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -diff -Naupr blackbox-0.70.1.orig/lib/Image.cc blackbox-0.70.1/lib/Image.cc ---- blackbox-0.70.1.orig/lib/Image.cc 2005-04-08 17:41:09.000000000 +0200 -+++ blackbox-0.70.1/lib/Image.cc 2008-02-24 08:31:28.000000000 +0100 -@@ -42,8 +42,9 @@ - - #include - #include --#include --#include -+#include -+#include -+#include - - // #define COLORTABLE_DEBUG - // #define MITSHM_DEBUG -diff -Naupr blackbox-0.70.1.orig/lib/Resource.cc blackbox-0.70.1/lib/Resource.cc ---- blackbox-0.70.1.orig/lib/Resource.cc 2005-04-06 23:16:50.000000000 +0200 -+++ blackbox-0.70.1/lib/Resource.cc 2008-02-24 08:33:11.000000000 +0100 -@@ -28,7 +28,8 @@ - #include - #include - --#include -+#include -+#include - - - bt::Resource::Resource(void) -diff -Naupr blackbox-0.70.1.orig/lib/XDG.cc blackbox-0.70.1/lib/XDG.cc ---- blackbox-0.70.1.orig/lib/XDG.cc 2005-04-06 16:04:38.000000000 +0200 -+++ blackbox-0.70.1/lib/XDG.cc 2008-02-24 08:34:11.000000000 +0100 -@@ -25,7 +25,8 @@ - #include "Util.hh" - #include "XDG.hh" - --#include -+#include -+#include - - - // make sure directory names end with a slash -diff -Naupr blackbox-0.70.1.orig/src/BlackboxResource.cc blackbox-0.70.1/src/BlackboxResource.cc ---- blackbox-0.70.1.orig/src/BlackboxResource.cc 2005-10-18 09:34:46.000000000 +0200 -+++ blackbox-0.70.1/src/BlackboxResource.cc 2008-02-24 08:34:49.000000000 +0100 -@@ -33,6 +33,8 @@ - #include - #include - -+#include -+ - - BlackboxResource::BlackboxResource(const std::string& rc): rc_file(rc) { - screen_resources = 0; -diff -Naupr blackbox-0.70.1.orig/src/main.cc blackbox-0.70.1/src/main.cc ---- blackbox-0.70.1.orig/src/main.cc 2005-01-03 10:42:57.000000000 +0100 -+++ blackbox-0.70.1/src/main.cc 2008-02-24 08:37:16.000000000 +0100 -@@ -34,7 +34,8 @@ - #include "blackbox.hh" - #include "../version.h" - --#include -+#include -+#include - - - static void showHelp(int exitval) { -diff -Naupr blackbox-0.70.1.orig/src/Screen.cc blackbox-0.70.1/src/Screen.cc ---- blackbox-0.70.1.orig/src/Screen.cc 2005-10-18 10:07:22.000000000 +0200 -+++ blackbox-0.70.1/src/Screen.cc 2008-02-24 08:35:46.000000000 +0100 -@@ -45,8 +45,9 @@ - #include - #include - #include --#include - #include -+#include -+#include - - - static bool running = true; -diff -Naupr blackbox-0.70.1.orig/src/ScreenResource.cc blackbox-0.70.1/src/ScreenResource.cc ---- blackbox-0.70.1.orig/src/ScreenResource.cc 2005-04-13 07:54:08.000000000 +0200 -+++ blackbox-0.70.1/src/ScreenResource.cc 2008-02-24 08:36:31.000000000 +0100 -@@ -33,6 +33,8 @@ - - #include - -+#include -+ - - static const int iconify_width = 9; - static const int iconify_height = 9; -diff -Naupr blackbox-0.70.1.orig/util/bsetroot.cc blackbox-0.70.1/util/bsetroot.cc ---- blackbox-0.70.1.orig/util/bsetroot.cc 2005-03-15 08:01:37.000000000 +0100 -+++ blackbox-0.70.1/util/bsetroot.cc 2008-02-24 08:38:41.000000000 +0100 -@@ -30,7 +30,9 @@ - #include - - #include --#include -+#include -+#include -+#include - - - // ignore all X errors diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/patches/blackbox-0.70.1-asneeded.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blackbox/stuff/patches/blackbox-0.70.1-asneeded.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,49 @@ +Fixing build with as-needed. Enabling shared libs. + +http://bugs.gentoo.org/show_bug.cgi?id=248549 + +--- src/Makefile.am ++++ src/Makefile.am +@@ -22,7 +22,7 @@ + + DEFAULT_MENU = $(pkgdatadir)/menu + DEFAULT_STYLE = $(pkgdatadir)/styles/Gray +-CPPFLAGS = @CPPFLAGS@ @SHAPE@ @XFT@ @DEBUG@ @NLS@ \ ++AM_CPPFLAGS = @SHAPE@ @XFT@ @DEBUG@ @NLS@ \ + -DLOCALEPATH=\"$(pkgdatadir)/nls\" \ + -DDEFAULTMENU=\"$(DEFAULT_MENU)\" \ + -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \ +--- lib/Makefile.am ++++ lib/Makefile.am +@@ -62,7 +62,8 @@ + Util.hh \ + XDG.hh + +-libbt_la_LIBADD = @ICONV@ @LOCALE@ ++libbt_la_LIBADD = @ICONV@ @LOCALE@ @xft_LIBS@ ++libbt_la_CFLAGS = @xft_CFLAGS@ + + pkgconfigdir = $(libdir)/pkgconfig + nodist_pkgconfig_DATA = libbt.pc +--- util/Makefile.am ++++ util/Makefile.am +@@ -21,7 +21,7 @@ + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + # DEALINGS IN THE SOFTWARE. + +-CPPFLAGS = @CPPFLAGS@ @DEBUG@ @NLS@ \ ++AM_CPPFLAGS = @DEBUG@ @NLS@ \ + -I$(top_srcdir)/lib + + bin_SCRIPTS = bsetbg +--- configure.ac ++++ configure.ac +@@ -29,7 +29,7 @@ + AC_PROG_INSTALL + + dnl libbt shouldn't be shared by default (yet) +-AC_DISABLE_SHARED ++dnl AC_DISABLE_SHARED + AC_PROG_LIBTOOL + AC_SUBST(LIBTOOL_DEPS) + diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/patches/blackbox-0.70.1-gcc-4.3.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blackbox/stuff/patches/blackbox-0.70.1-gcc-4.3.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,106 @@ +diff -Naupr blackbox-0.70.1.orig/lib/Image.cc blackbox-0.70.1/lib/Image.cc +--- blackbox-0.70.1.orig/lib/Image.cc 2005-04-08 17:41:09.000000000 +0200 ++++ blackbox-0.70.1/lib/Image.cc 2008-02-24 08:31:28.000000000 +0100 +@@ -42,8 +42,9 @@ + + #include + #include +-#include +-#include ++#include ++#include ++#include + + // #define COLORTABLE_DEBUG + // #define MITSHM_DEBUG +diff -Naupr blackbox-0.70.1.orig/lib/Resource.cc blackbox-0.70.1/lib/Resource.cc +--- blackbox-0.70.1.orig/lib/Resource.cc 2005-04-06 23:16:50.000000000 +0200 ++++ blackbox-0.70.1/lib/Resource.cc 2008-02-24 08:33:11.000000000 +0100 +@@ -28,7 +28,8 @@ + #include + #include + +-#include ++#include ++#include + + + bt::Resource::Resource(void) +diff -Naupr blackbox-0.70.1.orig/lib/XDG.cc blackbox-0.70.1/lib/XDG.cc +--- blackbox-0.70.1.orig/lib/XDG.cc 2005-04-06 16:04:38.000000000 +0200 ++++ blackbox-0.70.1/lib/XDG.cc 2008-02-24 08:34:11.000000000 +0100 +@@ -25,7 +25,8 @@ + #include "Util.hh" + #include "XDG.hh" + +-#include ++#include ++#include + + + // make sure directory names end with a slash +diff -Naupr blackbox-0.70.1.orig/src/BlackboxResource.cc blackbox-0.70.1/src/BlackboxResource.cc +--- blackbox-0.70.1.orig/src/BlackboxResource.cc 2005-10-18 09:34:46.000000000 +0200 ++++ blackbox-0.70.1/src/BlackboxResource.cc 2008-02-24 08:34:49.000000000 +0100 +@@ -33,6 +33,8 @@ + #include + #include + ++#include ++ + + BlackboxResource::BlackboxResource(const std::string& rc): rc_file(rc) { + screen_resources = 0; +diff -Naupr blackbox-0.70.1.orig/src/main.cc blackbox-0.70.1/src/main.cc +--- blackbox-0.70.1.orig/src/main.cc 2005-01-03 10:42:57.000000000 +0100 ++++ blackbox-0.70.1/src/main.cc 2008-02-24 08:37:16.000000000 +0100 +@@ -34,7 +34,8 @@ + #include "blackbox.hh" + #include "../version.h" + +-#include ++#include ++#include + + + static void showHelp(int exitval) { +diff -Naupr blackbox-0.70.1.orig/src/Screen.cc blackbox-0.70.1/src/Screen.cc +--- blackbox-0.70.1.orig/src/Screen.cc 2005-10-18 10:07:22.000000000 +0200 ++++ blackbox-0.70.1/src/Screen.cc 2008-02-24 08:35:46.000000000 +0100 +@@ -45,8 +45,9 @@ + #include + #include + #include +-#include + #include ++#include ++#include + + + static bool running = true; +diff -Naupr blackbox-0.70.1.orig/src/ScreenResource.cc blackbox-0.70.1/src/ScreenResource.cc +--- blackbox-0.70.1.orig/src/ScreenResource.cc 2005-04-13 07:54:08.000000000 +0200 ++++ blackbox-0.70.1/src/ScreenResource.cc 2008-02-24 08:36:31.000000000 +0100 +@@ -33,6 +33,8 @@ + + #include + ++#include ++ + + static const int iconify_width = 9; + static const int iconify_height = 9; +diff -Naupr blackbox-0.70.1.orig/util/bsetroot.cc blackbox-0.70.1/util/bsetroot.cc +--- blackbox-0.70.1.orig/util/bsetroot.cc 2005-03-15 08:01:37.000000000 +0100 ++++ blackbox-0.70.1/util/bsetroot.cc 2008-02-24 08:38:41.000000000 +0100 +@@ -30,7 +30,9 @@ + #include + + #include +-#include ++#include ++#include ++#include + + + // ignore all X errors diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blackbox/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +-p1|blackbox-0.70.1-gcc-4.3.patch +-p0|blackbox-0.70.1-asneeded.patch +-p1|textpropertytostring-unconditional.patch diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/patches/textpropertytostring-unconditional.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blackbox/stuff/patches/textpropertytostring-unconditional.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,28 @@ +Description: Declare bt::textPropertyToString unconditionally. +Author: Jakub Wilk +Forwarded: no +Bug-Debian: http://bugs.debian.org/614468 +Last-Update: 2011-03-12 + +--- a/lib/Util.hh ++++ b/lib/Util.hh +@@ -25,6 +25,8 @@ + #ifndef __Util_hh + #define __Util_hh + ++#include ++ + #include + #include + +@@ -94,10 +96,8 @@ + + std::string tolower(const std::string &string); + +-#ifdef _XUTIL_H_ + std::string textPropertyToString(::Display *display, + ::XTextProperty& text_prop); +-#endif + + } // namespace bt + diff -r c7b121a4ffd9 -r d6378d455338 blackbox/stuff/textpropertytostring-unconditional.patch --- a/blackbox/stuff/textpropertytostring-unconditional.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -Description: Declare bt::textPropertyToString unconditionally. -Author: Jakub Wilk -Forwarded: no -Bug-Debian: http://bugs.debian.org/614468 -Last-Update: 2011-03-12 - ---- a/lib/Util.hh -+++ b/lib/Util.hh -@@ -25,6 +25,8 @@ - #ifndef __Util_hh - #define __Util_hh - -+#include -+ - #include - #include - -@@ -94,10 +96,8 @@ - - std::string tolower(const std::string &string); - --#ifdef _XUTIL_H_ - std::string textPropertyToString(::Display *display, - ::XTextProperty& text_prop); --#endif - - } // namespace bt - diff -r c7b121a4ffd9 -r d6378d455338 buffer/receipt --- a/buffer/receipt Wed May 09 17:03:28 2018 +0300 +++ b/buffer/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 < $stuff/buffer-1.19.patch || exit 1 make cp buffer.man buffer.1 diff -r c7b121a4ffd9 -r d6378d455338 buffer/stuff/buffer-1.19.patch --- a/buffer/stuff/buffer-1.19.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ ---- buffer-1.19-ori/buffer.c -+++ buffer-1.19/buffer.c -@@ -126,11 +126,6 @@ - static char *rcsid = "$Header: /a/swan/home/swan/staff/csg/lmjm/src/buffer/RCS/buffer.c,v 1.19 1995/08/24 17:46:28 lmjm Exp lmjm $"; - #endif - --#ifndef __alpha --#ifndef __ia64 --extern char *shmat(); --#endif /* __ia64 */ --#endif /* __alpha */ - - /* General macros */ - #define TRUE 1 diff -r c7b121a4ffd9 -r d6378d455338 buffer/stuff/patches/buffer-1.19.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buffer/stuff/patches/buffer-1.19.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +--- buffer-1.19-ori/buffer.c ++++ buffer-1.19/buffer.c +@@ -126,11 +126,6 @@ + static char *rcsid = "$Header: /a/swan/home/swan/staff/csg/lmjm/src/buffer/RCS/buffer.c,v 1.19 1995/08/24 17:46:28 lmjm Exp lmjm $"; + #endif + +-#ifndef __alpha +-#ifndef __ia64 +-extern char *shmat(); +-#endif /* __ia64 */ +-#endif /* __alpha */ + + /* General macros */ + #define TRUE 1 diff -r c7b121a4ffd9 -r d6378d455338 buffer/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buffer/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|buffer-1.19.patch diff -r c7b121a4ffd9 -r d6378d455338 cdrdao/receipt --- a/cdrdao/receipt Wed May 09 17:03:28 2018 +0300 +++ b/cdrdao/receipt Thu May 10 21:12:00 2018 +0300 @@ -25,8 +25,8 @@ grep -qs 'define u8' scsilib/libscg/scsi-linux-sg.c || sed -i 's|#include |#define u8 __u8\n&|' \ scsilib/libscg/scsi-linux-sg.c - patch -Np1 -i $stuff/$PACKAGE-$VERSION-stat.patch || return 1 export CXXFLAGS="-Wno-narrowing" + ./configure \ --prefix=/usr \ --with-lame \ diff -r c7b121a4ffd9 -r d6378d455338 cdrdao/stuff/cdrdao-1.2.3-stat.patch --- a/cdrdao/stuff/cdrdao-1.2.3-stat.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -diff -up cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat cdrdao-1.2.3/dao/ScsiIf-linux.cc ---- cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat 2010-01-20 20:11:36.000000000 +0100 -+++ cdrdao-1.2.3/dao/ScsiIf-linux.cc 2010-01-20 20:14:07.000000000 +0100 -@@ -19,6 +19,9 @@ - - #include - -+#include -+#include -+ - #include - #include - #include diff -r c7b121a4ffd9 -r d6378d455338 cdrdao/stuff/patches/cdrdao-1.2.3-stat.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cdrdao/stuff/patches/cdrdao-1.2.3-stat.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,13 @@ +diff -up cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat cdrdao-1.2.3/dao/ScsiIf-linux.cc +--- cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat 2010-01-20 20:11:36.000000000 +0100 ++++ cdrdao-1.2.3/dao/ScsiIf-linux.cc 2010-01-20 20:14:07.000000000 +0100 +@@ -19,6 +19,9 @@ + + #include + ++#include ++#include ++ + #include + #include + #include diff -r c7b121a4ffd9 -r d6378d455338 cdrdao/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cdrdao/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +cdrdao-1.2.3-stat.patch diff -r c7b121a4ffd9 -r d6378d455338 cdrkit/stuff/cdrkit-1.1.9-glibc-2.10.patch --- a/cdrkit/stuff/cdrkit-1.1.9-glibc-2.10.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -diff -puNr cdrkit-1.1.9.orig/include/schily.h cdrkit-1.1.9/include/schily.h ---- cdrkit-1.1.9.orig/include/schily.h 2006-11-25 01:20:20.000000000 +0100 -+++ cdrkit-1.1.9/include/schily.h 2009-03-11 20:31:53.000000000 +0100 -@@ -116,7 +116,7 @@ extern int fexecl(const char *, FILE *, - extern int fexecle(const char *, FILE *, FILE *, FILE *, const char *, ...); - /* 6th arg not const, fexecv forces av[ac] = NULL */ - extern int fexecv(const char *, FILE *, FILE *, FILE *, int, char **); --extern int fexecve(const char *, FILE *, FILE *, FILE *, char * const *, -+extern int f_execve(const char *, FILE *, FILE *, FILE *, char * const *, - char * const *); - extern int fspawnv(FILE *, FILE *, FILE *, int, char * const *); - extern int fspawnl(FILE *, FILE *, FILE *, const char *, const char *, ...); -@@ -190,7 +190,7 @@ extern int schily_error(const char *, .. - extern char *fillbytes(void *, int, char); - extern char *findbytes(const void *, int, char); - extern int findline(const char *, char, const char *, int, char **, int); --extern int getline(char *, int); -+extern int get_line(char *, int); - extern int getstr(char *, int); - extern int breakline(char *, char, char **, int); - extern int getallargs(int *, char * const**, const char *, ...); -diff -puNr cdrkit-1.1.9.orig/librols/fexec.c cdrkit-1.1.9/librols/fexec.c ---- cdrkit-1.1.9.orig/librols/fexec.c 2008-02-25 12:14:07.000000000 +0100 -+++ cdrkit-1.1.9/librols/fexec.c 2009-03-11 20:31:53.000000000 +0100 -@@ -170,7 +170,7 @@ fexecle(name, in, out, err, va_alist) - } while (p != NULL); - va_end(args); - -- ret = fexecve(name, in, out, err, av, env); -+ ret = f_execve(name, in, out, err, av, env); - if (av != xav) - free(av); - return (ret); -@@ -184,11 +184,11 @@ fexecv(name, in, out, err, ac, av) - char *av[]; - { - av[ac] = NULL; /* force list to be null terminated */ -- return (fexecve(name, in, out, err, av, environ)); -+ return (f_execve(name, in, out, err, av, environ)); - } - - EXPORT int --fexecve(name, in, out, err, av, env) -+f_execve(name, in, out, err, av, env) - const char *name; - FILE *in, *out, *err; - char * const av[], * const env[]; -diff -puNr cdrkit-1.1.9.orig/librols/stdio/fgetline.c cdrkit-1.1.9/librols/stdio/fgetline.c ---- cdrkit-1.1.9.orig/librols/stdio/fgetline.c 2006-09-05 10:39:04.000000000 +0200 -+++ cdrkit-1.1.9/librols/stdio/fgetline.c 2009-03-11 20:31:53.000000000 +0100 -@@ -76,7 +76,7 @@ fgetline(f, buf, len) - } - - EXPORT int --getline(buf, len) -+get_line(buf, len) - char *buf; - int len; - { -diff -puNr cdrkit-1.1.9.orig/libusal/scsitransp.c cdrkit-1.1.9/libusal/scsitransp.c ---- cdrkit-1.1.9.orig/libusal/scsitransp.c 2008-02-25 12:14:07.000000000 +0100 -+++ cdrkit-1.1.9/libusal/scsitransp.c 2009-03-11 20:31:53.000000000 +0100 -@@ -301,7 +301,7 @@ usal_yes(char *msg) - - printf("%s", msg); - flush(); -- if (getline(okbuf, sizeof (okbuf)) == EOF) -+ if (get_line(okbuf, sizeof (okbuf)) == EOF) - exit(EX_BAD); - if (streql(okbuf, "y") || streql(okbuf, "yes") || - streql(okbuf, "Y") || streql(okbuf, "YES")) -diff -puNr cdrkit-1.1.9.orig/readom/io.c cdrkit-1.1.9/readom/io.c ---- cdrkit-1.1.9.orig/readom/io.c 2006-12-08 14:38:43.000000000 +0100 -+++ cdrkit-1.1.9/readom/io.c 2009-03-11 20:31:53.000000000 +0100 -@@ -130,7 +130,7 @@ BOOL getvalue(char *s, long *lp, long mi - (*prt)(s, *lp, mini, maxi, dp); - flush(); - line[0] = '\0'; -- if (getline(line, 80) == EOF) -+ if (get_line(line, 80) == EOF) - exit(EX_BAD); - - linep = skipwhite(line); -@@ -178,7 +178,7 @@ again: - vprintf(form, args); - va_end(args); - flush(); -- if (getline(okbuf, sizeof(okbuf)) == EOF) -+ if (get_line(okbuf, sizeof(okbuf)) == EOF) - exit(EX_BAD); - if (okbuf[0] == '?') { - printf("Enter 'y', 'Y', 'yes' or 'YES' if you agree with the previous asked question.\n"); -diff -puNr cdrkit-1.1.9.orig/readom/readom.c cdrkit-1.1.9/readom/readom.c ---- cdrkit-1.1.9.orig/readom/readom.c 2007-04-03 00:43:29.000000000 +0200 -+++ cdrkit-1.1.9/readom/readom.c 2009-03-11 20:31:53.000000000 +0100 -@@ -1605,7 +1605,7 @@ read_generic(SCSI *usalp, parm_t *parmp, - fprintf(stderr, "Copy from SCSI (%d,%d,%d) disk to file\n", - usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp)); - fprintf(stderr, "Enter filename [%s]: ", defname); flush(); -- (void) getline(filename, sizeof (filename)); -+ (void) get_line(filename, sizeof (filename)); - } - - if (askrange) { -@@ -1772,7 +1772,7 @@ write_disk(SCSI *usalp, parm_t *parmp) - fprintf(stderr, "Copy from file to SCSI (%d,%d,%d) disk\n", - usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp)); - fprintf(stderr, "Enter filename [%s]: ", defname); flush(); -- (void) getline(filename, sizeof (filename)); -+ (void) get_line(filename, sizeof (filename)); - fprintf(stderr, "Notice: reading from file always starts at file offset 0.\n"); - - getlong("Enter starting sector for copy:", &addr, 0L, end-1); -diff -puNr cdrkit-1.1.9.orig/wodim/cue.c cdrkit-1.1.9/wodim/cue.c ---- cdrkit-1.1.9.orig/wodim/cue.c 2006-12-08 14:38:43.000000000 +0100 -+++ cdrkit-1.1.9/wodim/cue.c 2009-03-11 20:32:18.000000000 +0100 -@@ -253,7 +253,7 @@ static char *skipwhite(const char *s); - static char *peekword(void); - static char *lineend(void); - static char *markword(char *delim); --static char getdelim(void); -+static char get_delim(void); - static char *getnextitem(char *delim); - static char *neednextitem(char *delim); - static char *nextword(void); -@@ -746,7 +746,7 @@ parse_track(track_t trackp[], state_t *s - if (kp == NULL) - cueabort("Unknown filetype '%s'", word); - -- if (getdelim() == '/') { -+ if (get_delim() == '/') { - word = needitem(); - if (*astol(++word, &secsize) != '\0') - cueabort("Not a number '%s'", word); -@@ -1128,7 +1128,7 @@ linelen--; - } - - static char --getdelim() -+get_delim() - { - return (wordendc); - } diff -r c7b121a4ffd9 -r d6378d455338 clementine/receipt --- a/clementine/receipt Wed May 09 17:03:28 2018 +0300 +++ b/clementine/receipt Thu May 10 21:12:00 2018 +0300 @@ -23,7 +23,6 @@ compile_rules() { mkdir build - patch -Np1 -i $stuff/udisks-namespace.patch cd $src/build cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ diff -r c7b121a4ffd9 -r d6378d455338 clementine/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clementine/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +udisks-namespace.patch diff -r c7b121a4ffd9 -r d6378d455338 clementine/stuff/patches/udisks-namespace.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clementine/stuff/patches/udisks-namespace.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,33 @@ +--- + src/CMakeLists.txt | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 650fa74..775b0a5 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -892,11 +892,6 @@ optional_source(LINUX SOURCES widgets/osd_x11.cpp) + if(HAVE_DBUS) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus) + +- # Hack to get it to generate interfaces without namespaces - required +- # because otherwise org::freedesktop::UDisks and +- # org::freedesktop::UDisks::Device conflict. +- list(APPEND QT_DBUSXML2CPP_EXECUTABLE -N) +- + # MPRIS DBUS interfaces + qt4_add_dbus_adaptor(SOURCES + dbus/org.freedesktop.MediaPlayer.player.xml +@@ -964,6 +959,10 @@ if(HAVE_DBUS) + + # DeviceKit DBUS interfaces + if(HAVE_DEVICEKIT) ++ set_source_files_properties(dbus/org.freedesktop.UDisks.xml ++ PROPERTIES NO_NAMESPACE dbus/udisks) ++ set_source_files_properties(dbus/org.freedesktop.UDisks.Device.xml ++ PROPERTIES NO_NAMESPACE dbus/udisksdevice) + qt4_add_dbus_interface(SOURCES + dbus/org.freedesktop.UDisks.xml + dbus/udisks) +-- +2.0.3 diff -r c7b121a4ffd9 -r d6378d455338 clementine/stuff/udisks-namespace.patch --- a/clementine/stuff/udisks-namespace.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ ---- - src/CMakeLists.txt | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 650fa74..775b0a5 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -892,11 +892,6 @@ optional_source(LINUX SOURCES widgets/osd_x11.cpp) - if(HAVE_DBUS) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus) - -- # Hack to get it to generate interfaces without namespaces - required -- # because otherwise org::freedesktop::UDisks and -- # org::freedesktop::UDisks::Device conflict. -- list(APPEND QT_DBUSXML2CPP_EXECUTABLE -N) -- - # MPRIS DBUS interfaces - qt4_add_dbus_adaptor(SOURCES - dbus/org.freedesktop.MediaPlayer.player.xml -@@ -964,6 +959,10 @@ if(HAVE_DBUS) - - # DeviceKit DBUS interfaces - if(HAVE_DEVICEKIT) -+ set_source_files_properties(dbus/org.freedesktop.UDisks.xml -+ PROPERTIES NO_NAMESPACE dbus/udisks) -+ set_source_files_properties(dbus/org.freedesktop.UDisks.Device.xml -+ PROPERTIES NO_NAMESPACE dbus/udisksdevice) - qt4_add_dbus_interface(SOURCES - dbus/org.freedesktop.UDisks.xml - dbus/udisks) --- -2.0.3 diff -r c7b121a4ffd9 -r d6378d455338 clisp/receipt --- a/clisp/receipt Wed May 09 17:03:28 2018 +0300 +++ b/clisp/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ # Rules to configure and make the package. compile_rules() { - # Temporarily (?) disabling one failed test - patch -p1 -i $stuff/streams.tst.patch - # CFLAGS/CXXFLAGS/MAKEFLAGS screw the build process. unset CFLAGS CXXFLAGS MAKEFLAGS export CFLAGS="-falign-functions=4" diff -r c7b121a4ffd9 -r d6378d455338 clisp/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clisp/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# Temporarily (?) disabling one failed test +-p1|streams.tst.patch diff -r c7b121a4ffd9 -r d6378d455338 clisp/stuff/patches/streams.tst.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clisp/stuff/patches/streams.tst.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,43 @@ +Disable one test from "streams" group. + + +1) Normal test flow: http://cook.slitaz.org/cooker.cgi?log=clisp.log.2 + +(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S))) +;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 301 Moved Permanently --> "http://www.clisp.org/impnotes/id-href.map" +;; connecting to "http://www.clisp.org/impnotes/id-href.map"...connected...HTTP/1.1 200 OK...74,297 bytes +;; SYSTEM::GET-STRING-MAP(#)...2,004 IDs +;; SYSTEM::ENSURE-IMPNOTES-MAP(#P"/home/slitaz/wok/clisp/source/clisp-2.49/doc/Symbol-Table.text")... +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol + "EXT:SOURCE-PROGRAM-ERROR" +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol + "EXT:SOURCE-PROGRAM-ERROR-DETAIL" +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol + "EXT:SOURCE-PROGRAM-ERROR-FORM" +644 IDs +EQL-OK: T + + +2) Something wrong (network problems?): http://cook.slitaz.org/cooker.cgi?pkg=clisp + +(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S))) +;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 302 Found --> "https://clisp.cons.org:80/impnotes/id-href.map" +;; connecting to "http://clisp.cons.orghttps://clisp.cons.org:80/impnotes/id-href.map"... +[SIMPLE-PARSE-ERROR]: PARSE-INTEGER: substring "" does not have integer syntax at position 0 + +ERROR!! ERROR should be T ! + + +--- a/tests/streams.tst ++++ b/tests/streams.tst +@@ -1036,8 +1036,8 @@ + (describe (make-array nil :element-type nil) s))) + T + +-(stringp (with-output-to-string (s) (describe nil s))) +-T ++;;(stringp (with-output-to-string (s) (describe nil s))) ++;;T + + ;; https://sourceforge.net/tracker/index.php?func=detail&aid=1622642&group_id=1355&atid=101355 + (let ((s "a b")) diff -r c7b121a4ffd9 -r d6378d455338 clisp/stuff/streams.tst.patch --- a/clisp/stuff/streams.tst.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -Disable one test from "streams" group. - - -1) Normal test flow: http://cook.slitaz.org/cooker.cgi?log=clisp.log.2 - -(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S))) -;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 301 Moved Permanently --> "http://www.clisp.org/impnotes/id-href.map" -;; connecting to "http://www.clisp.org/impnotes/id-href.map"...connected...HTTP/1.1 200 OK...74,297 bytes -;; SYSTEM::GET-STRING-MAP(#)...2,004 IDs -;; SYSTEM::ENSURE-IMPNOTES-MAP(#P"/home/slitaz/wok/clisp/source/clisp-2.49/doc/Symbol-Table.text")... -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol - "EXT:SOURCE-PROGRAM-ERROR" -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol - "EXT:SOURCE-PROGRAM-ERROR-DETAIL" -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol - "EXT:SOURCE-PROGRAM-ERROR-FORM" -644 IDs -EQL-OK: T - - -2) Something wrong (network problems?): http://cook.slitaz.org/cooker.cgi?pkg=clisp - -(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S))) -;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 302 Found --> "https://clisp.cons.org:80/impnotes/id-href.map" -;; connecting to "http://clisp.cons.orghttps://clisp.cons.org:80/impnotes/id-href.map"... -[SIMPLE-PARSE-ERROR]: PARSE-INTEGER: substring "" does not have integer syntax at position 0 - -ERROR!! ERROR should be T ! - - ---- a/tests/streams.tst -+++ b/tests/streams.tst -@@ -1036,8 +1036,8 @@ - (describe (make-array nil :element-type nil) s))) - T - --(stringp (with-output-to-string (s) (describe nil s))) --T -+;;(stringp (with-output-to-string (s) (describe nil s))) -+;;T - - ;; https://sourceforge.net/tracker/index.php?func=detail&aid=1622642&group_id=1355&atid=101355 - (let ((s "a b")) diff -r c7b121a4ffd9 -r d6378d455338 cmark-gfm/receipt --- a/cmark-gfm/receipt Wed May 09 17:03:28 2018 +0300 +++ b/cmark-gfm/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,8 +17,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/cmark-0.27.1.76.patch - mkdir build; cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make && diff -r c7b121a4ffd9 -r d6378d455338 cmark-gfm/stuff/cmark-0.27.1.76.patch --- a/cmark-gfm/stuff/cmark-0.27.1.76.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- a/man/CMakeLists.txt -+++ b/man/CMakeLists.txt -@@ -5,6 +5,6 @@ - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) - -- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark.3 -+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark-gfm.3 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) - endif(NOT MSVC) diff -r c7b121a4ffd9 -r d6378d455338 cmark-gfm/stuff/patches/cmark-0.27.1.76.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmark-gfm/stuff/patches/cmark-0.27.1.76.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- a/man/CMakeLists.txt ++++ b/man/CMakeLists.txt +@@ -5,6 +5,6 @@ + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + +- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark.3 ++ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark-gfm.3 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) + endif(NOT MSVC) diff -r c7b121a4ffd9 -r d6378d455338 cmark-gfm/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmark-gfm/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|cmark-0.27.1.76.patch diff -r c7b121a4ffd9 -r d6378d455338 codeblocks/receipt --- a/codeblocks/receipt Wed May 09 17:03:28 2018 +0300 +++ b/codeblocks/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,8 +19,6 @@ # Binutils 2.22 break many packages build without LDFLAGS set correctly. export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" - busybox patch -p1 -i $stuff/glib.u - ./configure \ --with-contrib-plugins="all, -help" \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 codeblocks/stuff/glib.u --- a/codeblocks/stuff/glib.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883 - ---- codeblocks-8.02/src/src/prefix.cpp -+++ codeblocks-8.02/src/src/prefix.cpp -@@ -393,7 +393,7 @@ - - br_return_val_if_fail (path != (char *) NULL, (char *) NULL); - -- end = strrchr (path, '/'); -+ end = strrchr ((char *) path, '/'); - if (!end) return strdup ("."); - - while (end > path && *end == '/') -@@ -429,7 +429,7 @@ - br_return_val_if_fail (path != (char *) NULL, (char *) NULL); - - if (!*path) return strdup ("/"); -- end = strrchr (path, '/'); -+ end = strrchr ((char *) path, '/'); - if (!end) return strdup (path); - - tmp = br_strndup ((char *) path, end - path); - ---- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp -+++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp -@@ -21,6 +21,13 @@ - - #include - #include "sdk.h" -+#if defined(__WXGTK__) -+#define GSocket GlibGSocket -+ #include "wx/gtk/win_gtk.h" -+#undef GSocket -+ #include -+#endif -+ - #ifndef CB_PRECOMP - #include - #include // Manager::Get()->GetAppWindow() -@@ -51,11 +58,6 @@ - #include - #include "memorymappedfile.h" - --#if defined(__WXGTK__) -- #include "wx/gtk/win_gtk.h" -- #include --#endif -- - // The plugin needs a flag ON to enable some code for the plugin - #if !defined(BUILDING_PLUGIN) - #error preprocessor BUILDING_PLUGIN flag required for this target - ---- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp -+++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp -@@ -19,6 +19,12 @@ - */ - // RCS-ID: $Id: codesnippetstreectrl.cpp 112 2008-01-07 17:03:31Z Pecan $ - -+#if defined(__WXGTK__) -+#define GSocket GlibGSocket -+ #include "wx/gtk/win_gtk.h" -+#undef GSocket -+ #include -+#endif - #ifdef WX_PRECOMP - #include "wx_pch.h" - #else -@@ -48,10 +54,6 @@ - #include "messagebox.h" - #include "menuidentifiers.h" - #include "editsnippetframe.h" --#if defined(__WXGTK__) -- #include "wx/gtk/win_gtk.h" -- #include --#endif - - IMPLEMENT_DYNAMIC_CLASS(CodeSnippetsTreeCtrl, wxTreeCtrl) - diff -r c7b121a4ffd9 -r d6378d455338 codeblocks/stuff/patches/glib.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/codeblocks/stuff/patches/glib.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,78 @@ +Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883 + +--- codeblocks-8.02/src/src/prefix.cpp ++++ codeblocks-8.02/src/src/prefix.cpp +@@ -393,7 +393,7 @@ + + br_return_val_if_fail (path != (char *) NULL, (char *) NULL); + +- end = strrchr (path, '/'); ++ end = strrchr ((char *) path, '/'); + if (!end) return strdup ("."); + + while (end > path && *end == '/') +@@ -429,7 +429,7 @@ + br_return_val_if_fail (path != (char *) NULL, (char *) NULL); + + if (!*path) return strdup ("/"); +- end = strrchr (path, '/'); ++ end = strrchr ((char *) path, '/'); + if (!end) return strdup (path); + + tmp = br_strndup ((char *) path, end - path); + +--- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp ++++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp +@@ -21,6 +21,13 @@ + + #include + #include "sdk.h" ++#if defined(__WXGTK__) ++#define GSocket GlibGSocket ++ #include "wx/gtk/win_gtk.h" ++#undef GSocket ++ #include ++#endif ++ + #ifndef CB_PRECOMP + #include + #include // Manager::Get()->GetAppWindow() +@@ -51,11 +58,6 @@ + #include + #include "memorymappedfile.h" + +-#if defined(__WXGTK__) +- #include "wx/gtk/win_gtk.h" +- #include +-#endif +- + // The plugin needs a flag ON to enable some code for the plugin + #if !defined(BUILDING_PLUGIN) + #error preprocessor BUILDING_PLUGIN flag required for this target + +--- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp ++++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp +@@ -19,6 +19,12 @@ + */ + // RCS-ID: $Id: codesnippetstreectrl.cpp 112 2008-01-07 17:03:31Z Pecan $ + ++#if defined(__WXGTK__) ++#define GSocket GlibGSocket ++ #include "wx/gtk/win_gtk.h" ++#undef GSocket ++ #include ++#endif + #ifdef WX_PRECOMP + #include "wx_pch.h" + #else +@@ -48,10 +54,6 @@ + #include "messagebox.h" + #include "menuidentifiers.h" + #include "editsnippetframe.h" +-#if defined(__WXGTK__) +- #include "wx/gtk/win_gtk.h" +- #include +-#endif + + IMPLEMENT_DYNAMIC_CLASS(CodeSnippetsTreeCtrl, wxTreeCtrl) + diff -r c7b121a4ffd9 -r d6378d455338 codeblocks/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/codeblocks/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|glib.u diff -r c7b121a4ffd9 -r d6378d455338 comical/receipt --- a/comical/receipt Wed May 09 17:03:28 2018 +0300 +++ b/comical/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/comical-0.8_wx-2.8.patch make -j 1 } diff -r c7b121a4ffd9 -r d6378d455338 comical/stuff/comical-0.8_wx-2.8.patch --- a/comical/stuff/comical-0.8_wx-2.8.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ ---- "a/Comical Icons/comical.xpm" -+++ "b/Comical Icons/comical.xpm" -@@ -1,5 +1,5 @@ - /* XPM */ --static char *comical_xpm[]={ -+static const char *comical_xpm[]={ - "128 128 131 2", - "Qt c None", - ".8 c #080000", ---- a/src/ComicalApp.cpp -+++ b/src/ComicalApp.cpp -@@ -28,6 +28,8 @@ - #include "ComicalApp.h" - #include "ComicalFrame.h" - #include -+#include -+#include - - #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__) - #include "../Comical Icons/comical.xpm" ---- a/src/ComicBook.cpp -+++ b/src/ComicBook.cpp -@@ -537,7 +537,8 @@ - if (curr > 0) { // ftw and fth scaling requires previous page to - target--; // do FitWithoutScrollbars. - if (target > high) -- target = curr - (++target - high); -+ // target = curr - (++target - high); // will cause 'target' uninitialized warning -+ target = curr - ((target + 1) - high); - } else if (target > high) - target = curr - (target - high); - try { ---- a/Makefile -+++ b/Makefile -@@ -1,8 +1,8 @@ - CC = `wx-config --cxx` --LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -+LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz - INSTALL = install - INSTALL_PROGRAM = $(INSTALL) --prefix = /usr/local -+prefix = /usr - exec_prefix = $(prefix) - bindir = $(exec_prefix)/bin - -@@ -43,4 +43,4 @@ - $(MAKE) clean -C unzip - rm -f $(DEPS) bin2h src/bin2h.o - --.PHONY : install install-strip uninstall clean distclean -+.PHONY : all install install-strip uninstall clean distclean diff -r c7b121a4ffd9 -r d6378d455338 comical/stuff/patches/comical-0.8_wx-2.8.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/comical/stuff/patches/comical-0.8_wx-2.8.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,51 @@ +--- "a/Comical Icons/comical.xpm" ++++ "b/Comical Icons/comical.xpm" +@@ -1,5 +1,5 @@ + /* XPM */ +-static char *comical_xpm[]={ ++static const char *comical_xpm[]={ + "128 128 131 2", + "Qt c None", + ".8 c #080000", +--- a/src/ComicalApp.cpp ++++ b/src/ComicalApp.cpp +@@ -28,6 +28,8 @@ + #include "ComicalApp.h" + #include "ComicalFrame.h" + #include ++#include ++#include + + #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__) + #include "../Comical Icons/comical.xpm" +--- a/src/ComicBook.cpp ++++ b/src/ComicBook.cpp +@@ -537,7 +537,8 @@ + if (curr > 0) { // ftw and fth scaling requires previous page to + target--; // do FitWithoutScrollbars. + if (target > high) +- target = curr - (++target - high); ++ // target = curr - (++target - high); // will cause 'target' uninitialized warning ++ target = curr - ((target + 1) - high); + } else if (target > high) + target = curr - (target - high); + try { +--- a/Makefile ++++ b/Makefile +@@ -1,8 +1,8 @@ + CC = `wx-config --cxx` +-LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip ++LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz + INSTALL = install + INSTALL_PROGRAM = $(INSTALL) +-prefix = /usr/local ++prefix = /usr + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + +@@ -43,4 +43,4 @@ + $(MAKE) clean -C unzip + rm -f $(DEPS) bin2h src/bin2h.o + +-.PHONY : install install-strip uninstall clean distclean ++.PHONY : all install install-strip uninstall clean distclean diff -r c7b121a4ffd9 -r d6378d455338 comical/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/comical/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|comical-0.8_wx-2.8.patch diff -r c7b121a4ffd9 -r d6378d455338 cryptkeeper/receipt --- a/cryptkeeper/receipt Wed May 09 17:03:28 2018 +0300 +++ b/cryptkeeper/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,6 @@ compile_rules() { mv po/ru_RU.gmo po/ru.gmo - patch -p1 -i $stuff/cryptkeeper.patch export LDFLAGS="-lX11" ./configure $CONFIGURE_ARGS && make && make install diff -r c7b121a4ffd9 -r d6378d455338 cryptkeeper/stuff/cryptkeeper.patch --- a/cryptkeeper/stuff/cryptkeeper.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ ---- a/src/defines.h -+++ b/src/defines.h -@@ -4,7 +4,7 @@ - #define UI_SPACING 5 - #define UI_WINDOW_BORDER 10 - --#define DEFAULT_FILEMANAGER "nautilus" -+#define DEFAULT_FILEMANAGER "pcmanfm" - - #include "../config.h" - #include "../lib/gettext.h" - ---- a/src/lsof.cpp -+++ b/src/lsof.cpp -@@ -17,6 +17,7 @@ - */ - #include - #include -+#include - #include - #include - #include - ---- a/po/LINGUAS -+++ b.po/LINGUAS -@@ -1 +1 @@ --en@quot en@boldquot fr en_GB de_DE pt_BR ru_RU tr pl es_ES it -+en@quot en@boldquot fr en_GB de_DE pt_BR ru tr pl es_ES it - ---- a/cryptkeeper.desktop -+++ b/cryptkeeper.desktop -@@ -3,7 +3,7 @@ - Name=Cryptkeeper - Exec=cryptkeeper - Icon=cryptkeeper --Categories=Application;System; -+Categories=Application;System;Security; - Terminal=false - Type=Application - StartupNotify=false diff -r c7b121a4ffd9 -r d6378d455338 cryptkeeper/stuff/patches/cryptkeeper.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cryptkeeper/stuff/patches/cryptkeeper.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,40 @@ +--- a/src/defines.h ++++ b/src/defines.h +@@ -4,7 +4,7 @@ + #define UI_SPACING 5 + #define UI_WINDOW_BORDER 10 + +-#define DEFAULT_FILEMANAGER "nautilus" ++#define DEFAULT_FILEMANAGER "pcmanfm" + + #include "../config.h" + #include "../lib/gettext.h" + +--- a/src/lsof.cpp ++++ b/src/lsof.cpp +@@ -17,6 +17,7 @@ + */ + #include + #include ++#include + #include + #include + #include + +--- a/po/LINGUAS ++++ b.po/LINGUAS +@@ -1 +1 @@ +-en@quot en@boldquot fr en_GB de_DE pt_BR ru_RU tr pl es_ES it ++en@quot en@boldquot fr en_GB de_DE pt_BR ru tr pl es_ES it + +--- a/cryptkeeper.desktop ++++ b/cryptkeeper.desktop +@@ -3,7 +3,7 @@ + Name=Cryptkeeper + Exec=cryptkeeper + Icon=cryptkeeper +-Categories=Application;System; ++Categories=Application;System;Security; + Terminal=false + Type=Application + StartupNotify=false diff -r c7b121a4ffd9 -r d6378d455338 cryptkeeper/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cryptkeeper/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|cryptkeeper.patch diff -r c7b121a4ffd9 -r d6378d455338 csstidy/receipt --- a/csstidy/receipt Wed May 09 17:03:28 2018 +0300 +++ b/csstidy/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/csstidy-1.4-fix-misc.cpp.patch scons mkdir -p $install/usr/bin cp -a $src/release/csstidy/csstidy $install/usr/bin diff -r c7b121a4ffd9 -r d6378d455338 csstidy/stuff/csstidy-1.4-fix-misc.cpp.patch --- a/csstidy/stuff/csstidy-1.4-fix-misc.cpp.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- a/csstidy/misc.cpp -+++ b/csstidy/misc.cpp -@@ -16,6 +16,7 @@ - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -+#include - #include "csspp_globals.hpp" - - bool escaped(const string &istring, const int pos) diff -r c7b121a4ffd9 -r d6378d455338 csstidy/stuff/patches/csstidy-1.4-fix-misc.cpp.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/csstidy/stuff/patches/csstidy-1.4-fix-misc.cpp.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- a/csstidy/misc.cpp ++++ b/csstidy/misc.cpp +@@ -16,6 +16,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#include + #include "csspp_globals.hpp" + + bool escaped(const string &istring, const int pos) diff -r c7b121a4ffd9 -r d6378d455338 csstidy/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/csstidy/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|csstidy-1.4-fix-misc.cpp.patch diff -r c7b121a4ffd9 -r d6378d455338 dia/receipt --- a/dia/receipt Wed May 09 17:03:28 2018 +0300 +++ b/dia/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,7 +19,6 @@ compile_rules() { #find . -name '*.[ch]*' | xargs sed -i 's||&\n#include |' plug-ins/vdx/vdx-export.c - #patch -Np1 -i $stuff/dia-overflow-fix.patch ./configure \ --with-python \ diff -r c7b121a4ffd9 -r d6378d455338 dia/stuff/dia-overflow-fix.patch --- a/dia/stuff/dia-overflow-fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -diff -wbBur dia-0.97.1/plug-ins/xfig/xfig-export.c dia-0.97.1.my/plug-ins/xfig/xfig-export.c ---- dia-0.97.1/plug-ins/xfig/xfig-export.c 2009-11-07 17:28:34.000000000 +0300 -+++ dia-0.97.1.my/plug-ins/xfig/xfig-export.c 2010-11-15 17:44:05.640896280 +0300 -@@ -417,6 +417,9 @@ - if (text[i] > 127) { - newlen += 3; - } -+ if (text[i] == '\\') { -+ newlen += 1; -+ } - } - returntext = g_malloc(sizeof(char)*(newlen+1)); - j = 0; -@@ -1085,10 +1088,10 @@ - figtext = figText(renderer, (unsigned char *) text); - /* xfig texts are specials */ - fprintf(renderer->file, "4 %d %d %d 0 %d %s 0.0 6 0.0 0.0 %d %d %s\\001\n", -- figAlignment(renderer, alignment), -- figColor(renderer, color), -- figDepth(renderer), -- figFont(renderer), -+ (int)figAlignment(renderer, alignment), -+ (int)figColor(renderer, color), -+ (int)figDepth(renderer), -+ (int)figFont(renderer), - xfig_dtostr(d_buf, figFontSize(renderer)), - (int)figCoord(renderer, pos->x), - (int)figCoord(renderer, pos->y), diff -r c7b121a4ffd9 -r d6378d455338 dia/stuff/patches/dia-overflow-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dia/stuff/patches/dia-overflow-fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,28 @@ +diff -wbBur dia-0.97.1/plug-ins/xfig/xfig-export.c dia-0.97.1.my/plug-ins/xfig/xfig-export.c +--- dia-0.97.1/plug-ins/xfig/xfig-export.c 2009-11-07 17:28:34.000000000 +0300 ++++ dia-0.97.1.my/plug-ins/xfig/xfig-export.c 2010-11-15 17:44:05.640896280 +0300 +@@ -417,6 +417,9 @@ + if (text[i] > 127) { + newlen += 3; + } ++ if (text[i] == '\\') { ++ newlen += 1; ++ } + } + returntext = g_malloc(sizeof(char)*(newlen+1)); + j = 0; +@@ -1085,10 +1088,10 @@ + figtext = figText(renderer, (unsigned char *) text); + /* xfig texts are specials */ + fprintf(renderer->file, "4 %d %d %d 0 %d %s 0.0 6 0.0 0.0 %d %d %s\\001\n", +- figAlignment(renderer, alignment), +- figColor(renderer, color), +- figDepth(renderer), +- figFont(renderer), ++ (int)figAlignment(renderer, alignment), ++ (int)figColor(renderer, color), ++ (int)figDepth(renderer), ++ (int)figFont(renderer), + xfig_dtostr(d_buf, figFontSize(renderer)), + (int)figCoord(renderer, pos->x), + (int)figCoord(renderer, pos->y), diff -r c7b121a4ffd9 -r d6378d455338 dia/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dia/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +# dia-overflow-fix.patch diff -r c7b121a4ffd9 -r d6378d455338 dillo/receipt --- a/dillo/receipt Wed May 09 17:03:28 2018 +0300 +++ b/dillo/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,7 +15,6 @@ xorg-libX11-dev" compile_rules() { - patch -p0 < $stuff/fltk-1.3.3.u cp -f $stuff/pixmaps.slitaz.h src/pixmaps.h && ./configure \ diff -r c7b121a4ffd9 -r d6378d455338 dillo/stuff/fltk-1.3.3.u --- a/dillo/stuff/fltk-1.3.3.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ ---- dw/fltkviewbase.cc -+++ dw/fltkviewbase.cc -@@ -27,8 +27,6 @@ - #include - #include "../lout/msg.h" - --extern Fl_Widget* fl_oldfocus; -- - using namespace lout::object; - using namespace lout::container::typed; - -@@ -364,7 +362,9 @@ - } - return 1; - case FL_UNFOCUS: -- focused_child = fl_oldfocus; -+ //focused_child = fl_oldfocus; -+ for (Fl_Widget *p = this; p; p = p->parent()) -+ focused_child = p; - return 0; - case FL_KEYBOARD: - if (Fl::event_key() == FL_Tab) diff -r c7b121a4ffd9 -r d6378d455338 dillo/stuff/patches/fltk-1.3.3.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dillo/stuff/patches/fltk-1.3.3.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,22 @@ +--- dw/fltkviewbase.cc ++++ dw/fltkviewbase.cc +@@ -27,8 +27,6 @@ + #include + #include "../lout/msg.h" + +-extern Fl_Widget* fl_oldfocus; +- + using namespace lout::object; + using namespace lout::container::typed; + +@@ -364,7 +362,9 @@ + } + return 1; + case FL_UNFOCUS: +- focused_child = fl_oldfocus; ++ //focused_child = fl_oldfocus; ++ for (Fl_Widget *p = this; p; p = p->parent()) ++ focused_child = p; + return 0; + case FL_KEYBOARD: + if (Fl::event_key() == FL_Tab) diff -r c7b121a4ffd9 -r d6378d455338 dillo/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dillo/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|fltk-1.3.3.u diff -r c7b121a4ffd9 -r d6378d455338 dvd+rw-tools/receipt --- a/dvd+rw-tools/receipt Wed May 09 17:03:28 2018 +0300 +++ b/dvd+rw-tools/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,7 +15,6 @@ SPLIT="dvd+rw-media-tools" compile_rules() { - patch -p1 -i $stuff/build-7.1.patch grep -qs 'define u8' growisofs.c || sed -i 's|#include |#define u8 __u8\n&|' growisofs.c make diff -r c7b121a4ffd9 -r d6378d455338 dvd+rw-tools/stuff/build-7.1.patch --- a/dvd+rw-tools/stuff/build-7.1.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- dvd+rw-tools-7.1/growisofs.c Tue Mar 4 09:15:03 2008 -+++ dvd+rw-tools-7.1-new/growisofs.c Wed Apr 22 21:57:43 2009 -@@ -442,6 +442,7 @@ - #include - #include - #include -+#include - #include "mp.h" - - #if defined(__unix) || defined(__unix__) ---- dvd+rw-tools-7.1/transport.hxx Sat Mar 1 10:34:43 2008 -+++ dvd+rw-tools-7.1-new/transport.hxx Wed Apr 22 21:58:09 2009 -@@ -145,6 +145,7 @@ - #include - #include - #include -+#include - #if !defined(SG_FLAG_LUN_INHIBIT) - # if defined(SG_FLAG_UNUSED_LUN_INHIBIT) - # define SG_FLAG_LUN_INHIBIT SG_FLAG_UNUSED_LUN_INHIBIT diff -r c7b121a4ffd9 -r d6378d455338 dvd+rw-tools/stuff/patches/build-7.1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dvd+rw-tools/stuff/patches/build-7.1.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- dvd+rw-tools-7.1/growisofs.c Tue Mar 4 09:15:03 2008 ++++ dvd+rw-tools-7.1-new/growisofs.c Wed Apr 22 21:57:43 2009 +@@ -442,6 +442,7 @@ + #include + #include + #include ++#include + #include "mp.h" + + #if defined(__unix) || defined(__unix__) +--- dvd+rw-tools-7.1/transport.hxx Sat Mar 1 10:34:43 2008 ++++ dvd+rw-tools-7.1-new/transport.hxx Wed Apr 22 21:58:09 2009 +@@ -145,6 +145,7 @@ + #include + #include + #include ++#include + #if !defined(SG_FLAG_LUN_INHIBIT) + # if defined(SG_FLAG_UNUSED_LUN_INHIBIT) + # define SG_FLAG_LUN_INHIBIT SG_FLAG_UNUSED_LUN_INHIBIT diff -r c7b121a4ffd9 -r d6378d455338 dvd+rw-tools/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dvd+rw-tools/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|build-7.1.patch diff -r c7b121a4ffd9 -r d6378d455338 epdfview-cups/receipt --- a/epdfview-cups/receipt Wed May 09 17:03:28 2018 +0300 +++ b/epdfview-cups/receipt Thu May 10 21:12:00 2018 +0300 @@ -27,7 +27,7 @@ -e 's/location->values\[0\].string.text/ippGetString(location, 0, NULL)/' \ -e 's/.*IPP_TAG_KEYWORD.*/ ipp_t *request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);\n&/' \ src/PrintPter.cxx - patch -p1 -i $stuff/no-stock-icons.patch + ./configure \ --with-cups \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 epdfview-cups/stuff/no-stock-icons.patch --- a/epdfview-cups/stuff/no-stock-icons.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ ---- a/src/gtk/FindView.cxx -+++ b/srv/gtk/FindView.cxx -@@ -50,7 +50,7 @@ - gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ); - - // The "Close" button. -- m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); -+ m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close")); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1); - - // The text to find entry. -@@ -65,13 +65,13 @@ - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1); - - // The "Find Next" button. -- m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT); -+ m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next")); - gtk_tool_item_set_is_important (m_FindNext, TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1); - - // The "Find Previous" button. - m_FindPrevious = -- gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS); -+ gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous")); - gtk_tool_item_set_is_important (m_FindPrevious, TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1); - ---- a/src/gtk/MainView.cxx -+++ b/src/gtk/MainView.cxx -@@ -92,80 +92,80 @@ - { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, - { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, - -- { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "O", -+ { "OpenFile", "document-open", N_("_Open"), "O", - N_("Open a PDF document"), - G_CALLBACK (main_window_open_file_cb) }, - -- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", -+ { "ReloadFile", "view-refresh", N_("_Reload"), "R", - N_("Reload the current document"), - G_CALLBACK (main_window_reload_cb) }, - -- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", -+ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", - N_("Save a copy of the current document"), - G_CALLBACK (main_window_save_file_cb) }, - - #if defined (HAVE_CUPS) -- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", -+ { "Print", "document-print", N_("_Print..."), "P", - N_("Print the current document"), - G_CALLBACK (main_window_print_cb) }, - #endif // HAVE_CUPS - -- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", -+ { "Quit", "window-close", N_("_Close"), "W", - N_("Close this window"), - G_CALLBACK (main_window_quit_cb) }, - -- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", -+ { "Find", "edit-find", N_("_Find"), "F", - N_("Find a word in the document"), - G_CALLBACK (main_window_find_cb) }, - -- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, -+ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, - N_("Change the application's preferences"), - G_CALLBACK (main_window_preferences_cb) }, - -- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", -+ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", - N_("Enlarge the document"), - G_CALLBACK (main_window_zoom_in_cb) }, - -- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", -+ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", - N_("Shrink the document"), - G_CALLBACK (main_window_zoom_out_cb) }, - -- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", -+ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", - N_("Rotate the document 90 degrees clockwise"), - G_CALLBACK (main_window_rotate_right_cb) }, - -- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", -+ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", - N_("Rotate the document 90 degrees counter-clockwise"), - G_CALLBACK (main_window_rotate_left_cb) }, - -- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", -+ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", - N_("Go to the first page"), - G_CALLBACK (main_window_go_to_first_page_cb) }, - -- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", -+ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", - N_("Go to the next page"), - G_CALLBACK (main_window_go_to_next_page_cb) }, - -- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", -+ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", - N_("Go to the previous page"), - G_CALLBACK (main_window_go_to_previous_page_cb) }, - -- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", -+ { "GoToLastPage", "go-last", N_("_Last Page"), "End", - N_("Go to the last page"), - G_CALLBACK (main_window_go_to_last_page_cb) }, - -- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, -+ { "About", "help-about", N_("_About"), NULL, - N_("Display application's credits"), - G_CALLBACK (main_window_about_box_cb) }, - - // Accelerator keys. -- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, -+ { "Slash", "edit-find", NULL, "slash", NULL, - G_CALLBACK (main_window_find_cb) }, - -- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, -+ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, - G_CALLBACK (main_window_zoom_in_cb) }, - -- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", -+ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", - NULL, - G_CALLBACK (main_window_zoom_out_cb) } - }; -@@ -188,21 +188,21 @@ - N_("Show or hide the document's outline"), - G_CALLBACK (main_window_show_index_cb), FALSE }, - -- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, -+ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, - N_("Make the current document fill the window"), - G_CALLBACK (main_window_zoom_fit_cb), FALSE }, - -- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, -+ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, - N_("Make the current document fill the window width"), - G_CALLBACK (main_window_zoom_width_cb), FALSE }, - }; - - static GtkRadioActionEntry g_PageScrollEntries[] = - { -- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, -+ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, - N_("Mouse scroll page"), (int)PagePterModeScroll }, - -- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, -+ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, - N_(" Mouse select text"), (int)PagePterModeSelectText }, - }; - -@@ -1031,35 +1031,7 @@ - void - MainView::setMainWindowIcon () - { -- const gchar *iconFiles[] = -- { -- "icon_epdfview-48.png", -- "icon_epdfview-32.png", -- "icon_epdfview-24.png", -- }; -- -- GList *iconList = NULL; -- int iconFilesNum = G_N_ELEMENTS (iconFiles); -- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) -- { -- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", -- iconFiles[iconIndex], NULL); -- GError *error = NULL; -- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); -- if ( NULL != iconPixbuf ) -- { -- iconList = g_list_prepend (iconList, iconPixbuf); -- } -- else -- { -- g_warning ("Error loading icon: %s\n", error->message); -- g_error_free (error); -- } -- g_free (filename); -- } -- gtk_window_set_default_icon_list (iconList); -- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); -- g_list_free (iconList); -+ gtk_window_set_default_icon_name ("epdfview"); - } - - /// diff -r c7b121a4ffd9 -r d6378d455338 epdfview-cups/stuff/patches/no-stock-icons.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview-cups/stuff/patches/no-stock-icons.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,192 @@ +--- a/src/gtk/FindView.cxx ++++ b/srv/gtk/FindView.cxx +@@ -50,7 +50,7 @@ + gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ); + + // The "Close" button. +- m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); ++ m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close")); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1); + + // The text to find entry. +@@ -65,13 +65,13 @@ + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1); + + // The "Find Next" button. +- m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT); ++ m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next")); + gtk_tool_item_set_is_important (m_FindNext, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1); + + // The "Find Previous" button. + m_FindPrevious = +- gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS); ++ gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous")); + gtk_tool_item_set_is_important (m_FindPrevious, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1); + +--- a/src/gtk/MainView.cxx ++++ b/src/gtk/MainView.cxx +@@ -92,80 +92,80 @@ + { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, + { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, + +- { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "O", ++ { "OpenFile", "document-open", N_("_Open"), "O", + N_("Open a PDF document"), + G_CALLBACK (main_window_open_file_cb) }, + +- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", ++ { "ReloadFile", "view-refresh", N_("_Reload"), "R", + N_("Reload the current document"), + G_CALLBACK (main_window_reload_cb) }, + +- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", ++ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", + N_("Save a copy of the current document"), + G_CALLBACK (main_window_save_file_cb) }, + + #if defined (HAVE_CUPS) +- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", ++ { "Print", "document-print", N_("_Print..."), "P", + N_("Print the current document"), + G_CALLBACK (main_window_print_cb) }, + #endif // HAVE_CUPS + +- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", ++ { "Quit", "window-close", N_("_Close"), "W", + N_("Close this window"), + G_CALLBACK (main_window_quit_cb) }, + +- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", ++ { "Find", "edit-find", N_("_Find"), "F", + N_("Find a word in the document"), + G_CALLBACK (main_window_find_cb) }, + +- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, ++ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, + N_("Change the application's preferences"), + G_CALLBACK (main_window_preferences_cb) }, + +- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", ++ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", + N_("Enlarge the document"), + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", ++ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", + N_("Shrink the document"), + G_CALLBACK (main_window_zoom_out_cb) }, + +- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", ++ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", + N_("Rotate the document 90 degrees clockwise"), + G_CALLBACK (main_window_rotate_right_cb) }, + +- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", ++ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", + N_("Rotate the document 90 degrees counter-clockwise"), + G_CALLBACK (main_window_rotate_left_cb) }, + +- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", ++ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", + N_("Go to the first page"), + G_CALLBACK (main_window_go_to_first_page_cb) }, + +- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", ++ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", + N_("Go to the next page"), + G_CALLBACK (main_window_go_to_next_page_cb) }, + +- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", ++ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", + N_("Go to the previous page"), + G_CALLBACK (main_window_go_to_previous_page_cb) }, + +- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", ++ { "GoToLastPage", "go-last", N_("_Last Page"), "End", + N_("Go to the last page"), + G_CALLBACK (main_window_go_to_last_page_cb) }, + +- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, ++ { "About", "help-about", N_("_About"), NULL, + N_("Display application's credits"), + G_CALLBACK (main_window_about_box_cb) }, + + // Accelerator keys. +- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, ++ { "Slash", "edit-find", NULL, "slash", NULL, + G_CALLBACK (main_window_find_cb) }, + +- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, ++ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", ++ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", + NULL, + G_CALLBACK (main_window_zoom_out_cb) } + }; +@@ -188,21 +188,21 @@ + N_("Show or hide the document's outline"), + G_CALLBACK (main_window_show_index_cb), FALSE }, + +- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, ++ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, + N_("Make the current document fill the window"), + G_CALLBACK (main_window_zoom_fit_cb), FALSE }, + +- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, ++ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, + N_("Make the current document fill the window width"), + G_CALLBACK (main_window_zoom_width_cb), FALSE }, + }; + + static GtkRadioActionEntry g_PageScrollEntries[] = + { +- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, ++ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, + N_("Mouse scroll page"), (int)PagePterModeScroll }, + +- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, ++ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, + N_(" Mouse select text"), (int)PagePterModeSelectText }, + }; + +@@ -1031,35 +1031,7 @@ + void + MainView::setMainWindowIcon () + { +- const gchar *iconFiles[] = +- { +- "icon_epdfview-48.png", +- "icon_epdfview-32.png", +- "icon_epdfview-24.png", +- }; +- +- GList *iconList = NULL; +- int iconFilesNum = G_N_ELEMENTS (iconFiles); +- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) +- { +- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", +- iconFiles[iconIndex], NULL); +- GError *error = NULL; +- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); +- if ( NULL != iconPixbuf ) +- { +- iconList = g_list_prepend (iconList, iconPixbuf); +- } +- else +- { +- g_warning ("Error loading icon: %s\n", error->message); +- g_error_free (error); +- } +- g_free (filename); +- } +- gtk_window_set_default_icon_list (iconList); +- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); +- g_list_free (iconList); ++ gtk_window_set_default_icon_name ("epdfview"); + } + + /// diff -r c7b121a4ffd9 -r d6378d455338 epdfview-cups/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview-cups/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|no-stock-icons.patch diff -r c7b121a4ffd9 -r d6378d455338 epdfview/receipt --- a/epdfview/receipt Wed May 09 17:03:28 2018 +0300 +++ b/epdfview/receipt Thu May 10 21:12:00 2018 +0300 @@ -22,8 +22,7 @@ sed -i 's//&\n#include \n#define g_fopen fopen/' \ src/epdfview.h find . -name '*.[ch]*' | xargs sed -i 's| -Date: Tue, 5 Jul 2011 09:23:38 +0000 -Subject: [PATCH 1/2] When using Poppler 0.17.0, I needed to swap the blue and - red channels, otherwise the colors (other than black - and white) looked wierd. - -git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@367 cb4bfb15-1111-0410-82e2-95233c8f1c7e ---- - src/PDFDocument.cxx | 20 ++++++++++++++++++++ - 1 files changed, 20 insertions(+), 0 deletions(-) - -diff --git a/src/PDFDocument.cxx b/src/PDFDocument.cxx -index df5d75f..63b3513 100644 ---- a/src/PDFDocument.cxx -+++ b/src/PDFDocument.cxx -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include "epdfview.h" - - using namespace ePDFView; -@@ -33,6 +34,24 @@ static PageLayout convertPageLayout (gint pageLayout); - static PageMode convertPageMode (gint pageMode); - static gchar *getAbsoluteFileName (const gchar *fileName); - -+namespace -+{ -+ void -+ convert_bgra_to_rgba (guint8 *data, int width, int height) -+ { -+ using std::swap; -+ -+ for (int y = 0; y < height; y++) -+ { -+ for (int x = 0; x < width; x++) -+ { -+ swap(data[0], data[2]); -+ data += 4; -+ } -+ } -+ } -+} -+ - /// - /// @brief Constructs a new PDFDocument object. - /// -@@ -650,6 +669,7 @@ PDFDocument::renderPage (gint pageNum) - poppler_page_render (page, context); - cairo_destroy(context); - cairo_surface_destroy (surface); -+ convert_bgra_to_rgba(renderedPage->getData (), width, height); - #else // !HAVE_POPPLER_0_17_0 - // Create the pixbuf from the data and render to it. - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (), --- -1.7.7 diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/fix-scrolling.patch --- a/epdfview/stuff/fix-scrolling.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ ---- ./src/gtk/MainView.cxx.old 2009-02-28 22:00:55.000000000 +0100 -+++ ./src/gtk/MainView.cxx 2009-03-20 03:12:10.000000000 +0100 -@@ -77,7 +77,7 @@ - static void main_window_zoom_out_cb (GtkWidget *, gpointer); - static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); - static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer); --static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); -+static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); - - #if defined (HAVE_CUPS) - static void main_window_print_cb (GtkWidget *, gpointer); -@@ -1479,18 +1479,19 @@ - pter->setPageMode (mode); - } - --void -+gboolean - main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data) - { - g_assert ( NULL != data && "The data parameter is NULL."); - - MainPter *pter = (MainPter *)data; - // Only zoom when the CTRL-Button is down... -- if ( !(event->state & GDK_CONTROL_MASK) ) return; -+ if ( !(event->state & GDK_CONTROL_MASK) ) return FALSE; - if ( event->direction == GDK_SCROLL_UP ) { - pter->zoomInActivated (); - } else if ( event->direction == GDK_SCROLL_DOWN ) { - pter->zoomOutActivated (); - } -+ return TRUE; - } - diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/no-stock-icons.patch --- a/epdfview/stuff/no-stock-icons.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ ---- a/src/gtk/FindView.cxx -+++ b/srv/gtk/FindView.cxx -@@ -50,7 +50,7 @@ - gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ); - - // The "Close" button. -- m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); -+ m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close")); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1); - - // The text to find entry. -@@ -65,13 +65,13 @@ - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1); - - // The "Find Next" button. -- m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT); -+ m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next")); - gtk_tool_item_set_is_important (m_FindNext, TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1); - - // The "Find Previous" button. - m_FindPrevious = -- gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS); -+ gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous")); - gtk_tool_item_set_is_important (m_FindPrevious, TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1); - ---- a/src/gtk/MainView.cxx -+++ b/src/gtk/MainView.cxx -@@ -92,80 +92,80 @@ - { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, - { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, - -- { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "O", -+ { "OpenFile", "document-open", N_("_Open"), "O", - N_("Open a PDF document"), - G_CALLBACK (main_window_open_file_cb) }, - -- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", -+ { "ReloadFile", "view-refresh", N_("_Reload"), "R", - N_("Reload the current document"), - G_CALLBACK (main_window_reload_cb) }, - -- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", -+ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", - N_("Save a copy of the current document"), - G_CALLBACK (main_window_save_file_cb) }, - - #if defined (HAVE_CUPS) -- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", -+ { "Print", "document-print", N_("_Print..."), "P", - N_("Print the current document"), - G_CALLBACK (main_window_print_cb) }, - #endif // HAVE_CUPS - -- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", -+ { "Quit", "window-close", N_("_Close"), "W", - N_("Close this window"), - G_CALLBACK (main_window_quit_cb) }, - -- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", -+ { "Find", "edit-find", N_("_Find"), "F", - N_("Find a word in the document"), - G_CALLBACK (main_window_find_cb) }, - -- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, -+ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, - N_("Change the application's preferences"), - G_CALLBACK (main_window_preferences_cb) }, - -- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", -+ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", - N_("Enlarge the document"), - G_CALLBACK (main_window_zoom_in_cb) }, - -- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", -+ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", - N_("Shrink the document"), - G_CALLBACK (main_window_zoom_out_cb) }, - -- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", -+ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", - N_("Rotate the document 90 degrees clockwise"), - G_CALLBACK (main_window_rotate_right_cb) }, - -- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", -+ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", - N_("Rotate the document 90 degrees counter-clockwise"), - G_CALLBACK (main_window_rotate_left_cb) }, - -- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", -+ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", - N_("Go to the first page"), - G_CALLBACK (main_window_go_to_first_page_cb) }, - -- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", -+ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", - N_("Go to the next page"), - G_CALLBACK (main_window_go_to_next_page_cb) }, - -- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", -+ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", - N_("Go to the previous page"), - G_CALLBACK (main_window_go_to_previous_page_cb) }, - -- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", -+ { "GoToLastPage", "go-last", N_("_Last Page"), "End", - N_("Go to the last page"), - G_CALLBACK (main_window_go_to_last_page_cb) }, - -- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, -+ { "About", "help-about", N_("_About"), NULL, - N_("Display application's credits"), - G_CALLBACK (main_window_about_box_cb) }, - - // Accelerator keys. -- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, -+ { "Slash", "edit-find", NULL, "slash", NULL, - G_CALLBACK (main_window_find_cb) }, - -- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, -+ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, - G_CALLBACK (main_window_zoom_in_cb) }, - -- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", -+ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", - NULL, - G_CALLBACK (main_window_zoom_out_cb) } - }; -@@ -188,21 +188,21 @@ - N_("Show or hide the document's outline"), - G_CALLBACK (main_window_show_index_cb), FALSE }, - -- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, -+ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, - N_("Make the current document fill the window"), - G_CALLBACK (main_window_zoom_fit_cb), FALSE }, - -- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, -+ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, - N_("Make the current document fill the window width"), - G_CALLBACK (main_window_zoom_width_cb), FALSE }, - }; - - static GtkRadioActionEntry g_PageScrollEntries[] = - { -- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, -+ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, - N_("Mouse scroll page"), (int)PagePterModeScroll }, - -- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, -+ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, - N_(" Mouse select text"), (int)PagePterModeSelectText }, - }; - -@@ -1031,35 +1031,7 @@ - void - MainView::setMainWindowIcon () - { -- const gchar *iconFiles[] = -- { -- "icon_epdfview-48.png", -- "icon_epdfview-32.png", -- "icon_epdfview-24.png", -- }; -- -- GList *iconList = NULL; -- int iconFilesNum = G_N_ELEMENTS (iconFiles); -- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) -- { -- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", -- iconFiles[iconIndex], NULL); -- GError *error = NULL; -- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); -- if ( NULL != iconPixbuf ) -- { -- iconList = g_list_prepend (iconList, iconPixbuf); -- } -- else -- { -- g_warning ("Error loading icon: %s\n", error->message); -- g_error_free (error); -- } -- g_free (filename); -- } -- gtk_window_set_default_icon_list (iconList); -- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); -- g_list_free (iconList); -+ gtk_window_set_default_icon_name ("epdfview"); - } - - /// diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/patches/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview/stuff/patches/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,59 @@ +From d30496f52b85f82947bd07b9bd60f8482843ece8 Mon Sep 17 00:00:00 2001 +From: jordi +Date: Tue, 5 Jul 2011 09:23:38 +0000 +Subject: [PATCH 1/2] When using Poppler 0.17.0, I needed to swap the blue and + red channels, otherwise the colors (other than black + and white) looked wierd. + +git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@367 cb4bfb15-1111-0410-82e2-95233c8f1c7e +--- + src/PDFDocument.cxx | 20 ++++++++++++++++++++ + 1 files changed, 20 insertions(+), 0 deletions(-) + +diff --git a/src/PDFDocument.cxx b/src/PDFDocument.cxx +index df5d75f..63b3513 100644 +--- a/src/PDFDocument.cxx ++++ b/src/PDFDocument.cxx +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "epdfview.h" + + using namespace ePDFView; +@@ -33,6 +34,24 @@ static PageLayout convertPageLayout (gint pageLayout); + static PageMode convertPageMode (gint pageMode); + static gchar *getAbsoluteFileName (const gchar *fileName); + ++namespace ++{ ++ void ++ convert_bgra_to_rgba (guint8 *data, int width, int height) ++ { ++ using std::swap; ++ ++ for (int y = 0; y < height; y++) ++ { ++ for (int x = 0; x < width; x++) ++ { ++ swap(data[0], data[2]); ++ data += 4; ++ } ++ } ++ } ++} ++ + /// + /// @brief Constructs a new PDFDocument object. + /// +@@ -650,6 +669,7 @@ PDFDocument::renderPage (gint pageNum) + poppler_page_render (page, context); + cairo_destroy(context); + cairo_surface_destroy (surface); ++ convert_bgra_to_rgba(renderedPage->getData (), width, height); + #else // !HAVE_POPPLER_0_17_0 + // Create the pixbuf from the data and render to it. + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (), +-- +1.7.7 diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/patches/fix-scrolling.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview/stuff/patches/fix-scrolling.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,33 @@ +--- ./src/gtk/MainView.cxx.old 2009-02-28 22:00:55.000000000 +0100 ++++ ./src/gtk/MainView.cxx 2009-03-20 03:12:10.000000000 +0100 +@@ -77,7 +77,7 @@ + static void main_window_zoom_out_cb (GtkWidget *, gpointer); + static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); + static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer); +-static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); ++static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); + + #if defined (HAVE_CUPS) + static void main_window_print_cb (GtkWidget *, gpointer); +@@ -1479,18 +1479,19 @@ + pter->setPageMode (mode); + } + +-void ++gboolean + main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data) + { + g_assert ( NULL != data && "The data parameter is NULL."); + + MainPter *pter = (MainPter *)data; + // Only zoom when the CTRL-Button is down... +- if ( !(event->state & GDK_CONTROL_MASK) ) return; ++ if ( !(event->state & GDK_CONTROL_MASK) ) return FALSE; + if ( event->direction == GDK_SCROLL_UP ) { + pter->zoomInActivated (); + } else if ( event->direction == GDK_SCROLL_DOWN ) { + pter->zoomOutActivated (); + } ++ return TRUE; + } + diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/patches/no-stock-icons.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview/stuff/patches/no-stock-icons.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,192 @@ +--- a/src/gtk/FindView.cxx ++++ b/srv/gtk/FindView.cxx +@@ -50,7 +50,7 @@ + gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ); + + // The "Close" button. +- m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); ++ m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close")); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1); + + // The text to find entry. +@@ -65,13 +65,13 @@ + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1); + + // The "Find Next" button. +- m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT); ++ m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next")); + gtk_tool_item_set_is_important (m_FindNext, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1); + + // The "Find Previous" button. + m_FindPrevious = +- gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS); ++ gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous")); + gtk_tool_item_set_is_important (m_FindPrevious, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1); + +--- a/src/gtk/MainView.cxx ++++ b/src/gtk/MainView.cxx +@@ -92,80 +92,80 @@ + { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, + { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, + +- { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "O", ++ { "OpenFile", "document-open", N_("_Open"), "O", + N_("Open a PDF document"), + G_CALLBACK (main_window_open_file_cb) }, + +- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", ++ { "ReloadFile", "view-refresh", N_("_Reload"), "R", + N_("Reload the current document"), + G_CALLBACK (main_window_reload_cb) }, + +- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", ++ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", + N_("Save a copy of the current document"), + G_CALLBACK (main_window_save_file_cb) }, + + #if defined (HAVE_CUPS) +- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", ++ { "Print", "document-print", N_("_Print..."), "P", + N_("Print the current document"), + G_CALLBACK (main_window_print_cb) }, + #endif // HAVE_CUPS + +- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", ++ { "Quit", "window-close", N_("_Close"), "W", + N_("Close this window"), + G_CALLBACK (main_window_quit_cb) }, + +- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", ++ { "Find", "edit-find", N_("_Find"), "F", + N_("Find a word in the document"), + G_CALLBACK (main_window_find_cb) }, + +- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, ++ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, + N_("Change the application's preferences"), + G_CALLBACK (main_window_preferences_cb) }, + +- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", ++ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", + N_("Enlarge the document"), + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", ++ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", + N_("Shrink the document"), + G_CALLBACK (main_window_zoom_out_cb) }, + +- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", ++ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", + N_("Rotate the document 90 degrees clockwise"), + G_CALLBACK (main_window_rotate_right_cb) }, + +- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", ++ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", + N_("Rotate the document 90 degrees counter-clockwise"), + G_CALLBACK (main_window_rotate_left_cb) }, + +- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", ++ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", + N_("Go to the first page"), + G_CALLBACK (main_window_go_to_first_page_cb) }, + +- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", ++ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", + N_("Go to the next page"), + G_CALLBACK (main_window_go_to_next_page_cb) }, + +- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", ++ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", + N_("Go to the previous page"), + G_CALLBACK (main_window_go_to_previous_page_cb) }, + +- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", ++ { "GoToLastPage", "go-last", N_("_Last Page"), "End", + N_("Go to the last page"), + G_CALLBACK (main_window_go_to_last_page_cb) }, + +- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, ++ { "About", "help-about", N_("_About"), NULL, + N_("Display application's credits"), + G_CALLBACK (main_window_about_box_cb) }, + + // Accelerator keys. +- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, ++ { "Slash", "edit-find", NULL, "slash", NULL, + G_CALLBACK (main_window_find_cb) }, + +- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, ++ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", ++ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", + NULL, + G_CALLBACK (main_window_zoom_out_cb) } + }; +@@ -188,21 +188,21 @@ + N_("Show or hide the document's outline"), + G_CALLBACK (main_window_show_index_cb), FALSE }, + +- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, ++ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, + N_("Make the current document fill the window"), + G_CALLBACK (main_window_zoom_fit_cb), FALSE }, + +- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, ++ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, + N_("Make the current document fill the window width"), + G_CALLBACK (main_window_zoom_width_cb), FALSE }, + }; + + static GtkRadioActionEntry g_PageScrollEntries[] = + { +- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, ++ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, + N_("Mouse scroll page"), (int)PagePterModeScroll }, + +- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, ++ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, + N_(" Mouse select text"), (int)PagePterModeSelectText }, + }; + +@@ -1031,35 +1031,7 @@ + void + MainView::setMainWindowIcon () + { +- const gchar *iconFiles[] = +- { +- "icon_epdfview-48.png", +- "icon_epdfview-32.png", +- "icon_epdfview-24.png", +- }; +- +- GList *iconList = NULL; +- int iconFilesNum = G_N_ELEMENTS (iconFiles); +- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) +- { +- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", +- iconFiles[iconIndex], NULL); +- GError *error = NULL; +- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); +- if ( NULL != iconPixbuf ) +- { +- iconList = g_list_prepend (iconList, iconPixbuf); +- } +- else +- { +- g_warning ("Error loading icon: %s\n", error->message); +- g_error_free (error); +- } +- g_free (filename); +- } +- gtk_window_set_default_icon_list (iconList); +- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); +- g_list_free (iconList); ++ gtk_window_set_default_icon_name ("epdfview"); + } + + /// diff -r c7b121a4ffd9 -r d6378d455338 epdfview/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-Np1|0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch +-p1|no-stock-icons.patch diff -r c7b121a4ffd9 -r d6378d455338 etherboot/receipt --- a/etherboot/receipt Wed May 09 17:03:28 2018 +0300 +++ b/etherboot/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,14 +16,6 @@ compile_rules() { cd $src/src - while read file; do - [ -f done.$file ] && continue - patch -p2 < $stuff/$file - touch done.$file - done <= length -- of bootsect + room for stack */ -+ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ -+ /* of bootsect + room for stack + 12 for */ -+ /* saved disk parm block */ - - movw $BOOTSEG, %ax - movw %ax,%ds - movw %ax,%es -- -- cli -- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ -+ movw %ax,%ss /* put stack at initial position */ - movw %di,%sp -- sti - -- movw $why_end-why, %cx -- movw $why - _prefix, %si -+/* Many BIOS's default disk parameter tables will not recognize multi-sector -+ * reads beyond the maximum sector number specified in the default diskette -+ * parameter tables - this may mean 7 sectors in some cases. -+ * -+ * Since single sector reads are slow and out of the question, we must take care -+ * of this by creating new parameter tables (for the first disk) in RAM. We -+ * will set the maximum sector count to 36 - the most we will encounter on an -+ * ED 2.88. High doesn't hurt. Low does. -+ * -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG -+ */ -+ -+ xorw %cx,%cx -+ movw %cx,%es /* access segment 0 */ -+ movw $0x78, %bx /* 0:bx is parameter table address */ -+ pushw %ds /* save ds */ -+/* 0:bx is parameter table address */ -+ ldsw %es:(%bx),%si /* loads ds and si */ -+ -+ movw %ax,%es /* ax is BOOTSECT (loaded above) */ -+ movb $6, %cl /* copy 12 bytes */ -+ cld -+ pushw %di /* keep a copy for later */ -+ rep -+ movsw /* ds:si is source, es:di is dest */ -+ popw %di -+ -+ movb $36,%es:4(%di) -+ -+ movw %cx,%ds /* access segment 0 */ -+ xchgw %di,(%bx) -+ movw %es,%si -+ xchgw %si,2(%bx) -+ popw %ds /* restore ds */ -+ movw %di, dpoff /* save old parameters */ -+ movw %si, dpseg /* to restore just before finishing */ -+ pushw %ds -+ popw %es /* reload es */ -+ -+/* Note that es is already set up. Also cx is 0 from rep movsw above. */ -+ -+ xorb %ah,%ah /* reset FDC */ -+ xorb %dl,%dl -+ int $0x13 -+ -+/* Get disk drive parameters, specifically number of sectors/track. -+ * -+ * It seems that there is no BIOS call to get the number of sectors. Guess -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, -+ * 15 if sector 15 can be read. Otherwise guess 9. -+ */ - -- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -- movb $0x0e, %ah /* write char, tty mode */ --prloop: -+ movw $disksizes, %si /* table of sizes to try */ -+ -+probe_loop: - lodsb -+ orb %al, %al -+ je got_sectors /* if all else fails, try 9 */ -+ cbtw /* extend to word */ -+ movw %ax, sectors -+ xchgw %cx,%ax /* cx = track and sector */ -+ xorw %dx,%dx /* drive 0, head 0 */ -+ movw $0x0200, %bx /* address after boot sector */ -+ /* (512 bytes from origin, es = cs) */ -+ movw $0x0201, %ax /* service 2, 1 sector */ -+ int $0x13 -+ jc probe_loop /* try next value */ -+ -+got_sectors: -+ movw $msg1end-msg1, %cx -+ movw $msg1, %si -+ call print_str -+ -+/* ok, we've written the Loading... message, now we want to load the system */ -+ -+ pushw %es /* = ds */ -+ movw $SYSSEG, %ax -+ movw %ax,%es /* segment of SYSSEG<<4 */ -+ pushw %es -+ call read_it -+ -+/* This turns off the floppy drive motor, so that we enter the kernel in a -+ * known state, and don't have to worry about it later. -+ */ -+ movw $0x3f2, %dx -+ xorb %al,%al -+ outb %al,%dx -+ -+ call print_nl -+ pop %es /* = SYSSEG */ -+ pop %es /* balance push/pop es */ -+sigok: -+ -+/* Restore original disk parameters */ -+ movw $0x78, %bx -+ movw dpoff, %di -+ movw dpseg, %si -+ xorw %ax,%ax -+ movw %ax,%ds -+ movw %di,(%bx) -+ movw %si,2(%bx) -+ -+/* after that (everything loaded), we call to the .ROM file loaded. */ -+ -+ movw $SYSSEG, %ax -+ jmp go_setup_code -+ -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB -+ * boundaries are crossed. We try to load it as fast as possible, loading whole -+ * tracks whenever we can. -+ * -+ * in: es - starting address segment (normally SYSSEG) -+ */ -+read_it: -+ movw $0,sread /* read whole image incl boot sector */ -+ movw %es,%ax -+ testw $0x0fff, %ax -+die: jne die /* es must be at 64kB boundary */ -+ xorw %bx,%bx /* bx is starting address within segment */ -+rp_read: -+ movw %es,%ax -+ movw %bx,%dx -+ movb $4, %cl -+ shrw %cl,%dx /* bx is always divisible by 16 */ -+ addw %dx,%ax -+ cmpw $SYSSEG+SYSSIZE, %ax /* have we loaded all yet? */ -+ jb ok1_read -+ ret -+ok1_read: -+ movw sectors, %ax -+ subw sread, %ax -+ movw %ax,%cx -+ shlw $9, %cx /* 80186 opcode */ -+ addw %bx,%cx -+ jnc ok2_read -+ je ok2_read -+ xorw %ax,%ax -+ subw %bx,%ax -+ shrw $9, %ax /* 80186 opcode */ -+ok2_read: -+ call read_track -+ movw %ax,%cx -+ addw sread, %ax -+ cmpw sectors, %ax -+ jne ok3_read -+ movw $1, %ax -+ subw head, %ax -+ jne ok4_read -+ incw track -+ok4_read: -+ movw %ax, head -+ xorw %ax,%ax -+ok3_read: -+ movw %ax, sread -+ shlw $9, %cx /* 80186 opcode */ -+ addw %cx,%bx -+ jnc rp_read -+ movw %es,%ax -+ addb $0x10, %ah -+ movw %ax,%es -+ xorw %bx,%bx -+ jmp rp_read -+ -+read_track: -+ pusha /* 80186 opcode */ -+ pushw %ax -+ pushw %bx -+ pushw %bp /* just in case the BIOS is buggy */ -+ movb $0x2e, %al /* 0x2e = . */ -+ call print_char -+ popw %bp -+ popw %bx -+ popw %ax -+ -+ movw sread, %cx -+ incw %cx -+ movb track, %ch -+ movw $0x0100, %dx -+ andb head, %dh -+ movb $2, %ah -+ -+ pushw %dx /* save for error dump */ -+ pushw %cx -+ pushw %bx -+ pushw %ax -+ -+ int $0x13 -+ jc bad_rt -+ addw $8, %sp -+ popa /* 80186 opcode */ -+ ret -+ -+bad_rt: pushw %ax /* save error code */ -+ call print_all /* ah = error, al = read */ -+ -+ xorb %ah,%ah -+ xorb %dl,%dl -+ int $0x13 -+ -+ addw $10, %sp -+ popa /* 80186 opcode */ -+ jmp read_track -+ -+/* print_all is for debugging purposes. It will print out all of the registers. -+ * The assumption is that this is called from a routine, with a stack frame like -+ * dx -+ * cx -+ * bx -+ * ax -+ * error -+ * ret <- sp -+ */ -+ -+print_all: -+ call print_nl /* nl for readability */ -+ /* print_nl update ah and bx */ -+ movw $5, %cx /* error code + 4 registers */ -+ movw %sp,%bp -+ -+print_loop: -+ pushw %cx /* save count left */ -+ -+ cmpb $5, %cl -+ jae no_reg /* see if register name is needed */ -+ -+ movb $0x5+0x41-1, %al -+ subb %cl,%al -+ int $0x10 -+ -+ movb $0x58, %al /* 'X' */ -+ int $0x10 -+ -+ movb $0x3A, %al /* ':' */ -+ int $0x10 -+ -+no_reg: -+ addw $2, %bp /* next register */ -+ call print_hex /* print it */ -+ movb $0x20, %al /* print a space */ - int $0x10 -+ popw %cx -+ loop print_loop -+ /* nl for readability */ -+print_nl: -+ movb $0xd, %al /* CR */ -+ call print_char -+ movb $0xa, %al /* LF */ -+ jmp print_char -+ -+ -+print_str: -+prloop: -+ lodsb -+ call print_char - loop prloop --freeze: jmp freeze -+ ret -+ -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ -+ -+print_hex: -+ movw (%bp),%dx /* load word into dx */ -+ movb $4, %cl -+ call print_2digits -+print_2digits: -+ call print_digit -+/* fall through */ -+print_digit: -+ rol %cl,%dx /* rotate to use lowest 4 bits */ -+ movb $0x0f, %al /* mask for nybble */ -+ andb %dl,%al -+ addb $0x90, %al /* convert al to ascii hex */ -+ daa /* (four instructions) */ -+ adcb $0x40, %al -+ daa -+print_char: -+ movb $0x0e, %ah /* write char, tty mode */ -+ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -+ int $0x10 -+ ret -+ -+sread: .word 0 /* sectors read of current track */ -+head: .word 0 /* current head */ -+track: .word 0 /* current track */ -+ -+sectors: -+ .word 0 -+ -+dpseg: .word 0 -+dpoff: .word 0 - --why: .ascii "This image cannot be loaded from a floppy disk.\r\n" --why_end: -+disksizes: -+ .byte 36,18,15,9,0 - -+msg1: -+ .ascii "Loading ROM image" -+msg1end: - - .org 497 - setup_sects: -@@ -117,15 +402,22 @@ - whose entry point is SYSSEG:0. - */ - setup_code: -- pushl $0 /* No parameters to preserve for exit path */ -- pushw $0 /* Use prefix exit path mechanism */ -+ movw $(SYSSEG-(PREFIXSIZE/16)), %ax - /* Etherboot expects to be contiguous in memory once loaded. - * LILO doesn't do this, but since we don't need any - * information that's left in the prefix, it doesn't matter: - * we just have to ensure that %cs:0000 is where the start of - * the Etherboot image *would* be. - */ -- ljmp $(SYSSEG-(PREFIXSIZE/16)), $_start -+go_setup_code: -+ xorw %cx, %cx -+ pushw %cx -+ pushw %cx /* No parameters to preserve for exit path */ -+ pushw %cx /* Use prefix exit path mechanism */ -+ pushw %ax -+ pushw $_start -+ /* Calculated lcall to _start with %cs:0000 = image start */ -+ lret - - .section ".text16", "ax", @progbits - .globl prefix_exit - ---- etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S -+++ etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S -@@ -82,6 +82,14 @@ - #define SIG1 0xAA55 - #define SIG2 0x5A5A - -+/* SYS_SIZE is the number of clicks (16 bytes) to be loaded. For Etherboot -+ * purposes, we need to load everything but the boot sector itself, i.e. 32 -+ * clicks less than the size of the entire (verbatim) image. The image size -+ * is practically limited only by the available base memory size. -+ */ -+.globl SYSSIZE -+.equ SYSSIZE, _verbatim_size_pgh - 32 -+ - .text - .code16 - .arch i386 -@@ -90,40 +98,349 @@ - .globl _prefix - _prefix: - --/* -- This is a minimal boot sector. If anyone tries to execute it (e.g., if -- a .lilo file is dd'ed to a floppy), print an error message. --*/ -+ call here -+here: -+ pop %ax -+ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ -+ jne bootsector -+ -+/* We need a real mode stack that won't be stomped on by Etherboot -+ which starts at 0x20000. Choose something that's sufficiently high, -+ but not in DOC territory. Note that we couldn't do this in a real -+ .com program since stack variables are in the same segment as the -+ code and data, but this isn't really a .com program, it just looks -+ like one to make DOS load it into memory. It still has the 64kB -+ limitation of .com files though. */ -+#define STACK_SEG 0x7000 -+#define STACK_SIZE 0x4000 -+ /* Set up temporary stack */ -+ movw $STACK_SEG, %ax -+ movw %ax, %ss -+ movw $STACK_SIZE, %sp -+ -+ /* Calculate segment address of image start */ -+ pushw %cs -+ popw %ax -+ addw $(0x100/16), %ax -+ jmp go_setup_code - --bootsector: -- jmp $BOOTSEG, $go - _prefix /* reload cs:ip to match relocation addr */ -+bootsector: -+ jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ - go: -- movw $0x2000, %di /* 0x2000 is arbitrary value >= length -- of bootsect + room for stack */ -+ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ -+ /* of bootsect + room for stack + 12 for */ -+ /* saved disk parm block */ - - movw $BOOTSEG, %ax - movw %ax,%ds - movw %ax,%es -- -- cli -- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ -+ movw %ax,%ss /* put stack at initial position */ - movw %di,%sp -- sti - -- movw $why_end-why, %cx -- movw $why - _prefix, %si -+/* Many BIOS's default disk parameter tables will not recognize multi-sector -+ * reads beyond the maximum sector number specified in the default diskette -+ * parameter tables - this may mean 7 sectors in some cases. -+ * -+ * Since single sector reads are slow and out of the question, we must take care -+ * of this by creating new parameter tables (for the first disk) in RAM. We -+ * will set the maximum sector count to 36 - the most we will encounter on an -+ * ED 2.88. High doesn't hurt. Low does. -+ * -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG -+ */ -+ -+ xorw %cx,%cx -+ movw %cx,%es /* access segment 0 */ -+ movw $0x78, %bx /* 0:bx is parameter table address */ -+ pushw %ds /* save ds */ -+/* 0:bx is parameter table address */ -+ ldsw %es:(%bx),%si /* loads ds and si */ -+ -+ movw %ax,%es /* ax is BOOTSECT (loaded above) */ -+ movb $6, %cl /* copy 12 bytes */ -+ cld -+ pushw %di /* keep a copy for later */ -+ rep -+ movsw /* ds:si is source, es:di is dest */ -+ popw %di - -- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -- movb $0x0e, %ah /* write char, tty mode */ --prloop: -+ movb $36,%es:4(%di) -+ -+ movw %cx,%ds /* access segment 0 */ -+ xchgw %di,(%bx) -+ movw %es,%si -+ xchgw %si,2(%bx) -+ popw %ds /* restore ds */ -+ movw %di, dpoff /* save old parameters */ -+ movw %si, dpseg /* to restore just before finishing */ -+ pushw %ds -+ popw %es /* reload es */ -+ -+/* Note that es is already set up. Also cx is 0 from rep movsw above. */ -+ -+ xorb %ah,%ah /* reset FDC */ -+ xorb %dl,%dl -+ int $0x13 -+ -+/* Get disk drive parameters, specifically number of sectors/track. -+ * -+ * It seems that there is no BIOS call to get the number of sectors. Guess -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, -+ * 15 if sector 15 can be read. Otherwise guess 9. -+ */ -+ -+ movw $disksizes, %si /* table of sizes to try */ -+ -+probe_loop: - lodsb -+ orb %al, %al -+ je got_sectors /* if all else fails, try 9 */ -+ cbtw /* extend to word */ -+ movw %ax, sectors -+ xchgw %cx,%ax /* cx = track and sector */ -+ xorw %dx,%dx /* drive 0, head 0 */ -+ movw $0x0200, %bx /* address after boot sector */ -+ /* (512 bytes from origin, es = cs) */ -+ movw $0x0201, %ax /* service 2, 1 sector */ -+ int $0x13 -+ jc probe_loop /* try next value */ -+ -+got_sectors: -+ movw $msg1end-msg1, %cx -+ movw $msg1, %si -+ call print_str -+ -+/* ok, we've written the Loading... message, now we want to load the system */ -+ -+ pushw %es /* = ds */ -+ movw $SYSSEG, %ax -+ movw %ax,%es /* segment of SYSSEG<<4 */ -+ pushw %es -+ call read_it -+ -+/* This turns off the floppy drive motor, so that we enter the kernel in a -+ * known state, and don't have to worry about it later. -+ */ -+ movw $0x3f2, %dx -+ xorb %al,%al -+ outb %al,%dx -+ -+ call print_nl -+ pop %es /* = SYSSEG */ -+ pop %es /* balance push/pop es */ -+sigok: -+ -+/* Restore original disk parameters */ -+ movw $0x78, %bx -+ movw dpoff, %di -+ movw dpseg, %si -+ xorw %ax,%ax -+ movw %ax,%ds -+ movw %di,(%bx) -+ movw %si,2(%bx) -+ -+/* after that (everything loaded), we call to the .ROM file loaded. */ -+ -+ movw $SYSSEG, %ax -+go_setup_code: -+ xorw %cx, %cx -+ pushw %cx -+ pushw %cx /* No parameters to preserve for exit path */ -+ pushw %cx /* Use prefix exit path mechanism */ -+ pushw %ax -+ pushw $_start -+ /* Calculated lcall to _start with %cs:0000 = image start */ -+ lret -+ -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB -+ * boundaries are crossed. We try to load it as fast as possible, loading whole -+ * tracks whenever we can. -+ * -+ * in: es - starting address segment (normally SYSSEG) -+ */ -+read_it: -+ movw $0,sread /* read whole image incl boot sector */ -+ movw %es,%ax -+ testw $0x0fff, %ax -+die: jne die /* es must be at 64kB boundary */ -+ xorw %bx,%bx /* bx is starting address within segment */ -+rp_read: -+ movw %es,%ax -+ movw %bx,%dx -+ movb $4, %cl -+ shrw %cl,%dx /* bx is always divisible by 16 */ -+ addw %dx,%ax -+ cmpw $SYSSEG+SYSSIZE, %ax /* have we loaded all yet? */ -+ jb ok1_read -+ ret -+ok1_read: -+ movw sectors, %ax -+ subw sread, %ax -+ movw %ax,%cx -+ shlw $9, %cx /* 80186 opcode */ -+ addw %bx,%cx -+ jnc ok2_read -+ je ok2_read -+ xorw %ax,%ax -+ subw %bx,%ax -+ shrw $9, %ax /* 80186 opcode */ -+ok2_read: -+ call read_track -+ movw %ax,%cx -+ addw sread, %ax -+ cmpw sectors, %ax -+ jne ok3_read -+ movw $1, %ax -+ subw head, %ax -+ jne ok4_read -+ incw track -+ok4_read: -+ movw %ax, head -+ xorw %ax,%ax -+ok3_read: -+ movw %ax, sread -+ shlw $9, %cx /* 80186 opcode */ -+ addw %cx,%bx -+ jnc rp_read -+ movw %es,%ax -+ addb $0x10, %ah -+ movw %ax,%es -+ xorw %bx,%bx -+ jmp rp_read -+ -+read_track: -+ pusha /* 80186 opcode */ -+ pushw %ax -+ pushw %bx -+ pushw %bp /* just in case the BIOS is buggy */ -+ movb $0x2e, %al /* 0x2e = . */ -+ call print_char -+ popw %bp -+ popw %bx -+ popw %ax -+ -+ movw sread, %cx -+ incw %cx -+ movb track, %ch -+ movw $0x0100, %dx -+ andb head, %dh -+ movb $2, %ah -+ -+ pushw %dx /* save for error dump */ -+ pushw %cx -+ pushw %bx -+ pushw %ax -+ -+ int $0x13 -+ jc bad_rt -+ addw $8, %sp -+ popa /* 80186 opcode */ -+ ret -+ -+bad_rt: pushw %ax /* save error code */ -+ call print_all /* ah = error, al = read */ -+ -+ xorb %ah,%ah -+ xorb %dl,%dl -+ int $0x13 -+ -+ addw $10, %sp -+ popa /* 80186 opcode */ -+ jmp read_track -+ -+/* print_all is for debugging purposes. It will print out all of the registers. -+ * The assumption is that this is called from a routine, with a stack frame like -+ * dx -+ * cx -+ * bx -+ * ax -+ * error -+ * ret <- sp -+ */ -+ -+print_all: -+ call print_nl /* nl for readability */ -+ /* print_nl update ah and bx */ -+ movw $5, %cx /* error code + 4 registers */ -+ movw %sp,%bp -+ -+print_loop: -+ pushw %cx /* save count left */ -+ -+ cmpb $5, %cl -+ jae no_reg /* see if register name is needed */ -+ -+ movb $0x5+0x41-1, %al -+ subb %cl,%al - int $0x10 -+ -+ movb $0x58, %al /* 'X' */ -+ int $0x10 -+ -+ movb $0x3A, %al /* ':' */ -+ int $0x10 -+ -+no_reg: -+ addw $2, %bp /* next register */ -+ call print_hex /* print it */ -+ movb $0x20, %al /* print a space */ -+ int $0x10 -+ popw %cx -+ loop print_loop -+ /* nl for readability */ -+print_nl: -+ movb $0xd, %al /* CR */ -+ call print_char -+ movb $0xa, %al /* LF */ -+ jmp print_char -+ -+ -+print_str: -+prloop: -+ lodsb -+ call print_char - loop prloop --freeze: jmp freeze -+ ret - --why: .ascii "This image cannot be loaded from a floppy disk.\r\n" --why_end: -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ -+ -+print_hex: -+ movw (%bp),%dx /* load word into dx */ -+ movb $4, %cl -+ call print_2digits -+print_2digits: -+ call print_digit -+/* fall through */ -+print_digit: -+ rol %cl,%dx /* rotate to use lowest 4 bits */ -+ movb $0x0f, %al /* mask for nybble */ -+ andb %dl,%al -+ addb $0x90, %al /* convert al to ascii hex */ -+ daa /* (four instructions) */ -+ adcb $0x40, %al -+ daa -+print_char: -+ movb $0x0e, %ah /* write char, tty mode */ -+ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -+ int $0x10 -+ ret - -+sread: .word 0 /* sectors read of current track */ -+head: .word 0 /* current head */ -+track: .word 0 /* current track */ -+ -+sectors: -+ .word 0 -+ -+dpseg: .word 0 -+dpoff: .word 0 -+ -+disksizes: -+ .byte 36,18,15,9,0 -+ -+msg1: -+ .ascii "Loading ROM image" -+msg1end: - - .org 497 - setup_sects: diff -r c7b121a4ffd9 -r d6378d455338 etherboot/stuff/patches/etherboot-net.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etherboot/stuff/patches/etherboot-net.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,46 @@ +Patch from network_boot_floppy+cd+hd_540.zip at http://sourceforge.net/projects/thinstation +--- etherboot-5.4.3/src/Makefile.main 2007-02-24 15:44:59.000000000 +0100 ++++ etherboot-5.4.3/src/Makefile.main 2008-04-08 15:06:47.000000000 +0200 +@@ -382,6 +382,27 @@ + $(BIN)/%.zbin: $(BIN)/%.bin $(BIN)/nrv2b $(MAKEDEPS) + $(BIN)/nrv2b e $< $@ + ++# Rule for the multi-NIC image. (by Paolo Salvan) ++NETOBJS:= ++# Note: the 3c90x.o driver should be linked BEFORE the 3c595.o ++# otherwise 3c905b cards will be (badly) handled by the 3c595 driver as 3c900b cards ++NETOBJS+= $(BIN)/3c90x.o ++# PCI cards... ++NETOBJS+= $(BIN)/3c595.o $(BIN)/davicom.o $(BIN)/eepro100.o $(BIN)/ns8390.o $(BIN)/pcnet32.o $(BIN)/prism2_plx.o $(BIN)/rtl8139.o $(BIN)/sis900.o $(BIN)/tulip.o $(BIN)/via-rhine.o $(BIN)/r8169.o $(BIN)/forcedeth.o $(BIN)/ns83820.o $(BIN)/eepro.o $(BIN)/e1000.o ++# ISA cards... ++NETOBJS+= $(BIN)/3c503.o $(BIN)/ne.o $(BIN)/wd.o $(BIN)/3c529.o $(BIN)/3c509.o ++# Exclude these drivers + the belows to create the .COM image, max 65280 byte... ++NETOBJS+= $(BIN)/sk_g16.o $(BIN)/depca.o $(BIN)/cs89x0.o $(BIN)/prism2_pci.o $(BIN)/smc9000.o $(BIN)/natsemi.o $(BIN)/epic100.o $(BIN)/sundance.o $(BIN)/w89c840.o $(BIN)/tlan.o ++# Try excluding this big and rarely-used driver if you get "ERROR: code size exceeds limit!" at build-time ++# or system resets/hungs-up during image decompression at run-time ++# (uncompressed image could have exceeded low-memory...) ++NETOBJS+= $(BIN)/tg3.o ++# This driver has slow autoprobing and is rarely used, so it is better to exclude it... ++#NETOBJS+= $(BIN)/3c515.o ++ ++$(BIN)/etherboot-net.o: $(NETOBJS) ++ $(LD) -r $(NETOBJS) -o $@ ++ + # Housekeeping + + clean: + +--- etherboot-5.4.3/src/core/main.c 2007-02-24 15:44:59.000000000 +0100 ++++ etherboot-5.4.3/src/core/main.c 2008-04-08 15:11:46.000000000 +0200 +@@ -471,6 +471,11 @@ + #ifdef DNS_RESOLVER + const char *resolvt; + #endif ++ char *name_tmp = fname; ++ while ( *name_tmp != 0 ) { ++ if ( memcmp(name_tmp, ".zpxe", 6 ) == 0 ) {*name_tmp=0;} else {++name_tmp;} ++ } ++ + ip.s_addr = arptable[ARP_SERVER].ipaddr.s_addr; + name = fname; + url_port = -1; diff -r c7b121a4ffd9 -r d6378d455338 etherboot/stuff/patches/etherboot-prefix.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etherboot/stuff/patches/etherboot-prefix.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,859 @@ +--- etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S ++++ etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S +@@ -1,92 +1,377 @@ +-/* +- Copyright (C) 2000, Entity Cyber, Inc. +- +- Authors: Gary Byers (gb@thinguin.org) +- Marty Connor (mdc@thinguin.org) +- +- This software may be used and distributed according to the terms +- of the GNU Public License (GPL), incorporated herein by reference. +- +- Description: +- +- This is just a little bit of code and data that can get prepended +- to an Etherboot ROM image in order to allow LILO to load the +- result as if it were a Linux kernel image. +- +- A real Linux kernel image consists of a one-sector boot loader +- (to load the image from a floppy disk), followed a few sectors +- of setup code, followed by the kernel code itself. There's +- a table in the first sector (starting at offset 497) that indicates +- how many sectors of setup code follow the first sector and which +- contains some other parameters that aren't interesting in this +- case. +- +- When LILO loads the sectors that comprise a kernel image, it doesn't +- execute the code in the first sector (since that code would try to +- load the image from a floppy disk.) The code in the first sector +- below doesn't expect to get executed (and prints an error message +- if it ever -is- executed.) LILO's only interested in knowing the +- number of setup sectors advertised in the table (at offset 497 in +- the first sector.) +- +- Etherboot doesn't require much in the way of setup code. +- Historically, the Linux kernel required at least 4 sectors of +- setup code. Current versions of LILO look at the byte at +- offset 497 in the first sector to indicate how many sectors +- of setup code are contained in the image. +- +-*/ ++/* SYS_SIZE is the number of clicks (16 bytes) to be loaded. For Etherboot ++ * purposes, we need to load everything but the boot sector itself, i.e. 32 ++ * clicks less than the size of the entire (verbatim) image. The image size ++ * is practically limited only by the available base memory size. ++ */ ++.globl SYSSIZE ++.equ SYSSIZE, _verbatim_size_pgh - 32 ++ ++/* floppyload.S Copyright (C) 1991, 1992 Linus Torvalds ++ * modified by Drew Eckhardt ++ * modified by Bruce Evans (bde) ++ * ++ * floppyprefix.S is loaded at 0x0000:0x7c00 by the bios-startup routines. ++ * ++ * It then loads the system at SYSSEG<<4, using BIOS interrupts. ++ * ++ * The loader has been made as simple as possible, and continuous read errors ++ * will result in a unbreakable loop. Reboot by hand. It loads pretty fast by ++ * getting whole tracks at a time whenever possible. ++ */ + + #define SETUPSECS 4 /* Minimal nr of setup-sectors */ + #define PREFIXSIZE ((SETUPSECS+1)*512) + #define PREFIXPGH (PREFIXSIZE / 16 ) +-#define BOOTSEG 0x07C0 /* original address of boot-sector */ + #define INITSEG 0x9000 /* we move boot here - out of the way */ + #define SETUPSEG 0x9020 /* setup starts here */ +-#define SYSSEG 0x1000 /* system loaded at 0x10000 (65536). */ + +- .text +- .code16 +- .arch i386 +- .org 0 +- .section ".prefix", "ax", @progbits + .globl _prefix + _prefix: ++.equ BOOTSEG, 0x07C0 /* original address of boot-sector */ + +-/* +- This is a minimal boot sector. If anyone tries to execute it (e.g., if +- a .lilo file is dd'ed to a floppy), print an error message. +-*/ ++.equ SYSSEG, 0x1000 /* system loaded at SYSSEG<<4 */ ++ ++ .org 0 ++ .arch i386 ++ .text ++ .section ".prefix", "ax", @progbits ++ .code16 ++ ++ call here ++here: ++ pop %ax ++ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ ++ jne bootsector ++ ++/* We need a real mode stack that won't be stomped on by Etherboot ++ which starts at 0x20000. Choose something that's sufficiently high, ++ but not in DOC territory. Note that we couldn't do this in a real ++ .com program since stack variables are in the same segment as the ++ code and data, but this isn't really a .com program, it just looks ++ like one to make DOS load it into memory. It still has the 64kB ++ limitation of .com files though. */ ++#define STACK_SEG 0x7000 ++#define STACK_SIZE 0x4000 ++ /* Set up temporary stack */ ++ movw $STACK_SEG, %ax ++ movw %ax, %ss ++ movw $STACK_SIZE, %sp ++ ++ /* Calculate segment address of image start */ ++ pushw %cs ++ popw %ax ++ addw $(0x100/16), %ax ++ jmp go_setup_code + +-bootsector: +- jmp $BOOTSEG, $go - _prefix /* reload cs:ip to match relocation addr */ ++bootsector: ++ jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ + go: +- movw $0x2000, %di /* 0x2000 is arbitrary value >= length +- of bootsect + room for stack */ ++ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ ++ /* of bootsect + room for stack + 12 for */ ++ /* saved disk parm block */ + + movw $BOOTSEG, %ax + movw %ax,%ds + movw %ax,%es +- +- cli +- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ ++ movw %ax,%ss /* put stack at initial position */ + movw %di,%sp +- sti + +- movw $why_end-why, %cx +- movw $why - _prefix, %si ++/* Many BIOS's default disk parameter tables will not recognize multi-sector ++ * reads beyond the maximum sector number specified in the default diskette ++ * parameter tables - this may mean 7 sectors in some cases. ++ * ++ * Since single sector reads are slow and out of the question, we must take care ++ * of this by creating new parameter tables (for the first disk) in RAM. We ++ * will set the maximum sector count to 36 - the most we will encounter on an ++ * ED 2.88. High doesn't hurt. Low does. ++ * ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG ++ */ ++ ++ xorw %cx,%cx ++ movw %cx,%es /* access segment 0 */ ++ movw $0x78, %bx /* 0:bx is parameter table address */ ++ pushw %ds /* save ds */ ++/* 0:bx is parameter table address */ ++ ldsw %es:(%bx),%si /* loads ds and si */ ++ ++ movw %ax,%es /* ax is BOOTSECT (loaded above) */ ++ movb $6, %cl /* copy 12 bytes */ ++ cld ++ pushw %di /* keep a copy for later */ ++ rep ++ movsw /* ds:si is source, es:di is dest */ ++ popw %di ++ ++ movb $36,%es:4(%di) ++ ++ movw %cx,%ds /* access segment 0 */ ++ xchgw %di,(%bx) ++ movw %es,%si ++ xchgw %si,2(%bx) ++ popw %ds /* restore ds */ ++ movw %di, dpoff /* save old parameters */ ++ movw %si, dpseg /* to restore just before finishing */ ++ pushw %ds ++ popw %es /* reload es */ ++ ++/* Note that es is already set up. Also cx is 0 from rep movsw above. */ ++ ++ xorb %ah,%ah /* reset FDC */ ++ xorb %dl,%dl ++ int $0x13 ++ ++/* Get disk drive parameters, specifically number of sectors/track. ++ * ++ * It seems that there is no BIOS call to get the number of sectors. Guess ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, ++ * 15 if sector 15 can be read. Otherwise guess 9. ++ */ + +- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ +- movb $0x0e, %ah /* write char, tty mode */ +-prloop: ++ movw $disksizes, %si /* table of sizes to try */ ++ ++probe_loop: + lodsb ++ orb %al, %al ++ je got_sectors /* if all else fails, try 9 */ ++ cbtw /* extend to word */ ++ movw %ax, sectors ++ xchgw %cx,%ax /* cx = track and sector */ ++ xorw %dx,%dx /* drive 0, head 0 */ ++ movw $0x0200, %bx /* address after boot sector */ ++ /* (512 bytes from origin, es = cs) */ ++ movw $0x0201, %ax /* service 2, 1 sector */ ++ int $0x13 ++ jc probe_loop /* try next value */ ++ ++got_sectors: ++ movw $msg1end-msg1, %cx ++ movw $msg1, %si ++ call print_str ++ ++/* ok, we've written the Loading... message, now we want to load the system */ ++ ++ pushw %es /* = ds */ ++ movw $SYSSEG, %ax ++ movw %ax,%es /* segment of SYSSEG<<4 */ ++ pushw %es ++ call read_it ++ ++/* This turns off the floppy drive motor, so that we enter the kernel in a ++ * known state, and don't have to worry about it later. ++ */ ++ movw $0x3f2, %dx ++ xorb %al,%al ++ outb %al,%dx ++ ++ call print_nl ++ pop %es /* = SYSSEG */ ++ pop %es /* balance push/pop es */ ++sigok: ++ ++/* Restore original disk parameters */ ++ movw $0x78, %bx ++ movw dpoff, %di ++ movw dpseg, %si ++ xorw %ax,%ax ++ movw %ax,%ds ++ movw %di,(%bx) ++ movw %si,2(%bx) ++ ++/* after that (everything loaded), we call to the .ROM file loaded. */ ++ ++ movw $SYSSEG, %ax ++ jmp go_setup_code ++ ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB ++ * boundaries are crossed. We try to load it as fast as possible, loading whole ++ * tracks whenever we can. ++ * ++ * in: es - starting address segment (normally SYSSEG) ++ */ ++read_it: ++ movw $0,sread /* read whole image incl boot sector */ ++ movw %es,%ax ++ testw $0x0fff, %ax ++die: jne die /* es must be at 64kB boundary */ ++ xorw %bx,%bx /* bx is starting address within segment */ ++rp_read: ++ movw %es,%ax ++ movw %bx,%dx ++ movb $4, %cl ++ shrw %cl,%dx /* bx is always divisible by 16 */ ++ addw %dx,%ax ++ cmpw $SYSSEG+SYSSIZE, %ax /* have we loaded all yet? */ ++ jb ok1_read ++ ret ++ok1_read: ++ movw sectors, %ax ++ subw sread, %ax ++ movw %ax,%cx ++ shlw $9, %cx /* 80186 opcode */ ++ addw %bx,%cx ++ jnc ok2_read ++ je ok2_read ++ xorw %ax,%ax ++ subw %bx,%ax ++ shrw $9, %ax /* 80186 opcode */ ++ok2_read: ++ call read_track ++ movw %ax,%cx ++ addw sread, %ax ++ cmpw sectors, %ax ++ jne ok3_read ++ movw $1, %ax ++ subw head, %ax ++ jne ok4_read ++ incw track ++ok4_read: ++ movw %ax, head ++ xorw %ax,%ax ++ok3_read: ++ movw %ax, sread ++ shlw $9, %cx /* 80186 opcode */ ++ addw %cx,%bx ++ jnc rp_read ++ movw %es,%ax ++ addb $0x10, %ah ++ movw %ax,%es ++ xorw %bx,%bx ++ jmp rp_read ++ ++read_track: ++ pusha /* 80186 opcode */ ++ pushw %ax ++ pushw %bx ++ pushw %bp /* just in case the BIOS is buggy */ ++ movb $0x2e, %al /* 0x2e = . */ ++ call print_char ++ popw %bp ++ popw %bx ++ popw %ax ++ ++ movw sread, %cx ++ incw %cx ++ movb track, %ch ++ movw $0x0100, %dx ++ andb head, %dh ++ movb $2, %ah ++ ++ pushw %dx /* save for error dump */ ++ pushw %cx ++ pushw %bx ++ pushw %ax ++ ++ int $0x13 ++ jc bad_rt ++ addw $8, %sp ++ popa /* 80186 opcode */ ++ ret ++ ++bad_rt: pushw %ax /* save error code */ ++ call print_all /* ah = error, al = read */ ++ ++ xorb %ah,%ah ++ xorb %dl,%dl ++ int $0x13 ++ ++ addw $10, %sp ++ popa /* 80186 opcode */ ++ jmp read_track ++ ++/* print_all is for debugging purposes. It will print out all of the registers. ++ * The assumption is that this is called from a routine, with a stack frame like ++ * dx ++ * cx ++ * bx ++ * ax ++ * error ++ * ret <- sp ++ */ ++ ++print_all: ++ call print_nl /* nl for readability */ ++ /* print_nl update ah and bx */ ++ movw $5, %cx /* error code + 4 registers */ ++ movw %sp,%bp ++ ++print_loop: ++ pushw %cx /* save count left */ ++ ++ cmpb $5, %cl ++ jae no_reg /* see if register name is needed */ ++ ++ movb $0x5+0x41-1, %al ++ subb %cl,%al ++ int $0x10 ++ ++ movb $0x58, %al /* 'X' */ ++ int $0x10 ++ ++ movb $0x3A, %al /* ':' */ ++ int $0x10 ++ ++no_reg: ++ addw $2, %bp /* next register */ ++ call print_hex /* print it */ ++ movb $0x20, %al /* print a space */ + int $0x10 ++ popw %cx ++ loop print_loop ++ /* nl for readability */ ++print_nl: ++ movb $0xd, %al /* CR */ ++ call print_char ++ movb $0xa, %al /* LF */ ++ jmp print_char ++ ++ ++print_str: ++prloop: ++ lodsb ++ call print_char + loop prloop +-freeze: jmp freeze ++ ret ++ ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ ++ ++print_hex: ++ movw (%bp),%dx /* load word into dx */ ++ movb $4, %cl ++ call print_2digits ++print_2digits: ++ call print_digit ++/* fall through */ ++print_digit: ++ rol %cl,%dx /* rotate to use lowest 4 bits */ ++ movb $0x0f, %al /* mask for nybble */ ++ andb %dl,%al ++ addb $0x90, %al /* convert al to ascii hex */ ++ daa /* (four instructions) */ ++ adcb $0x40, %al ++ daa ++print_char: ++ movb $0x0e, %ah /* write char, tty mode */ ++ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ ++ int $0x10 ++ ret ++ ++sread: .word 0 /* sectors read of current track */ ++head: .word 0 /* current head */ ++track: .word 0 /* current track */ ++ ++sectors: ++ .word 0 ++ ++dpseg: .word 0 ++dpoff: .word 0 + +-why: .ascii "This image cannot be loaded from a floppy disk.\r\n" +-why_end: ++disksizes: ++ .byte 36,18,15,9,0 + ++msg1: ++ .ascii "Loading ROM image" ++msg1end: + + .org 497 + setup_sects: +@@ -117,15 +402,22 @@ + whose entry point is SYSSEG:0. + */ + setup_code: +- pushl $0 /* No parameters to preserve for exit path */ +- pushw $0 /* Use prefix exit path mechanism */ ++ movw $(SYSSEG-(PREFIXSIZE/16)), %ax + /* Etherboot expects to be contiguous in memory once loaded. + * LILO doesn't do this, but since we don't need any + * information that's left in the prefix, it doesn't matter: + * we just have to ensure that %cs:0000 is where the start of + * the Etherboot image *would* be. + */ +- ljmp $(SYSSEG-(PREFIXSIZE/16)), $_start ++go_setup_code: ++ xorw %cx, %cx ++ pushw %cx ++ pushw %cx /* No parameters to preserve for exit path */ ++ pushw %cx /* Use prefix exit path mechanism */ ++ pushw %ax ++ pushw $_start ++ /* Calculated lcall to _start with %cs:0000 = image start */ ++ lret + + .section ".text16", "ax", @progbits + .globl prefix_exit + +--- etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S ++++ etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S +@@ -82,6 +82,14 @@ + #define SIG1 0xAA55 + #define SIG2 0x5A5A + ++/* SYS_SIZE is the number of clicks (16 bytes) to be loaded. For Etherboot ++ * purposes, we need to load everything but the boot sector itself, i.e. 32 ++ * clicks less than the size of the entire (verbatim) image. The image size ++ * is practically limited only by the available base memory size. ++ */ ++.globl SYSSIZE ++.equ SYSSIZE, _verbatim_size_pgh - 32 ++ + .text + .code16 + .arch i386 +@@ -90,40 +98,349 @@ + .globl _prefix + _prefix: + +-/* +- This is a minimal boot sector. If anyone tries to execute it (e.g., if +- a .lilo file is dd'ed to a floppy), print an error message. +-*/ ++ call here ++here: ++ pop %ax ++ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ ++ jne bootsector ++ ++/* We need a real mode stack that won't be stomped on by Etherboot ++ which starts at 0x20000. Choose something that's sufficiently high, ++ but not in DOC territory. Note that we couldn't do this in a real ++ .com program since stack variables are in the same segment as the ++ code and data, but this isn't really a .com program, it just looks ++ like one to make DOS load it into memory. It still has the 64kB ++ limitation of .com files though. */ ++#define STACK_SEG 0x7000 ++#define STACK_SIZE 0x4000 ++ /* Set up temporary stack */ ++ movw $STACK_SEG, %ax ++ movw %ax, %ss ++ movw $STACK_SIZE, %sp ++ ++ /* Calculate segment address of image start */ ++ pushw %cs ++ popw %ax ++ addw $(0x100/16), %ax ++ jmp go_setup_code + +-bootsector: +- jmp $BOOTSEG, $go - _prefix /* reload cs:ip to match relocation addr */ ++bootsector: ++ jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ + go: +- movw $0x2000, %di /* 0x2000 is arbitrary value >= length +- of bootsect + room for stack */ ++ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ ++ /* of bootsect + room for stack + 12 for */ ++ /* saved disk parm block */ + + movw $BOOTSEG, %ax + movw %ax,%ds + movw %ax,%es +- +- cli +- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ ++ movw %ax,%ss /* put stack at initial position */ + movw %di,%sp +- sti + +- movw $why_end-why, %cx +- movw $why - _prefix, %si ++/* Many BIOS's default disk parameter tables will not recognize multi-sector ++ * reads beyond the maximum sector number specified in the default diskette ++ * parameter tables - this may mean 7 sectors in some cases. ++ * ++ * Since single sector reads are slow and out of the question, we must take care ++ * of this by creating new parameter tables (for the first disk) in RAM. We ++ * will set the maximum sector count to 36 - the most we will encounter on an ++ * ED 2.88. High doesn't hurt. Low does. ++ * ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG ++ */ ++ ++ xorw %cx,%cx ++ movw %cx,%es /* access segment 0 */ ++ movw $0x78, %bx /* 0:bx is parameter table address */ ++ pushw %ds /* save ds */ ++/* 0:bx is parameter table address */ ++ ldsw %es:(%bx),%si /* loads ds and si */ ++ ++ movw %ax,%es /* ax is BOOTSECT (loaded above) */ ++ movb $6, %cl /* copy 12 bytes */ ++ cld ++ pushw %di /* keep a copy for later */ ++ rep ++ movsw /* ds:si is source, es:di is dest */ ++ popw %di + +- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ +- movb $0x0e, %ah /* write char, tty mode */ +-prloop: ++ movb $36,%es:4(%di) ++ ++ movw %cx,%ds /* access segment 0 */ ++ xchgw %di,(%bx) ++ movw %es,%si ++ xchgw %si,2(%bx) ++ popw %ds /* restore ds */ ++ movw %di, dpoff /* save old parameters */ ++ movw %si, dpseg /* to restore just before finishing */ ++ pushw %ds ++ popw %es /* reload es */ ++ ++/* Note that es is already set up. Also cx is 0 from rep movsw above. */ ++ ++ xorb %ah,%ah /* reset FDC */ ++ xorb %dl,%dl ++ int $0x13 ++ ++/* Get disk drive parameters, specifically number of sectors/track. ++ * ++ * It seems that there is no BIOS call to get the number of sectors. Guess ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, ++ * 15 if sector 15 can be read. Otherwise guess 9. ++ */ ++ ++ movw $disksizes, %si /* table of sizes to try */ ++ ++probe_loop: + lodsb ++ orb %al, %al ++ je got_sectors /* if all else fails, try 9 */ ++ cbtw /* extend to word */ ++ movw %ax, sectors ++ xchgw %cx,%ax /* cx = track and sector */ ++ xorw %dx,%dx /* drive 0, head 0 */ ++ movw $0x0200, %bx /* address after boot sector */ ++ /* (512 bytes from origin, es = cs) */ ++ movw $0x0201, %ax /* service 2, 1 sector */ ++ int $0x13 ++ jc probe_loop /* try next value */ ++ ++got_sectors: ++ movw $msg1end-msg1, %cx ++ movw $msg1, %si ++ call print_str ++ ++/* ok, we've written the Loading... message, now we want to load the system */ ++ ++ pushw %es /* = ds */ ++ movw $SYSSEG, %ax ++ movw %ax,%es /* segment of SYSSEG<<4 */ ++ pushw %es ++ call read_it ++ ++/* This turns off the floppy drive motor, so that we enter the kernel in a ++ * known state, and don't have to worry about it later. ++ */ ++ movw $0x3f2, %dx ++ xorb %al,%al ++ outb %al,%dx ++ ++ call print_nl ++ pop %es /* = SYSSEG */ ++ pop %es /* balance push/pop es */ ++sigok: ++ ++/* Restore original disk parameters */ ++ movw $0x78, %bx ++ movw dpoff, %di ++ movw dpseg, %si ++ xorw %ax,%ax ++ movw %ax,%ds ++ movw %di,(%bx) ++ movw %si,2(%bx) ++ ++/* after that (everything loaded), we call to the .ROM file loaded. */ ++ ++ movw $SYSSEG, %ax ++go_setup_code: ++ xorw %cx, %cx ++ pushw %cx ++ pushw %cx /* No parameters to preserve for exit path */ ++ pushw %cx /* Use prefix exit path mechanism */ ++ pushw %ax ++ pushw $_start ++ /* Calculated lcall to _start with %cs:0000 = image start */ ++ lret ++ ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB ++ * boundaries are crossed. We try to load it as fast as possible, loading whole ++ * tracks whenever we can. ++ * ++ * in: es - starting address segment (normally SYSSEG) ++ */ ++read_it: ++ movw $0,sread /* read whole image incl boot sector */ ++ movw %es,%ax ++ testw $0x0fff, %ax ++die: jne die /* es must be at 64kB boundary */ ++ xorw %bx,%bx /* bx is starting address within segment */ ++rp_read: ++ movw %es,%ax ++ movw %bx,%dx ++ movb $4, %cl ++ shrw %cl,%dx /* bx is always divisible by 16 */ ++ addw %dx,%ax ++ cmpw $SYSSEG+SYSSIZE, %ax /* have we loaded all yet? */ ++ jb ok1_read ++ ret ++ok1_read: ++ movw sectors, %ax ++ subw sread, %ax ++ movw %ax,%cx ++ shlw $9, %cx /* 80186 opcode */ ++ addw %bx,%cx ++ jnc ok2_read ++ je ok2_read ++ xorw %ax,%ax ++ subw %bx,%ax ++ shrw $9, %ax /* 80186 opcode */ ++ok2_read: ++ call read_track ++ movw %ax,%cx ++ addw sread, %ax ++ cmpw sectors, %ax ++ jne ok3_read ++ movw $1, %ax ++ subw head, %ax ++ jne ok4_read ++ incw track ++ok4_read: ++ movw %ax, head ++ xorw %ax,%ax ++ok3_read: ++ movw %ax, sread ++ shlw $9, %cx /* 80186 opcode */ ++ addw %cx,%bx ++ jnc rp_read ++ movw %es,%ax ++ addb $0x10, %ah ++ movw %ax,%es ++ xorw %bx,%bx ++ jmp rp_read ++ ++read_track: ++ pusha /* 80186 opcode */ ++ pushw %ax ++ pushw %bx ++ pushw %bp /* just in case the BIOS is buggy */ ++ movb $0x2e, %al /* 0x2e = . */ ++ call print_char ++ popw %bp ++ popw %bx ++ popw %ax ++ ++ movw sread, %cx ++ incw %cx ++ movb track, %ch ++ movw $0x0100, %dx ++ andb head, %dh ++ movb $2, %ah ++ ++ pushw %dx /* save for error dump */ ++ pushw %cx ++ pushw %bx ++ pushw %ax ++ ++ int $0x13 ++ jc bad_rt ++ addw $8, %sp ++ popa /* 80186 opcode */ ++ ret ++ ++bad_rt: pushw %ax /* save error code */ ++ call print_all /* ah = error, al = read */ ++ ++ xorb %ah,%ah ++ xorb %dl,%dl ++ int $0x13 ++ ++ addw $10, %sp ++ popa /* 80186 opcode */ ++ jmp read_track ++ ++/* print_all is for debugging purposes. It will print out all of the registers. ++ * The assumption is that this is called from a routine, with a stack frame like ++ * dx ++ * cx ++ * bx ++ * ax ++ * error ++ * ret <- sp ++ */ ++ ++print_all: ++ call print_nl /* nl for readability */ ++ /* print_nl update ah and bx */ ++ movw $5, %cx /* error code + 4 registers */ ++ movw %sp,%bp ++ ++print_loop: ++ pushw %cx /* save count left */ ++ ++ cmpb $5, %cl ++ jae no_reg /* see if register name is needed */ ++ ++ movb $0x5+0x41-1, %al ++ subb %cl,%al + int $0x10 ++ ++ movb $0x58, %al /* 'X' */ ++ int $0x10 ++ ++ movb $0x3A, %al /* ':' */ ++ int $0x10 ++ ++no_reg: ++ addw $2, %bp /* next register */ ++ call print_hex /* print it */ ++ movb $0x20, %al /* print a space */ ++ int $0x10 ++ popw %cx ++ loop print_loop ++ /* nl for readability */ ++print_nl: ++ movb $0xd, %al /* CR */ ++ call print_char ++ movb $0xa, %al /* LF */ ++ jmp print_char ++ ++ ++print_str: ++prloop: ++ lodsb ++ call print_char + loop prloop +-freeze: jmp freeze ++ ret + +-why: .ascii "This image cannot be loaded from a floppy disk.\r\n" +-why_end: ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ ++ ++print_hex: ++ movw (%bp),%dx /* load word into dx */ ++ movb $4, %cl ++ call print_2digits ++print_2digits: ++ call print_digit ++/* fall through */ ++print_digit: ++ rol %cl,%dx /* rotate to use lowest 4 bits */ ++ movb $0x0f, %al /* mask for nybble */ ++ andb %dl,%al ++ addb $0x90, %al /* convert al to ascii hex */ ++ daa /* (four instructions) */ ++ adcb $0x40, %al ++ daa ++print_char: ++ movb $0x0e, %ah /* write char, tty mode */ ++ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ ++ int $0x10 ++ ret + ++sread: .word 0 /* sectors read of current track */ ++head: .word 0 /* current head */ ++track: .word 0 /* current track */ ++ ++sectors: ++ .word 0 ++ ++dpseg: .word 0 ++dpoff: .word 0 ++ ++disksizes: ++ .byte 36,18,15,9,0 ++ ++msg1: ++ .ascii "Loading ROM image" ++msg1end: + + .org 497 + setup_sects: diff -r c7b121a4ffd9 -r d6378d455338 etherboot/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etherboot/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|etherboot-net.u +-p1|etherboot-prefix.u diff -r c7b121a4ffd9 -r d6378d455338 fbvnc/receipt --- a/fbvnc/receipt Wed May 09 17:03:28 2018 +0300 +++ b/fbvnc/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,6 @@ #BUILD_DEPENDS="git" compile_rules() { - #patch -p0 < $stuff/fbvnc.u && sed -i s"/cc/${HOST_SYSTEM}-gcc/" Makefile && make && install -Dm755 $src/fbvnc $install/usr/bin/fbvnc diff -r c7b121a4ffd9 -r d6378d455338 fbvnc/stuff/fbvnc.u --- a/fbvnc/stuff/fbvnc.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,612 +0,0 @@ ---- draw.h -+++ draw.h -@@ -15,5 +15,11 @@ - void fb_cmap(void); - - /* helper functions */ -+struct rgb_conv { -+ int rshl, gshl; -+ int rskp, gskp, bskp; -+ int rmax, gmax, bmax; -+}; -+void fill_rgb_conv(int mode, struct rgb_conv *s); - void fb_set(int r, int c, void *mem, int len); - unsigned fb_val(int r, int g, int b); ---- draw.c -+++ draw.c -@@ -10,14 +10,13 @@ - - #define MIN(a, b) ((a) < (b) ? (a) : (b)) - #define MAX(a, b) ((a) > (b) ? (a) : (b)) --#define NLEVELS (1 << 8) -+#define NLEVELS (1 << 16) - - static int fd; - static void *fb; - static struct fb_var_screeninfo vinfo; - static struct fb_fix_screeninfo finfo; --static int bpp; --static int nr, ng, nb; -+static int bytes_per_pixel; - - static int fb_len(void) - { -@@ -28,10 +27,12 @@ - { - static unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; - struct fb_cmap cmap; -+ - if (finfo.visual == FB_VISUAL_TRUECOLOR) - return; -+ - cmap.start = 0; -- cmap.len = MAX(nr, MAX(ng, nb)); -+ cmap.len = NLEVELS; - cmap.red = red; - cmap.green = green; - cmap.blue = blue; -@@ -41,24 +42,39 @@ - - void fb_cmap(void) - { -- unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; -+ struct fb_bitfield *color[3] = { -+ &vinfo.blue, &vinfo.green, &vinfo.red -+ }; -+ int eye_sensibility[3] = { 2, 0, 1 }; // higher=red, blue, lower=green - struct fb_cmap cmap; -- int i; -+ unsigned short map[3][NLEVELS]; -+ int i, j, n, offset; -+ - if (finfo.visual == FB_VISUAL_TRUECOLOR) - return; - -- for (i = 0; i < nr; i++) -- red[i] = (65535 / (nr - 1)) * i; -- for (i = 0; i < ng; i++) -- green[i] = (65535 / (ng - 1)) * i; -- for (i = 0; i < nb; i++) -- blue[i] = (65535 / (nb - 1)) * i; -- -+ for (i = 0, n = vinfo.bits_per_pixel; i < 3; i++) { -+ n -= color[eye_sensibility[i]]->length = n / (3 - i); -+ } -+ n = (1 << vinfo.bits_per_pixel); -+ if (n > NLEVELS) -+ n = NLEVELS; -+ for (i = offset = 0; i < 3; i++) { -+ int length = color[i]->length; -+ color[i]->offset = offset; -+ for (j = 0; j < n; j++) { -+ int k = (j >> offset) << (16 - length); -+ if (k == (0xFFFF << (16 - length))) -+ k = 0xFFFF; -+ map[i][j] = k; -+ } -+ offset += length; -+ } - cmap.start = 0; -- cmap.len = MAX(nr, MAX(ng, nb)); -- cmap.red = red; -- cmap.green = green; -- cmap.blue = blue; -+ cmap.len = n; -+ cmap.red = map[2]; -+ cmap.green = map[1]; -+ cmap.blue = map[0]; - cmap.transp = NULL; - - ioctl(fd, FBIOPUTCMAP, &cmap); -@@ -66,25 +82,26 @@ - - unsigned fb_mode(void) - { -- return (bpp << 16) | (vinfo.red.length << 8) | -+ return (bytes_per_pixel << 16) | (vinfo.red.length << 8) | - (vinfo.green.length << 4) | (vinfo.blue.length); - } - - int fb_init(void) - { -+ int err = 1; - fd = open(FBDEV_PATH, O_RDWR); - if (fd == -1) - goto failed; -+ err++; - if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) - goto failed; -+ err++; - if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) - goto failed; - fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); -- bpp = (vinfo.bits_per_pixel + 7) >> 3; -- nr = 1 << vinfo.red.length; -- ng = 1 << vinfo.blue.length; -- nb = 1 << vinfo.green.length; -+ bytes_per_pixel = (vinfo.bits_per_pixel + 7) >> 3; - fb = mmap(NULL, fb_len(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); -+ err++; - if (fb == MAP_FAILED) - goto failed; - fb_cmap_save(1); -@@ -93,7 +110,7 @@ - failed: - perror("fb_init()"); - close(fd); -- return 1; -+ return err; - } - - void fb_free(void) -@@ -120,19 +137,30 @@ - - void fb_set(int r, int c, void *mem, int len) - { -- memcpy(fb_mem(r) + (c + vinfo.xoffset) * bpp, mem, len * bpp); -+ memcpy(fb_mem(r) + (c + vinfo.xoffset) * bytes_per_pixel, -+ mem, len * bytes_per_pixel); - } - -+void fill_rgb_conv(int mode, struct rgb_conv *s) -+{ -+ int bits; -+ -+ bits = mode & 0xF; mode >>= 4; -+ s->rshl = s->gshl = bits; -+ s->bskp = 8 - bits; s->bmax = (1 << bits) -1; -+ bits = mode & 0xF; mode >>= 4; -+ s->rshl += bits; -+ s->gskp = 8 - bits; s->gmax = (1 << bits) -1; -+ bits = mode & 0xF; -+ s->rskp = 8 - bits; s->rmax = (1 << bits) -1; -+} -+ - unsigned fb_val(int r, int g, int b) - { -- switch (fb_mode() & 0x0fff) { -- default: -- fprintf(stderr, "fb_val: unknown fb_mode()\n"); -- case 0x0888: -- return (r << 16) | (g << 8) | b; -- case 0x0565: -- return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); -- case 0x0233: -- return ((r >> 6) << 6) | ((g >> 5) << 3) | (b >> 5); -- } -+ static struct rgb_conv c; -+ -+ if (c.rshl == 0) -+ fill_rgb_conv(fb_mode(), &c); -+ return ((r >> c.rskp) << c.rshl) | ((g >> c.gskp) << c.gshl) -+ | (b >> c.bskp); - } ---- fbvnc.c -+++ fbvnc.c -@@ -36,13 +36,15 @@ - - #define VNC_PORT "5900" - --#define MAXRES (1 << 21) --#define MIN(a, b) ((a) < (b) ? (a) : (b)) -+#define MAXRES (1 << 12) - - static int cols, rows; -+static int srv_cols, srv_rows; -+static int or, oc; - static int mr, mc; /* mouse position */ - - static char buf[MAXRES]; -+#define MAXPIX (MAXRES/sizeof(fbval_t)) - - static int vnc_connect(char *addr, char *port) - { -@@ -61,22 +63,26 @@ - - if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) == -1) { - close(fd); -- freeaddrinfo(addrinfo); -- return -1; -+ fd = -2; - } - freeaddrinfo(addrinfo); - return fd; - } - -+static int bpp, vnc_mode; -+static struct rgb_conv format; - static int vnc_init(int fd) - { -- char vncver[] = "RFB 003.003\n"; -+ static int vncfmt[] = { 0x40888, 0x20565, 0x10233, 0 }; -+ char vncver[12]; -+ int i; -+ - struct vnc_client_init clientinit; - struct vnc_server_init serverinit; - struct vnc_client_pixelfmt pixfmt_cmd; - int connstat = VNC_CONN_FAILED; - -- write(fd, vncver, 12); -+ write(fd, "RFB 003.003\n", 12); - read(fd, vncver, 12); - - read(fd, &connstat, sizeof(connstat)); -@@ -88,68 +94,78 @@ - write(fd, &clientinit, sizeof(clientinit)); - read(fd, &serverinit, sizeof(serverinit)); - -- if (fb_init()) -- return -1; -- if (FBM_BPP(fb_mode()) != sizeof(fbval_t)) { -- fprintf(stderr, "fbvnc: fbval_t doesn't match fb depth\n"); -- exit(1); -- } -- cols = MIN(ntohs(serverinit.w), fb_cols()); -- rows = MIN(ntohs(serverinit.h), fb_rows()); -+ i = fb_init(); -+ if (i) -+ return -1 - i; -+ srv_cols = ntohs(serverinit.w); -+ srv_rows = ntohs(serverinit.h); -+ cols = MIN(srv_cols, fb_cols()); -+ rows = MIN(srv_rows, fb_rows()); - mr = rows / 2; - mc = cols / 2; -+ or = oc = 0; - - read(fd, buf, ntohl(serverinit.len)); - pixfmt_cmd.type = VNC_CLIENT_PIXFMT; -- pixfmt_cmd.format.bpp = 8; -- pixfmt_cmd.format.depth = 8; - pixfmt_cmd.format.bigendian = 0; - pixfmt_cmd.format.truecolor = 1; - -- pixfmt_cmd.format.rmax = htons(3); -- pixfmt_cmd.format.gmax = htons(7); -- pixfmt_cmd.format.bmax = htons(7); -- pixfmt_cmd.format.rshl = 0; -- pixfmt_cmd.format.gshl = 2; -- pixfmt_cmd.format.bshl = 5; -+ if (bpp < 1) -+ bpp = FBM_BPP(fb_mode()); -+ if (bpp >= 3) -+ bpp = 4; -+ for (i = 0; bpp <= FBM_BPP(vncfmt[i]); i++) -+ vnc_mode = vncfmt[i]; -+ bpp = FBM_BPP(vnc_mode); -+ pixfmt_cmd.format.bpp = -+ pixfmt_cmd.format.depth = bpp << 3; - -+ fill_rgb_conv(FBM_COLORS(vnc_mode), &format); -+ pixfmt_cmd.format.rmax = htons(format.rmax); -+ pixfmt_cmd.format.gmax = htons(format.gmax); -+ pixfmt_cmd.format.bmax = htons(format.bmax); -+ pixfmt_cmd.format.rshl = format.rshl; -+ pixfmt_cmd.format.gshl = format.gshl; -+ pixfmt_cmd.format.bshl = 0; - write(fd, &pixfmt_cmd, sizeof(pixfmt_cmd)); - return fd; - } - --static int vnc_free(void) -+static void vnc_free(void) - { - fb_free(); -- return 0; - } - --static int vnc_refresh(int fd, int inc) -+static void vnc_refresh(int fd, int inc) - { - struct vnc_client_fbup fbup_req; - fbup_req.type = VNC_CLIENT_FBUP; - fbup_req.inc = inc; -- fbup_req.x = htons(0); -- fbup_req.y = htons(0); -- fbup_req.w = htons(cols); -- fbup_req.h = htons(rows); -+ fbup_req.x = htons(oc); -+ fbup_req.y = htons(or); -+ fbup_req.w = htons(oc + cols); -+ fbup_req.h = htons(or + rows); - write(fd, &fbup_req, sizeof(fbup_req)); -- return 0; - } - --static void drawfb(char *s, int x, int y, int w, int h) -+static void drawfb(char *s, int x, int y, int w) - { -- fbval_t slice[1 << 14]; -- int i, j; -- for (i = 0; i < h; i++) { -- for (j = 0; j < w; j++) { -- int c = *(unsigned char *) &s[i * w + j]; -- int r = (c & 0x3) << 6; -- int g = ((c >> 2) & 0x7) << 5; -- int b = ((c >> 5) & 0x7) << 5; -- slice[j] = FB_VAL(r, g, b); -+ int mode = fb_mode(); -+ if (mode != vnc_mode) { -+ fbval_t slice[MAXRES]; -+ unsigned char *byte = (unsigned char *) slice; -+ int j; -+ int fb_bpp = FBM_BPP(mode); -+ for (j = 0; j < w; j++, byte += fb_bpp, s += bpp) { -+ fbval_t c = * (fbval_t *) s; -+ int r = ((c >> format.rshl) & format.rmax) << format.rskp; -+ int g = ((c >> format.gshl) & format.gmax) << format.gskp; -+ int b = (c & format.bmax) << format.bskp; -+ * (fbval_t *) byte = FB_VAL(r, g, b); - } -- fb_set(y + i, x, slice, w); -+ s = (void *) slice; - } -+ fb_set(y, x, s, w); - } - - static void xread(int fd, void *buf, int len) -@@ -159,54 +175,84 @@ - while (nr < len && (n = read(fd, buf + nr, len - nr)) > 0) - nr += n; - if (nr < len) { -- printf("partial vnc read!\n"); -- exit(1); -+ fprintf(stderr,"partial vnc read!\n"); -+ exit(99); - } - } - -+static void skip(int fd, int len) -+{ -+ int n; -+ while (len > 0 && (n = read(fd, buf, MIN(len, sizeof(buf)))) > 0) -+ len -= n; -+} -+ - static int vnc_event(int fd) - { - struct vnc_rect uprect; -- char msg[1 << 12]; -- struct vnc_server_fbup *fbup = (void *) msg; -- struct vnc_server_cuttext *cuttext = (void *) msg; -- struct vnc_server_colormap *colormap = (void *) msg; -- int j; -- int n; -+ union { -+ struct vnc_server_fbup fbup; -+ struct vnc_server_cuttext cuttext; -+ struct vnc_server_colormap colormap; -+ } msg; -+ int j, n; - -- if (read(fd, msg, 1) != 1) -+ if (read(fd, &msg.fbup.type, 1) != 1) - return -1; -- switch (msg[0]) { -+ switch (msg.fbup.type) { - case VNC_SERVER_FBUP: -- xread(fd, msg + 1, sizeof(*fbup) - 1); -- n = ntohs(fbup->n); -+ xread(fd, &msg.fbup.pad, sizeof(msg.fbup) - 1); -+ n = ntohs(msg.fbup.n); - for (j = 0; j < n; j++) { -- int x, y, w, h; -+ int x, y, w, h, l, i; - xread(fd, &uprect, sizeof(uprect)); -+ if (uprect.enc != 0) { -+ fprintf(stderr,"Encoding not RAW: %d\n", -+ ntohl(uprect.enc)); -+ return -1; -+ } - x = ntohs(uprect.x); - y = ntohs(uprect.y); - w = ntohs(uprect.w); - h = ntohs(uprect.h); -- if (x >= cols || x + w > cols) -- return -1; -- if (y >= rows || y + h > rows) -- return -1; -- xread(fd, buf, w * h); -- drawfb(buf, x, y, w, h); -+ x -= oc; -+ y -= or; -+ i = 0; -+ l = MIN(w, cols - x); -+ if (x < 0) { -+ l = MIN(w + x, cols); -+ i = MIN(w, -x); -+ x = 0; -+ } -+ if (l < 0) -+ l = 0; -+ for (; h--; y++) { -+ int n = l; -+ int xj = x; -+ skip(fd, i * bpp); -+ while (n > 0) { -+ int j = MIN(n, MAXPIX); -+ xread(fd, buf, j * bpp); -+ if (y >= 0 && y < rows) -+ drawfb(buf, xj, y, j); -+ xj += j; n -= j; -+ } -+ skip(fd, (w - l - i) * bpp); -+ } - } - break; - case VNC_SERVER_BELL: - break; - case VNC_SERVER_CUTTEXT: -- xread(fd, msg + 1, sizeof(*cuttext) - 1); -- xread(fd, buf, ntohl(cuttext->len)); -+ xread(fd, &msg.cuttext.pad1, sizeof(msg.cuttext) - 1); -+ skip(fd, ntohl(msg.cuttext.len)); - break; - case VNC_SERVER_COLORMAP: -- xread(fd, msg + 1, sizeof(*colormap) - 1); -- xread(fd, buf, ntohs(colormap->n) * 3 * 2); -+ xread(fd, &msg.colormap.pad, sizeof(msg.colormap) - 1); -+ skip(fd, ntohs(msg.colormap.n) * 3 * 2); - break; - default: -- fprintf(stderr, "unknown vnc msg: %d\n", msg[0]); -+ fprintf(stderr, "unknown vnc msg: %d\n", msg.fbup.type); - return -1; - } - return 0; -@@ -217,12 +263,31 @@ - char ie[3]; - struct vnc_client_ratevent me = {VNC_CLIENT_RATEVENT}; - int mask = 0; -+ int refresh = 2; - if (read(ratfd, &ie, sizeof(ie)) != 3) - return -1; - mc += ie[1]; - mr -= ie[2]; -- mc = MAX(0, MIN(cols - 1, mc)); -- mr = MAX(0, MIN(rows - 1, mr)); -+ if (mc < oc) { -+ if ((oc -= cols / 5) < 0) -+ oc = 0; -+ } -+ else if (mc >= oc + cols && oc + cols < srv_cols) { -+ if ((oc += cols / 5) > srv_cols - cols) -+ oc = srv_cols - cols; -+ } -+ else refresh--; -+ if (mr < or) { -+ if ((or -= rows / 5) < 0) -+ or = 0; -+ } -+ else if (mr >= or + rows && or + rows < srv_rows) { -+ if ((or += rows / 5) > srv_rows - rows) -+ or = srv_rows - rows; -+ } -+ else refresh--; -+ mc = MAX(oc, MIN(oc + cols - 1, mc)); -+ mr = MAX(or, MIN(or + rows - 1, mr)); - if (ie[0] & 0x01) - mask |= VNC_BUTTON1_MASK; - if (ie[0] & 0x04) -@@ -233,6 +298,8 @@ - me.x = htons(mc); - me.mask = mask; - write(fd, &me, sizeof(me)); -+ if (refresh) -+ vnc_refresh(fd, 0); - return 0; - } - -@@ -292,12 +359,11 @@ - k = 0xff0d; - break; - case 0x0c: /* ^L: redraw */ -- if (vnc_refresh(fd, 0)) -- return -1; -+ vnc_refresh(fd, 0); - default: - k = (unsigned char) key[i]; - } -- if (k >= 'A' && k <= 'Z' || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) -+ if ((k >= 'A' && k <= 'Z') || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) - mod[nmod++] = 0xffe1; - if (k >= 1 && k <= 26) { - k = 'a' + k - 1; -@@ -339,40 +405,42 @@ - write(STDIN_FILENO, show, strlen(show)); - } - --static void mainloop(int vnc_fd, int kbd_fd, int rat_fd) -+static int mainloop(int vnc_fd, int kbd_fd, int rat_fd) - { - struct pollfd ufds[3]; - int pending = 0; - int err; - ufds[0].fd = kbd_fd; -- ufds[0].events = POLLIN; - ufds[1].fd = vnc_fd; -- ufds[1].events = POLLIN; - ufds[2].fd = rat_fd; -+ ufds[0].events = -+ ufds[1].events = - ufds[2].events = POLLIN; -- if (vnc_refresh(vnc_fd, 0)) -- return; -+ vnc_refresh(vnc_fd, 0); - while (1) { - err = poll(ufds, 3, 500); - if (err == -1 && errno != EINTR) - break; - if (!err) - continue; -+ err = -2; - if (ufds[0].revents & POLLIN) - if (kbd_event(vnc_fd, kbd_fd) == -1) - break; -+ err--; - if (ufds[1].revents & POLLIN) { - if (vnc_event(vnc_fd) == -1) - break; - pending = 0; - } -+ err--; - if (ufds[2].revents & POLLIN) - if (rat_event(vnc_fd, rat_fd) == -1) - break; - if (!pending++) -- if (vnc_refresh(vnc_fd, 1)) -- break; -+ vnc_refresh(vnc_fd, 1); - } -+ return err; - } - - int main(int argc, char * argv[]) -@@ -380,27 +448,38 @@ - char *port = VNC_PORT; - char *host = "127.0.0.1"; - struct termios ti; -- int vnc_fd, rat_fd; -+ int vnc_fd, rat_fd, status; -+ -+ if (argc < 2) { -+ fprintf(stderr, "Usage : fbvnc [-bpp bits] server [port]\n"); -+ return 0; -+ } -+ if (*argv[1] == '-' && argc >= 3) { -+ argc -= 2; argv += 2; -+ bpp = atoi(argv[0]) >> 3; -+ } - if (argc >= 2) - host = argv[1]; - if (argc >= 3) - port = argv[2]; -- if ((vnc_fd = vnc_connect(host, port)) == -1) { -- fprintf(stderr, "could not connect!\n"); -+ if ((vnc_fd = vnc_connect(host, port)) < 0) { -+ fprintf(stderr, "could not connect! %s %s : %d\n", -+ host,port,vnc_fd); - return 1; - } -- if (vnc_init(vnc_fd) == -1) { -- fprintf(stderr, "vnc init failed!\n"); -- return 1; -+ status = vnc_init(vnc_fd); -+ if (status < 0) { -+ fprintf(stderr, "vnc init failed! %d\n", status); -+ return 2; - } - term_setup(&ti); - rat_fd = open("/dev/input/mice", O_RDONLY); - -- mainloop(vnc_fd, 0, rat_fd); -+ status = mainloop(vnc_fd, 0, rat_fd); - - term_cleanup(&ti); - vnc_free(); - close(vnc_fd); - close(rat_fd); -- return 0; -+ return 2 - status; - } diff -r c7b121a4ffd9 -r d6378d455338 fbvnc/stuff/patches/fbvnc.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fbvnc/stuff/patches/fbvnc.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,612 @@ +--- draw.h ++++ draw.h +@@ -15,5 +15,11 @@ + void fb_cmap(void); + + /* helper functions */ ++struct rgb_conv { ++ int rshl, gshl; ++ int rskp, gskp, bskp; ++ int rmax, gmax, bmax; ++}; ++void fill_rgb_conv(int mode, struct rgb_conv *s); + void fb_set(int r, int c, void *mem, int len); + unsigned fb_val(int r, int g, int b); +--- draw.c ++++ draw.c +@@ -10,14 +10,13 @@ + + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #define MAX(a, b) ((a) > (b) ? (a) : (b)) +-#define NLEVELS (1 << 8) ++#define NLEVELS (1 << 16) + + static int fd; + static void *fb; + static struct fb_var_screeninfo vinfo; + static struct fb_fix_screeninfo finfo; +-static int bpp; +-static int nr, ng, nb; ++static int bytes_per_pixel; + + static int fb_len(void) + { +@@ -28,10 +27,12 @@ + { + static unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; + struct fb_cmap cmap; ++ + if (finfo.visual == FB_VISUAL_TRUECOLOR) + return; ++ + cmap.start = 0; +- cmap.len = MAX(nr, MAX(ng, nb)); ++ cmap.len = NLEVELS; + cmap.red = red; + cmap.green = green; + cmap.blue = blue; +@@ -41,24 +42,39 @@ + + void fb_cmap(void) + { +- unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS]; ++ struct fb_bitfield *color[3] = { ++ &vinfo.blue, &vinfo.green, &vinfo.red ++ }; ++ int eye_sensibility[3] = { 2, 0, 1 }; // higher=red, blue, lower=green + struct fb_cmap cmap; +- int i; ++ unsigned short map[3][NLEVELS]; ++ int i, j, n, offset; ++ + if (finfo.visual == FB_VISUAL_TRUECOLOR) + return; + +- for (i = 0; i < nr; i++) +- red[i] = (65535 / (nr - 1)) * i; +- for (i = 0; i < ng; i++) +- green[i] = (65535 / (ng - 1)) * i; +- for (i = 0; i < nb; i++) +- blue[i] = (65535 / (nb - 1)) * i; +- ++ for (i = 0, n = vinfo.bits_per_pixel; i < 3; i++) { ++ n -= color[eye_sensibility[i]]->length = n / (3 - i); ++ } ++ n = (1 << vinfo.bits_per_pixel); ++ if (n > NLEVELS) ++ n = NLEVELS; ++ for (i = offset = 0; i < 3; i++) { ++ int length = color[i]->length; ++ color[i]->offset = offset; ++ for (j = 0; j < n; j++) { ++ int k = (j >> offset) << (16 - length); ++ if (k == (0xFFFF << (16 - length))) ++ k = 0xFFFF; ++ map[i][j] = k; ++ } ++ offset += length; ++ } + cmap.start = 0; +- cmap.len = MAX(nr, MAX(ng, nb)); +- cmap.red = red; +- cmap.green = green; +- cmap.blue = blue; ++ cmap.len = n; ++ cmap.red = map[2]; ++ cmap.green = map[1]; ++ cmap.blue = map[0]; + cmap.transp = NULL; + + ioctl(fd, FBIOPUTCMAP, &cmap); +@@ -66,25 +82,26 @@ + + unsigned fb_mode(void) + { +- return (bpp << 16) | (vinfo.red.length << 8) | ++ return (bytes_per_pixel << 16) | (vinfo.red.length << 8) | + (vinfo.green.length << 4) | (vinfo.blue.length); + } + + int fb_init(void) + { ++ int err = 1; + fd = open(FBDEV_PATH, O_RDWR); + if (fd == -1) + goto failed; ++ err++; + if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) + goto failed; ++ err++; + if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) + goto failed; + fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); +- bpp = (vinfo.bits_per_pixel + 7) >> 3; +- nr = 1 << vinfo.red.length; +- ng = 1 << vinfo.blue.length; +- nb = 1 << vinfo.green.length; ++ bytes_per_pixel = (vinfo.bits_per_pixel + 7) >> 3; + fb = mmap(NULL, fb_len(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ++ err++; + if (fb == MAP_FAILED) + goto failed; + fb_cmap_save(1); +@@ -93,7 +110,7 @@ + failed: + perror("fb_init()"); + close(fd); +- return 1; ++ return err; + } + + void fb_free(void) +@@ -120,19 +137,30 @@ + + void fb_set(int r, int c, void *mem, int len) + { +- memcpy(fb_mem(r) + (c + vinfo.xoffset) * bpp, mem, len * bpp); ++ memcpy(fb_mem(r) + (c + vinfo.xoffset) * bytes_per_pixel, ++ mem, len * bytes_per_pixel); + } + ++void fill_rgb_conv(int mode, struct rgb_conv *s) ++{ ++ int bits; ++ ++ bits = mode & 0xF; mode >>= 4; ++ s->rshl = s->gshl = bits; ++ s->bskp = 8 - bits; s->bmax = (1 << bits) -1; ++ bits = mode & 0xF; mode >>= 4; ++ s->rshl += bits; ++ s->gskp = 8 - bits; s->gmax = (1 << bits) -1; ++ bits = mode & 0xF; ++ s->rskp = 8 - bits; s->rmax = (1 << bits) -1; ++} ++ + unsigned fb_val(int r, int g, int b) + { +- switch (fb_mode() & 0x0fff) { +- default: +- fprintf(stderr, "fb_val: unknown fb_mode()\n"); +- case 0x0888: +- return (r << 16) | (g << 8) | b; +- case 0x0565: +- return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); +- case 0x0233: +- return ((r >> 6) << 6) | ((g >> 5) << 3) | (b >> 5); +- } ++ static struct rgb_conv c; ++ ++ if (c.rshl == 0) ++ fill_rgb_conv(fb_mode(), &c); ++ return ((r >> c.rskp) << c.rshl) | ((g >> c.gskp) << c.gshl) ++ | (b >> c.bskp); + } +--- fbvnc.c ++++ fbvnc.c +@@ -36,13 +36,15 @@ + + #define VNC_PORT "5900" + +-#define MAXRES (1 << 21) +-#define MIN(a, b) ((a) < (b) ? (a) : (b)) ++#define MAXRES (1 << 12) + + static int cols, rows; ++static int srv_cols, srv_rows; ++static int or, oc; + static int mr, mc; /* mouse position */ + + static char buf[MAXRES]; ++#define MAXPIX (MAXRES/sizeof(fbval_t)) + + static int vnc_connect(char *addr, char *port) + { +@@ -61,22 +63,26 @@ + + if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) == -1) { + close(fd); +- freeaddrinfo(addrinfo); +- return -1; ++ fd = -2; + } + freeaddrinfo(addrinfo); + return fd; + } + ++static int bpp, vnc_mode; ++static struct rgb_conv format; + static int vnc_init(int fd) + { +- char vncver[] = "RFB 003.003\n"; ++ static int vncfmt[] = { 0x40888, 0x20565, 0x10233, 0 }; ++ char vncver[12]; ++ int i; ++ + struct vnc_client_init clientinit; + struct vnc_server_init serverinit; + struct vnc_client_pixelfmt pixfmt_cmd; + int connstat = VNC_CONN_FAILED; + +- write(fd, vncver, 12); ++ write(fd, "RFB 003.003\n", 12); + read(fd, vncver, 12); + + read(fd, &connstat, sizeof(connstat)); +@@ -88,68 +94,78 @@ + write(fd, &clientinit, sizeof(clientinit)); + read(fd, &serverinit, sizeof(serverinit)); + +- if (fb_init()) +- return -1; +- if (FBM_BPP(fb_mode()) != sizeof(fbval_t)) { +- fprintf(stderr, "fbvnc: fbval_t doesn't match fb depth\n"); +- exit(1); +- } +- cols = MIN(ntohs(serverinit.w), fb_cols()); +- rows = MIN(ntohs(serverinit.h), fb_rows()); ++ i = fb_init(); ++ if (i) ++ return -1 - i; ++ srv_cols = ntohs(serverinit.w); ++ srv_rows = ntohs(serverinit.h); ++ cols = MIN(srv_cols, fb_cols()); ++ rows = MIN(srv_rows, fb_rows()); + mr = rows / 2; + mc = cols / 2; ++ or = oc = 0; + + read(fd, buf, ntohl(serverinit.len)); + pixfmt_cmd.type = VNC_CLIENT_PIXFMT; +- pixfmt_cmd.format.bpp = 8; +- pixfmt_cmd.format.depth = 8; + pixfmt_cmd.format.bigendian = 0; + pixfmt_cmd.format.truecolor = 1; + +- pixfmt_cmd.format.rmax = htons(3); +- pixfmt_cmd.format.gmax = htons(7); +- pixfmt_cmd.format.bmax = htons(7); +- pixfmt_cmd.format.rshl = 0; +- pixfmt_cmd.format.gshl = 2; +- pixfmt_cmd.format.bshl = 5; ++ if (bpp < 1) ++ bpp = FBM_BPP(fb_mode()); ++ if (bpp >= 3) ++ bpp = 4; ++ for (i = 0; bpp <= FBM_BPP(vncfmt[i]); i++) ++ vnc_mode = vncfmt[i]; ++ bpp = FBM_BPP(vnc_mode); ++ pixfmt_cmd.format.bpp = ++ pixfmt_cmd.format.depth = bpp << 3; + ++ fill_rgb_conv(FBM_COLORS(vnc_mode), &format); ++ pixfmt_cmd.format.rmax = htons(format.rmax); ++ pixfmt_cmd.format.gmax = htons(format.gmax); ++ pixfmt_cmd.format.bmax = htons(format.bmax); ++ pixfmt_cmd.format.rshl = format.rshl; ++ pixfmt_cmd.format.gshl = format.gshl; ++ pixfmt_cmd.format.bshl = 0; + write(fd, &pixfmt_cmd, sizeof(pixfmt_cmd)); + return fd; + } + +-static int vnc_free(void) ++static void vnc_free(void) + { + fb_free(); +- return 0; + } + +-static int vnc_refresh(int fd, int inc) ++static void vnc_refresh(int fd, int inc) + { + struct vnc_client_fbup fbup_req; + fbup_req.type = VNC_CLIENT_FBUP; + fbup_req.inc = inc; +- fbup_req.x = htons(0); +- fbup_req.y = htons(0); +- fbup_req.w = htons(cols); +- fbup_req.h = htons(rows); ++ fbup_req.x = htons(oc); ++ fbup_req.y = htons(or); ++ fbup_req.w = htons(oc + cols); ++ fbup_req.h = htons(or + rows); + write(fd, &fbup_req, sizeof(fbup_req)); +- return 0; + } + +-static void drawfb(char *s, int x, int y, int w, int h) ++static void drawfb(char *s, int x, int y, int w) + { +- fbval_t slice[1 << 14]; +- int i, j; +- for (i = 0; i < h; i++) { +- for (j = 0; j < w; j++) { +- int c = *(unsigned char *) &s[i * w + j]; +- int r = (c & 0x3) << 6; +- int g = ((c >> 2) & 0x7) << 5; +- int b = ((c >> 5) & 0x7) << 5; +- slice[j] = FB_VAL(r, g, b); ++ int mode = fb_mode(); ++ if (mode != vnc_mode) { ++ fbval_t slice[MAXRES]; ++ unsigned char *byte = (unsigned char *) slice; ++ int j; ++ int fb_bpp = FBM_BPP(mode); ++ for (j = 0; j < w; j++, byte += fb_bpp, s += bpp) { ++ fbval_t c = * (fbval_t *) s; ++ int r = ((c >> format.rshl) & format.rmax) << format.rskp; ++ int g = ((c >> format.gshl) & format.gmax) << format.gskp; ++ int b = (c & format.bmax) << format.bskp; ++ * (fbval_t *) byte = FB_VAL(r, g, b); + } +- fb_set(y + i, x, slice, w); ++ s = (void *) slice; + } ++ fb_set(y, x, s, w); + } + + static void xread(int fd, void *buf, int len) +@@ -159,54 +175,84 @@ + while (nr < len && (n = read(fd, buf + nr, len - nr)) > 0) + nr += n; + if (nr < len) { +- printf("partial vnc read!\n"); +- exit(1); ++ fprintf(stderr,"partial vnc read!\n"); ++ exit(99); + } + } + ++static void skip(int fd, int len) ++{ ++ int n; ++ while (len > 0 && (n = read(fd, buf, MIN(len, sizeof(buf)))) > 0) ++ len -= n; ++} ++ + static int vnc_event(int fd) + { + struct vnc_rect uprect; +- char msg[1 << 12]; +- struct vnc_server_fbup *fbup = (void *) msg; +- struct vnc_server_cuttext *cuttext = (void *) msg; +- struct vnc_server_colormap *colormap = (void *) msg; +- int j; +- int n; ++ union { ++ struct vnc_server_fbup fbup; ++ struct vnc_server_cuttext cuttext; ++ struct vnc_server_colormap colormap; ++ } msg; ++ int j, n; + +- if (read(fd, msg, 1) != 1) ++ if (read(fd, &msg.fbup.type, 1) != 1) + return -1; +- switch (msg[0]) { ++ switch (msg.fbup.type) { + case VNC_SERVER_FBUP: +- xread(fd, msg + 1, sizeof(*fbup) - 1); +- n = ntohs(fbup->n); ++ xread(fd, &msg.fbup.pad, sizeof(msg.fbup) - 1); ++ n = ntohs(msg.fbup.n); + for (j = 0; j < n; j++) { +- int x, y, w, h; ++ int x, y, w, h, l, i; + xread(fd, &uprect, sizeof(uprect)); ++ if (uprect.enc != 0) { ++ fprintf(stderr,"Encoding not RAW: %d\n", ++ ntohl(uprect.enc)); ++ return -1; ++ } + x = ntohs(uprect.x); + y = ntohs(uprect.y); + w = ntohs(uprect.w); + h = ntohs(uprect.h); +- if (x >= cols || x + w > cols) +- return -1; +- if (y >= rows || y + h > rows) +- return -1; +- xread(fd, buf, w * h); +- drawfb(buf, x, y, w, h); ++ x -= oc; ++ y -= or; ++ i = 0; ++ l = MIN(w, cols - x); ++ if (x < 0) { ++ l = MIN(w + x, cols); ++ i = MIN(w, -x); ++ x = 0; ++ } ++ if (l < 0) ++ l = 0; ++ for (; h--; y++) { ++ int n = l; ++ int xj = x; ++ skip(fd, i * bpp); ++ while (n > 0) { ++ int j = MIN(n, MAXPIX); ++ xread(fd, buf, j * bpp); ++ if (y >= 0 && y < rows) ++ drawfb(buf, xj, y, j); ++ xj += j; n -= j; ++ } ++ skip(fd, (w - l - i) * bpp); ++ } + } + break; + case VNC_SERVER_BELL: + break; + case VNC_SERVER_CUTTEXT: +- xread(fd, msg + 1, sizeof(*cuttext) - 1); +- xread(fd, buf, ntohl(cuttext->len)); ++ xread(fd, &msg.cuttext.pad1, sizeof(msg.cuttext) - 1); ++ skip(fd, ntohl(msg.cuttext.len)); + break; + case VNC_SERVER_COLORMAP: +- xread(fd, msg + 1, sizeof(*colormap) - 1); +- xread(fd, buf, ntohs(colormap->n) * 3 * 2); ++ xread(fd, &msg.colormap.pad, sizeof(msg.colormap) - 1); ++ skip(fd, ntohs(msg.colormap.n) * 3 * 2); + break; + default: +- fprintf(stderr, "unknown vnc msg: %d\n", msg[0]); ++ fprintf(stderr, "unknown vnc msg: %d\n", msg.fbup.type); + return -1; + } + return 0; +@@ -217,12 +263,31 @@ + char ie[3]; + struct vnc_client_ratevent me = {VNC_CLIENT_RATEVENT}; + int mask = 0; ++ int refresh = 2; + if (read(ratfd, &ie, sizeof(ie)) != 3) + return -1; + mc += ie[1]; + mr -= ie[2]; +- mc = MAX(0, MIN(cols - 1, mc)); +- mr = MAX(0, MIN(rows - 1, mr)); ++ if (mc < oc) { ++ if ((oc -= cols / 5) < 0) ++ oc = 0; ++ } ++ else if (mc >= oc + cols && oc + cols < srv_cols) { ++ if ((oc += cols / 5) > srv_cols - cols) ++ oc = srv_cols - cols; ++ } ++ else refresh--; ++ if (mr < or) { ++ if ((or -= rows / 5) < 0) ++ or = 0; ++ } ++ else if (mr >= or + rows && or + rows < srv_rows) { ++ if ((or += rows / 5) > srv_rows - rows) ++ or = srv_rows - rows; ++ } ++ else refresh--; ++ mc = MAX(oc, MIN(oc + cols - 1, mc)); ++ mr = MAX(or, MIN(or + rows - 1, mr)); + if (ie[0] & 0x01) + mask |= VNC_BUTTON1_MASK; + if (ie[0] & 0x04) +@@ -233,6 +298,8 @@ + me.x = htons(mc); + me.mask = mask; + write(fd, &me, sizeof(me)); ++ if (refresh) ++ vnc_refresh(fd, 0); + return 0; + } + +@@ -292,12 +359,11 @@ + k = 0xff0d; + break; + case 0x0c: /* ^L: redraw */ +- if (vnc_refresh(fd, 0)) +- return -1; ++ vnc_refresh(fd, 0); + default: + k = (unsigned char) key[i]; + } +- if (k >= 'A' && k <= 'Z' || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) ++ if ((k >= 'A' && k <= 'Z') || strchr(":\"<>?{}|+_()*&^%$#@!~", k)) + mod[nmod++] = 0xffe1; + if (k >= 1 && k <= 26) { + k = 'a' + k - 1; +@@ -339,40 +405,42 @@ + write(STDIN_FILENO, show, strlen(show)); + } + +-static void mainloop(int vnc_fd, int kbd_fd, int rat_fd) ++static int mainloop(int vnc_fd, int kbd_fd, int rat_fd) + { + struct pollfd ufds[3]; + int pending = 0; + int err; + ufds[0].fd = kbd_fd; +- ufds[0].events = POLLIN; + ufds[1].fd = vnc_fd; +- ufds[1].events = POLLIN; + ufds[2].fd = rat_fd; ++ ufds[0].events = ++ ufds[1].events = + ufds[2].events = POLLIN; +- if (vnc_refresh(vnc_fd, 0)) +- return; ++ vnc_refresh(vnc_fd, 0); + while (1) { + err = poll(ufds, 3, 500); + if (err == -1 && errno != EINTR) + break; + if (!err) + continue; ++ err = -2; + if (ufds[0].revents & POLLIN) + if (kbd_event(vnc_fd, kbd_fd) == -1) + break; ++ err--; + if (ufds[1].revents & POLLIN) { + if (vnc_event(vnc_fd) == -1) + break; + pending = 0; + } ++ err--; + if (ufds[2].revents & POLLIN) + if (rat_event(vnc_fd, rat_fd) == -1) + break; + if (!pending++) +- if (vnc_refresh(vnc_fd, 1)) +- break; ++ vnc_refresh(vnc_fd, 1); + } ++ return err; + } + + int main(int argc, char * argv[]) +@@ -380,27 +448,38 @@ + char *port = VNC_PORT; + char *host = "127.0.0.1"; + struct termios ti; +- int vnc_fd, rat_fd; ++ int vnc_fd, rat_fd, status; ++ ++ if (argc < 2) { ++ fprintf(stderr, "Usage : fbvnc [-bpp bits] server [port]\n"); ++ return 0; ++ } ++ if (*argv[1] == '-' && argc >= 3) { ++ argc -= 2; argv += 2; ++ bpp = atoi(argv[0]) >> 3; ++ } + if (argc >= 2) + host = argv[1]; + if (argc >= 3) + port = argv[2]; +- if ((vnc_fd = vnc_connect(host, port)) == -1) { +- fprintf(stderr, "could not connect!\n"); ++ if ((vnc_fd = vnc_connect(host, port)) < 0) { ++ fprintf(stderr, "could not connect! %s %s : %d\n", ++ host,port,vnc_fd); + return 1; + } +- if (vnc_init(vnc_fd) == -1) { +- fprintf(stderr, "vnc init failed!\n"); +- return 1; ++ status = vnc_init(vnc_fd); ++ if (status < 0) { ++ fprintf(stderr, "vnc init failed! %d\n", status); ++ return 2; + } + term_setup(&ti); + rat_fd = open("/dev/input/mice", O_RDONLY); + +- mainloop(vnc_fd, 0, rat_fd); ++ status = mainloop(vnc_fd, 0, rat_fd); + + term_cleanup(&ti); + vnc_free(); + close(vnc_fd); + close(rat_fd); +- return 0; ++ return 2 - status; + } diff -r c7b121a4ffd9 -r d6378d455338 fbvnc/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fbvnc/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +#-p0|fbvnc.u diff -r c7b121a4ffd9 -r d6378d455338 foobillard/receipt --- a/foobillard/receipt Wed May 09 17:03:28 2018 +0300 +++ b/foobillard/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,11 +18,6 @@ compile_rules() { sed -i -e 's/-lXaw//' -e 's/-lXi//' src/Makefile.in - patch -p1 < $stuff/03_bugfixes - patch -p1 < $stuff/05_foul_explanation - patch -p1 < $stuff/06_show_ball_to_hit - patch -p0 < $stuff/snooker_reset.patch - patch -p0 < $stuff/snooker_draw.patch ./configure \ --prefix=/usr \ diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/03_bugfixes --- a/foobillard/stuff/03_bugfixes Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -Index: foobillard-3.0a/src/ball.c -=================================================================== ---- foobillard-3.0a.orig/src/ball.c 2006-10-12 16:42:39.000000000 +0200 -+++ foobillard-3.0a/src/ball.c 2006-10-12 16:42:48.000000000 +0200 -@@ -1821,6 +1821,7 @@ - } else if( options_cuberef && cuberef_binds!=0 ){ - glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cuberef_binds[i]); - #ifdef GL_VERTEX_PROGRAM_NV -+#ifdef USE_BALL_FRESNEL - { - myvec cam_pos2; - // cam_pos2=vec_scale(vec_unit(vec_diff(cam_pos,balls.ball[i].r)),BALL_D/2.5); -@@ -1829,6 +1830,7 @@ - BALL_D/2.0,BALL_D/2.5,0,0 ); - } - #endif -+#endif - draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); - }else{ - draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); -Index: foobillard-3.0a/src/evaluate_move.c -=================================================================== ---- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:42:43.000000000 +0200 -+++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:42:48.000000000 +0200 -@@ -385,6 +385,11 @@ - int ball_out; - int other_player=(act_player==1)?0:1; - int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; -+ if(st.to_play==SN_DONE) -+ { -+ BM_reset_move_info(); -+ return; -+ } - - if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; - printf("EVAL start\n"); diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/05_foul_explanation --- a/foobillard/stuff/05_foul_explanation Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -Index: foobillard-3.0a/src/billard3d.c -=================================================================== ---- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:44:17.000000000 +0200 -+++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:44:31.000000000 +0200 -@@ -331,6 +331,8 @@ - static textObj * winner_name_text_obj; - static textObj * winner_text_obj; - -+textObj * last_fault_text; -+ - #ifndef _WIN32 - - enum optionType -@@ -3322,6 +3324,13 @@ - if( player[act_player].text != 0 ){ - textObj_draw( player[act_player].text ); - } -+ /* last fault */ -+ if (strcmp("x", last_fault_text->str)!=0) { -+ glTranslatef(0.0, 70.0, 0.0); -+ textObj_draw(last_fault_text); -+ glTranslatef(0.0,-70.0,0.0); -+ } -+ - glTranslatef(0,30,0); - if (gametype==GAME_8BALL){ - switch(player[act_player].half_full){ -@@ -5197,6 +5206,9 @@ - } - DPRINTF("created winner text obj's\n"); - -+ -+ last_fault_text = textObj_new( "x", options_help_fontname, 20 ); -+ - init_menu(); - - sys_set_timer(frametime_ms, Idle_timer); /* assure a framerate of max 50 fps (1frame/20ms) */ -Index: foobillard-3.0a/src/evaluate_move.c -=================================================================== ---- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:44:22.000000000 +0200 -+++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:44:31.000000000 +0200 -@@ -4,6 +4,9 @@ - ** Copyright (C) 2001 Florian Berger - ** Email: harpin_floh@yahoo.de, florian.berger@jk.uni-linz.ac.at - ** -+** Small changes to output a reason why the last shot was a fault by -+** Thorsten Gunkel -+** - ** This program is free software; you can redistribute it and/or modify - ** it under the terms of the GNU General Public License Version 2 as - ** published by the Free Software Foundation; -@@ -108,11 +111,12 @@ - - /* wenn fremde kugel zuerst angespielt -> foul */ - first_ball_hit=BM_get_1st_ball_hit(); -- if( player[act_player].half_full == BALL_FULL ){ -- if ( first_ball_hit>8 && first_ball_hit<16 ) foul=1; -- } -- if( player[act_player].half_full == BALL_HALF ){ -- if ( first_ball_hit>0 && first_ball_hit<8 ) foul=1; -+ if( -+ ( player[act_player].half_full == BALL_FULL && first_ball_hit>8 && first_ball_hit<16 ) || -+ ( player[act_player].half_full == BALL_HALF && first_ball_hit>0 && first_ball_hit<8 ) -+ ){ -+ foul=1; -+ textObj_setText(last_fault_text, "First ball hit was not one of yours"); - } - - /* erst an 2. stelle, da oben kein foul bei break */ -@@ -146,7 +150,10 @@ - } - } - } -- if(eigene_da) foul=1; -+ if(eigene_da){ -+ foul=1; -+ textObj_setText(last_fault_text, "You hit the 8-Ball too soon"); -+ } - } - - /* wenn angespielte kugel im strafraum */ -@@ -154,6 +161,7 @@ - in_strafraum(BM_get_1st_ball_hit_pos()) && - !BM_get_non_strafraum_wall_hit_before_1st_ball(in_strafraum) ){ - foul=1; -+ textObj_setText(last_fault_text, "You hit a ball not behind the head string"); - } - - /* wenn eigene rein naechster */ -@@ -169,7 +177,10 @@ - } - - -- if( BM_get_balls_hit()==0 ) foul=1; -+ if( BM_get_balls_hit()==0 ){ -+ foul=1; -+ textObj_setText(last_fault_text, "No Ball hit"); -+ } - - /* wenn weisse rein */ - if( BM_get_white_out() ){ -@@ -177,6 +188,7 @@ - foul=1; - balls.ball[0].in_game=1; - balls.ball[0].in_hole=0; -+ textObj_setText(last_fault_text, "White ball potted"); - } - - /* wenn foul */ -@@ -188,6 +200,8 @@ - balls.ball[0].w=vec_xyz(0.0,0.0,0.0); - balls.ball[0].r=vec_xyz(0.0,-TABLE_L/4.0,0.0); - // balls.ball[0].r=vec_xyz(x,y,0.0); -+ } else { -+ textObj_setText(last_fault_text, "x"); - } - - /* if 8 out */ -@@ -221,6 +235,7 @@ - else - { - player[(act_player==1)?0:1].winner=1; -+ textObj_setText(last_fault_text, "8 ball potted too soon"); - } - - } -@@ -277,9 +292,15 @@ - nextplayer=0; - } - -- if( BM_get_balls_hit()==0 ) foul=1; -- -- if( BM_get_1st_ball_hit()!=minball ) foul=1; -+ if( BM_get_balls_hit()==0 ){ -+ textObj_setText(last_fault_text, "No Ball hit"); -+ foul=1; -+ } else { -+ if( BM_get_1st_ball_hit()!=minball ){ -+ textObj_setText(last_fault_text, "First ball hit was not the lowest"); -+ foul=1; -+ } -+ } - - /* wenn weisse rein */ - if( BM_get_white_out() ){ -@@ -287,6 +308,7 @@ - nextplayer=1; - pballs->ball[0].in_game=1; - pballs->ball[0].in_hole=0; -+ textObj_setText(last_fault_text, "White ball is potted"); - } - - /* wenn foul - weisse platzieren */ -@@ -297,6 +319,8 @@ - pballs->ball[0].v=vec_xyz(0.0,0.0,0.0); - pballs->ball[0].w=vec_xyz(0.0,0.0,0.0); - pballs->ball[0].r=vec_xyz(0,-TABLE_L/4.0,0.0); -+ } else { -+ textObj_setText(last_fault_text, "x"); - } - - fprintf(stderr,"foul:%d, nextplayer:%d, BM_get_ball_out(9):%d\n",foul,nextplayer,BM_get_ball_out(9)); -@@ -409,6 +433,7 @@ - act_penalty =MAX(act_penalty,(BM_get_1st_ball_hit()<=7?BM_get_1st_ball_hit():4)); - spot_snooker_ball(pballs,0); - player[other_player].place_cue_ball=1; -+ textObj_setText(last_fault_text, "White ball is potted"); - } - - switch(st.to_play) -@@ -420,6 +445,11 @@ - foul=1; - act_penalty=MAX(act_penalty,b1hit); - printf("EVAL foul 1\n"); -+ if( BM_get_balls_hit()==0 ){ -+ textObj_setText(last_fault_text, "No Ball hit"); -+ } else { -+ textObj_setText(last_fault_text, "First ball hit was not a red one"); -+ } - } - i=1; - while((ball_out=BM_get_nth_ball_out(i++))>=0) -@@ -434,6 +464,11 @@ - act_penalty=MAX(act_penalty,ball_out); - foul=1; - printf("EVAL foul 2\n"); -+ if (BM_get_white_out()){ -+ textObj_setText(last_fault_text, "White ball potted"); -+ } else { -+ textObj_setText(last_fault_text, "Potted ball was not a red one"); -+ } - } - } - for(i=2;i<8;i++) -@@ -449,6 +484,11 @@ - foul=1; - printf("EVAL foul 3\n"); - act_penalty=MAX(act_penalty,7); -+ if( BM_get_balls_hit()==0 ){ -+ textObj_setText(last_fault_text, "No Ball hit"); -+ } else { -+ textObj_setText(last_fault_text, "First ball hit was not a colored one"); -+ } - } - color_to_pot=b1hit; - i=1; -@@ -464,6 +504,11 @@ - foul=1; - printf("EVAL foul 4\n"); - act_penalty=MAX(act_penalty,ball_out==1?7:ball_out); -+ if (BM_get_white_out()){ -+ textObj_setText(last_fault_text, "White ball potted"); -+ } else { -+ textObj_setText(last_fault_text, "Potted ball was not a colored one"); -+ } - } - } - if(red_balls_are_in_game) -@@ -490,6 +535,11 @@ - printf("EVAL foul 5\n"); - act_penalty=MAX(act_penalty,b1hit); - act_penalty=MAX(act_penalty,color_to_pot); -+ if( BM_get_balls_hit()==0 ){ -+ textObj_setText(last_fault_text, "No Ball hit"); -+ } else { -+ textObj_setText(last_fault_text, "First ball hit was not the correct one"); -+ } - } - i=1; - while((ball_out=BM_get_nth_ball_out(i++))>=0) -@@ -505,6 +555,11 @@ - printf("EVAL foul 6\n"); - act_penalty=MAX(act_penalty,b1hit); - act_penalty=MAX(act_penalty,color_to_pot); -+ if (BM_get_white_out()){ -+ textObj_setText(last_fault_text, "White ball potted"); -+ } else { -+ textObj_setText(last_fault_text, "Potted ball was not the correct one"); -+ } - } - } - if(!foul && act_score>0) st.to_play++; -@@ -528,6 +583,7 @@ - { - player[act_player].score += act_score ; - printf("EVAL no foul\n"); -+ textObj_setText(last_fault_text, "x"); - } - if(act_score==0 || foul) - { -Index: foobillard-3.0a/src/evaluate_move.h -=================================================================== ---- foobillard-3.0a.orig/src/evaluate_move.h 2006-10-12 16:44:24.000000000 +0200 -+++ foobillard-3.0a/src/evaluate_move.h 2006-10-12 16:44:31.000000000 +0200 -@@ -31,6 +31,7 @@ - BallsType * pballs, int * pqueue_view, float * pXque ); - #endif - -+extern textObj * last_fault_text; - - void evaluate_last_move_8ball ( struct Player * player, int * actual_player, - BallsType * pballs, int * pqueue_view, float * pXque ); diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/06_show_ball_to_hit --- a/foobillard/stuff/06_show_ball_to_hit Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +0,0 @@ -Index: foobillard-3.0a/src/billard.c -=================================================================== ---- foobillard-3.0a.orig/src/billard.c 2006-10-12 16:45:04.000000000 +0200 -+++ foobillard-3.0a/src/billard.c 2006-10-12 16:45:23.000000000 +0200 -@@ -31,6 +31,8 @@ - void * (*billard_malloc)( size_t size ) = malloc; - void (*billard_free)( void * ptr ) = free; - -+SnookerState snooker_state={SN_PLAY_RED}; -+ - void setfunc_create_scene( void (*func)( BallsType * balls ) ) - { - create_scene=func; -Index: foobillard-3.0a/src/billard.h -=================================================================== ---- foobillard-3.0a.orig/src/billard.h 2006-10-12 16:45:05.000000000 +0200 -+++ foobillard-3.0a/src/billard.h 2006-10-12 16:45:23.000000000 +0200 -@@ -76,9 +76,30 @@ - #define BALL_HALF 2 - #define BALL_ANY 0 - -+typedef enum -+{ -+ SN_PLAY_RED, -+ SN_PLAY_ANY_COLOR, -+ SN_PLAY_YELLOW, -+ SN_PLAY_GREEN, -+ SN_PLAY_BROWN, -+ SN_PLAY_BLUE, -+ SN_PLAY_PINK, -+ SN_PLAY_BLACK, -+ SN_DONE -+} -+SnookerBallToPlay; -+ -+typedef struct -+{ -+ SnookerBallToPlay to_play; -+} -+SnookerState; -+ - #ifndef BILLARD_C - extern void (*create_scene)( BallsType * balls ); - extern void (*create_walls)( BordersType * walls ); -+extern SnookerState snooker_state; - #endif - - void create_0hole_walls( BordersType * walls ); /* carambol */ -Index: foobillard-3.0a/src/billard3d.c -=================================================================== ---- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:45:08.000000000 +0200 -+++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:45:23.000000000 +0200 -@@ -829,6 +829,7 @@ - player[act_player].place_cue_ball=1; - human_player_roster.player[0].cue_ball=0; human_player_roster.player[1].cue_ball=0; - human_player_roster.player[act_player].place_cue_ball=1; -+ snooker_state.to_play=SN_PLAY_RED; - } - } - -@@ -1787,6 +1788,7 @@ - /* score text */ - for(i=0;i<2;i++){ - char str[256]; -+ char *color; - switch(gametype){ - case GAME_8BALL: strcpy(str,"0"); break; - case GAME_9BALL: -@@ -1805,7 +1807,44 @@ - sprintf( str, "%d", player[i].score ); - break; - case GAME_SNOOKER: -- sprintf( str, "%c%03d %s", (player[i].score<0)?'-':'+', abs(player[i].score), player[i].snooker_on_red ? "red":"col" ); -+ switch(snooker_state.to_play) -+ { -+ case SN_PLAY_RED: -+ color="red"; -+ break; -+ case SN_PLAY_ANY_COLOR: -+ color="color"; -+ break; -+ case SN_PLAY_YELLOW: -+ color="yellow"; -+ break; -+ case SN_PLAY_GREEN: -+ color="green"; -+ break; -+ case SN_PLAY_BROWN: -+ color="brown"; -+ break; -+ case SN_PLAY_BLUE: -+ color="blue"; -+ break; -+ case SN_PLAY_PINK: -+ color="pink"; -+ break; -+ case SN_PLAY_BLACK: -+ color="black"; -+ break; -+ case SN_DONE: -+ color=""; -+ break; -+ } -+ if(i==act_player) -+ { -+ sprintf( str, "%.3d %s", player[i].score, color); -+ } -+ else -+ { -+ sprintf( str, "%.3d", player[i].score); -+ } - break; - } - textObj_setText( player[i].score_text, str ); -Index: foobillard-3.0a/src/evaluate_move.c -=================================================================== ---- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:45:12.000000000 +0200 -+++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:45:23.000000000 +0200 -@@ -30,26 +30,6 @@ - - #define MAX(x,y) ((x)>(y)?(x):(y)); - --typedef enum --{ -- SN_PLAY_RED, -- SN_PLAY_ANY_COLOR, -- SN_PLAY_YELLOW, -- SN_PLAY_GREEN, -- SN_PLAY_BROWN, -- SN_PLAY_BLUE, -- SN_PLAY_PINK, -- SN_PLAY_BLACK, -- SN_DONE --} --SnookerBallToPlay; -- --typedef struct --{ -- SnookerBallToPlay to_play; --} --SnookerState; -- - - void spot_snooker_ball(BallsType *balls,int nr); - -@@ -400,7 +380,6 @@ - #define act_player (*pact_player) - #define IS_RED(x) ( x==1 || x>=8 ) - int red_balls_are_in_game=0; -- static SnookerState st={SN_PLAY_RED}; - int color_to_pot; - int i; - int act_score=0; -@@ -409,7 +388,7 @@ - int ball_out; - int other_player=(act_player==1)?0:1; - int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; -- if(st.to_play==SN_DONE) -+ if(snooker_state.to_play==SN_DONE) - { - BM_reset_move_info(); - return; -@@ -417,7 +396,7 @@ - - if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; - printf("EVAL start\n"); -- printf("EVAL to_play=%d\n",st.to_play); -+ printf("EVAL to_play=%d\n",snooker_state.to_play); - printf("EVAL b1hit=%d\n",b1hit); - for(i=0;inr;i++){ - if( IS_RED(pballs->ball[i].nr) && pballs->ball[i].in_game ){ -@@ -436,7 +415,7 @@ - textObj_setText(last_fault_text, "White ball is potted"); - } - -- switch(st.to_play) -+ switch(snooker_state.to_play) - { - case SN_PLAY_RED: - color_to_pot=1; -@@ -476,7 +455,7 @@ - if( BM_get_ball_out(i)) - spot_snooker_ball(pballs,i); - } -- st.to_play=SN_PLAY_ANY_COLOR; -+ snooker_state.to_play=SN_PLAY_ANY_COLOR; - break; - case SN_PLAY_ANY_COLOR: - if(b1hit==1) -@@ -512,9 +491,9 @@ - } - } - if(red_balls_are_in_game) -- st.to_play=SN_PLAY_RED; -+ snooker_state.to_play=SN_PLAY_RED; - else -- st.to_play=SN_PLAY_YELLOW; -+ snooker_state.to_play=SN_PLAY_YELLOW; - - for(i=2;i<8;i++) - { -@@ -528,7 +507,7 @@ - case SN_PLAY_BLUE: - case SN_PLAY_PINK: - case SN_PLAY_BLACK: -- color_to_pot=st.to_play; -+ color_to_pot=snooker_state.to_play; - if(b1hit!=color_to_pot) - { - foul=1; -@@ -562,9 +541,9 @@ - } - } - } -- if(!foul && act_score>0) st.to_play++; -+ if(!foul && act_score>0) snooker_state.to_play++; - -- for(i=st.to_play;i<8;i++) -+ for(i=snooker_state.to_play;i<8;i++) - { - if( BM_get_ball_out(i)) - spot_snooker_ball(pballs,i); -@@ -590,13 +569,13 @@ - printf("EVAL next player\n"); - if(red_balls_are_in_game) - { -- st.to_play=SN_PLAY_RED; -+ snooker_state.to_play=SN_PLAY_RED; - } - else - { -- if(st.to_play<=SN_PLAY_ANY_COLOR) -+ if(snooker_state.to_play<=SN_PLAY_ANY_COLOR) - { -- st.to_play=SN_PLAY_YELLOW; -+ snooker_state.to_play=SN_PLAY_YELLOW; - } - } - player[act_player].queue_view=*pqueue_view; -@@ -605,11 +584,11 @@ - *pqueue_view=player[act_player].queue_view; - } - -- player[act_player].snooker_on_red=st.to_play==SN_PLAY_RED; -- player[act_player].snooker_next_color=st.to_play; -- printf("EVAL to_play=%d\n",st.to_play); -+ player[act_player].snooker_on_red=snooker_state.to_play==SN_PLAY_RED; -+ player[act_player].snooker_next_color=snooker_state.to_play; -+ printf("EVAL to_play=%d\n",snooker_state.to_play); - -- if(st.to_play==SN_DONE) -+ if(snooker_state.to_play==SN_DONE) - { - int other_player; - diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/03_bugfixes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/03_bugfixes Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,36 @@ +Index: foobillard-3.0a/src/ball.c +=================================================================== +--- foobillard-3.0a.orig/src/ball.c 2006-10-12 16:42:39.000000000 +0200 ++++ foobillard-3.0a/src/ball.c 2006-10-12 16:42:48.000000000 +0200 +@@ -1821,6 +1821,7 @@ + } else if( options_cuberef && cuberef_binds!=0 ){ + glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cuberef_binds[i]); + #ifdef GL_VERTEX_PROGRAM_NV ++#ifdef USE_BALL_FRESNEL + { + myvec cam_pos2; + // cam_pos2=vec_scale(vec_unit(vec_diff(cam_pos,balls.ball[i].r)),BALL_D/2.5); +@@ -1829,6 +1830,7 @@ + BALL_D/2.0,BALL_D/2.5,0,0 ); + } + #endif ++#endif + draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); + }else{ + draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:42:43.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:42:48.000000000 +0200 +@@ -385,6 +385,11 @@ + int ball_out; + int other_player=(act_player==1)?0:1; + int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; ++ if(st.to_play==SN_DONE) ++ { ++ BM_reset_move_info(); ++ return; ++ } + + if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; + printf("EVAL start\n"); diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/05_foul_explanation --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/05_foul_explanation Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,262 @@ +Index: foobillard-3.0a/src/billard3d.c +=================================================================== +--- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:44:17.000000000 +0200 ++++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:44:31.000000000 +0200 +@@ -331,6 +331,8 @@ + static textObj * winner_name_text_obj; + static textObj * winner_text_obj; + ++textObj * last_fault_text; ++ + #ifndef _WIN32 + + enum optionType +@@ -3322,6 +3324,13 @@ + if( player[act_player].text != 0 ){ + textObj_draw( player[act_player].text ); + } ++ /* last fault */ ++ if (strcmp("x", last_fault_text->str)!=0) { ++ glTranslatef(0.0, 70.0, 0.0); ++ textObj_draw(last_fault_text); ++ glTranslatef(0.0,-70.0,0.0); ++ } ++ + glTranslatef(0,30,0); + if (gametype==GAME_8BALL){ + switch(player[act_player].half_full){ +@@ -5197,6 +5206,9 @@ + } + DPRINTF("created winner text obj's\n"); + ++ ++ last_fault_text = textObj_new( "x", options_help_fontname, 20 ); ++ + init_menu(); + + sys_set_timer(frametime_ms, Idle_timer); /* assure a framerate of max 50 fps (1frame/20ms) */ +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:44:22.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:44:31.000000000 +0200 +@@ -4,6 +4,9 @@ + ** Copyright (C) 2001 Florian Berger + ** Email: harpin_floh@yahoo.de, florian.berger@jk.uni-linz.ac.at + ** ++** Small changes to output a reason why the last shot was a fault by ++** Thorsten Gunkel ++** + ** This program is free software; you can redistribute it and/or modify + ** it under the terms of the GNU General Public License Version 2 as + ** published by the Free Software Foundation; +@@ -108,11 +111,12 @@ + + /* wenn fremde kugel zuerst angespielt -> foul */ + first_ball_hit=BM_get_1st_ball_hit(); +- if( player[act_player].half_full == BALL_FULL ){ +- if ( first_ball_hit>8 && first_ball_hit<16 ) foul=1; +- } +- if( player[act_player].half_full == BALL_HALF ){ +- if ( first_ball_hit>0 && first_ball_hit<8 ) foul=1; ++ if( ++ ( player[act_player].half_full == BALL_FULL && first_ball_hit>8 && first_ball_hit<16 ) || ++ ( player[act_player].half_full == BALL_HALF && first_ball_hit>0 && first_ball_hit<8 ) ++ ){ ++ foul=1; ++ textObj_setText(last_fault_text, "First ball hit was not one of yours"); + } + + /* erst an 2. stelle, da oben kein foul bei break */ +@@ -146,7 +150,10 @@ + } + } + } +- if(eigene_da) foul=1; ++ if(eigene_da){ ++ foul=1; ++ textObj_setText(last_fault_text, "You hit the 8-Ball too soon"); ++ } + } + + /* wenn angespielte kugel im strafraum */ +@@ -154,6 +161,7 @@ + in_strafraum(BM_get_1st_ball_hit_pos()) && + !BM_get_non_strafraum_wall_hit_before_1st_ball(in_strafraum) ){ + foul=1; ++ textObj_setText(last_fault_text, "You hit a ball not behind the head string"); + } + + /* wenn eigene rein naechster */ +@@ -169,7 +177,10 @@ + } + + +- if( BM_get_balls_hit()==0 ) foul=1; ++ if( BM_get_balls_hit()==0 ){ ++ foul=1; ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } + + /* wenn weisse rein */ + if( BM_get_white_out() ){ +@@ -177,6 +188,7 @@ + foul=1; + balls.ball[0].in_game=1; + balls.ball[0].in_hole=0; ++ textObj_setText(last_fault_text, "White ball potted"); + } + + /* wenn foul */ +@@ -188,6 +200,8 @@ + balls.ball[0].w=vec_xyz(0.0,0.0,0.0); + balls.ball[0].r=vec_xyz(0.0,-TABLE_L/4.0,0.0); + // balls.ball[0].r=vec_xyz(x,y,0.0); ++ } else { ++ textObj_setText(last_fault_text, "x"); + } + + /* if 8 out */ +@@ -221,6 +235,7 @@ + else + { + player[(act_player==1)?0:1].winner=1; ++ textObj_setText(last_fault_text, "8 ball potted too soon"); + } + + } +@@ -277,9 +292,15 @@ + nextplayer=0; + } + +- if( BM_get_balls_hit()==0 ) foul=1; +- +- if( BM_get_1st_ball_hit()!=minball ) foul=1; ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ foul=1; ++ } else { ++ if( BM_get_1st_ball_hit()!=minball ){ ++ textObj_setText(last_fault_text, "First ball hit was not the lowest"); ++ foul=1; ++ } ++ } + + /* wenn weisse rein */ + if( BM_get_white_out() ){ +@@ -287,6 +308,7 @@ + nextplayer=1; + pballs->ball[0].in_game=1; + pballs->ball[0].in_hole=0; ++ textObj_setText(last_fault_text, "White ball is potted"); + } + + /* wenn foul - weisse platzieren */ +@@ -297,6 +319,8 @@ + pballs->ball[0].v=vec_xyz(0.0,0.0,0.0); + pballs->ball[0].w=vec_xyz(0.0,0.0,0.0); + pballs->ball[0].r=vec_xyz(0,-TABLE_L/4.0,0.0); ++ } else { ++ textObj_setText(last_fault_text, "x"); + } + + fprintf(stderr,"foul:%d, nextplayer:%d, BM_get_ball_out(9):%d\n",foul,nextplayer,BM_get_ball_out(9)); +@@ -409,6 +433,7 @@ + act_penalty =MAX(act_penalty,(BM_get_1st_ball_hit()<=7?BM_get_1st_ball_hit():4)); + spot_snooker_ball(pballs,0); + player[other_player].place_cue_ball=1; ++ textObj_setText(last_fault_text, "White ball is potted"); + } + + switch(st.to_play) +@@ -420,6 +445,11 @@ + foul=1; + act_penalty=MAX(act_penalty,b1hit); + printf("EVAL foul 1\n"); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not a red one"); ++ } + } + i=1; + while((ball_out=BM_get_nth_ball_out(i++))>=0) +@@ -434,6 +464,11 @@ + act_penalty=MAX(act_penalty,ball_out); + foul=1; + printf("EVAL foul 2\n"); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not a red one"); ++ } + } + } + for(i=2;i<8;i++) +@@ -449,6 +484,11 @@ + foul=1; + printf("EVAL foul 3\n"); + act_penalty=MAX(act_penalty,7); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not a colored one"); ++ } + } + color_to_pot=b1hit; + i=1; +@@ -464,6 +504,11 @@ + foul=1; + printf("EVAL foul 4\n"); + act_penalty=MAX(act_penalty,ball_out==1?7:ball_out); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not a colored one"); ++ } + } + } + if(red_balls_are_in_game) +@@ -490,6 +535,11 @@ + printf("EVAL foul 5\n"); + act_penalty=MAX(act_penalty,b1hit); + act_penalty=MAX(act_penalty,color_to_pot); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not the correct one"); ++ } + } + i=1; + while((ball_out=BM_get_nth_ball_out(i++))>=0) +@@ -505,6 +555,11 @@ + printf("EVAL foul 6\n"); + act_penalty=MAX(act_penalty,b1hit); + act_penalty=MAX(act_penalty,color_to_pot); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not the correct one"); ++ } + } + } + if(!foul && act_score>0) st.to_play++; +@@ -528,6 +583,7 @@ + { + player[act_player].score += act_score ; + printf("EVAL no foul\n"); ++ textObj_setText(last_fault_text, "x"); + } + if(act_score==0 || foul) + { +Index: foobillard-3.0a/src/evaluate_move.h +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.h 2006-10-12 16:44:24.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.h 2006-10-12 16:44:31.000000000 +0200 +@@ -31,6 +31,7 @@ + BallsType * pballs, int * pqueue_view, float * pXque ); + #endif + ++extern textObj * last_fault_text; + + void evaluate_last_move_8ball ( struct Player * player, int * actual_player, + BallsType * pballs, int * pqueue_view, float * pXque ); diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/06_show_ball_to_hit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/06_show_ball_to_hit Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,255 @@ +Index: foobillard-3.0a/src/billard.c +=================================================================== +--- foobillard-3.0a.orig/src/billard.c 2006-10-12 16:45:04.000000000 +0200 ++++ foobillard-3.0a/src/billard.c 2006-10-12 16:45:23.000000000 +0200 +@@ -31,6 +31,8 @@ + void * (*billard_malloc)( size_t size ) = malloc; + void (*billard_free)( void * ptr ) = free; + ++SnookerState snooker_state={SN_PLAY_RED}; ++ + void setfunc_create_scene( void (*func)( BallsType * balls ) ) + { + create_scene=func; +Index: foobillard-3.0a/src/billard.h +=================================================================== +--- foobillard-3.0a.orig/src/billard.h 2006-10-12 16:45:05.000000000 +0200 ++++ foobillard-3.0a/src/billard.h 2006-10-12 16:45:23.000000000 +0200 +@@ -76,9 +76,30 @@ + #define BALL_HALF 2 + #define BALL_ANY 0 + ++typedef enum ++{ ++ SN_PLAY_RED, ++ SN_PLAY_ANY_COLOR, ++ SN_PLAY_YELLOW, ++ SN_PLAY_GREEN, ++ SN_PLAY_BROWN, ++ SN_PLAY_BLUE, ++ SN_PLAY_PINK, ++ SN_PLAY_BLACK, ++ SN_DONE ++} ++SnookerBallToPlay; ++ ++typedef struct ++{ ++ SnookerBallToPlay to_play; ++} ++SnookerState; ++ + #ifndef BILLARD_C + extern void (*create_scene)( BallsType * balls ); + extern void (*create_walls)( BordersType * walls ); ++extern SnookerState snooker_state; + #endif + + void create_0hole_walls( BordersType * walls ); /* carambol */ +Index: foobillard-3.0a/src/billard3d.c +=================================================================== +--- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:45:08.000000000 +0200 ++++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:45:23.000000000 +0200 +@@ -829,6 +829,7 @@ + player[act_player].place_cue_ball=1; + human_player_roster.player[0].cue_ball=0; human_player_roster.player[1].cue_ball=0; + human_player_roster.player[act_player].place_cue_ball=1; ++ snooker_state.to_play=SN_PLAY_RED; + } + } + +@@ -1787,6 +1788,7 @@ + /* score text */ + for(i=0;i<2;i++){ + char str[256]; ++ char *color; + switch(gametype){ + case GAME_8BALL: strcpy(str,"0"); break; + case GAME_9BALL: +@@ -1805,7 +1807,44 @@ + sprintf( str, "%d", player[i].score ); + break; + case GAME_SNOOKER: +- sprintf( str, "%c%03d %s", (player[i].score<0)?'-':'+', abs(player[i].score), player[i].snooker_on_red ? "red":"col" ); ++ switch(snooker_state.to_play) ++ { ++ case SN_PLAY_RED: ++ color="red"; ++ break; ++ case SN_PLAY_ANY_COLOR: ++ color="color"; ++ break; ++ case SN_PLAY_YELLOW: ++ color="yellow"; ++ break; ++ case SN_PLAY_GREEN: ++ color="green"; ++ break; ++ case SN_PLAY_BROWN: ++ color="brown"; ++ break; ++ case SN_PLAY_BLUE: ++ color="blue"; ++ break; ++ case SN_PLAY_PINK: ++ color="pink"; ++ break; ++ case SN_PLAY_BLACK: ++ color="black"; ++ break; ++ case SN_DONE: ++ color=""; ++ break; ++ } ++ if(i==act_player) ++ { ++ sprintf( str, "%.3d %s", player[i].score, color); ++ } ++ else ++ { ++ sprintf( str, "%.3d", player[i].score); ++ } + break; + } + textObj_setText( player[i].score_text, str ); +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:45:12.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:45:23.000000000 +0200 +@@ -30,26 +30,6 @@ + + #define MAX(x,y) ((x)>(y)?(x):(y)); + +-typedef enum +-{ +- SN_PLAY_RED, +- SN_PLAY_ANY_COLOR, +- SN_PLAY_YELLOW, +- SN_PLAY_GREEN, +- SN_PLAY_BROWN, +- SN_PLAY_BLUE, +- SN_PLAY_PINK, +- SN_PLAY_BLACK, +- SN_DONE +-} +-SnookerBallToPlay; +- +-typedef struct +-{ +- SnookerBallToPlay to_play; +-} +-SnookerState; +- + + void spot_snooker_ball(BallsType *balls,int nr); + +@@ -400,7 +380,6 @@ + #define act_player (*pact_player) + #define IS_RED(x) ( x==1 || x>=8 ) + int red_balls_are_in_game=0; +- static SnookerState st={SN_PLAY_RED}; + int color_to_pot; + int i; + int act_score=0; +@@ -409,7 +388,7 @@ + int ball_out; + int other_player=(act_player==1)?0:1; + int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; +- if(st.to_play==SN_DONE) ++ if(snooker_state.to_play==SN_DONE) + { + BM_reset_move_info(); + return; +@@ -417,7 +396,7 @@ + + if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; + printf("EVAL start\n"); +- printf("EVAL to_play=%d\n",st.to_play); ++ printf("EVAL to_play=%d\n",snooker_state.to_play); + printf("EVAL b1hit=%d\n",b1hit); + for(i=0;inr;i++){ + if( IS_RED(pballs->ball[i].nr) && pballs->ball[i].in_game ){ +@@ -436,7 +415,7 @@ + textObj_setText(last_fault_text, "White ball is potted"); + } + +- switch(st.to_play) ++ switch(snooker_state.to_play) + { + case SN_PLAY_RED: + color_to_pot=1; +@@ -476,7 +455,7 @@ + if( BM_get_ball_out(i)) + spot_snooker_ball(pballs,i); + } +- st.to_play=SN_PLAY_ANY_COLOR; ++ snooker_state.to_play=SN_PLAY_ANY_COLOR; + break; + case SN_PLAY_ANY_COLOR: + if(b1hit==1) +@@ -512,9 +491,9 @@ + } + } + if(red_balls_are_in_game) +- st.to_play=SN_PLAY_RED; ++ snooker_state.to_play=SN_PLAY_RED; + else +- st.to_play=SN_PLAY_YELLOW; ++ snooker_state.to_play=SN_PLAY_YELLOW; + + for(i=2;i<8;i++) + { +@@ -528,7 +507,7 @@ + case SN_PLAY_BLUE: + case SN_PLAY_PINK: + case SN_PLAY_BLACK: +- color_to_pot=st.to_play; ++ color_to_pot=snooker_state.to_play; + if(b1hit!=color_to_pot) + { + foul=1; +@@ -562,9 +541,9 @@ + } + } + } +- if(!foul && act_score>0) st.to_play++; ++ if(!foul && act_score>0) snooker_state.to_play++; + +- for(i=st.to_play;i<8;i++) ++ for(i=snooker_state.to_play;i<8;i++) + { + if( BM_get_ball_out(i)) + spot_snooker_ball(pballs,i); +@@ -590,13 +569,13 @@ + printf("EVAL next player\n"); + if(red_balls_are_in_game) + { +- st.to_play=SN_PLAY_RED; ++ snooker_state.to_play=SN_PLAY_RED; + } + else + { +- if(st.to_play<=SN_PLAY_ANY_COLOR) ++ if(snooker_state.to_play<=SN_PLAY_ANY_COLOR) + { +- st.to_play=SN_PLAY_YELLOW; ++ snooker_state.to_play=SN_PLAY_YELLOW; + } + } + player[act_player].queue_view=*pqueue_view; +@@ -605,11 +584,11 @@ + *pqueue_view=player[act_player].queue_view; + } + +- player[act_player].snooker_on_red=st.to_play==SN_PLAY_RED; +- player[act_player].snooker_next_color=st.to_play; +- printf("EVAL to_play=%d\n",st.to_play); ++ player[act_player].snooker_on_red=snooker_state.to_play==SN_PLAY_RED; ++ player[act_player].snooker_next_color=snooker_state.to_play; ++ printf("EVAL to_play=%d\n",snooker_state.to_play); + +- if(st.to_play==SN_DONE) ++ if(snooker_state.to_play==SN_DONE) + { + int other_player; + diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,5 @@ +-p1|03_bugfixes +-p1|05_foul_explanation +-p1|06_show_ball_to_hit +-p0|snooker_reset.patch +-p0|snooker_draw.patch diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/snooker_draw.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/snooker_draw.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,48 @@ +Index: src/evaluate_move.c +=================================================================== +--- src/evaluate_move.c (revision 6) ++++ src/evaluate_move.c (working copy) +@@ -602,6 +602,11 @@ + player[act_player].winner=0; + player[other_player].winner=1; + } ++ if(player[act_player].score==player[other_player].score) { ++ player[act_player].winner=1; ++ player[other_player].winner=1; ++ } ++ + } + + printf("EVAL done\n"); +Index: src/billard3d.c +=================================================================== +--- src/billard3d.c (revision 6) ++++ src/billard3d.c (working copy) +@@ -1760,8 +1760,17 @@ + options_gamemode==options_gamemode_tournament && + (player[0].winner || player[1].winner) ) + { +- tournament_evaluate_last_match( &tournament_state ); +- tournament_state.wait_for_next_match=1; ++ if ( player[0].winner == player[1].winner ) ++ { // Draw ++ restart_game_common(); ++ player[act_player].winner=0; ++ player[other_player].winner=0; ++ } ++ else ++ { ++ tournament_evaluate_last_match( &tournament_state ); ++ tournament_state.wait_for_next_match=1; ++ } + } + } else { + int old_cueball_ind; +@@ -3654,6 +3663,7 @@ + create_walls( &walls ); + create_scene( &balls ); + g_shot_due=1; ++ snooker_state.to_play=SN_PLAY_RED; + } + + diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/patches/snooker_reset.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/patches/snooker_reset.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- src/billard3d.c 2010-02-27 04:01:40.000000000 -0600 ++++ src/billard3d.c 2010-02-27 04:02:59.000000000 -0600 +@@ -1219,6 +1219,8 @@ + printf("tournament_state_setup_next_match 7\n"); + queue_view=player[act_player].queue_view; + printf("tournament_state_setup_next_match 8\n"); ++ snooker_state.to_play = SN_PLAY_RED; ++ printf("tournament_state_setup_next_match 9\n"); + } + + void create_players_text() diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/snooker_draw.patch --- a/foobillard/stuff/snooker_draw.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -Index: src/evaluate_move.c -=================================================================== ---- src/evaluate_move.c (revision 6) -+++ src/evaluate_move.c (working copy) -@@ -602,6 +602,11 @@ - player[act_player].winner=0; - player[other_player].winner=1; - } -+ if(player[act_player].score==player[other_player].score) { -+ player[act_player].winner=1; -+ player[other_player].winner=1; -+ } -+ - } - - printf("EVAL done\n"); -Index: src/billard3d.c -=================================================================== ---- src/billard3d.c (revision 6) -+++ src/billard3d.c (working copy) -@@ -1760,8 +1760,17 @@ - options_gamemode==options_gamemode_tournament && - (player[0].winner || player[1].winner) ) - { -- tournament_evaluate_last_match( &tournament_state ); -- tournament_state.wait_for_next_match=1; -+ if ( player[0].winner == player[1].winner ) -+ { // Draw -+ restart_game_common(); -+ player[act_player].winner=0; -+ player[other_player].winner=0; -+ } -+ else -+ { -+ tournament_evaluate_last_match( &tournament_state ); -+ tournament_state.wait_for_next_match=1; -+ } - } - } else { - int old_cueball_ind; -@@ -3654,6 +3663,7 @@ - create_walls( &walls ); - create_scene( &balls ); - g_shot_due=1; -+ snooker_state.to_play=SN_PLAY_RED; - } - - diff -r c7b121a4ffd9 -r d6378d455338 foobillard/stuff/snooker_reset.patch --- a/foobillard/stuff/snooker_reset.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- src/billard3d.c 2010-02-27 04:01:40.000000000 -0600 -+++ src/billard3d.c 2010-02-27 04:02:59.000000000 -0600 -@@ -1219,6 +1219,8 @@ - printf("tournament_state_setup_next_match 7\n"); - queue_view=player[act_player].queue_view; - printf("tournament_state_setup_next_match 8\n"); -+ snooker_state.to_play = SN_PLAY_RED; -+ printf("tournament_state_setup_next_match 9\n"); - } - - void create_players_text() diff -r c7b121a4ffd9 -r d6378d455338 freeglut/receipt --- a/freeglut/receipt Wed May 09 17:03:28 2018 +0300 +++ b/freeglut/receipt Thu May 10 21:12:00 2018 +0300 @@ -24,10 +24,6 @@ if [ ! -d $src ]; then mv $PACKAGE-2.6.0 $src; fi cd $src - # fixes an issue with the radeon[hd] ATI opensource drivers - # ref: http://bugs.gentoo.org/show_bug.cgi?id=295163 - patch -p0 -i $stuff/2.6.0-GFX_radeon.patch -# sed -i 's/-Werror//' configure ./configure $CONFIGURE_ARGS && # sed -i '/XF86VMODE/d' config.status diff -r c7b121a4ffd9 -r d6378d455338 freeglut/stuff/2.6.0-GFX_radeon.patch --- a/freeglut/stuff/2.6.0-GFX_radeon.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -Index: src/freeglut_window.c -=================================================================== ---- src/freeglut_window.c (Revision 832) -+++ src/freeglut_window.c (Arbeitskopie) -@@ -594,10 +594,9 @@ - #if TARGET_HOST_POSIX_X11 - if ( window ) - { -- glXMakeContextCurrent( -+ glXMakeCurrent( - fgDisplay.Display, - window->Window.Handle, -- window->Window.Handle, - window->Window.Context - ); - -@@ -932,10 +932,9 @@ - XSetWMProtocols( fgDisplay.Display, window->Window.Handle, - &fgDisplay.DeleteWindow, 1 ); - -- glXMakeContextCurrent( -+ glXMakeCurrent( - fgDisplay.Display, - window->Window.Handle, -- window->Window.Handle, - window->Window.Context - ); - diff -r c7b121a4ffd9 -r d6378d455338 freeglut/stuff/patches/2.6.0-GFX_radeon.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/freeglut/stuff/patches/2.6.0-GFX_radeon.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,28 @@ +Index: src/freeglut_window.c +=================================================================== +--- src/freeglut_window.c (Revision 832) ++++ src/freeglut_window.c (Arbeitskopie) +@@ -594,10 +594,9 @@ + #if TARGET_HOST_POSIX_X11 + if ( window ) + { +- glXMakeContextCurrent( ++ glXMakeCurrent( + fgDisplay.Display, + window->Window.Handle, +- window->Window.Handle, + window->Window.Context + ); + +@@ -932,10 +932,9 @@ + XSetWMProtocols( fgDisplay.Display, window->Window.Handle, + &fgDisplay.DeleteWindow, 1 ); + +- glXMakeContextCurrent( ++ glXMakeCurrent( + fgDisplay.Display, + window->Window.Handle, +- window->Window.Handle, + window->Window.Context + ); + diff -r c7b121a4ffd9 -r d6378d455338 freeglut/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/freeglut/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +# fixes an issue with the radeon[hd] ATI opensource drivers +# ref: http://bugs.gentoo.org/show_bug.cgi?id=295163 +-p0|2.6.0-GFX_radeon.patch diff -r c7b121a4ffd9 -r d6378d455338 fusecloop/receipt --- a/fusecloop/receipt Wed May 09 17:03:28 2018 +0300 +++ b/fusecloop/receipt Thu May 10 21:12:00 2018 +0300 @@ -24,7 +24,6 @@ wget -P $SRC $ADVANCECOMP_URL tar xzf $SRC/$ADVANCECOMP_TARBALL sed -i 's/dprintf/d_printf/g' *.h *.c - patch -p0 < $stuff/fusecloop.u ADVANCECOMP=advancecomp-$ADVANCECOMP_VERSION cp *.h *.c $ADVANCECOMP cp create_compressed_fs.c $ADVANCECOMP/redef.cc diff -r c7b121a4ffd9 -r d6378d455338 fusecloop/stuff/fusecloop.u --- a/fusecloop/stuff/fusecloop.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,858 +0,0 @@ ---- compressed_loop.h -+++ compressed_loop.h -@@ -41,6 +41,80 @@ - /* data_index (num_blocks 64bit pointers, network order)... */ - /* compressed data (gzip block compressed format)... */ - -+struct cloop_tail -+{ -+ u_int32_t table_size; -+ u_int32_t index_size; -+ u_int32_t num_blocks; -+}; -+ -+struct block_info -+{ -+ loff_t offset; /* 64-bit offsets of compressed block */ -+ u_int32_t size; /* 32-bit compressed block size */ -+ u_int32_t optidx; /* 32-bit index number */ -+}; -+ -+static inline char *build_index(struct block_info *offsets, unsigned long n) -+{ -+ u_int32_t *ofs32 = (u_int32_t *) offsets; -+ loff_t *ofs64 = (loff_t *) offsets; -+ -+ if (ofs32[0] == 0) { -+ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ -+ while (n--) { -+ offsets[n].offset = __be64_to_cpu(offsets[n].offset); -+ offsets[n].size = ntohl(offsets[n].size); -+ } -+ return (char *) "128BE accelerated knoppix 1.0"; -+ } -+ else { /* V2.0 */ -+ loff_t last = __be64_to_cpu(ofs64[n]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = __be64_to_cpu(ofs64[n])); -+ last = offsets[n].offset; -+ } -+ return (char *) "64BE v2.0"; -+ } -+ } -+ else if (ofs32[1] == 0) { /* V1.0 */ -+ loff_t last = __le64_to_cpu(ofs64[n]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = __le64_to_cpu(ofs64[n])); -+ last = offsets[n].offset; -+ } -+ return (char *) "64LE v1.0"; -+ } -+ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ -+ loff_t last = ntohl(ofs32[n]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = ntohl(ofs32[n])); -+ last = offsets[n].offset; -+ } -+ return (char *) "32BE v0.68"; -+ } -+ else { /* V3.0 */ -+ unsigned long i; -+ loff_t j; -+ -+ for (i = n; i-- != 0; ) -+ offsets[i].size = ntohl(ofs32[i]); -+ for (i = 0, j = sizeof(struct cloop_head); i < n; i++) { -+ offsets[i].offset = j; -+ if (offsets[i].size & 0x80000000) { -+ unsigned long k = offsets[i].size & 0x7FFFFFFF; -+ offsets[i].offset = offsets[k].offset; -+ offsets[i].size = offsets[k].size; -+ } -+ else j += offsets[i].size; -+ } -+ return (char *) "32BE v3.0"; -+ } -+} -+ - /* Cloop suspend IOCTL */ - #define CLOOP_SUSPEND 0x4C07 - - ---- cloopreader.h -+++ cloopreader.h -@@ -33,7 +33,7 @@ - int numblocks; - ulong blocksize; - -- loff_t* toc; /* Data index */ -+ struct block_info *toc; /* Data index */ - size_t tocsize; - - unsigned char* cblock; /* Compressed block */ - ---- cloopreader.c -+++ cloopreader.c -@@ -59,10 +59,32 @@ - - ALLOC(c->pblock,c->blocksize); - -- c->tocsize=sizeof *c->toc * (c->numblocks+1); /* One extra address is position of EOF */ -- ALLOC(c->toc,c->tocsize); -+ if (c->numblocks + 1 == 0) { -+ struct cloop_tail tail; -+ loff_t end = lseek(c->fh,0,SEEK_END); /* lseek(,-n,SEEK_END) buggy ? */ -+ void *p; -+ ulong toclen, len; - -- OP(read_all(c->fh,c->toc,c->tocsize)); /* read Data Index */ -+ OP(lseek(c->fh, end - sizeof(tail), SEEK_SET)); -+ OP(read_all(c->fh, &tail, sizeof(tail))); -+ c->numblocks = ntohl(tail.num_blocks); -+ c->tocsize = sizeof(*c->toc) * c->numblocks; -+ len = ntohl(tail.table_size); -+ toclen = (ntohl(tail.index_size) & 255) * c->numblocks; -+ OP(lseek(c->fh, end - sizeof(tail) - len, SEEK_SET)); -+ ALLOC(c->toc, sizeof(*c->toc) * c->numblocks); -+ ALLOC(p,len); -+ OP(read_all(c->fh,p,len)); /* read Data Index */ -+ if (uncompress((void *)c->toc,&toclen,p,len) != Z_OK) -+ exit(1); -+ free(p); -+ } -+ else { -+ c->tocsize = sizeof(*c->toc) * c->numblocks; -+ ALLOC(c->toc,c->tocsize); -+ OP(read_all(c->fh,c->toc,c->tocsize)); /* read Data Index */ -+ } -+ build_index(c->toc, c->numblocks); - c->cblocksizecur=0; - c->curblock=-1; - return 0; -@@ -79,10 +101,10 @@ - if(page>=c->numblocks){errno=EFAULT;return -1;} - c->curblock=page; - -- bprintf("Seeking to 0x%Lx\n",btc(c->toc[page])); -- OP(lseek(c->fh,btc(c->toc[page]), SEEK_SET)); -+ bprintf("Seeking to 0x%Lx\n",c->toc[page].offset); -+ OP(lseek(c->fh,c->toc[page].offset, SEEK_SET)); - -- c->cblocksize=btc(c->toc[page+1]) - btc(c->toc[page]); -+ c->cblocksize=c->toc[page].size; - bprintf("Compressed size=%lu\n",c->cblocksize); - if(c->cblocksize > c->cblocksizecur){ - if(c->cblocksizecur)free(c->cblock); - ---- extract_compressed_fs.c -+++ extract_compressed_fs.c -@@ -1,19 +1,23 @@ - /* Extracts a filesystem back from a compressed fs file */ -+#define _LARGEFILE64_SOURCE - #include "common_header.h" -+#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" - - int main(int argc, char *argv[]) - { - int handle; - struct cloop_head head; - unsigned int i; -+ unsigned long num_blocks, block_size, zblock_maxsize, lastlen = 0; - unsigned char *buffer, *clear_buffer; -+ struct block_info *offsets; - -- if (argc != 2) { -- fprintf(stderr, "Need filename\n"); -+ if (argc < 2 || argv[1][0] == '-') { -+ fprintf(stderr, "Usage: extract_compressed_fs file [--convert-to-v2] > output\n"); - exit(1); - } - -- handle = open(argv[1], O_RDONLY); -+ handle = open(argv[1], O_RDONLY|O_LARGEFILE); - if (handle < 0) { - perror("Opening compressed file\n"); - exit(1); -@@ -24,66 +28,100 @@ - exit(1); - } - -- buffer = malloc(ntohl(head.block_size) + ntohl(head.block_size)/1000 -- + 12 + 4); -- clear_buffer = malloc(ntohl(head.block_size)); -- fprintf(stderr, "%u blocks of size %u. Preamble:\n%s\n", -- ntohl(head.num_blocks), ntohl(head.block_size), head.preamble); -+ num_blocks = ntohl(head.num_blocks); -+ block_size = ntohl(head.block_size); -+ zblock_maxsize = block_size + block_size/1000 + 12 + 4; -+ buffer = malloc(zblock_maxsize); -+ clear_buffer = malloc(block_size); - -- for (i = 0; i < ntohl(head.num_blocks); i++) { -- int currpos; -- unsigned long destlen = ntohl(head.block_size); -- loff_t offset[2]; -- unsigned int size; -+ if (num_blocks == (unsigned long) -1) { -+ void *table; -+ struct cloop_tail tail; -+ unsigned long len, table_size; -+ loff_t end = lseek64(handle, 0, SEEK_END); -+ -+ if (lseek64(handle, end - sizeof(tail), SEEK_SET) < 0 || -+ read(handle, &tail, sizeof(tail)) != sizeof(tail) || -+ lseek64(handle, end - sizeof(tail) - -+ ntohl(tail.table_size), SEEK_SET) < 0) { -+ perror("Reading tail\n"); -+ exit(1); -+ } -+ head.num_blocks = tail.num_blocks; -+ num_blocks = ntohl(head.num_blocks); -+ table_size = ntohl(tail.table_size); -+ table = malloc(table_size); -+ len = i = num_blocks * (ntohl(tail.index_size) & 255); -+ lastlen = ntohl(tail.index_size) / 256; -+ offsets = malloc(num_blocks * sizeof(*offsets)); -+ if (!table || !offsets || -+ read(handle, table, table_size) != table_size || -+ uncompress((void *)offsets, &len, table, table_size) != Z_OK || -+ len != i) { -+ perror("Reading index\n"); -+ exit(1); -+ } -+ free(table); -+ } -+ else { -+ offsets = malloc(i = num_blocks * sizeof(*offsets)); -+ if (!offsets || read(handle, offsets, i) != i) { -+ perror("Reading index\n"); -+ exit(1); -+ } -+ } -+ -+ fprintf(stderr, "%lu blocks of size %lu. Preamble:\n%s\n", -+ num_blocks, block_size, head.preamble); -+ fprintf(stderr, "Index %s.\n", build_index(offsets, num_blocks)); -+ -+ if (argc > 2) { -+ unsigned n; -+ loff_t data, offset = ((num_blocks + 1) * sizeof(offset)) + sizeof(head); -+ -+ strcpy(head.preamble, CLOOP_PREAMBLE); -+ write(STDOUT_FILENO, &head, n = sizeof(head)); -+ for (i = 0; i < num_blocks; i++) { -+ data = __be64_to_cpu(offset); -+ write(STDOUT_FILENO, &data, sizeof(data)); -+ n += sizeof(data); -+ offset += offsets[i].size; -+ } -+ data = __be64_to_cpu(offset); -+ write(STDOUT_FILENO, &data, sizeof(data)); -+ for (i = 0; i < num_blocks && lseek64(handle, offsets[i].offset, SEEK_SET) >= 0; i++) { -+ read(handle, buffer, offsets[i].size); -+ write(STDOUT_FILENO, buffer, offsets[i].size); -+ n += offsets[i].size; -+ } -+ n &= 0x1FF; -+ if (n) { -+ memset(buffer, 0, 512); -+ write(STDOUT_FILENO, buffer, 512 - n); -+ } -+ return 0; -+ } -+ -+ for (i = 0; i < num_blocks; i++) { -+ unsigned long destlen = block_size; -+ unsigned int size = offsets[i].size; - -- read(handle, &offset, 2*sizeof(loff_t)); -- lseek(handle, -sizeof(loff_t), SEEK_CUR); -- -- currpos = lseek(handle, 0, SEEK_CUR); -- if (lseek(handle, __be64_to_cpu(offset[0]), SEEK_SET) < 0) { -+ if (lseek64(handle, offsets[i].offset, SEEK_SET) < 0) { - fprintf(stderr, "lseek to %Lu: %s\n", -- __be64_to_cpu(offset[0]), strerror(errno)); -+ offsets[i].offset, strerror(errno)); - exit(1); - } - -- size=__be64_to_cpu(offset[1])-__be64_to_cpu(offset[0]); -- if (size > ntohl(head.block_size) + ntohl(head.block_size)/1000 -- + 12 + 4) { -+ if (size > zblock_maxsize) { - fprintf(stderr, - "Size %u for block %u (offset %Lu) too big\n", -- size, i, __be64_to_cpu(offset[0])); -+ size, i, offsets[i].offset); - exit(1); - } - read(handle, buffer, size); -- if (lseek(handle, currpos, SEEK_SET) < 0) { -- perror("seeking"); -- exit(1); -- } - -- fprintf(stderr, "Block %u length %u => %lu\n", -- i, size, destlen); -- if (i == 3) { -- fprintf(stderr, -- "Block head:%02X%02X%02X%02X%02X%02X%02X%02X\n", -- buffer[0], -- buffer[1], -- buffer[2], -- buffer[3], -- buffer[4], -- buffer[5], -- buffer[6], -- buffer[7]); -- fprintf(stderr, -- "Block tail:%02X%02X%02X%02X%02X%02X%02X%02X\n", -- buffer[3063], -- buffer[3064], -- buffer[3065], -- buffer[3066], -- buffer[3067], -- buffer[3068], -- buffer[3069], -- buffer[3070]); -- } -+ fprintf(stderr, "Block %u at %llu length %u", -+ i, offsets[i].offset, size); - switch (uncompress(clear_buffer, &destlen, - buffer, size)) { - case Z_OK: -@@ -105,12 +143,13 @@ - fprintf(stderr, "Uncomp: unknown error %u\n", i); - exit(1); - } -- if (destlen != ntohl(head.block_size)) { -- fprintf(stderr, "Uncomp: bad len %u (%lu not %u)\n", i, -- destlen, ntohl(head.block_size)); -+ fprintf(stderr, " => %lu\n", destlen); -+ if (destlen != block_size && i != num_blocks - 1) { -+ fprintf(stderr, "Uncomp: bad len %u (%lu not %lu)\n", i, -+ destlen, block_size); - exit(1); - } -- write(STDOUT_FILENO, clear_buffer, ntohl(head.block_size)); -+ write(STDOUT_FILENO, clear_buffer, (lastlen != 0 && (i+1) == num_blocks) ? lastlen : block_size); - } - return 0; - } ---- Makefile -+++ Makefile -@@ -1,16 +1,19 @@ - PROGNAME=fusecloop - ARCFILES=*.c *.h *.pl Makefile configure README VERSION HELP INSTALL typescript *.cloop COPYING --PROGS=fusecloop cloopreaderdemo extract_compressed_fs -+PROGS=fusecloop cloopreaderdemo extract_compressed_fs create_compressed_fs - FUSECFLAGS=`pkg-config fuse --cflags` - FUSELDFLAGS=`pkg-config fuse --libs` - - CFLAGS= -Wall - --all: fusecloop extract_compressed_fs -+all: fusecloop extract_compressed_fs create_compressed_fs - - extract_compressed_fs: extract_compressed_fs.c - ${CC} ${CFLAGS} ${LDFLAGS} -lz extract_compressed_fs.c -o extract_compressed_fs - -+create_compressed_fs: create_compressed_fs.c md5sum.c -+ ${CC} ${CFLAGS} ${LDFLAGS} -lz create_compressed_fs.c -o create_compressed_fs -+ - fusecloop: fusecloop.c cloopreader.o strver debug.o - ${CC} ${CFLAGS} ${LDFLAGS} -lz cloopreader.o ${FUSECFLAGS} ${FUSELDFLAGS} fusecloop.c debug.o -o fusecloop - - - ---- md5sum.c -+++ md5sum.c -@@ -0,0 +1,246 @@ -+/* -+ * Based on busybox code. -+ * -+ * Compute MD5 checksum of strings according to the -+ * definition of MD5 in RFC 1321 from April 1992. -+ * -+ * Written by Ulrich Drepper , 1995. -+ * -+ * Copyright (C) 1995-1999 Free Software Foundation, Inc. -+ * Copyright (C) 2001 Manuel Novoa III -+ * Copyright (C) 2003 Glenn L. McGrath -+ * Copyright (C) 2003 Erik Andersen -+ * Copyright (C) 2010 Denys Vlasenko -+ * Copyright (C) 2012 Pascal Bellard -+ * -+ * Licensed under GPLv2 or later -+ */ -+ -+#define ALIGN1 -+ -+static uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */ -+static uint64_t total64; /* must be directly before hash[] */ -+static uint32_t hash[8]; /* 4 elements for md5, 5 for sha1, 8 for sha256 */ -+ -+/* Emit a string of hex representation of bytes */ -+static char* bin2hex(char *p) -+{ -+ static const char bb_hexdigits_upcase[] ALIGN1 = "0123456789abcdef"; -+ int count = 16; -+ const char *cp = (const char *) hash; -+ while (count) { -+ unsigned char c = *cp++; -+ /* put lowercase hex digits */ -+ *p++ = bb_hexdigits_upcase[c >> 4]; -+ *p++ = bb_hexdigits_upcase[c & 0xf]; -+ count--; -+ } -+ return p; -+} -+ -+//#define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n)))) -+static uint32_t rotl32(uint32_t x, unsigned n) -+{ -+ return (x << n) | (x >> (32 - n)); -+} -+ -+static void md5_process_block64(void); -+ -+/* Feed data through a temporary buffer. -+ * The internal buffer remembers previous data until it has 64 -+ * bytes worth to pass on. -+ */ -+static void common64_hash(const void *buffer, size_t len) -+{ -+ unsigned bufpos = total64 & 63; -+ -+ total64 += len; -+ -+ while (1) { -+ unsigned remaining = 64 - bufpos; -+ if (remaining > len) -+ remaining = len; -+ /* Copy data into aligned buffer */ -+ memcpy(wbuffer + bufpos, buffer, remaining); -+ len -= remaining; -+ buffer = (const char *)buffer + remaining; -+ bufpos += remaining; -+ /* clever way to do "if (bufpos != 64) break; ... ; bufpos = 0;" */ -+ bufpos -= 64; -+ if (bufpos != 0) -+ break; -+ /* Buffer is filled up, process it */ -+ md5_process_block64(); -+ /*bufpos = 0; - already is */ -+ } -+} -+ -+/* Process the remaining bytes in the buffer */ -+static void common64_end(void) -+{ -+ unsigned bufpos = total64 & 63; -+ /* Pad the buffer to the next 64-byte boundary with 0x80,0,0,0... */ -+ wbuffer[bufpos++] = 0x80; -+ -+ /* This loop iterates either once or twice, no more, no less */ -+ while (1) { -+ unsigned remaining = 64 - bufpos; -+ memset(wbuffer + bufpos, 0, remaining); -+ /* Do we have enough space for the length count? */ -+ if (remaining >= 8) { -+ /* Store the 64-bit counter of bits in the buffer */ -+ uint64_t t = total64 << 3; -+ /* wbuffer is suitably aligned for this */ -+ *(uint64_t *) (&wbuffer[64 - 8]) = t; -+ } -+ md5_process_block64(); -+ if (remaining >= 8) -+ break; -+ bufpos = 0; -+ } -+} -+ -+/* These are the four functions used in the four steps of the MD5 algorithm -+ * and defined in the RFC 1321. The first function is a little bit optimized -+ * (as found in Colin Plumbs public domain implementation). -+ * #define FF(b, c, d) ((b & c) | (~b & d)) -+ */ -+#undef FF -+#undef FG -+#undef FH -+#undef FI -+#define FF(b, c, d) (d ^ (b & (c ^ d))) -+#define FG(b, c, d) FF(d, b, c) -+#define FH(b, c, d) (b ^ c ^ d) -+#define FI(b, c, d) (c ^ (b | ~d)) -+ -+/* Hash a single block, 64 bytes long and 4-byte aligned */ -+static void md5_process_block64(void) -+{ -+ /* Before we start, one word to the strange constants. -+ They are defined in RFC 1321 as -+ T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64 -+ */ -+ static const uint32_t C_array[] = { -+ /* round 1 */ -+ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, -+ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, -+ 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, -+ 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, -+ /* round 2 */ -+ 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, -+ 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, -+ 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, -+ 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, -+ /* round 3 */ -+ 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, -+ 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, -+ 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05, -+ 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, -+ /* round 4 */ -+ 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, -+ 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, -+ 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, -+ 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 -+ }; -+ static const char P_array[] ALIGN1 = { -+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ -+ 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */ -+ 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */ -+ 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */ -+ }; -+ uint32_t *words = (uint32_t *) wbuffer; -+ uint32_t A = hash[0]; -+ uint32_t B = hash[1]; -+ uint32_t C = hash[2]; -+ uint32_t D = hash[3]; -+ -+ static const char S_array[] ALIGN1 = { -+ 7, 12, 17, 22, -+ 5, 9, 14, 20, -+ 4, 11, 16, 23, -+ 6, 10, 15, 21 -+ }; -+ const uint32_t *pc; -+ const char *pp; -+ const char *ps; -+ int i; -+ uint32_t temp; -+ -+ -+ pc = C_array; -+ pp = P_array; -+ ps = S_array - 4; -+ -+ for (i = 0; i < 64; i++) { -+ if ((i & 0x0f) == 0) -+ ps += 4; -+ temp = A; -+ switch (i >> 4) { -+ case 0: -+ temp += FF(B, C, D); -+ break; -+ case 1: -+ temp += FG(B, C, D); -+ break; -+ case 2: -+ temp += FH(B, C, D); -+ break; -+ case 3: -+ temp += FI(B, C, D); -+ } -+ temp += words[(int) (*pp++)] + *pc++; -+ temp = rotl32(temp, ps[i & 3]); -+ temp += B; -+ A = D; -+ D = C; -+ C = B; -+ B = temp; -+ } -+ /* Add checksum to the starting values */ -+ hash[0] += A; -+ hash[1] += B; -+ hash[2] += C; -+ hash[3] += D; -+ -+} -+#undef FF -+#undef FG -+#undef FH -+#undef FI -+ -+/* Initialize structure containing state of computation. -+ * (RFC 1321, 3.3: Step 3) -+ */ -+static void md5_begin(void) -+{ -+ hash[0] = 0x67452301; -+ hash[1] = 0xefcdab89; -+ hash[2] = 0x98badcfe; -+ hash[3] = 0x10325476; -+ total64 = 0; -+} -+ -+/* Used also for sha1 and sha256 */ -+#define md5_hash common64_hash -+ -+/* Process the remaining bytes in the buffer and put result from CTX -+ * in first 16 bytes following RESBUF. The result is always in little -+ * endian byte order, so that a byte-wise output yields to the wanted -+ * ASCII representation of the message digest. -+ */ -+#define md5_end common64_end -+ -+typedef struct { char hash[16]; } md5hash; -+ -+static md5hash md5sum(uint8_t *buffer, int len) -+{ -+ md5hash val; -+ -+ md5_begin(); -+ md5_hash(buffer, len); -+ md5_end(); -+ memcpy(&val, hash, 16); -+ -+ return val; -+} ---- create_compressed_fs.c -+++ create_compressed_fs.c -@@ -0,0 +1,224 @@ -+#ifdef FIND_BEST_COMPRESSION -+#include -+extern "C" { -+#include -+#include -+ -+#define ZMAX 12 /* 12 compression levels with libdeflate, not 9 */ -+static shrink_t level; -+static int pass, iter; -+static int best_compress(unsigned char *compressed, -+ unsigned long *compressed_len, -+ unsigned char *uncompressed, -+ unsigned long uncompressed_len) -+{ -+ int i, j, err; -+ unsigned char *buf[2]; -+ unsigned len; -+ unsigned long llen, best = *compressed_len * 2; -+ static unsigned char *buffer; -+ static unsigned long buffersz; -+ -+ if (buffersz < *compressed_len) { -+ if (buffer) free(buffer); -+ buffer = (unsigned char *) malloc(buffersz = *compressed_len); -+ if (!buffer) return Z_MEM_ERROR; -+ } -+ buf[0] = compressed; -+ buf[1] = buffer; -+ for (i = j = 0; i <= ZMAX+2 && (pass == 0 || i < pass); i++) { -+ llen = len = *compressed_len; -+ if (i >= ZMAX+1) { -+ level.level = (i == ZMAX+1) ? shrink_extra : shrink_insane; -+ err = (compress_zlib(level, buf[j], -+ len, uncompressed, -+ uncompressed_len)) ? Z_OK : Z_DATA_ERROR; -+ } else { -+ err = compress2(buf[j], &llen, uncompressed, -+ uncompressed_len, i); -+ len = llen; -+ } -+ if (err != Z_OK) return err; -+ if (len < best) { -+ best = len; -+ j = 1 - j; -+ } -+ } -+ *compressed_len = best; -+ if (j == 0) -+ memcpy(compressed, buffer, best); -+ return err; -+} -+#define compress2(a,b,c,d,e) best_compress(a,b,c,d) -+#endif -+ -+#include -+ -+/* Creates a compressed file */ -+#include "common_header.h" -+ -+#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V3.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" -+#define CHUNK 65536 -+#define DEFAULT_BLOCKSIZE 65536 -+ -+static void quit(const char *s) -+{ -+ fprintf(stderr, "%s\n", s); -+ exit(1); -+} -+ -+static int readblock(unsigned char *buffer, int n) -+{ -+ int i; -+ -+ memset(buffer, 0, n); -+ for (i = 0 ; i < n;) { -+ int j = read(STDIN_FILENO, buffer + i, n - i); -+ if (j < 0 && errno == EINTR) continue; -+ if (j <= 0) break; -+ i += j; -+ } -+ return i; -+} -+ -+#ifdef FIND_BEST_COMPRESSION -+#include "md5sum.c" -+#endif -+ -+static unsigned n; -+static unsigned long lastlen, pos, *block_index; -+static unsigned char *compressed; -+static unsigned long block_size = 0; -+static void flush_index(int sig) -+{ -+ static char padding[512]; -+ struct cloop_tail tail; -+ unsigned long len; -+ -+ fprintf(stderr, "Write index for %lu blocks\n", n); -+ if (block_size >= 0x1000000) lastlen = 0; -+ tail.index_size = ntohl(sizeof(*block_index) + 256*(lastlen % 0xFFffFF)); -+ tail.num_blocks = ntohl(n); -+ n *= sizeof(*block_index); -+ len = n + n/1000 + 12; -+ compressed = (unsigned char *) realloc(compressed, len); -+ if (!compressed || compress2(compressed, &len, (unsigned char *) block_index, -+ n, Z_BEST_SPEED) != Z_OK) -+ quit("Index compression failed"); -+ tail.table_size = ntohl(len); -+ pos += len + sizeof(tail); -+ n = pos & 511; -+ if (n) write(STDOUT_FILENO, padding, 512 - n); -+ write(STDOUT_FILENO, compressed, len); -+ write(STDOUT_FILENO, &tail, sizeof(tail)); -+ exit(sig != 0); -+} -+ -+int main(int argc, char *argv[]) -+{ -+ struct cloop_head head; -+ unsigned char *uncompressed; -+ unsigned long len; -+ unsigned indexmax, zlenmax; -+#ifdef FIND_BEST_COMPRESSION -+ unsigned i, j, hashmax; -+ md5hash *hash; -+#endif -+ -+#ifdef FIND_BEST_COMPRESSION -+ while (argc > 1) { -+ if (argv[1][0] == '-') { -+ int *p = &pass; -+ switch (argv[1][1]) { -+ case 'i' : p = &iter; -+ case 'n' : *p = atoi(argv[2]); -+ argc -= 2; -+ argv += 2; -+ continue; -+ } -+ } -+ argc--; -+ if (argv[1][0] < '0' || argv[1][0] > '9') -+ quit("Usage : create_compressed_fs [-n ][ -i ] [block size] < input > output"); -+#else -+ if (argc > 1) { -+ if (argv[1][0] < '0' || argv[1][0] > '9') -+ quit("Usage : create_compressed_fs [block size] < input > output"); -+#endif -+ block_size = atoi(argv[1]); -+ } -+ if (block_size < 4096) -+ block_size = DEFAULT_BLOCKSIZE; -+ fprintf(stderr, "Block size is %lu\n", block_size); -+ zlenmax = block_size + block_size/1000 + 12; -+ -+ memset(&head, 0, sizeof(head)); -+ strcpy(head.preamble, CLOOP_PREAMBLE); -+ head.num_blocks = -1; -+ head.block_size = htonl(block_size); -+ write(STDOUT_FILENO, &head, sizeof(head)); -+ pos = sizeof(head); -+ -+ compressed = (unsigned char *) malloc(zlenmax); -+ uncompressed = (unsigned char *) malloc(block_size); -+ block_index = (unsigned long *) malloc(indexmax = CHUNK); -+#ifdef FIND_BEST_COMPRESSION -+ hash = (md5hash *) malloc(hashmax = CHUNK); -+ if (!compressed || !uncompressed || !block_index || !hash) -+#else -+ if (!compressed || !uncompressed || !block_index) -+#endif -+ quit("Malloc failed"); -+ -+ signal(SIGINT,flush_index); -+ signal(SIGQUIT,flush_index); -+ signal(SIGTERM,flush_index); -+ -+ for (n = 0; (len = readblock(uncompressed, block_size)) != 0; n++) { -+ lastlen = len; -+ if (n * sizeof(*block_index) >= indexmax) { -+ block_index = (unsigned long *) realloc(block_index, -+ indexmax += CHUNK); -+ if (!block_index) -+ quit("Realloc"); -+ } -+#ifdef FIND_BEST_COMPRESSION -+ if (n * sizeof(*hash) >= hashmax) { -+ hash = (md5hash *) realloc(hash, hashmax += CHUNK); -+ if (!hash) -+ quit("Realloc hash"); -+ } -+ hash[n] = md5sum(uncompressed, len); -+ j = 0x7FFFFFFF; -+ if (n < j) -+ j = n; -+ for (i = 0; i < j; i++) { -+ if (* (uint32_t *) &hash[i] == * (uint32_t *) &hash[n] -+ && !memcmp(&hash[i],&hash[n],sizeof(*hash))) -+ break; -+ } -+ if (i != j) { -+ block_index[n] = ntohl(0x80000000 | i); -+ fprintf(stderr, "Block %u length %lu => duplicate %lu\n", -+ n, block_size, i); -+ } -+ else -+#endif -+ { -+ len = zlenmax; -+ if (compress2(compressed, &len, uncompressed, lastlen, -+ Z_BEST_SPEED) != Z_OK) -+ quit("Compression failed"); -+ fprintf(stderr, "Block %u length %lu => %lu\n", -+ n, block_size, len); -+ write(STDOUT_FILENO, compressed, len); -+ pos += len; -+ block_index[n] = ntohl(len); -+ } -+ } -+ flush_index(0); -+ return 0; -+} -+#ifdef FIND_BEST_COMPRESSION -+} -+#endif ---- fusecloop.c -+++ fusecloop.c -@@ -65,7 +65,7 @@ - - memcpy(stbuf,&stb,sizeof stb); - stbuf->st_mode&=~0222; -- stbuf->st_size = cd.blocksize * cd.numblocks; -+ stbuf->st_size = (loff_t) cd.blocksize * cd.numblocks; - /* - stbuf->st_mode = S_IFREG | 0444; - stbuf->st_nlink = 1; diff -r c7b121a4ffd9 -r d6378d455338 fusecloop/stuff/patches/fusecloop.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fusecloop/stuff/patches/fusecloop.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,858 @@ +--- compressed_loop.h ++++ compressed_loop.h +@@ -41,6 +41,80 @@ + /* data_index (num_blocks 64bit pointers, network order)... */ + /* compressed data (gzip block compressed format)... */ + ++struct cloop_tail ++{ ++ u_int32_t table_size; ++ u_int32_t index_size; ++ u_int32_t num_blocks; ++}; ++ ++struct block_info ++{ ++ loff_t offset; /* 64-bit offsets of compressed block */ ++ u_int32_t size; /* 32-bit compressed block size */ ++ u_int32_t optidx; /* 32-bit index number */ ++}; ++ ++static inline char *build_index(struct block_info *offsets, unsigned long n) ++{ ++ u_int32_t *ofs32 = (u_int32_t *) offsets; ++ loff_t *ofs64 = (loff_t *) offsets; ++ ++ if (ofs32[0] == 0) { ++ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ ++ while (n--) { ++ offsets[n].offset = __be64_to_cpu(offsets[n].offset); ++ offsets[n].size = ntohl(offsets[n].size); ++ } ++ return (char *) "128BE accelerated knoppix 1.0"; ++ } ++ else { /* V2.0 */ ++ loff_t last = __be64_to_cpu(ofs64[n]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = __be64_to_cpu(ofs64[n])); ++ last = offsets[n].offset; ++ } ++ return (char *) "64BE v2.0"; ++ } ++ } ++ else if (ofs32[1] == 0) { /* V1.0 */ ++ loff_t last = __le64_to_cpu(ofs64[n]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = __le64_to_cpu(ofs64[n])); ++ last = offsets[n].offset; ++ } ++ return (char *) "64LE v1.0"; ++ } ++ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ ++ loff_t last = ntohl(ofs32[n]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = ntohl(ofs32[n])); ++ last = offsets[n].offset; ++ } ++ return (char *) "32BE v0.68"; ++ } ++ else { /* V3.0 */ ++ unsigned long i; ++ loff_t j; ++ ++ for (i = n; i-- != 0; ) ++ offsets[i].size = ntohl(ofs32[i]); ++ for (i = 0, j = sizeof(struct cloop_head); i < n; i++) { ++ offsets[i].offset = j; ++ if (offsets[i].size & 0x80000000) { ++ unsigned long k = offsets[i].size & 0x7FFFFFFF; ++ offsets[i].offset = offsets[k].offset; ++ offsets[i].size = offsets[k].size; ++ } ++ else j += offsets[i].size; ++ } ++ return (char *) "32BE v3.0"; ++ } ++} ++ + /* Cloop suspend IOCTL */ + #define CLOOP_SUSPEND 0x4C07 + + +--- cloopreader.h ++++ cloopreader.h +@@ -33,7 +33,7 @@ + int numblocks; + ulong blocksize; + +- loff_t* toc; /* Data index */ ++ struct block_info *toc; /* Data index */ + size_t tocsize; + + unsigned char* cblock; /* Compressed block */ + +--- cloopreader.c ++++ cloopreader.c +@@ -59,10 +59,32 @@ + + ALLOC(c->pblock,c->blocksize); + +- c->tocsize=sizeof *c->toc * (c->numblocks+1); /* One extra address is position of EOF */ +- ALLOC(c->toc,c->tocsize); ++ if (c->numblocks + 1 == 0) { ++ struct cloop_tail tail; ++ loff_t end = lseek(c->fh,0,SEEK_END); /* lseek(,-n,SEEK_END) buggy ? */ ++ void *p; ++ ulong toclen, len; + +- OP(read_all(c->fh,c->toc,c->tocsize)); /* read Data Index */ ++ OP(lseek(c->fh, end - sizeof(tail), SEEK_SET)); ++ OP(read_all(c->fh, &tail, sizeof(tail))); ++ c->numblocks = ntohl(tail.num_blocks); ++ c->tocsize = sizeof(*c->toc) * c->numblocks; ++ len = ntohl(tail.table_size); ++ toclen = (ntohl(tail.index_size) & 255) * c->numblocks; ++ OP(lseek(c->fh, end - sizeof(tail) - len, SEEK_SET)); ++ ALLOC(c->toc, sizeof(*c->toc) * c->numblocks); ++ ALLOC(p,len); ++ OP(read_all(c->fh,p,len)); /* read Data Index */ ++ if (uncompress((void *)c->toc,&toclen,p,len) != Z_OK) ++ exit(1); ++ free(p); ++ } ++ else { ++ c->tocsize = sizeof(*c->toc) * c->numblocks; ++ ALLOC(c->toc,c->tocsize); ++ OP(read_all(c->fh,c->toc,c->tocsize)); /* read Data Index */ ++ } ++ build_index(c->toc, c->numblocks); + c->cblocksizecur=0; + c->curblock=-1; + return 0; +@@ -79,10 +101,10 @@ + if(page>=c->numblocks){errno=EFAULT;return -1;} + c->curblock=page; + +- bprintf("Seeking to 0x%Lx\n",btc(c->toc[page])); +- OP(lseek(c->fh,btc(c->toc[page]), SEEK_SET)); ++ bprintf("Seeking to 0x%Lx\n",c->toc[page].offset); ++ OP(lseek(c->fh,c->toc[page].offset, SEEK_SET)); + +- c->cblocksize=btc(c->toc[page+1]) - btc(c->toc[page]); ++ c->cblocksize=c->toc[page].size; + bprintf("Compressed size=%lu\n",c->cblocksize); + if(c->cblocksize > c->cblocksizecur){ + if(c->cblocksizecur)free(c->cblock); + +--- extract_compressed_fs.c ++++ extract_compressed_fs.c +@@ -1,19 +1,23 @@ + /* Extracts a filesystem back from a compressed fs file */ ++#define _LARGEFILE64_SOURCE + #include "common_header.h" ++#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" + + int main(int argc, char *argv[]) + { + int handle; + struct cloop_head head; + unsigned int i; ++ unsigned long num_blocks, block_size, zblock_maxsize, lastlen = 0; + unsigned char *buffer, *clear_buffer; ++ struct block_info *offsets; + +- if (argc != 2) { +- fprintf(stderr, "Need filename\n"); ++ if (argc < 2 || argv[1][0] == '-') { ++ fprintf(stderr, "Usage: extract_compressed_fs file [--convert-to-v2] > output\n"); + exit(1); + } + +- handle = open(argv[1], O_RDONLY); ++ handle = open(argv[1], O_RDONLY|O_LARGEFILE); + if (handle < 0) { + perror("Opening compressed file\n"); + exit(1); +@@ -24,66 +28,100 @@ + exit(1); + } + +- buffer = malloc(ntohl(head.block_size) + ntohl(head.block_size)/1000 +- + 12 + 4); +- clear_buffer = malloc(ntohl(head.block_size)); +- fprintf(stderr, "%u blocks of size %u. Preamble:\n%s\n", +- ntohl(head.num_blocks), ntohl(head.block_size), head.preamble); ++ num_blocks = ntohl(head.num_blocks); ++ block_size = ntohl(head.block_size); ++ zblock_maxsize = block_size + block_size/1000 + 12 + 4; ++ buffer = malloc(zblock_maxsize); ++ clear_buffer = malloc(block_size); + +- for (i = 0; i < ntohl(head.num_blocks); i++) { +- int currpos; +- unsigned long destlen = ntohl(head.block_size); +- loff_t offset[2]; +- unsigned int size; ++ if (num_blocks == (unsigned long) -1) { ++ void *table; ++ struct cloop_tail tail; ++ unsigned long len, table_size; ++ loff_t end = lseek64(handle, 0, SEEK_END); ++ ++ if (lseek64(handle, end - sizeof(tail), SEEK_SET) < 0 || ++ read(handle, &tail, sizeof(tail)) != sizeof(tail) || ++ lseek64(handle, end - sizeof(tail) - ++ ntohl(tail.table_size), SEEK_SET) < 0) { ++ perror("Reading tail\n"); ++ exit(1); ++ } ++ head.num_blocks = tail.num_blocks; ++ num_blocks = ntohl(head.num_blocks); ++ table_size = ntohl(tail.table_size); ++ table = malloc(table_size); ++ len = i = num_blocks * (ntohl(tail.index_size) & 255); ++ lastlen = ntohl(tail.index_size) / 256; ++ offsets = malloc(num_blocks * sizeof(*offsets)); ++ if (!table || !offsets || ++ read(handle, table, table_size) != table_size || ++ uncompress((void *)offsets, &len, table, table_size) != Z_OK || ++ len != i) { ++ perror("Reading index\n"); ++ exit(1); ++ } ++ free(table); ++ } ++ else { ++ offsets = malloc(i = num_blocks * sizeof(*offsets)); ++ if (!offsets || read(handle, offsets, i) != i) { ++ perror("Reading index\n"); ++ exit(1); ++ } ++ } ++ ++ fprintf(stderr, "%lu blocks of size %lu. Preamble:\n%s\n", ++ num_blocks, block_size, head.preamble); ++ fprintf(stderr, "Index %s.\n", build_index(offsets, num_blocks)); ++ ++ if (argc > 2) { ++ unsigned n; ++ loff_t data, offset = ((num_blocks + 1) * sizeof(offset)) + sizeof(head); ++ ++ strcpy(head.preamble, CLOOP_PREAMBLE); ++ write(STDOUT_FILENO, &head, n = sizeof(head)); ++ for (i = 0; i < num_blocks; i++) { ++ data = __be64_to_cpu(offset); ++ write(STDOUT_FILENO, &data, sizeof(data)); ++ n += sizeof(data); ++ offset += offsets[i].size; ++ } ++ data = __be64_to_cpu(offset); ++ write(STDOUT_FILENO, &data, sizeof(data)); ++ for (i = 0; i < num_blocks && lseek64(handle, offsets[i].offset, SEEK_SET) >= 0; i++) { ++ read(handle, buffer, offsets[i].size); ++ write(STDOUT_FILENO, buffer, offsets[i].size); ++ n += offsets[i].size; ++ } ++ n &= 0x1FF; ++ if (n) { ++ memset(buffer, 0, 512); ++ write(STDOUT_FILENO, buffer, 512 - n); ++ } ++ return 0; ++ } ++ ++ for (i = 0; i < num_blocks; i++) { ++ unsigned long destlen = block_size; ++ unsigned int size = offsets[i].size; + +- read(handle, &offset, 2*sizeof(loff_t)); +- lseek(handle, -sizeof(loff_t), SEEK_CUR); +- +- currpos = lseek(handle, 0, SEEK_CUR); +- if (lseek(handle, __be64_to_cpu(offset[0]), SEEK_SET) < 0) { ++ if (lseek64(handle, offsets[i].offset, SEEK_SET) < 0) { + fprintf(stderr, "lseek to %Lu: %s\n", +- __be64_to_cpu(offset[0]), strerror(errno)); ++ offsets[i].offset, strerror(errno)); + exit(1); + } + +- size=__be64_to_cpu(offset[1])-__be64_to_cpu(offset[0]); +- if (size > ntohl(head.block_size) + ntohl(head.block_size)/1000 +- + 12 + 4) { ++ if (size > zblock_maxsize) { + fprintf(stderr, + "Size %u for block %u (offset %Lu) too big\n", +- size, i, __be64_to_cpu(offset[0])); ++ size, i, offsets[i].offset); + exit(1); + } + read(handle, buffer, size); +- if (lseek(handle, currpos, SEEK_SET) < 0) { +- perror("seeking"); +- exit(1); +- } + +- fprintf(stderr, "Block %u length %u => %lu\n", +- i, size, destlen); +- if (i == 3) { +- fprintf(stderr, +- "Block head:%02X%02X%02X%02X%02X%02X%02X%02X\n", +- buffer[0], +- buffer[1], +- buffer[2], +- buffer[3], +- buffer[4], +- buffer[5], +- buffer[6], +- buffer[7]); +- fprintf(stderr, +- "Block tail:%02X%02X%02X%02X%02X%02X%02X%02X\n", +- buffer[3063], +- buffer[3064], +- buffer[3065], +- buffer[3066], +- buffer[3067], +- buffer[3068], +- buffer[3069], +- buffer[3070]); +- } ++ fprintf(stderr, "Block %u at %llu length %u", ++ i, offsets[i].offset, size); + switch (uncompress(clear_buffer, &destlen, + buffer, size)) { + case Z_OK: +@@ -105,12 +143,13 @@ + fprintf(stderr, "Uncomp: unknown error %u\n", i); + exit(1); + } +- if (destlen != ntohl(head.block_size)) { +- fprintf(stderr, "Uncomp: bad len %u (%lu not %u)\n", i, +- destlen, ntohl(head.block_size)); ++ fprintf(stderr, " => %lu\n", destlen); ++ if (destlen != block_size && i != num_blocks - 1) { ++ fprintf(stderr, "Uncomp: bad len %u (%lu not %lu)\n", i, ++ destlen, block_size); + exit(1); + } +- write(STDOUT_FILENO, clear_buffer, ntohl(head.block_size)); ++ write(STDOUT_FILENO, clear_buffer, (lastlen != 0 && (i+1) == num_blocks) ? lastlen : block_size); + } + return 0; + } +--- Makefile ++++ Makefile +@@ -1,16 +1,19 @@ + PROGNAME=fusecloop + ARCFILES=*.c *.h *.pl Makefile configure README VERSION HELP INSTALL typescript *.cloop COPYING +-PROGS=fusecloop cloopreaderdemo extract_compressed_fs ++PROGS=fusecloop cloopreaderdemo extract_compressed_fs create_compressed_fs + FUSECFLAGS=`pkg-config fuse --cflags` + FUSELDFLAGS=`pkg-config fuse --libs` + + CFLAGS= -Wall + +-all: fusecloop extract_compressed_fs ++all: fusecloop extract_compressed_fs create_compressed_fs + + extract_compressed_fs: extract_compressed_fs.c + ${CC} ${CFLAGS} ${LDFLAGS} -lz extract_compressed_fs.c -o extract_compressed_fs + ++create_compressed_fs: create_compressed_fs.c md5sum.c ++ ${CC} ${CFLAGS} ${LDFLAGS} -lz create_compressed_fs.c -o create_compressed_fs ++ + fusecloop: fusecloop.c cloopreader.o strver debug.o + ${CC} ${CFLAGS} ${LDFLAGS} -lz cloopreader.o ${FUSECFLAGS} ${FUSELDFLAGS} fusecloop.c debug.o -o fusecloop + + + +--- md5sum.c ++++ md5sum.c +@@ -0,0 +1,246 @@ ++/* ++ * Based on busybox code. ++ * ++ * Compute MD5 checksum of strings according to the ++ * definition of MD5 in RFC 1321 from April 1992. ++ * ++ * Written by Ulrich Drepper , 1995. ++ * ++ * Copyright (C) 1995-1999 Free Software Foundation, Inc. ++ * Copyright (C) 2001 Manuel Novoa III ++ * Copyright (C) 2003 Glenn L. McGrath ++ * Copyright (C) 2003 Erik Andersen ++ * Copyright (C) 2010 Denys Vlasenko ++ * Copyright (C) 2012 Pascal Bellard ++ * ++ * Licensed under GPLv2 or later ++ */ ++ ++#define ALIGN1 ++ ++static uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */ ++static uint64_t total64; /* must be directly before hash[] */ ++static uint32_t hash[8]; /* 4 elements for md5, 5 for sha1, 8 for sha256 */ ++ ++/* Emit a string of hex representation of bytes */ ++static char* bin2hex(char *p) ++{ ++ static const char bb_hexdigits_upcase[] ALIGN1 = "0123456789abcdef"; ++ int count = 16; ++ const char *cp = (const char *) hash; ++ while (count) { ++ unsigned char c = *cp++; ++ /* put lowercase hex digits */ ++ *p++ = bb_hexdigits_upcase[c >> 4]; ++ *p++ = bb_hexdigits_upcase[c & 0xf]; ++ count--; ++ } ++ return p; ++} ++ ++//#define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n)))) ++static uint32_t rotl32(uint32_t x, unsigned n) ++{ ++ return (x << n) | (x >> (32 - n)); ++} ++ ++static void md5_process_block64(void); ++ ++/* Feed data through a temporary buffer. ++ * The internal buffer remembers previous data until it has 64 ++ * bytes worth to pass on. ++ */ ++static void common64_hash(const void *buffer, size_t len) ++{ ++ unsigned bufpos = total64 & 63; ++ ++ total64 += len; ++ ++ while (1) { ++ unsigned remaining = 64 - bufpos; ++ if (remaining > len) ++ remaining = len; ++ /* Copy data into aligned buffer */ ++ memcpy(wbuffer + bufpos, buffer, remaining); ++ len -= remaining; ++ buffer = (const char *)buffer + remaining; ++ bufpos += remaining; ++ /* clever way to do "if (bufpos != 64) break; ... ; bufpos = 0;" */ ++ bufpos -= 64; ++ if (bufpos != 0) ++ break; ++ /* Buffer is filled up, process it */ ++ md5_process_block64(); ++ /*bufpos = 0; - already is */ ++ } ++} ++ ++/* Process the remaining bytes in the buffer */ ++static void common64_end(void) ++{ ++ unsigned bufpos = total64 & 63; ++ /* Pad the buffer to the next 64-byte boundary with 0x80,0,0,0... */ ++ wbuffer[bufpos++] = 0x80; ++ ++ /* This loop iterates either once or twice, no more, no less */ ++ while (1) { ++ unsigned remaining = 64 - bufpos; ++ memset(wbuffer + bufpos, 0, remaining); ++ /* Do we have enough space for the length count? */ ++ if (remaining >= 8) { ++ /* Store the 64-bit counter of bits in the buffer */ ++ uint64_t t = total64 << 3; ++ /* wbuffer is suitably aligned for this */ ++ *(uint64_t *) (&wbuffer[64 - 8]) = t; ++ } ++ md5_process_block64(); ++ if (remaining >= 8) ++ break; ++ bufpos = 0; ++ } ++} ++ ++/* These are the four functions used in the four steps of the MD5 algorithm ++ * and defined in the RFC 1321. The first function is a little bit optimized ++ * (as found in Colin Plumbs public domain implementation). ++ * #define FF(b, c, d) ((b & c) | (~b & d)) ++ */ ++#undef FF ++#undef FG ++#undef FH ++#undef FI ++#define FF(b, c, d) (d ^ (b & (c ^ d))) ++#define FG(b, c, d) FF(d, b, c) ++#define FH(b, c, d) (b ^ c ^ d) ++#define FI(b, c, d) (c ^ (b | ~d)) ++ ++/* Hash a single block, 64 bytes long and 4-byte aligned */ ++static void md5_process_block64(void) ++{ ++ /* Before we start, one word to the strange constants. ++ They are defined in RFC 1321 as ++ T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64 ++ */ ++ static const uint32_t C_array[] = { ++ /* round 1 */ ++ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, ++ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, ++ 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, ++ 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, ++ /* round 2 */ ++ 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, ++ 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, ++ 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, ++ 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, ++ /* round 3 */ ++ 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, ++ 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, ++ 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05, ++ 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, ++ /* round 4 */ ++ 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, ++ 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, ++ 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, ++ 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 ++ }; ++ static const char P_array[] ALIGN1 = { ++ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ ++ 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */ ++ 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */ ++ 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */ ++ }; ++ uint32_t *words = (uint32_t *) wbuffer; ++ uint32_t A = hash[0]; ++ uint32_t B = hash[1]; ++ uint32_t C = hash[2]; ++ uint32_t D = hash[3]; ++ ++ static const char S_array[] ALIGN1 = { ++ 7, 12, 17, 22, ++ 5, 9, 14, 20, ++ 4, 11, 16, 23, ++ 6, 10, 15, 21 ++ }; ++ const uint32_t *pc; ++ const char *pp; ++ const char *ps; ++ int i; ++ uint32_t temp; ++ ++ ++ pc = C_array; ++ pp = P_array; ++ ps = S_array - 4; ++ ++ for (i = 0; i < 64; i++) { ++ if ((i & 0x0f) == 0) ++ ps += 4; ++ temp = A; ++ switch (i >> 4) { ++ case 0: ++ temp += FF(B, C, D); ++ break; ++ case 1: ++ temp += FG(B, C, D); ++ break; ++ case 2: ++ temp += FH(B, C, D); ++ break; ++ case 3: ++ temp += FI(B, C, D); ++ } ++ temp += words[(int) (*pp++)] + *pc++; ++ temp = rotl32(temp, ps[i & 3]); ++ temp += B; ++ A = D; ++ D = C; ++ C = B; ++ B = temp; ++ } ++ /* Add checksum to the starting values */ ++ hash[0] += A; ++ hash[1] += B; ++ hash[2] += C; ++ hash[3] += D; ++ ++} ++#undef FF ++#undef FG ++#undef FH ++#undef FI ++ ++/* Initialize structure containing state of computation. ++ * (RFC 1321, 3.3: Step 3) ++ */ ++static void md5_begin(void) ++{ ++ hash[0] = 0x67452301; ++ hash[1] = 0xefcdab89; ++ hash[2] = 0x98badcfe; ++ hash[3] = 0x10325476; ++ total64 = 0; ++} ++ ++/* Used also for sha1 and sha256 */ ++#define md5_hash common64_hash ++ ++/* Process the remaining bytes in the buffer and put result from CTX ++ * in first 16 bytes following RESBUF. The result is always in little ++ * endian byte order, so that a byte-wise output yields to the wanted ++ * ASCII representation of the message digest. ++ */ ++#define md5_end common64_end ++ ++typedef struct { char hash[16]; } md5hash; ++ ++static md5hash md5sum(uint8_t *buffer, int len) ++{ ++ md5hash val; ++ ++ md5_begin(); ++ md5_hash(buffer, len); ++ md5_end(); ++ memcpy(&val, hash, 16); ++ ++ return val; ++} +--- create_compressed_fs.c ++++ create_compressed_fs.c +@@ -0,0 +1,224 @@ ++#ifdef FIND_BEST_COMPRESSION ++#include ++extern "C" { ++#include ++#include ++ ++#define ZMAX 12 /* 12 compression levels with libdeflate, not 9 */ ++static shrink_t level; ++static int pass, iter; ++static int best_compress(unsigned char *compressed, ++ unsigned long *compressed_len, ++ unsigned char *uncompressed, ++ unsigned long uncompressed_len) ++{ ++ int i, j, err; ++ unsigned char *buf[2]; ++ unsigned len; ++ unsigned long llen, best = *compressed_len * 2; ++ static unsigned char *buffer; ++ static unsigned long buffersz; ++ ++ if (buffersz < *compressed_len) { ++ if (buffer) free(buffer); ++ buffer = (unsigned char *) malloc(buffersz = *compressed_len); ++ if (!buffer) return Z_MEM_ERROR; ++ } ++ buf[0] = compressed; ++ buf[1] = buffer; ++ for (i = j = 0; i <= ZMAX+2 && (pass == 0 || i < pass); i++) { ++ llen = len = *compressed_len; ++ if (i >= ZMAX+1) { ++ level.level = (i == ZMAX+1) ? shrink_extra : shrink_insane; ++ err = (compress_zlib(level, buf[j], ++ len, uncompressed, ++ uncompressed_len)) ? Z_OK : Z_DATA_ERROR; ++ } else { ++ err = compress2(buf[j], &llen, uncompressed, ++ uncompressed_len, i); ++ len = llen; ++ } ++ if (err != Z_OK) return err; ++ if (len < best) { ++ best = len; ++ j = 1 - j; ++ } ++ } ++ *compressed_len = best; ++ if (j == 0) ++ memcpy(compressed, buffer, best); ++ return err; ++} ++#define compress2(a,b,c,d,e) best_compress(a,b,c,d) ++#endif ++ ++#include ++ ++/* Creates a compressed file */ ++#include "common_header.h" ++ ++#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V3.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" ++#define CHUNK 65536 ++#define DEFAULT_BLOCKSIZE 65536 ++ ++static void quit(const char *s) ++{ ++ fprintf(stderr, "%s\n", s); ++ exit(1); ++} ++ ++static int readblock(unsigned char *buffer, int n) ++{ ++ int i; ++ ++ memset(buffer, 0, n); ++ for (i = 0 ; i < n;) { ++ int j = read(STDIN_FILENO, buffer + i, n - i); ++ if (j < 0 && errno == EINTR) continue; ++ if (j <= 0) break; ++ i += j; ++ } ++ return i; ++} ++ ++#ifdef FIND_BEST_COMPRESSION ++#include "md5sum.c" ++#endif ++ ++static unsigned n; ++static unsigned long lastlen, pos, *block_index; ++static unsigned char *compressed; ++static unsigned long block_size = 0; ++static void flush_index(int sig) ++{ ++ static char padding[512]; ++ struct cloop_tail tail; ++ unsigned long len; ++ ++ fprintf(stderr, "Write index for %lu blocks\n", n); ++ if (block_size >= 0x1000000) lastlen = 0; ++ tail.index_size = ntohl(sizeof(*block_index) + 256*(lastlen % 0xFFffFF)); ++ tail.num_blocks = ntohl(n); ++ n *= sizeof(*block_index); ++ len = n + n/1000 + 12; ++ compressed = (unsigned char *) realloc(compressed, len); ++ if (!compressed || compress2(compressed, &len, (unsigned char *) block_index, ++ n, Z_BEST_SPEED) != Z_OK) ++ quit("Index compression failed"); ++ tail.table_size = ntohl(len); ++ pos += len + sizeof(tail); ++ n = pos & 511; ++ if (n) write(STDOUT_FILENO, padding, 512 - n); ++ write(STDOUT_FILENO, compressed, len); ++ write(STDOUT_FILENO, &tail, sizeof(tail)); ++ exit(sig != 0); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ struct cloop_head head; ++ unsigned char *uncompressed; ++ unsigned long len; ++ unsigned indexmax, zlenmax; ++#ifdef FIND_BEST_COMPRESSION ++ unsigned i, j, hashmax; ++ md5hash *hash; ++#endif ++ ++#ifdef FIND_BEST_COMPRESSION ++ while (argc > 1) { ++ if (argv[1][0] == '-') { ++ int *p = &pass; ++ switch (argv[1][1]) { ++ case 'i' : p = &iter; ++ case 'n' : *p = atoi(argv[2]); ++ argc -= 2; ++ argv += 2; ++ continue; ++ } ++ } ++ argc--; ++ if (argv[1][0] < '0' || argv[1][0] > '9') ++ quit("Usage : create_compressed_fs [-n ][ -i ] [block size] < input > output"); ++#else ++ if (argc > 1) { ++ if (argv[1][0] < '0' || argv[1][0] > '9') ++ quit("Usage : create_compressed_fs [block size] < input > output"); ++#endif ++ block_size = atoi(argv[1]); ++ } ++ if (block_size < 4096) ++ block_size = DEFAULT_BLOCKSIZE; ++ fprintf(stderr, "Block size is %lu\n", block_size); ++ zlenmax = block_size + block_size/1000 + 12; ++ ++ memset(&head, 0, sizeof(head)); ++ strcpy(head.preamble, CLOOP_PREAMBLE); ++ head.num_blocks = -1; ++ head.block_size = htonl(block_size); ++ write(STDOUT_FILENO, &head, sizeof(head)); ++ pos = sizeof(head); ++ ++ compressed = (unsigned char *) malloc(zlenmax); ++ uncompressed = (unsigned char *) malloc(block_size); ++ block_index = (unsigned long *) malloc(indexmax = CHUNK); ++#ifdef FIND_BEST_COMPRESSION ++ hash = (md5hash *) malloc(hashmax = CHUNK); ++ if (!compressed || !uncompressed || !block_index || !hash) ++#else ++ if (!compressed || !uncompressed || !block_index) ++#endif ++ quit("Malloc failed"); ++ ++ signal(SIGINT,flush_index); ++ signal(SIGQUIT,flush_index); ++ signal(SIGTERM,flush_index); ++ ++ for (n = 0; (len = readblock(uncompressed, block_size)) != 0; n++) { ++ lastlen = len; ++ if (n * sizeof(*block_index) >= indexmax) { ++ block_index = (unsigned long *) realloc(block_index, ++ indexmax += CHUNK); ++ if (!block_index) ++ quit("Realloc"); ++ } ++#ifdef FIND_BEST_COMPRESSION ++ if (n * sizeof(*hash) >= hashmax) { ++ hash = (md5hash *) realloc(hash, hashmax += CHUNK); ++ if (!hash) ++ quit("Realloc hash"); ++ } ++ hash[n] = md5sum(uncompressed, len); ++ j = 0x7FFFFFFF; ++ if (n < j) ++ j = n; ++ for (i = 0; i < j; i++) { ++ if (* (uint32_t *) &hash[i] == * (uint32_t *) &hash[n] ++ && !memcmp(&hash[i],&hash[n],sizeof(*hash))) ++ break; ++ } ++ if (i != j) { ++ block_index[n] = ntohl(0x80000000 | i); ++ fprintf(stderr, "Block %u length %lu => duplicate %lu\n", ++ n, block_size, i); ++ } ++ else ++#endif ++ { ++ len = zlenmax; ++ if (compress2(compressed, &len, uncompressed, lastlen, ++ Z_BEST_SPEED) != Z_OK) ++ quit("Compression failed"); ++ fprintf(stderr, "Block %u length %lu => %lu\n", ++ n, block_size, len); ++ write(STDOUT_FILENO, compressed, len); ++ pos += len; ++ block_index[n] = ntohl(len); ++ } ++ } ++ flush_index(0); ++ return 0; ++} ++#ifdef FIND_BEST_COMPRESSION ++} ++#endif +--- fusecloop.c ++++ fusecloop.c +@@ -65,7 +65,7 @@ + + memcpy(stbuf,&stb,sizeof stb); + stbuf->st_mode&=~0222; +- stbuf->st_size = cd.blocksize * cd.numblocks; ++ stbuf->st_size = (loff_t) cd.blocksize * cd.numblocks; + /* + stbuf->st_mode = S_IFREG | 0444; + stbuf->st_nlink = 1; diff -r c7b121a4ffd9 -r d6378d455338 fusecloop/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fusecloop/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|fusecloop.u diff -r c7b121a4ffd9 -r d6378d455338 genromfs/receipt --- a/genromfs/receipt Wed May 09 17:03:28 2018 +0300 +++ b/genromfs/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,7 +14,7 @@ compile_rules() { sed -i 's|prefix)/man|prefix)/share/man|' Makefile - patch -p0 < $stuff/genromfs.u + make && make PREFIX=$DESTDIR install } diff -r c7b121a4ffd9 -r d6378d455338 genromfs/stuff/genromfs.u --- a/genromfs/stuff/genromfs.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ ---- genromfs.c -+++ genromfs.c -@@ -164,6 +164,7 @@ - uid_t nuid; - gid_t ngid; - time_t ntime; -+ nlink_t nlink; - unsigned int offset; - unsigned int realsize; - unsigned int prepad; -@@ -178,6 +179,8 @@ - int extlen; - }; - -+static int oldromfs = 1; -+ - #define EXTTYPE_UNKNOWN 0 - #define EXTTYPE_ALIGNMENT 1 - #define EXTTYPE_EXCLUDE 2 -@@ -361,7 +364,9 @@ - } - len+=16; - ri=(struct romfh *)bigbuf; -- if (n->offset) -+ if (!oldromfs) -+ ri->checksum = ntohl(n->ntime); -+ else if (n->offset) - fixsum(ri, len); - dumpdata(bigbuf, len, f); - #if 0 -@@ -373,6 +378,9 @@ - #endif - } - -+#define SIGNED_OVERFLOW(x,m) (((x) & (m)) != 0 && (((x) & (m)) | ~(m)) != ~0) -+#define SIGNED_EXTENTION(x,m) (((x) & (((m)+1)>>1)) ? (x) | ~(m) : (x) & (m)) -+ - void dumpnode(struct filenode *node, FILE *f) - { - struct romfh ri; -@@ -386,13 +394,33 @@ - - ri.nextfh = 0; - ri.spec = 0; -+ if (!oldromfs) { -+ ri.spec = node->modes & (0x0FFF ^ S_IXUSR); -+ ri.spec ^= S_IRUSR |S_IWUSR; -+ ri.spec |= node->nuid << 20; -+ ri.spec |= (node->ngid & 0xFF) << 12; -+ if (node->ngid & 0x100) -+ ri.spec |= S_IXUSR; -+ if (SIGNED_OVERFLOW(node->nuid,0xF000)) { -+ printf("%-50s : uid=%04X -> %04X \n", -+ node->realname, node->nuid, -+ (uid_t) SIGNED_EXTENTION(node->nuid,0x0FFF)); -+ } -+ if (SIGNED_OVERFLOW(node->ngid,0xFE00)) { -+ printf("%-50s : gid=%04X -> %04X \n", -+ node->realname, node->ngid, -+ (gid_t) SIGNED_EXTENTION(node->ngid,0x01FF)); -+ } -+ } -+ ri.spec = htonl(ri.spec); - ri.size = htonl(node->realsize); - ri.checksum = htonl(0x55555555); - - if (node->next && node->next->next) - ri.nextfh = htonl(node->next->offset); - if ((node->modes & 0111) && -- (S_ISDIR(node->modes) || S_ISREG(node->modes))) -+ (S_ISDIR(node->modes) || S_ISREG(node->modes) || -+ (!oldromfs && (S_ISCHR(node->modes) || S_ISBLK(node->modes))))) - ri.nextfh |= htonl(ROMFH_EXEC); - - if (node->orig_link) { -@@ -403,11 +431,17 @@ - dumpri(&ri, node, f); - } else if (S_ISDIR(node->modes)) { - ri.nextfh |= htonl(ROMFH_DIR); -+ if (!oldromfs) -+ ri.size = ri.spec; - if (listisempty(&node->dirlist)) { - ri.spec = htonl(node->offset); - } else { - ri.spec = htonl(node->dirlist.head->offset); - } -+ if (node->nlink > 0xf) -+ node->nlink = 0xf; -+ if (!oldromfs) -+ ri.spec |= htonl(node->nlink); - dumpri(&ri, node, f); - } else if (S_ISLNK(node->modes)) { - ri.nextfh |= htonl(ROMFH_LNK); -@@ -464,10 +498,14 @@ - } - } else if (S_ISCHR(node->modes)) { - ri.nextfh |= htonl(ROMFH_CHR); -+ if (!oldromfs) -+ ri.size = ri.spec; - ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode)); - dumpri(&ri, node, f); - } else if (S_ISBLK(node->modes)) { - ri.nextfh |= htonl(ROMFH_BLK); -+ if (!oldromfs) -+ ri.size = ri.spec; - ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode)); - dumpri(&ri, node, f); - } else if (S_ISFIFO(node->modes)) { -@@ -522,6 +560,7 @@ - n->nuid = sb->st_uid; - n->ngid = sb->st_gid; - n->ntime = sb->st_mtime; -+ n->nlink = sb->st_nlink; - n->realsize = 0; - /* only regular files and symlinks contain "data" in romfs */ - if (S_ISREG(n->modes) || S_ISLNK(n->modes)) { -@@ -574,6 +613,9 @@ - node->ondev = -1; - node->onino = -1; - node->modes = -1; -+ node->realsize = 0; -+ node->devnode = 0; -+ node->orig_link = NULL; - node->offset = curroffset; - node->align = DEFALIGN; - -@@ -935,6 +977,7 @@ - printf("\n"); - printf(" -f IMAGE Output the image into this file\n"); - printf(" -d DIRECTORY Use this directory as source\n"); -+ printf(" -t Time, uid & gid support (backward compatible)\n"); - printf(" -v (Too) verbose operation\n"); - printf(" -V VOLUME Use the specified volume name\n"); - printf(" -a ALIGN Align regular file data to ALIGN bytes\n"); -@@ -971,6 +1014,9 @@ - break; - case 'V': - volname = optarg; -+ break; -+ case 't': -+ oldromfs = 0; - break; - case 'v': - verbose = 1; diff -r c7b121a4ffd9 -r d6378d455338 genromfs/stuff/patches/genromfs.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genromfs/stuff/patches/genromfs.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,144 @@ +--- genromfs.c ++++ genromfs.c +@@ -164,6 +164,7 @@ + uid_t nuid; + gid_t ngid; + time_t ntime; ++ nlink_t nlink; + unsigned int offset; + unsigned int realsize; + unsigned int prepad; +@@ -178,6 +179,8 @@ + int extlen; + }; + ++static int oldromfs = 1; ++ + #define EXTTYPE_UNKNOWN 0 + #define EXTTYPE_ALIGNMENT 1 + #define EXTTYPE_EXCLUDE 2 +@@ -361,7 +364,9 @@ + } + len+=16; + ri=(struct romfh *)bigbuf; +- if (n->offset) ++ if (!oldromfs) ++ ri->checksum = ntohl(n->ntime); ++ else if (n->offset) + fixsum(ri, len); + dumpdata(bigbuf, len, f); + #if 0 +@@ -373,6 +378,9 @@ + #endif + } + ++#define SIGNED_OVERFLOW(x,m) (((x) & (m)) != 0 && (((x) & (m)) | ~(m)) != ~0) ++#define SIGNED_EXTENTION(x,m) (((x) & (((m)+1)>>1)) ? (x) | ~(m) : (x) & (m)) ++ + void dumpnode(struct filenode *node, FILE *f) + { + struct romfh ri; +@@ -386,13 +394,33 @@ + + ri.nextfh = 0; + ri.spec = 0; ++ if (!oldromfs) { ++ ri.spec = node->modes & (0x0FFF ^ S_IXUSR); ++ ri.spec ^= S_IRUSR |S_IWUSR; ++ ri.spec |= node->nuid << 20; ++ ri.spec |= (node->ngid & 0xFF) << 12; ++ if (node->ngid & 0x100) ++ ri.spec |= S_IXUSR; ++ if (SIGNED_OVERFLOW(node->nuid,0xF000)) { ++ printf("%-50s : uid=%04X -> %04X \n", ++ node->realname, node->nuid, ++ (uid_t) SIGNED_EXTENTION(node->nuid,0x0FFF)); ++ } ++ if (SIGNED_OVERFLOW(node->ngid,0xFE00)) { ++ printf("%-50s : gid=%04X -> %04X \n", ++ node->realname, node->ngid, ++ (gid_t) SIGNED_EXTENTION(node->ngid,0x01FF)); ++ } ++ } ++ ri.spec = htonl(ri.spec); + ri.size = htonl(node->realsize); + ri.checksum = htonl(0x55555555); + + if (node->next && node->next->next) + ri.nextfh = htonl(node->next->offset); + if ((node->modes & 0111) && +- (S_ISDIR(node->modes) || S_ISREG(node->modes))) ++ (S_ISDIR(node->modes) || S_ISREG(node->modes) || ++ (!oldromfs && (S_ISCHR(node->modes) || S_ISBLK(node->modes))))) + ri.nextfh |= htonl(ROMFH_EXEC); + + if (node->orig_link) { +@@ -403,11 +431,17 @@ + dumpri(&ri, node, f); + } else if (S_ISDIR(node->modes)) { + ri.nextfh |= htonl(ROMFH_DIR); ++ if (!oldromfs) ++ ri.size = ri.spec; + if (listisempty(&node->dirlist)) { + ri.spec = htonl(node->offset); + } else { + ri.spec = htonl(node->dirlist.head->offset); + } ++ if (node->nlink > 0xf) ++ node->nlink = 0xf; ++ if (!oldromfs) ++ ri.spec |= htonl(node->nlink); + dumpri(&ri, node, f); + } else if (S_ISLNK(node->modes)) { + ri.nextfh |= htonl(ROMFH_LNK); +@@ -464,10 +498,14 @@ + } + } else if (S_ISCHR(node->modes)) { + ri.nextfh |= htonl(ROMFH_CHR); ++ if (!oldromfs) ++ ri.size = ri.spec; + ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode)); + dumpri(&ri, node, f); + } else if (S_ISBLK(node->modes)) { + ri.nextfh |= htonl(ROMFH_BLK); ++ if (!oldromfs) ++ ri.size = ri.spec; + ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode)); + dumpri(&ri, node, f); + } else if (S_ISFIFO(node->modes)) { +@@ -522,6 +560,7 @@ + n->nuid = sb->st_uid; + n->ngid = sb->st_gid; + n->ntime = sb->st_mtime; ++ n->nlink = sb->st_nlink; + n->realsize = 0; + /* only regular files and symlinks contain "data" in romfs */ + if (S_ISREG(n->modes) || S_ISLNK(n->modes)) { +@@ -574,6 +613,9 @@ + node->ondev = -1; + node->onino = -1; + node->modes = -1; ++ node->realsize = 0; ++ node->devnode = 0; ++ node->orig_link = NULL; + node->offset = curroffset; + node->align = DEFALIGN; + +@@ -935,6 +977,7 @@ + printf("\n"); + printf(" -f IMAGE Output the image into this file\n"); + printf(" -d DIRECTORY Use this directory as source\n"); ++ printf(" -t Time, uid & gid support (backward compatible)\n"); + printf(" -v (Too) verbose operation\n"); + printf(" -V VOLUME Use the specified volume name\n"); + printf(" -a ALIGN Align regular file data to ALIGN bytes\n"); +@@ -971,6 +1014,9 @@ + break; + case 'V': + volname = optarg; ++ break; ++ case 't': ++ oldromfs = 0; + break; + case 'v': + verbose = 1; diff -r c7b121a4ffd9 -r d6378d455338 genromfs/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genromfs/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|genromfs.u diff -r c7b121a4ffd9 -r d6378d455338 ghex/receipt --- a/ghex/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ghex/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,9 +18,6 @@ compile_rules() { export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lm" - # GHex2 cannot display help without Yelp. Removing help references. - patch -Np1 -i $stuff/ghex2-remove-help.patch - ./configure \ --disable-schemas-install \ --disable-scrollkeeper \ diff -r c7b121a4ffd9 -r d6378d455338 ghex/stuff/ghex2-remove-help.patch --- a/ghex/stuff/ghex2-remove-help.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ ---- a/src/preferences.c -+++ b/src/preferences.c -@@ -74,10 +74,6 @@ - GTK_STOCK_CLOSE, - GTK_RESPONSE_CLOSE); - -- gtk_dialog_add_button (GTK_DIALOG (pui->pbox), -- GTK_STOCK_HELP, -- GTK_RESPONSE_HELP); -- - g_signal_connect(G_OBJECT(pui->pbox), "response", - G_CALLBACK(prefs_response_cb), pui); - ---- a/src/ghex-ui.xml -+++ b/src/ghex-ui.new -@@ -215,7 +215,7 @@ - - - -- -+ - - - diff -r c7b121a4ffd9 -r d6378d455338 ghex/stuff/patches/ghex2-remove-help.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ghex/stuff/patches/ghex2-remove-help.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,24 @@ +--- a/src/preferences.c ++++ b/src/preferences.c +@@ -74,10 +74,6 @@ + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE); + +- gtk_dialog_add_button (GTK_DIALOG (pui->pbox), +- GTK_STOCK_HELP, +- GTK_RESPONSE_HELP); +- + g_signal_connect(G_OBJECT(pui->pbox), "response", + G_CALLBACK(prefs_response_cb), pui); + +--- a/src/ghex-ui.xml ++++ b/src/ghex-ui.new +@@ -215,7 +215,7 @@ + + + +- ++ + + + diff -r c7b121a4ffd9 -r d6378d455338 ghex/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ghex/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# GHex2 cannot display help without Yelp. Removing help references. +ghex2-remove-help.patch diff -r c7b121a4ffd9 -r d6378d455338 gmrun/receipt --- a/gmrun/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gmrun/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,15 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - while read file; do - [ -f done.$file ] && continue - echo "Apply $file..." - patch -p1 < $stuff/$file || return 1 - touch done.$file - done < - #include - #include -+#include - #include - using namespace std; - ---- gmrun-0.9.2/src/ci_string.h.orig 2001-05-16 16:39:31.000000000 +0200 -+++ gmrun-0.9.2/src/ci_string.h 2008-05-08 08:51:33.000000000 +0200 -@@ -7,6 +7,7 @@ - #define __CI_STRING_H__ - - #include -+#include - #include - - struct ci_char_traits : public std::char_traits ---- gmrun-0.9.2/src/prefs.cc.orig 2002-08-16 12:48:22.000000000 +0200 -+++ gmrun-0.9.2/src/prefs.cc 2008-05-08 08:51:54.000000000 +0200 -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include - ---- gmrun-0.9.2/src/main.cc.orig 2003-11-16 11:55:07.000000000 +0100 -+++ gmrun-0.9.2/src/main.cc 2008-05-08 09:03:11.000000000 +0200 -@@ -14,6 +14,7 @@ - #include - - #include -+#include - #include - #include - #include ---- gmrun-0.9.2/src/gtkcompletionline.cc.orig Mon Jun 22 20:36:52 2009 -+++ gmrun-0.9.2/src/gtkcompletionline.cc Mon Jun 22 20:43:37 2009 -@@ -377,7 +377,7 @@ - return 0; - } - --int my_alphasort(const void* va, const void* vb) { -+int my_alphasort(const dirent** va, const dirent** vb) { - const struct dirent** a = (const struct dirent**)va; - const struct dirent** b = (const struct dirent**)vb; - diff -r c7b121a4ffd9 -r d6378d455338 gmrun/stuff/patches/gmrun-0.9.2-gcc43.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmrun/stuff/patches/gmrun-0.9.2-gcc43.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,51 @@ +--- gmrun-0.9.2/src/gtkcompletionline.cc.orig 2003-11-16 11:55:07.000000000 +0100 ++++ gmrun-0.9.2/src/gtkcompletionline.cc 2008-05-08 08:51:22.000000000 +0200 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + using namespace std; + +--- gmrun-0.9.2/src/ci_string.h.orig 2001-05-16 16:39:31.000000000 +0200 ++++ gmrun-0.9.2/src/ci_string.h 2008-05-08 08:51:33.000000000 +0200 +@@ -7,6 +7,7 @@ + #define __CI_STRING_H__ + + #include ++#include + #include + + struct ci_char_traits : public std::char_traits +--- gmrun-0.9.2/src/prefs.cc.orig 2002-08-16 12:48:22.000000000 +0200 ++++ gmrun-0.9.2/src/prefs.cc 2008-05-08 08:51:54.000000000 +0200 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #include + +--- gmrun-0.9.2/src/main.cc.orig 2003-11-16 11:55:07.000000000 +0100 ++++ gmrun-0.9.2/src/main.cc 2008-05-08 09:03:11.000000000 +0200 +@@ -14,6 +14,7 @@ + #include + + #include ++#include + #include + #include + #include +--- gmrun-0.9.2/src/gtkcompletionline.cc.orig Mon Jun 22 20:36:52 2009 ++++ gmrun-0.9.2/src/gtkcompletionline.cc Mon Jun 22 20:43:37 2009 +@@ -377,7 +377,7 @@ + return 0; + } + +-int my_alphasort(const void* va, const void* vb) { ++int my_alphasort(const dirent** va, const dirent** vb) { + const struct dirent** a = (const struct dirent**)va; + const struct dirent** b = (const struct dirent**)vb; + diff -r c7b121a4ffd9 -r d6378d455338 gmrun/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmrun/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|gmrun-0.9.2-gcc43.patch diff -r c7b121a4ffd9 -r d6378d455338 gpxe/receipt --- a/gpxe/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gpxe/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,12 +17,6 @@ compile_rules() { cd $src/src - for i in prefix.u default_boot.u cmdline.u url_list.u gcc.u; do - [ -f done.$i ] && continue - echo "Apply $i..." - patch -p2 < $stuff/$i || return 1 - touch done.$i - done sed -i 's/ = ++ns->cur_rx %/++; ns->cur_rx %=/' drivers/net/ns83820.c sed -i 's/ = (++tp->cur_rx) %/++; tp->cur_rx %=/' drivers/net/tulip.c sed -i 's/? s : ___strtok//' core/stringextra.c diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/cmdline.u --- a/gpxe/stuff/cmdline.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -@@ -77,7 +77,9 @@ - popw %ax - addw $(0x100/16), %ax /* Adjust cs */ - pushw %ax -- jmp go_setup_code -+ pushw $run_etherboot_floppy -+ /* Calculated lcall to _start with %cs:0000 = image start */ -+ lret - - bootsector: - jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ -@@ -197,7 +199,7 @@ - */ - - /* Jump to loaded copy */ -- ljmp $SYSSEG, $run_etherboot2 -+ ljmp $SYSSEG, $run_etherboot_floppy - - endseg: .word SYSSEG + _load_size_pgh - .section ".zinfo.fixup", "a" /* Compressor fixup information */ -@@ -436,8 +438,7 @@ - * we just have to ensure that %cs:0000 is where the start of - * the Etherboot image *would* be. - */ --go_setup_code: -- pushw $run_etherboot -+ pushw $run_etherboot_zImage - /* Calculated lcall to _start with %cs:0000 = image start */ - lret - -@@ -448,7 +449,25 @@ - /* - We're now at the beginning of the kernel proper. - */ --run_etherboot2: -+run_etherboot_zImage: -+ mov $0x0020, %si -+ lodsw -+ cmp $0xA33F, %ax -+ jne run_etherboot -+ lodsw -+ xchg %ax, %si -+ cmpb (%si),%ah -+ je run_etherboot -+ push %ds -+ pop %es -+ movw $boot_url, %di -+copy_cmdline: -+ lodsb -+ stosb -+ or %al, %al -+ jne copy_cmdline -+ jmp run_etherboot -+run_etherboot_floppy: - push %cs - pop %ds - run_etherboot: - ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -@@ -461,6 +461,15 @@ - push %ds - pop %es - movw $boot_url, %di -+ cmpw $0x4F42,(%si) /* skip BOOT_IMAGE=.... */ -+ jne copy_cmdline -+skip_arg: -+ lodsb -+ testb $0xDF, %al -+ jne skip_arg -+ or %al, %al -+ jne copy_cmdline -+ decw %si - copy_cmdline: - lodsb - stosb - ---- gpxe-0.9.3/src/net/udp/dns.c -+++ gpxe-0.9.3/src/net/udp/dns.c -@@ -506,6 +506,19 @@ - .resolv = dns_resolv, - }; - -+int apply_nameserver(struct in_addr sin_addr) -+{ -+ struct sockaddr_in *sin_nameserver; -+ -+ sin_nameserver = ( struct sockaddr_in * ) &nameserver; -+ sin_nameserver->sin_family = AF_INET; -+ sin_nameserver->sin_addr = sin_addr; -+ DBG ( "DNS using nameserver %s\n", -+ inet_ntoa ( sin_addr ) ); -+ -+ return 0; -+} -+ - /** - * Apply DHCP nameserver option - * -@@ -514,16 +527,10 @@ - */ - static int apply_dhcp_nameserver ( unsigned int tag __unused, - struct dhcp_option *option ) { -- struct sockaddr_in *sin_nameserver; -- -- sin_nameserver = ( struct sockaddr_in * ) &nameserver; -- sin_nameserver->sin_family = AF_INET; -- dhcp_ipv4_option ( option, &sin_nameserver->sin_addr ); -- -- DBG ( "DNS using nameserver %s\n", -- inet_ntoa ( sin_nameserver->sin_addr ) ); -+ struct in_addr sin_addr; - -- return 0; -+ dhcp_ipv4_option ( option, &sin_addr ); -+ return apply_nameserver(sin_addr); - } - - /** DHCP nameserver applicator */ - ---- gpxe-0.9.3/src/usr/autoboot.c -+++ gpxe-0.9.3/src/usr/autoboot.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -150,16 +151,68 @@ - */ - static int netboot ( struct net_device *netdev ) { - char buf[256]; -- int rc; -+ int rc, nodhcp; -+ char *ip, *gw, *dns, *s; -+ extern int apply_nameserver(struct in_addr sin_addr); - - /* Open device and display device status */ - if ( ( rc = ifopen ( netdev ) ) != 0 ) - return rc; - ifstat ( netdev ); - -+ ip = gw = dns = NULL; -+ nodhcp = 0; -+ for (s = forced_url.url; *s && s < forced_url.url + 256;) { -+ while (*s == ' ') s++; -+ if (!strncmp(s,"ip=",3)) ip = s + 3, *s++ = 0; -+ if (!strncmp(s,"gw=",3)) gw = s + 3, *s++ = 0; -+ if (!strncmp(s,"dns=",4)) dns = s + 4, *s++ = 0; -+ if (!strncmp(s,"nodhcp",5)) nodhcp++, *s++ = 0; -+ if (!strncmp(s,"url=",4)) { -+ char *p = forced_url.url; -+ for (s += 4; *s && *s != ' '; *p++ = *s++); -+ *p = 0; -+ } -+ while (*s && *s != ' ') s++; -+ *s++ = 0; -+ } -+ - /* Configure device via DHCP */ -- if ( ( rc = dhcp ( netdev ) ) != 0 ) -- return rc; -+ if (forced_url.url[0]) printf("url=%s\n",forced_url.url); -+ if ( nodhcp || ( rc = dhcp ( netdev ) ) != 0 ) { -+#define IN_CLASSA(x) (( (x).s_addr & 0x80000000) == 0) -+#define IN_CLASSB(x) (( (x).s_addr & 0xc0000000) == 0x80000000) -+#define IN_CLASSA_NET 0xff000000 -+#define IN_CLASSB_NET 0xffff0000 -+#define IN_CLASSC_NET 0xffffff00 -+#define IN_CLASSLESS_NET(x) (0xffffffff << (32 - (x))) -+ struct in_addr address, netmask, gateway, nameserver; -+ char *p; -+ -+ if (!ip || !gw || !inet_aton(gw, &gateway)) -+ return rc; -+ p = strchr(ip,'/'); -+ if (p) *p++ = 0; -+ if (!inet_aton(ip, &address)) -+ return rc; -+ if (p) { -+ int n; -+ for (n = 0; *p >= '0' && *p <= '9'; -+ n *= 10, n += *p++ - 10); -+ netmask.s_addr = IN_CLASSLESS_NET(n); -+ } -+ else if (IN_CLASSA(address)) netmask.s_addr = IN_CLASSA_NET; -+ else if (IN_CLASSB(address)) netmask.s_addr = IN_CLASSB_NET; -+ else netmask.s_addr = IN_CLASSC_NET; -+ del_ipv4_address ( netdev ); -+ if ( ( rc = add_ipv4_address ( netdev, address, netmask, -+ gateway ) ) != 0 ) { -+ return rc; -+ } -+ if (dns) printf("dns=%s\n",dns); -+ if (dns && inet_aton(dns, &nameserver)) -+ apply_nameserver(nameserver); -+ } - route(); - - /* Try to boot an embedded image if we have one */ diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/default_boot.u --- a/gpxe/stuff/default_boot.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,390 +0,0 @@ ---- gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c -+++ gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c -@@ -96,6 +96,8 @@ - PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * ); - PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * ); - PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * ); -+ PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * ); -+ PXENV_EXIT_t ( * file_api_check ) ( struct s_PXENV_FILE_API_CHECK * ); - }; - - /** -@@ -294,6 +296,14 @@ - pxenv_call.get_file_size = pxenv_get_file_size; - param_len = sizeof ( pxenv_any.get_file_size ); - break; -+ case PXENV_FILE_EXEC: -+ pxenv_call.file_exec = pxenv_file_exec; -+ param_len = sizeof ( pxenv_any.file_exec ); -+ break; -+ case PXENV_FILE_API_CHECK: -+ pxenv_call.file_api_check = pxenv_file_api_check; -+ param_len = sizeof ( pxenv_any.file_api_check ); -+ break; - default: - DBG ( "PXENV_UNKNOWN_%hx", opcode ); - pxenv_call.unknown = pxenv_unknown; - ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -@@ -197,7 +197,7 @@ - */ - - /* Jump to loaded copy */ -- ljmp $SYSSEG, $run_etherboot -+ ljmp $SYSSEG, $run_etherboot2 - - endseg: .word SYSSEG + _load_size_pgh - .section ".zinfo.fixup", "a" /* Compressor fixup information */ -@@ -441,11 +441,16 @@ - /* Calculated lcall to _start with %cs:0000 = image start */ - lret - -+boot_url: -+ .space 256, 0 - - .org PREFIXSIZE - /* - We're now at the beginning of the kernel proper. - */ -+run_etherboot2: -+ push %cs -+ pop %ds - run_etherboot: - call install - -@@ -453,6 +458,13 @@ - movw %bx, %ss - movw $_estack16, %sp - -+ /* Copy our boot_url structure to the forced_url variable */ -+ movw %bx, %es -+ movw $forced_url, %di -+ movw $boot_url, %si -+ movw $256, %cx -+ rep movsb -+ - /* Jump to .text16 segment */ - pushw %ax - pushw $1f ---- gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S -+++ gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S -@@ -19,6 +19,9 @@ - .section ".prefix" - /* Set up our non-stack segment registers */ - jmp $0x7c0, $1f -+#define PXELOADER_KEEP_UNDI -+boot_url: -+ .space 256, 0 - 1: movw %cs, %ax - movw %ax, %ds - movw $0x40, %ax /* BIOS data segment access */ -@@ -703,16 +706,22 @@ - /* Set up real-mode stack */ - movw %bx, %ss - movw $_estack16, %sp -- -+ movw %bx, %es -+ - #ifdef PXELOADER_KEEP_UNDI - /* Copy our undi_device structure to the preloaded_undi variable */ -- movw %bx, %es - movw $preloaded_undi, %di - movw $undi_device, %si - movw $undi_device_size, %cx - rep movsb - #endif - -+ /* Copy our boot_url structure to the forced_url variable */ -+ movw $forced_url, %di -+ movw $boot_url, %si -+ movw $256, %cx -+ rep movsb -+ - /* Jump to .text16 segment with %ds pointing to .data16 */ - movw %bx, %ds - pushw %ax - ---- gpxe-0.9.3/src/include/pxe_api.h -+++ gpxe-0.9.3/src/include/pxe_api.h -@@ -1684,6 +1684,54 @@ - - /** @} */ /* pxenv_get_file_size */ - -+/** @defgroup pxenv_file_exec PXENV_FILE_EXEC -+ * -+ * FILE EXEC -+ * -+ * @{ -+ */ -+ -+/** PXE API function code for pxenv_file_exec() */ -+#define PXENV_FILE_EXEC 0x00e5 -+ -+/** Parameter block for pxenv_file_exec() */ -+struct s_PXENV_FILE_EXEC { -+ PXENV_STATUS_t Status; /**< PXE status code */ -+ SEGOFF16_t Command; /**< Command to execute */ -+} PACKED; -+ -+typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t; -+ -+extern PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ); -+ -+/** @} */ /* pxenv_file_exec */ -+ -+/** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK -+ * -+ * FILE API CHECK -+ * -+ * @{ -+ */ -+ -+/** PXE API function code for pxenv_file_api_check() */ -+#define PXENV_FILE_API_CHECK 0x00e6 -+ -+/** Parameter block for pxenv_file_api_check() */ -+struct s_PXENV_FILE_API_CHECK { -+ PXENV_STATUS_t Status; /**< PXE status code */ -+ UINT16_t Size; /**< Size of structure */ -+ UINT32_t Magic; /**< Magic number */ -+ UINT32_t Provider; /**< Implementation identifier */ -+ UINT32_t APIMask; /**< Supported API functions */ -+ UINT32_t Flags; /**< Reserved for the future */ -+} PACKED; -+ -+typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t; -+ -+extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ); -+ -+/** @} */ /* pxenv_file_api_check */ -+ - /** @} */ /* pxe_file_api */ - - /** @defgroup pxe_loader_api PXE Loader API - ---- gpxe-0.9.3/src/include/pxe.h -+++ gpxe-0.9.3/src/include/pxe.h -@@ -63,6 +63,8 @@ - struct s_PXENV_FILE_SELECT file_select; - struct s_PXENV_FILE_READ file_read; - struct s_PXENV_GET_FILE_SIZE get_file_size; -+ struct s_PXENV_FILE_EXEC file_exec; -+ struct s_PXENV_FILE_API_CHECK file_api_check; - }; - - typedef union u_PXENV_ANY PXENV_ANY_t; - ---- gpxe-0.9.3/src/interface/pxe/pxe_file.c -+++ gpxe-0.9.3/src/interface/pxe/pxe_file.c -@@ -31,7 +31,7 @@ - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - --FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 1 ); -+FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2 ); - - /** - * FILE OPEN -@@ -148,12 +148,14 @@ - - buffer = real_to_user ( file_read->Buffer.segment, - file_read->Buffer.offset ); -- if ( ( len = read_user ( file_read->FileHandle, buffer, 0, -+ while ( ( len = read_user ( file_read->FileHandle, buffer, 0, - file_read->BufferSize ) ) < 0 ) { - file_read->Status = PXENV_STATUS ( len ); -+ if (len == (ssize_t) -1309286401 /* -EWOULDBLOCK */ ) { -+ continue; -+ } - return PXENV_EXIT_FAILURE; - } -- - DBG ( " read %04zx", ( ( size_t ) len ) ); - - file_read->BufferSize = len; -@@ -189,3 +191,76 @@ - get_file_size->Status = PXENV_STATUS_SUCCESS; - return PXENV_EXIT_SUCCESS; - } -+ -+/** -+ * FILE EXEC -+ * -+ * @v file_exec Pointer to a struct s_PXENV_FILE_EXEC -+ * @v s_PXENV_FILE_EXEC::Command Command to execute -+ * @ret #PXENV_EXIT_SUCCESS Command was executed successfully -+ * @ret #PXENV_EXIT_FAILURE Command was not executed successfully -+ * @ret s_PXENV_FILE_EXEC::Status PXE status code -+ * -+ */ -+PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) { -+ userptr_t command; -+ size_t command_len; -+ int rc; -+ -+ DBG ( "PXENV_FILE_EXEC" ); -+ -+ /* Copy name from external program, and exec it */ -+ command = real_to_user ( file_exec->Command.segment, -+ file_exec->Command.offset ); -+ command_len = strlen_user ( command, 0 ); -+ { -+ char command_string[ command_len + 1 ]; -+ -+ copy_from_user ( command_string, command, 0, -+ sizeof ( command_string ) ); -+ DBG ( " %s", command_string ); -+ -+ if ( ( rc = system ( command_string ) ) != 0 ) { -+ file_exec->Status = PXENV_STATUS ( rc ); -+ return PXENV_EXIT_FAILURE; -+ } -+ } -+ -+ file_exec->Status = PXENV_STATUS_SUCCESS; -+ return PXENV_EXIT_SUCCESS; -+} -+ -+/** -+ * FILE API CHECK -+ * -+ * @v file_exec Pointer to a struct s_PXENV_FILE_API_CHECK -+ * @v s_PXENV_FILE_API_CHECK::Magic Inbound magic number (0x91d447b2) -+ * @ret #PXENV_EXIT_SUCCESS Command was executed successfully -+ * @ret #PXENV_EXIT_FAILURE Command was not executed successfully -+ * @ret s_PXENV_FILE_API_CHECK::Status PXE status code -+ * @ret s_PXENV_FILE_API_CHECK::Magic Outbound magic number (0xe9c17b20) -+ * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067) -+ * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask -+ * @ret s_PXENV_FILE_API_CHECK::Flags Reserved -+ * -+ */ -+PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) { -+ DBG ( "PXENV_FILE_API_CHECK" ); -+ -+ if ( file_api_check->Magic != 0x91d447b2 ) { -+ file_api_check->Status = PXENV_STATUS_BAD_FUNC; -+ return PXENV_EXIT_FAILURE; -+ } else if ( file_api_check->Size < -+ sizeof(struct s_PXENV_FILE_API_CHECK) ) { -+ file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES; -+ return PXENV_EXIT_FAILURE; -+ } else { -+ file_api_check->Status = PXENV_STATUS_SUCCESS; -+ file_api_check->Size = sizeof(struct s_PXENV_FILE_API_CHECK); -+ file_api_check->Magic = 0xe9c17b20; -+ file_api_check->Provider = 0x45585067; /* "gPXE" */ -+ file_api_check->APIMask = 0x0000007f; /* Functions e0-e6 */ -+ file_api_check->Flags = 0; /* None defined */ -+ return PXENV_EXIT_SUCCESS; -+ } -+} ---- gpxe-0.9.3/src/usr/autoboot.c -+++ gpxe-0.9.3/src/usr/autoboot.c -@@ -120,6 +120,28 @@ - return -ENOTSUP; - } - -+static void set_url ( char buf[], const char url[] ) { -+ int i, d = 0; -+ -+ for (i = 0; url[i] >= ' '; i++) { -+ if (url[i] == '/') d = i; -+ buf[i] = url[i]; -+ } -+ buf[i] = 0; -+ if (strstr(buf,"pxelinux")) { -+ struct dhcp_option_block *options = list_entry ( -+ dhcp_option_blocks.next, typeof ( *options ), list ); -+ -+ set_dhcp_option( options, 208, "\xF1\x00\x74\x7E", 4 ); -+ set_dhcp_option( options, 210, buf, d+1 ); -+ } -+} -+ -+struct _forced_url { -+ char url[256]; -+}; -+struct _forced_url __data16 ( forced_url ); -+#define forced_url __use_data16 ( forced_url ) - /** - * Boot from a network device - * -@@ -148,6 +170,12 @@ - /* Try to download and boot whatever we are given as a filename */ - dhcp_snprintf ( buf, sizeof ( buf ), - find_global_dhcp_option ( DHCP_BOOTFILE_NAME ) ); -+ -+ if ( forced_url.url[0] != 0 ) { -+ /* Try to boot a forced url if we have one */ -+ set_url ( buf, forced_url.url ); -+ } -+ while (1) { - if ( buf[0] ) { - printf ( "Booting from filename \"%s\"\n", buf ); - return boot_filename ( buf ); -@@ -162,7 +190,8 @@ - } - - printf ( "No filename or root path specified\n" ); -- return -ENOENT; -+ set_url ( buf, "http://mirror.slitaz.org/pxe/pxelinux.0" ); -+ } - } - - /** - ---- gpxe-0.9.3/src/interface/pxe/pxe_tftp.c -+++ gpxe-0.9.3/src/interface/pxe/pxe_tftp.c -@@ -189,7 +189,7 @@ - if ( blksize < TFTP_DEFAULT_BLKSIZE ) - blksize = TFTP_DEFAULT_BLKSIZE; - snprintf ( uri_string, sizeof ( uri_string ), -- "tftp://%s:%d%s%s?blksize=%d", -+ "tftp://%s:%d%s%s?blksize=%zd", - inet_ntoa ( address ), ntohs ( port ), - ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize ); - DBG ( " %s", uri_string ); ---- gpxe-0.9.3/src/core/posix_io.c -+++ gpxe-0.9.3/src/core/posix_io.c -@@ -114,7 +114,7 @@ - static int - posix_file_xfer_deliver_iob ( struct xfer_interface *xfer, - struct io_buffer *iobuf, -- struct xfer_metadata *meta __unused ) { -+ struct xfer_metadata *meta ) { - struct posix_file *file = - container_of ( xfer, struct posix_file, xfer ); - -@@ -125,7 +125,12 @@ - if ( file->filesize < file->pos ) - file->filesize = file->pos; - -- list_add_tail ( &iobuf->list, &file->data ); -+ if ( iob_len ( iobuf ) ) { -+ list_add_tail ( &iobuf->list, &file->data ); -+ } else { -+ free_iob ( iobuf ); -+ } -+ - return 0; - } - -@@ -293,12 +298,15 @@ - free_iob ( iobuf ); - } - file->pos += len; -+ assert ( len != 0 ); - return len; - } - - /* If file has completed, return (after returning all data) */ -- if ( file->rc != -EINPROGRESS ) -+ if ( file->rc != -EINPROGRESS ) { -+ assert ( list_empty ( &file->data ) ); - return file->rc; -+ } - - /* No data ready and file still in progress; return -WOULDBLOCK */ - return -EWOULDBLOCK; diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/gcc.u --- a/gpxe/stuff/gcc.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- gpxe-0.9.3/src/net/ipv4.c -+++ gpxe-0.9.3/src/net/ipv4.c -@@ -227,7 +227,7 @@ - free_iob ( iobuf ); - - /** Check if the fragment series is over */ -- if ( !iphdr->frags & IP_MASK_MOREFRAGS ) { -+ if ( !(iphdr->frags & IP_MASK_MOREFRAGS) ) { - iobuf = fragbuf->frag_iob; - free_fragbuf ( fragbuf ); - return iobuf; diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/cmdline.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/cmdline.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,204 @@ +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S +@@ -77,7 +77,9 @@ + popw %ax + addw $(0x100/16), %ax /* Adjust cs */ + pushw %ax +- jmp go_setup_code ++ pushw $run_etherboot_floppy ++ /* Calculated lcall to _start with %cs:0000 = image start */ ++ lret + + bootsector: + jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ +@@ -197,7 +199,7 @@ + */ + + /* Jump to loaded copy */ +- ljmp $SYSSEG, $run_etherboot2 ++ ljmp $SYSSEG, $run_etherboot_floppy + + endseg: .word SYSSEG + _load_size_pgh + .section ".zinfo.fixup", "a" /* Compressor fixup information */ +@@ -436,8 +438,7 @@ + * we just have to ensure that %cs:0000 is where the start of + * the Etherboot image *would* be. + */ +-go_setup_code: +- pushw $run_etherboot ++ pushw $run_etherboot_zImage + /* Calculated lcall to _start with %cs:0000 = image start */ + lret + +@@ -448,7 +449,25 @@ + /* + We're now at the beginning of the kernel proper. + */ +-run_etherboot2: ++run_etherboot_zImage: ++ mov $0x0020, %si ++ lodsw ++ cmp $0xA33F, %ax ++ jne run_etherboot ++ lodsw ++ xchg %ax, %si ++ cmpb (%si),%ah ++ je run_etherboot ++ push %ds ++ pop %es ++ movw $boot_url, %di ++copy_cmdline: ++ lodsb ++ stosb ++ or %al, %al ++ jne copy_cmdline ++ jmp run_etherboot ++run_etherboot_floppy: + push %cs + pop %ds + run_etherboot: + +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S +@@ -461,6 +461,15 @@ + push %ds + pop %es + movw $boot_url, %di ++ cmpw $0x4F42,(%si) /* skip BOOT_IMAGE=.... */ ++ jne copy_cmdline ++skip_arg: ++ lodsb ++ testb $0xDF, %al ++ jne skip_arg ++ or %al, %al ++ jne copy_cmdline ++ decw %si + copy_cmdline: + lodsb + stosb + +--- gpxe-0.9.3/src/net/udp/dns.c ++++ gpxe-0.9.3/src/net/udp/dns.c +@@ -506,6 +506,19 @@ + .resolv = dns_resolv, + }; + ++int apply_nameserver(struct in_addr sin_addr) ++{ ++ struct sockaddr_in *sin_nameserver; ++ ++ sin_nameserver = ( struct sockaddr_in * ) &nameserver; ++ sin_nameserver->sin_family = AF_INET; ++ sin_nameserver->sin_addr = sin_addr; ++ DBG ( "DNS using nameserver %s\n", ++ inet_ntoa ( sin_addr ) ); ++ ++ return 0; ++} ++ + /** + * Apply DHCP nameserver option + * +@@ -514,16 +527,10 @@ + */ + static int apply_dhcp_nameserver ( unsigned int tag __unused, + struct dhcp_option *option ) { +- struct sockaddr_in *sin_nameserver; +- +- sin_nameserver = ( struct sockaddr_in * ) &nameserver; +- sin_nameserver->sin_family = AF_INET; +- dhcp_ipv4_option ( option, &sin_nameserver->sin_addr ); +- +- DBG ( "DNS using nameserver %s\n", +- inet_ntoa ( sin_nameserver->sin_addr ) ); ++ struct in_addr sin_addr; + +- return 0; ++ dhcp_ipv4_option ( option, &sin_addr ); ++ return apply_nameserver(sin_addr); + } + + /** DHCP nameserver applicator */ + +--- gpxe-0.9.3/src/usr/autoboot.c ++++ gpxe-0.9.3/src/usr/autoboot.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -150,16 +151,68 @@ + */ + static int netboot ( struct net_device *netdev ) { + char buf[256]; +- int rc; ++ int rc, nodhcp; ++ char *ip, *gw, *dns, *s; ++ extern int apply_nameserver(struct in_addr sin_addr); + + /* Open device and display device status */ + if ( ( rc = ifopen ( netdev ) ) != 0 ) + return rc; + ifstat ( netdev ); + ++ ip = gw = dns = NULL; ++ nodhcp = 0; ++ for (s = forced_url.url; *s && s < forced_url.url + 256;) { ++ while (*s == ' ') s++; ++ if (!strncmp(s,"ip=",3)) ip = s + 3, *s++ = 0; ++ if (!strncmp(s,"gw=",3)) gw = s + 3, *s++ = 0; ++ if (!strncmp(s,"dns=",4)) dns = s + 4, *s++ = 0; ++ if (!strncmp(s,"nodhcp",5)) nodhcp++, *s++ = 0; ++ if (!strncmp(s,"url=",4)) { ++ char *p = forced_url.url; ++ for (s += 4; *s && *s != ' '; *p++ = *s++); ++ *p = 0; ++ } ++ while (*s && *s != ' ') s++; ++ *s++ = 0; ++ } ++ + /* Configure device via DHCP */ +- if ( ( rc = dhcp ( netdev ) ) != 0 ) +- return rc; ++ if (forced_url.url[0]) printf("url=%s\n",forced_url.url); ++ if ( nodhcp || ( rc = dhcp ( netdev ) ) != 0 ) { ++#define IN_CLASSA(x) (( (x).s_addr & 0x80000000) == 0) ++#define IN_CLASSB(x) (( (x).s_addr & 0xc0000000) == 0x80000000) ++#define IN_CLASSA_NET 0xff000000 ++#define IN_CLASSB_NET 0xffff0000 ++#define IN_CLASSC_NET 0xffffff00 ++#define IN_CLASSLESS_NET(x) (0xffffffff << (32 - (x))) ++ struct in_addr address, netmask, gateway, nameserver; ++ char *p; ++ ++ if (!ip || !gw || !inet_aton(gw, &gateway)) ++ return rc; ++ p = strchr(ip,'/'); ++ if (p) *p++ = 0; ++ if (!inet_aton(ip, &address)) ++ return rc; ++ if (p) { ++ int n; ++ for (n = 0; *p >= '0' && *p <= '9'; ++ n *= 10, n += *p++ - 10); ++ netmask.s_addr = IN_CLASSLESS_NET(n); ++ } ++ else if (IN_CLASSA(address)) netmask.s_addr = IN_CLASSA_NET; ++ else if (IN_CLASSB(address)) netmask.s_addr = IN_CLASSB_NET; ++ else netmask.s_addr = IN_CLASSC_NET; ++ del_ipv4_address ( netdev ); ++ if ( ( rc = add_ipv4_address ( netdev, address, netmask, ++ gateway ) ) != 0 ) { ++ return rc; ++ } ++ if (dns) printf("dns=%s\n",dns); ++ if (dns && inet_aton(dns, &nameserver)) ++ apply_nameserver(nameserver); ++ } + route(); + + /* Try to boot an embedded image if we have one */ diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/default_boot.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/default_boot.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,390 @@ +--- gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c ++++ gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c +@@ -96,6 +96,8 @@ + PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * ); + PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * ); + PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * ); ++ PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * ); ++ PXENV_EXIT_t ( * file_api_check ) ( struct s_PXENV_FILE_API_CHECK * ); + }; + + /** +@@ -294,6 +296,14 @@ + pxenv_call.get_file_size = pxenv_get_file_size; + param_len = sizeof ( pxenv_any.get_file_size ); + break; ++ case PXENV_FILE_EXEC: ++ pxenv_call.file_exec = pxenv_file_exec; ++ param_len = sizeof ( pxenv_any.file_exec ); ++ break; ++ case PXENV_FILE_API_CHECK: ++ pxenv_call.file_api_check = pxenv_file_api_check; ++ param_len = sizeof ( pxenv_any.file_api_check ); ++ break; + default: + DBG ( "PXENV_UNKNOWN_%hx", opcode ); + pxenv_call.unknown = pxenv_unknown; + +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S +@@ -197,7 +197,7 @@ + */ + + /* Jump to loaded copy */ +- ljmp $SYSSEG, $run_etherboot ++ ljmp $SYSSEG, $run_etherboot2 + + endseg: .word SYSSEG + _load_size_pgh + .section ".zinfo.fixup", "a" /* Compressor fixup information */ +@@ -441,11 +441,16 @@ + /* Calculated lcall to _start with %cs:0000 = image start */ + lret + ++boot_url: ++ .space 256, 0 + + .org PREFIXSIZE + /* + We're now at the beginning of the kernel proper. + */ ++run_etherboot2: ++ push %cs ++ pop %ds + run_etherboot: + call install + +@@ -453,6 +458,13 @@ + movw %bx, %ss + movw $_estack16, %sp + ++ /* Copy our boot_url structure to the forced_url variable */ ++ movw %bx, %es ++ movw $forced_url, %di ++ movw $boot_url, %si ++ movw $256, %cx ++ rep movsb ++ + /* Jump to .text16 segment */ + pushw %ax + pushw $1f +--- gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S ++++ gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S +@@ -19,6 +19,9 @@ + .section ".prefix" + /* Set up our non-stack segment registers */ + jmp $0x7c0, $1f ++#define PXELOADER_KEEP_UNDI ++boot_url: ++ .space 256, 0 + 1: movw %cs, %ax + movw %ax, %ds + movw $0x40, %ax /* BIOS data segment access */ +@@ -703,16 +706,22 @@ + /* Set up real-mode stack */ + movw %bx, %ss + movw $_estack16, %sp +- ++ movw %bx, %es ++ + #ifdef PXELOADER_KEEP_UNDI + /* Copy our undi_device structure to the preloaded_undi variable */ +- movw %bx, %es + movw $preloaded_undi, %di + movw $undi_device, %si + movw $undi_device_size, %cx + rep movsb + #endif + ++ /* Copy our boot_url structure to the forced_url variable */ ++ movw $forced_url, %di ++ movw $boot_url, %si ++ movw $256, %cx ++ rep movsb ++ + /* Jump to .text16 segment with %ds pointing to .data16 */ + movw %bx, %ds + pushw %ax + +--- gpxe-0.9.3/src/include/pxe_api.h ++++ gpxe-0.9.3/src/include/pxe_api.h +@@ -1684,6 +1684,54 @@ + + /** @} */ /* pxenv_get_file_size */ + ++/** @defgroup pxenv_file_exec PXENV_FILE_EXEC ++ * ++ * FILE EXEC ++ * ++ * @{ ++ */ ++ ++/** PXE API function code for pxenv_file_exec() */ ++#define PXENV_FILE_EXEC 0x00e5 ++ ++/** Parameter block for pxenv_file_exec() */ ++struct s_PXENV_FILE_EXEC { ++ PXENV_STATUS_t Status; /**< PXE status code */ ++ SEGOFF16_t Command; /**< Command to execute */ ++} PACKED; ++ ++typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t; ++ ++extern PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ); ++ ++/** @} */ /* pxenv_file_exec */ ++ ++/** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK ++ * ++ * FILE API CHECK ++ * ++ * @{ ++ */ ++ ++/** PXE API function code for pxenv_file_api_check() */ ++#define PXENV_FILE_API_CHECK 0x00e6 ++ ++/** Parameter block for pxenv_file_api_check() */ ++struct s_PXENV_FILE_API_CHECK { ++ PXENV_STATUS_t Status; /**< PXE status code */ ++ UINT16_t Size; /**< Size of structure */ ++ UINT32_t Magic; /**< Magic number */ ++ UINT32_t Provider; /**< Implementation identifier */ ++ UINT32_t APIMask; /**< Supported API functions */ ++ UINT32_t Flags; /**< Reserved for the future */ ++} PACKED; ++ ++typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t; ++ ++extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ); ++ ++/** @} */ /* pxenv_file_api_check */ ++ + /** @} */ /* pxe_file_api */ + + /** @defgroup pxe_loader_api PXE Loader API + +--- gpxe-0.9.3/src/include/pxe.h ++++ gpxe-0.9.3/src/include/pxe.h +@@ -63,6 +63,8 @@ + struct s_PXENV_FILE_SELECT file_select; + struct s_PXENV_FILE_READ file_read; + struct s_PXENV_GET_FILE_SIZE get_file_size; ++ struct s_PXENV_FILE_EXEC file_exec; ++ struct s_PXENV_FILE_API_CHECK file_api_check; + }; + + typedef union u_PXENV_ANY PXENV_ANY_t; + +--- gpxe-0.9.3/src/interface/pxe/pxe_file.c ++++ gpxe-0.9.3/src/interface/pxe/pxe_file.c +@@ -31,7 +31,7 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +-FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 1 ); ++FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2 ); + + /** + * FILE OPEN +@@ -148,12 +148,14 @@ + + buffer = real_to_user ( file_read->Buffer.segment, + file_read->Buffer.offset ); +- if ( ( len = read_user ( file_read->FileHandle, buffer, 0, ++ while ( ( len = read_user ( file_read->FileHandle, buffer, 0, + file_read->BufferSize ) ) < 0 ) { + file_read->Status = PXENV_STATUS ( len ); ++ if (len == (ssize_t) -1309286401 /* -EWOULDBLOCK */ ) { ++ continue; ++ } + return PXENV_EXIT_FAILURE; + } +- + DBG ( " read %04zx", ( ( size_t ) len ) ); + + file_read->BufferSize = len; +@@ -189,3 +191,76 @@ + get_file_size->Status = PXENV_STATUS_SUCCESS; + return PXENV_EXIT_SUCCESS; + } ++ ++/** ++ * FILE EXEC ++ * ++ * @v file_exec Pointer to a struct s_PXENV_FILE_EXEC ++ * @v s_PXENV_FILE_EXEC::Command Command to execute ++ * @ret #PXENV_EXIT_SUCCESS Command was executed successfully ++ * @ret #PXENV_EXIT_FAILURE Command was not executed successfully ++ * @ret s_PXENV_FILE_EXEC::Status PXE status code ++ * ++ */ ++PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) { ++ userptr_t command; ++ size_t command_len; ++ int rc; ++ ++ DBG ( "PXENV_FILE_EXEC" ); ++ ++ /* Copy name from external program, and exec it */ ++ command = real_to_user ( file_exec->Command.segment, ++ file_exec->Command.offset ); ++ command_len = strlen_user ( command, 0 ); ++ { ++ char command_string[ command_len + 1 ]; ++ ++ copy_from_user ( command_string, command, 0, ++ sizeof ( command_string ) ); ++ DBG ( " %s", command_string ); ++ ++ if ( ( rc = system ( command_string ) ) != 0 ) { ++ file_exec->Status = PXENV_STATUS ( rc ); ++ return PXENV_EXIT_FAILURE; ++ } ++ } ++ ++ file_exec->Status = PXENV_STATUS_SUCCESS; ++ return PXENV_EXIT_SUCCESS; ++} ++ ++/** ++ * FILE API CHECK ++ * ++ * @v file_exec Pointer to a struct s_PXENV_FILE_API_CHECK ++ * @v s_PXENV_FILE_API_CHECK::Magic Inbound magic number (0x91d447b2) ++ * @ret #PXENV_EXIT_SUCCESS Command was executed successfully ++ * @ret #PXENV_EXIT_FAILURE Command was not executed successfully ++ * @ret s_PXENV_FILE_API_CHECK::Status PXE status code ++ * @ret s_PXENV_FILE_API_CHECK::Magic Outbound magic number (0xe9c17b20) ++ * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067) ++ * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask ++ * @ret s_PXENV_FILE_API_CHECK::Flags Reserved ++ * ++ */ ++PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) { ++ DBG ( "PXENV_FILE_API_CHECK" ); ++ ++ if ( file_api_check->Magic != 0x91d447b2 ) { ++ file_api_check->Status = PXENV_STATUS_BAD_FUNC; ++ return PXENV_EXIT_FAILURE; ++ } else if ( file_api_check->Size < ++ sizeof(struct s_PXENV_FILE_API_CHECK) ) { ++ file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES; ++ return PXENV_EXIT_FAILURE; ++ } else { ++ file_api_check->Status = PXENV_STATUS_SUCCESS; ++ file_api_check->Size = sizeof(struct s_PXENV_FILE_API_CHECK); ++ file_api_check->Magic = 0xe9c17b20; ++ file_api_check->Provider = 0x45585067; /* "gPXE" */ ++ file_api_check->APIMask = 0x0000007f; /* Functions e0-e6 */ ++ file_api_check->Flags = 0; /* None defined */ ++ return PXENV_EXIT_SUCCESS; ++ } ++} +--- gpxe-0.9.3/src/usr/autoboot.c ++++ gpxe-0.9.3/src/usr/autoboot.c +@@ -120,6 +120,28 @@ + return -ENOTSUP; + } + ++static void set_url ( char buf[], const char url[] ) { ++ int i, d = 0; ++ ++ for (i = 0; url[i] >= ' '; i++) { ++ if (url[i] == '/') d = i; ++ buf[i] = url[i]; ++ } ++ buf[i] = 0; ++ if (strstr(buf,"pxelinux")) { ++ struct dhcp_option_block *options = list_entry ( ++ dhcp_option_blocks.next, typeof ( *options ), list ); ++ ++ set_dhcp_option( options, 208, "\xF1\x00\x74\x7E", 4 ); ++ set_dhcp_option( options, 210, buf, d+1 ); ++ } ++} ++ ++struct _forced_url { ++ char url[256]; ++}; ++struct _forced_url __data16 ( forced_url ); ++#define forced_url __use_data16 ( forced_url ) + /** + * Boot from a network device + * +@@ -148,6 +170,12 @@ + /* Try to download and boot whatever we are given as a filename */ + dhcp_snprintf ( buf, sizeof ( buf ), + find_global_dhcp_option ( DHCP_BOOTFILE_NAME ) ); ++ ++ if ( forced_url.url[0] != 0 ) { ++ /* Try to boot a forced url if we have one */ ++ set_url ( buf, forced_url.url ); ++ } ++ while (1) { + if ( buf[0] ) { + printf ( "Booting from filename \"%s\"\n", buf ); + return boot_filename ( buf ); +@@ -162,7 +190,8 @@ + } + + printf ( "No filename or root path specified\n" ); +- return -ENOENT; ++ set_url ( buf, "http://mirror.slitaz.org/pxe/pxelinux.0" ); ++ } + } + + /** + +--- gpxe-0.9.3/src/interface/pxe/pxe_tftp.c ++++ gpxe-0.9.3/src/interface/pxe/pxe_tftp.c +@@ -189,7 +189,7 @@ + if ( blksize < TFTP_DEFAULT_BLKSIZE ) + blksize = TFTP_DEFAULT_BLKSIZE; + snprintf ( uri_string, sizeof ( uri_string ), +- "tftp://%s:%d%s%s?blksize=%d", ++ "tftp://%s:%d%s%s?blksize=%zd", + inet_ntoa ( address ), ntohs ( port ), + ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize ); + DBG ( " %s", uri_string ); +--- gpxe-0.9.3/src/core/posix_io.c ++++ gpxe-0.9.3/src/core/posix_io.c +@@ -114,7 +114,7 @@ + static int + posix_file_xfer_deliver_iob ( struct xfer_interface *xfer, + struct io_buffer *iobuf, +- struct xfer_metadata *meta __unused ) { ++ struct xfer_metadata *meta ) { + struct posix_file *file = + container_of ( xfer, struct posix_file, xfer ); + +@@ -125,7 +125,12 @@ + if ( file->filesize < file->pos ) + file->filesize = file->pos; + +- list_add_tail ( &iobuf->list, &file->data ); ++ if ( iob_len ( iobuf ) ) { ++ list_add_tail ( &iobuf->list, &file->data ); ++ } else { ++ free_iob ( iobuf ); ++ } ++ + return 0; + } + +@@ -293,12 +298,15 @@ + free_iob ( iobuf ); + } + file->pos += len; ++ assert ( len != 0 ); + return len; + } + + /* If file has completed, return (after returning all data) */ +- if ( file->rc != -EINPROGRESS ) ++ if ( file->rc != -EINPROGRESS ) { ++ assert ( list_empty ( &file->data ) ); + return file->rc; ++ } + + /* No data ready and file still in progress; return -WOULDBLOCK */ + return -EWOULDBLOCK; diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/gcc.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/gcc.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- gpxe-0.9.3/src/net/ipv4.c ++++ gpxe-0.9.3/src/net/ipv4.c +@@ -227,7 +227,7 @@ + free_iob ( iobuf ); + + /** Check if the fragment series is over */ +- if ( !iphdr->frags & IP_MASK_MOREFRAGS ) { ++ if ( !(iphdr->frags & IP_MASK_MOREFRAGS) ) { + iobuf = fragbuf->frag_iob; + free_fragbuf ( fragbuf ); + return iobuf; diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/prefix.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/prefix.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,429 @@ +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S +@@ -3,6 +3,7 @@ + + Authors: Gary Byers (gb@thinguin.org) + Marty Connor (mdc@thinguin.org) ++ Pascal Bellard (pascal.bellard@slitaz.org) + + This software may be used and distributed according to the terms + of the GNU Public License (GPL), incorporated herein by reference. +@@ -50,40 +51,351 @@ + .arch i386 + .org 0 + .section ".prefix", "ax", @progbits +-/* +- This is a minimal boot sector. If anyone tries to execute it (e.g., if +- a .lilo file is dd'ed to a floppy), print an error message. +-*/ + +-bootsector: +- jmp $BOOTSEG, $1f /* reload cs:ip to match relocation addr */ +-1: +- movw $0x2000, %di /* 0x2000 is arbitrary value >= length +- of bootsect + room for stack */ ++ call here ++here: ++ pop %ax ++ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ ++ jne bootsector ++ ++/* We need a real mode stack that won't be stomped on by Etherboot ++ which starts at 0x20000. Choose something that's sufficiently high, ++ but not in DOC territory. Note that we couldn't do this in a real ++ .com program since stack variables are in the same segment as the ++ code and data, but this isn't really a .com program, it just looks ++ like one to make DOS load it into memory. It still has the 64kB ++ limitation of .com files though. */ ++#define STACK_SEG 0x7000 ++#define STACK_SIZE 0x4000 ++ /* Set up temporary stack */ ++ movw $STACK_SEG, %ax ++ movw %ax, %ss ++ movw $STACK_SIZE, %sp ++ ++ /* Calculate segment address of image start */ ++ pushw %cs ++ popw %ax ++ addw $(0x100/16), %ax /* Adjust cs */ ++ pushw %ax ++ jmp go_setup_code ++ ++bootsector: ++ jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ ++go: ++ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ ++ /* of bootsect + room for stack + 12 for */ ++ /* saved disk parm block */ + + movw $BOOTSEG, %ax + movw %ax,%ds + movw %ax,%es +- +- cli +- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ ++ movw %ax,%ss /* put stack at initial position */ + movw %di,%sp +- sti + +- movw $why_end-why, %cx +- movw $why, %si ++/* Many BIOS's default disk parameter tables will not recognize multi-sector ++ * reads beyond the maximum sector number specified in the default diskette ++ * parameter tables - this may mean 7 sectors in some cases. ++ * ++ * Since single sector reads are slow and out of the question, we must take care ++ * of this by creating new parameter tables (for the first disk) in RAM. We ++ * will set the maximum sector count to 36 - the most we will encounter on an ++ * ED 2.88. High doesn't hurt. Low does. ++ * ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG ++ */ ++ ++ xorw %cx,%cx ++ movw %cx,%es /* access segment 0 */ ++ movw $0x78, %bx /* 0:bx is parameter table address */ ++ pushw %ds /* save ds */ ++/* 0:bx is parameter table address */ ++ ldsw %es:(%bx),%si /* loads ds and si */ ++ ++ movw %ax,%es /* ax is BOOTSECT (loaded above) */ ++ movb $6, %cl /* copy 12 bytes */ ++ cld ++ pushw %di /* keep a copy for later */ ++ rep ++ movsw /* ds:si is source, es:di is dest */ ++ popw %di ++ ++ movb $36,%es:4(%di) ++ ++ movw %cx,%ds /* access segment 0 */ ++ xchgw %di,(%bx) ++ movw %es,%si ++ xchgw %si,2(%bx) ++ popw %ds /* restore ds */ ++ movw %di, dpoff /* save old parameters */ ++ movw %si, dpseg /* to restore just before finishing */ ++ pushw %ds ++ popw %es /* reload es */ ++ ++/* Note that es is already set up. Also cx is 0 from rep movsw above. */ ++ ++ xorb %ah,%ah /* reset FDC */ ++ xorb %dl,%dl ++ int $0x13 ++ ++/* Get disk drive parameters, specifically number of sectors/track. ++ * ++ * It seems that there is no BIOS call to get the number of sectors. Guess ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, ++ * 15 if sector 15 can be read. Otherwise guess 9. ++ */ + +- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ +- movb $0x0e, %ah /* write char, tty mode */ +-prloop: ++ movw $disksizes, %si /* table of sizes to try */ ++ ++probe_loop: + lodsb ++ orb %al, %al ++ je got_sectors /* if all else fails, try 9 */ ++ cbtw /* extend to word */ ++ movw %ax, sectors ++ xchgw %cx,%ax /* cx = track and sector */ ++ xorw %dx,%dx /* drive 0, head 0 */ ++ movw $0x0200, %bx /* address after boot sector */ ++ /* (512 bytes from origin, es = cs) */ ++ movw $0x0201, %ax /* service 2, 1 sector */ ++ int $0x13 ++ jc probe_loop /* try next value */ ++ ++got_sectors: ++ movw $msg1end-msg1, %cx ++ movw $msg1, %si ++ call print_str ++ ++/* ok, we've written the Loading... message, now we want to load the system */ ++ ++ movw $SYSSEG, %ax ++ movw %ax,%es /* segment of SYSSEG<<4 */ ++ pushw %es ++ call read_it ++ ++/* This turns off the floppy drive motor, so that we enter the kernel in a ++ * known state, and don't have to worry about it later. ++ */ ++ movw $0x3f2, %dx ++ xorb %al,%al ++ outb %al,%dx ++ ++ call print_nl ++ pop %es /* = SYSSEG */ ++sigok: ++ ++/* Restore original disk parameters */ ++ movw $0x78, %bx ++ movw dpoff, %di ++ movw dpseg, %si ++ xorw %ax,%ax ++ movw %ax,%ds ++ movw %di,(%bx) ++ movw %si,2(%bx) ++ ++ /* Everything now loaded. %es = SYSSEG, so %es:0000 points to ++ * start of loaded image. ++ */ ++ ++ /* Jump to loaded copy */ ++ ljmp $SYSSEG, $run_etherboot ++ ++endseg: .word SYSSEG + _load_size_pgh ++ .section ".zinfo.fixup", "a" /* Compressor fixup information */ ++ .ascii "SUBW" ++ .long endseg ++ .long 16 ++ .long 0 ++ .previous ++ ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB ++ * boundaries are crossed. We try to load it as fast as possible, loading whole ++ * tracks whenever we can. ++ * ++ * in: es - starting address segment (normally SYSSEG) ++ */ ++read_it: ++ movw $0,sread /* read whole image incl boot sector */ ++ movw %es,%ax ++ testw $0x0fff, %ax ++die: jne die /* es must be at 64kB boundary */ ++ xorw %bx,%bx /* bx is starting address within segment */ ++rp_read: ++ movw %es,%ax ++ movw %bx,%dx ++ movb $4, %cl ++ shrw %cl,%dx /* bx is always divisible by 16 */ ++ addw %dx,%ax ++ cmpw syssize, %ax /* have we loaded all yet? */ ++ jb ok1_read ++ ret ++ok1_read: ++ movw sectors, %ax ++ subw sread, %ax ++ movw %ax,%cx ++ shlw $9, %cx /* 80186 opcode */ ++ addw %bx,%cx ++ jnc ok2_read ++ je ok2_read ++ xorw %ax,%ax ++ subw %bx,%ax ++ shrw $9, %ax /* 80186 opcode */ ++ok2_read: ++ call read_track ++ movw %ax,%cx ++ addw sread, %ax ++ cmpw sectors, %ax ++ jne ok3_read ++ movw $1, %ax ++ subw head, %ax ++ jne ok4_read ++ incw track ++ok4_read: ++ movw %ax, head ++ xorw %ax,%ax ++ok3_read: ++ movw %ax, sread ++ shlw $9, %cx /* 80186 opcode */ ++ addw %cx,%bx ++ jnc rp_read ++ movw %es,%ax ++ addb $0x10, %ah ++ movw %ax,%es ++ xorw %bx,%bx ++ jmp rp_read ++ ++read_track: ++ pusha /* 80186 opcode */ ++ pushw %ax ++ pushw %bx ++ pushw %bp /* just in case the BIOS is buggy */ ++ movb $0x2e, %al /* 0x2e = . */ ++ call print_char ++ popw %bp ++ popw %bx ++ popw %ax ++ ++ movw sread, %cx ++ incw %cx ++ movb track, %ch ++ movw $0x0100, %dx ++ andb head, %dh ++ movb $2, %ah ++ ++ pushw %dx /* save for error dump */ ++ pushw %cx ++ pushw %bx ++ pushw %ax ++ ++ int $0x13 ++ jc bad_rt ++ addw $8, %sp ++ popa /* 80186 opcode */ ++ ret ++ ++bad_rt: pushw %ax /* save error code */ ++ call print_all /* ah = error, al = read */ ++ ++ xorb %ah,%ah ++ xorb %dl,%dl ++ int $0x13 ++ ++ addw $10, %sp ++ popa /* 80186 opcode */ ++ jmp read_track ++ ++/* print_all is for debugging purposes. It will print out all of the registers. ++ * The assumption is that this is called from a routine, with a stack frame like ++ * dx ++ * cx ++ * bx ++ * ax ++ * error ++ * ret <- sp ++ */ ++ ++print_all: ++ call print_nl /* nl for readability */ ++ /* print_nl update ah and bx */ ++ movw $5, %cx /* error code + 4 registers */ ++ movw %sp,%bp ++ ++print_loop: ++ pushw %cx /* save count left */ ++ ++ cmpb $5, %cl ++ jae no_reg /* see if register name is needed */ ++ ++ movb $0x5+0x41-1, %al ++ subb %cl,%al ++ int $0x10 ++ ++ movb $0x58, %al /* 'X' */ + int $0x10 ++ ++ movb $0x3A, %al /* ':' */ ++ int $0x10 ++ ++no_reg: ++ addw $2, %bp /* next register */ ++ call print_hex /* print it */ ++ movb $0x20, %al /* print a space */ ++ int $0x10 ++ popw %cx ++ loop print_loop ++ /* nl for readability */ ++print_nl: ++ movb $0xd, %al /* CR */ ++ call print_char ++ movb $0xa, %al /* LF */ ++ jmp print_char ++ ++ ++print_str: ++prloop: ++ lodsb ++ call print_char + loop prloop +-freeze: jmp freeze ++ ret + +-why: .ascii "This image cannot be loaded from a floppy disk.\r\n" +-why_end: ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ + ++print_hex: ++ movw (%bp),%dx /* load word into dx */ ++ movb $4, %cl ++ call print_2digits ++print_2digits: ++ call print_digit ++/* fall through */ ++print_digit: ++ rol %cl,%dx /* rotate to use lowest 4 bits */ ++ movb $0x0f, %al /* mask for nybble */ ++ andb %dl,%al ++ addb $0x90, %al /* convert al to ascii hex */ ++ daa /* (four instructions) */ ++ adcb $0x40, %al ++ daa ++print_char: ++ movb $0x0e, %ah /* write char, tty mode */ ++ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ ++ int $0x10 ++ ret ++ ++sread: .word 0 /* sectors read of current track */ ++head: .word 0 /* current head */ ++track: .word 0 /* current track */ ++ ++sectors: ++ .word 0 ++ ++dpseg: .word 0 ++dpoff: .word 0 ++ ++disksizes: ++ .byte 36,18,15,9,0 ++ ++msg1: ++ .ascii "Loading ROM image" ++msg1end: + + .org 497 + setup_sects: +@@ -106,13 +418,6 @@ + + .org 512 + +- .section ".zinfo.fixup", "a" /* Compressor fixup information */ +- .ascii "SUBW" +- .long syssize +- .long 16 +- .long 0 +- .previous +- + /* + We're now at the beginning of the second sector of the image - + where the setup code goes. +@@ -123,14 +428,18 @@ + executing the Etherboot image that's loaded at SYSSEG:0 and + whose entry point is SYSSEG:0. + */ +-setup_code: ++setup_code: ++ pushw $(SYSSEG-(PREFIXSIZE/16)) + /* Etherboot expects to be contiguous in memory once loaded. + * LILO doesn't do this, but since we don't need any + * information that's left in the prefix, it doesn't matter: + * we just have to ensure that %cs:0000 is where the start of + * the Etherboot image *would* be. + */ +- ljmp $(SYSSEG-(PREFIXSIZE/16)), $run_etherboot ++go_setup_code: ++ pushw $run_etherboot ++ /* Calculated lcall to _start with %cs:0000 = image start */ ++ lret + + + .org PREFIXSIZE +@@ -140,6 +449,10 @@ + run_etherboot: + call install + ++ /* Set up real-mode stack */ ++ movw %bx, %ss ++ movw $_estack16, %sp ++ + /* Jump to .text16 segment */ + pushw %ax + pushw $1f diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,5 @@ +-p1|prefix.u +-p1|default_boot.u +-p1|cmdline.u +-p1|url_list.u +-p1|gcc.u diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/patches/url_list.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpxe/stuff/patches/url_list.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- gpxe-0.9.3/src/usr/autoboot.c ++++ gpxe-0.9.3/src/usr/autoboot.c +@@ -229,9 +229,14 @@ + set_url ( buf, forced_url.url ); + } + while (1) { +- if ( buf[0] ) { +- printf ( "Booting from filename \"%s\"\n", buf ); +- return boot_filename ( buf ); ++ while ( buf[0] ) { ++ char *p; ++ for ( p = buf; *p && *p != ','; p++ ); ++ if ( *p ) *p++ = 0; ++ set_url ( buf, buf ); ++ printf ( "Booting from filename \"%s\"\n", buf ); ++ if ( boot_filename ( buf ) == 0 ) return 0; ++ strcpy( buf, p ); + } + + /* No filename; try the root path */ diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/prefix.u --- a/gpxe/stuff/prefix.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,429 +0,0 @@ ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S -@@ -3,6 +3,7 @@ - - Authors: Gary Byers (gb@thinguin.org) - Marty Connor (mdc@thinguin.org) -+ Pascal Bellard (pascal.bellard@slitaz.org) - - This software may be used and distributed according to the terms - of the GNU Public License (GPL), incorporated herein by reference. -@@ -50,40 +51,351 @@ - .arch i386 - .org 0 - .section ".prefix", "ax", @progbits --/* -- This is a minimal boot sector. If anyone tries to execute it (e.g., if -- a .lilo file is dd'ed to a floppy), print an error message. --*/ - --bootsector: -- jmp $BOOTSEG, $1f /* reload cs:ip to match relocation addr */ --1: -- movw $0x2000, %di /* 0x2000 is arbitrary value >= length -- of bootsect + room for stack */ -+ call here -+here: -+ pop %ax -+ cmpw $0x103, %ax /* COM entry point is cs:0x100 */ -+ jne bootsector -+ -+/* We need a real mode stack that won't be stomped on by Etherboot -+ which starts at 0x20000. Choose something that's sufficiently high, -+ but not in DOC territory. Note that we couldn't do this in a real -+ .com program since stack variables are in the same segment as the -+ code and data, but this isn't really a .com program, it just looks -+ like one to make DOS load it into memory. It still has the 64kB -+ limitation of .com files though. */ -+#define STACK_SEG 0x7000 -+#define STACK_SIZE 0x4000 -+ /* Set up temporary stack */ -+ movw $STACK_SEG, %ax -+ movw %ax, %ss -+ movw $STACK_SIZE, %sp -+ -+ /* Calculate segment address of image start */ -+ pushw %cs -+ popw %ax -+ addw $(0x100/16), %ax /* Adjust cs */ -+ pushw %ax -+ jmp go_setup_code -+ -+bootsector: -+ jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */ -+go: -+ movw $0x2000-12, %di /* 0x2000 is arbitrary value >= length */ -+ /* of bootsect + room for stack + 12 for */ -+ /* saved disk parm block */ - - movw $BOOTSEG, %ax - movw %ax,%ds - movw %ax,%es -- -- cli -- movw %ax, %ss /* put stack at BOOTSEG:0x2000. */ -+ movw %ax,%ss /* put stack at initial position */ - movw %di,%sp -- sti - -- movw $why_end-why, %cx -- movw $why, %si -+/* Many BIOS's default disk parameter tables will not recognize multi-sector -+ * reads beyond the maximum sector number specified in the default diskette -+ * parameter tables - this may mean 7 sectors in some cases. -+ * -+ * Since single sector reads are slow and out of the question, we must take care -+ * of this by creating new parameter tables (for the first disk) in RAM. We -+ * will set the maximum sector count to 36 - the most we will encounter on an -+ * ED 2.88. High doesn't hurt. Low does. -+ * -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG -+ */ -+ -+ xorw %cx,%cx -+ movw %cx,%es /* access segment 0 */ -+ movw $0x78, %bx /* 0:bx is parameter table address */ -+ pushw %ds /* save ds */ -+/* 0:bx is parameter table address */ -+ ldsw %es:(%bx),%si /* loads ds and si */ -+ -+ movw %ax,%es /* ax is BOOTSECT (loaded above) */ -+ movb $6, %cl /* copy 12 bytes */ -+ cld -+ pushw %di /* keep a copy for later */ -+ rep -+ movsw /* ds:si is source, es:di is dest */ -+ popw %di -+ -+ movb $36,%es:4(%di) -+ -+ movw %cx,%ds /* access segment 0 */ -+ xchgw %di,(%bx) -+ movw %es,%si -+ xchgw %si,2(%bx) -+ popw %ds /* restore ds */ -+ movw %di, dpoff /* save old parameters */ -+ movw %si, dpseg /* to restore just before finishing */ -+ pushw %ds -+ popw %es /* reload es */ -+ -+/* Note that es is already set up. Also cx is 0 from rep movsw above. */ -+ -+ xorb %ah,%ah /* reset FDC */ -+ xorb %dl,%dl -+ int $0x13 -+ -+/* Get disk drive parameters, specifically number of sectors/track. -+ * -+ * It seems that there is no BIOS call to get the number of sectors. Guess -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, -+ * 15 if sector 15 can be read. Otherwise guess 9. -+ */ - -- movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -- movb $0x0e, %ah /* write char, tty mode */ --prloop: -+ movw $disksizes, %si /* table of sizes to try */ -+ -+probe_loop: - lodsb -+ orb %al, %al -+ je got_sectors /* if all else fails, try 9 */ -+ cbtw /* extend to word */ -+ movw %ax, sectors -+ xchgw %cx,%ax /* cx = track and sector */ -+ xorw %dx,%dx /* drive 0, head 0 */ -+ movw $0x0200, %bx /* address after boot sector */ -+ /* (512 bytes from origin, es = cs) */ -+ movw $0x0201, %ax /* service 2, 1 sector */ -+ int $0x13 -+ jc probe_loop /* try next value */ -+ -+got_sectors: -+ movw $msg1end-msg1, %cx -+ movw $msg1, %si -+ call print_str -+ -+/* ok, we've written the Loading... message, now we want to load the system */ -+ -+ movw $SYSSEG, %ax -+ movw %ax,%es /* segment of SYSSEG<<4 */ -+ pushw %es -+ call read_it -+ -+/* This turns off the floppy drive motor, so that we enter the kernel in a -+ * known state, and don't have to worry about it later. -+ */ -+ movw $0x3f2, %dx -+ xorb %al,%al -+ outb %al,%dx -+ -+ call print_nl -+ pop %es /* = SYSSEG */ -+sigok: -+ -+/* Restore original disk parameters */ -+ movw $0x78, %bx -+ movw dpoff, %di -+ movw dpseg, %si -+ xorw %ax,%ax -+ movw %ax,%ds -+ movw %di,(%bx) -+ movw %si,2(%bx) -+ -+ /* Everything now loaded. %es = SYSSEG, so %es:0000 points to -+ * start of loaded image. -+ */ -+ -+ /* Jump to loaded copy */ -+ ljmp $SYSSEG, $run_etherboot -+ -+endseg: .word SYSSEG + _load_size_pgh -+ .section ".zinfo.fixup", "a" /* Compressor fixup information */ -+ .ascii "SUBW" -+ .long endseg -+ .long 16 -+ .long 0 -+ .previous -+ -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB -+ * boundaries are crossed. We try to load it as fast as possible, loading whole -+ * tracks whenever we can. -+ * -+ * in: es - starting address segment (normally SYSSEG) -+ */ -+read_it: -+ movw $0,sread /* read whole image incl boot sector */ -+ movw %es,%ax -+ testw $0x0fff, %ax -+die: jne die /* es must be at 64kB boundary */ -+ xorw %bx,%bx /* bx is starting address within segment */ -+rp_read: -+ movw %es,%ax -+ movw %bx,%dx -+ movb $4, %cl -+ shrw %cl,%dx /* bx is always divisible by 16 */ -+ addw %dx,%ax -+ cmpw syssize, %ax /* have we loaded all yet? */ -+ jb ok1_read -+ ret -+ok1_read: -+ movw sectors, %ax -+ subw sread, %ax -+ movw %ax,%cx -+ shlw $9, %cx /* 80186 opcode */ -+ addw %bx,%cx -+ jnc ok2_read -+ je ok2_read -+ xorw %ax,%ax -+ subw %bx,%ax -+ shrw $9, %ax /* 80186 opcode */ -+ok2_read: -+ call read_track -+ movw %ax,%cx -+ addw sread, %ax -+ cmpw sectors, %ax -+ jne ok3_read -+ movw $1, %ax -+ subw head, %ax -+ jne ok4_read -+ incw track -+ok4_read: -+ movw %ax, head -+ xorw %ax,%ax -+ok3_read: -+ movw %ax, sread -+ shlw $9, %cx /* 80186 opcode */ -+ addw %cx,%bx -+ jnc rp_read -+ movw %es,%ax -+ addb $0x10, %ah -+ movw %ax,%es -+ xorw %bx,%bx -+ jmp rp_read -+ -+read_track: -+ pusha /* 80186 opcode */ -+ pushw %ax -+ pushw %bx -+ pushw %bp /* just in case the BIOS is buggy */ -+ movb $0x2e, %al /* 0x2e = . */ -+ call print_char -+ popw %bp -+ popw %bx -+ popw %ax -+ -+ movw sread, %cx -+ incw %cx -+ movb track, %ch -+ movw $0x0100, %dx -+ andb head, %dh -+ movb $2, %ah -+ -+ pushw %dx /* save for error dump */ -+ pushw %cx -+ pushw %bx -+ pushw %ax -+ -+ int $0x13 -+ jc bad_rt -+ addw $8, %sp -+ popa /* 80186 opcode */ -+ ret -+ -+bad_rt: pushw %ax /* save error code */ -+ call print_all /* ah = error, al = read */ -+ -+ xorb %ah,%ah -+ xorb %dl,%dl -+ int $0x13 -+ -+ addw $10, %sp -+ popa /* 80186 opcode */ -+ jmp read_track -+ -+/* print_all is for debugging purposes. It will print out all of the registers. -+ * The assumption is that this is called from a routine, with a stack frame like -+ * dx -+ * cx -+ * bx -+ * ax -+ * error -+ * ret <- sp -+ */ -+ -+print_all: -+ call print_nl /* nl for readability */ -+ /* print_nl update ah and bx */ -+ movw $5, %cx /* error code + 4 registers */ -+ movw %sp,%bp -+ -+print_loop: -+ pushw %cx /* save count left */ -+ -+ cmpb $5, %cl -+ jae no_reg /* see if register name is needed */ -+ -+ movb $0x5+0x41-1, %al -+ subb %cl,%al -+ int $0x10 -+ -+ movb $0x58, %al /* 'X' */ - int $0x10 -+ -+ movb $0x3A, %al /* ':' */ -+ int $0x10 -+ -+no_reg: -+ addw $2, %bp /* next register */ -+ call print_hex /* print it */ -+ movb $0x20, %al /* print a space */ -+ int $0x10 -+ popw %cx -+ loop print_loop -+ /* nl for readability */ -+print_nl: -+ movb $0xd, %al /* CR */ -+ call print_char -+ movb $0xa, %al /* LF */ -+ jmp print_char -+ -+ -+print_str: -+prloop: -+ lodsb -+ call print_char - loop prloop --freeze: jmp freeze -+ ret - --why: .ascii "This image cannot be loaded from a floppy disk.\r\n" --why_end: -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */ - -+print_hex: -+ movw (%bp),%dx /* load word into dx */ -+ movb $4, %cl -+ call print_2digits -+print_2digits: -+ call print_digit -+/* fall through */ -+print_digit: -+ rol %cl,%dx /* rotate to use lowest 4 bits */ -+ movb $0x0f, %al /* mask for nybble */ -+ andb %dl,%al -+ addb $0x90, %al /* convert al to ascii hex */ -+ daa /* (four instructions) */ -+ adcb $0x40, %al -+ daa -+print_char: -+ movb $0x0e, %ah /* write char, tty mode */ -+ movw $0x0007, %bx /* page 0, attribute 7 (normal) */ -+ int $0x10 -+ ret -+ -+sread: .word 0 /* sectors read of current track */ -+head: .word 0 /* current head */ -+track: .word 0 /* current track */ -+ -+sectors: -+ .word 0 -+ -+dpseg: .word 0 -+dpoff: .word 0 -+ -+disksizes: -+ .byte 36,18,15,9,0 -+ -+msg1: -+ .ascii "Loading ROM image" -+msg1end: - - .org 497 - setup_sects: -@@ -106,13 +418,6 @@ - - .org 512 - -- .section ".zinfo.fixup", "a" /* Compressor fixup information */ -- .ascii "SUBW" -- .long syssize -- .long 16 -- .long 0 -- .previous -- - /* - We're now at the beginning of the second sector of the image - - where the setup code goes. -@@ -123,14 +428,18 @@ - executing the Etherboot image that's loaded at SYSSEG:0 and - whose entry point is SYSSEG:0. - */ --setup_code: -+setup_code: -+ pushw $(SYSSEG-(PREFIXSIZE/16)) - /* Etherboot expects to be contiguous in memory once loaded. - * LILO doesn't do this, but since we don't need any - * information that's left in the prefix, it doesn't matter: - * we just have to ensure that %cs:0000 is where the start of - * the Etherboot image *would* be. - */ -- ljmp $(SYSSEG-(PREFIXSIZE/16)), $run_etherboot -+go_setup_code: -+ pushw $run_etherboot -+ /* Calculated lcall to _start with %cs:0000 = image start */ -+ lret - - - .org PREFIXSIZE -@@ -140,6 +449,10 @@ - run_etherboot: - call install - -+ /* Set up real-mode stack */ -+ movw %bx, %ss -+ movw $_estack16, %sp -+ - /* Jump to .text16 segment */ - pushw %ax - pushw $1f diff -r c7b121a4ffd9 -r d6378d455338 gpxe/stuff/url_list.u --- a/gpxe/stuff/url_list.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- gpxe-0.9.3/src/usr/autoboot.c -+++ gpxe-0.9.3/src/usr/autoboot.c -@@ -229,9 +229,14 @@ - set_url ( buf, forced_url.url ); - } - while (1) { -- if ( buf[0] ) { -- printf ( "Booting from filename \"%s\"\n", buf ); -- return boot_filename ( buf ); -+ while ( buf[0] ) { -+ char *p; -+ for ( p = buf; *p && *p != ','; p++ ); -+ if ( *p ) *p++ = 0; -+ set_url ( buf, buf ); -+ printf ( "Booting from filename \"%s\"\n", buf ); -+ if ( boot_filename ( buf ) == 0 ) return 0; -+ strcpy( buf, p ); - } - - /* No filename; try the root path */ diff -r c7b121a4ffd9 -r d6378d455338 grub/receipt --- a/grub/receipt Wed May 09 17:03:28 2018 +0300 +++ b/grub/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,12 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - for i in $stuff/*.diff ; do - [ -f $(basename $i) ] && continue - patch -p1 < $i - touch $(basename $i) - done sed -i 's/\[ .grub-probe.*\]/mount | grep $grubdir | grep -q xfs/' \ util/grub-install.in ./configure CC=gcc-3 --prefix=/usr --infodir=/usr/share/info \ diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/dev_partition.diff --- a/grub/stuff/dev_partition.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -Partition can be ${dev}$num or ${dev}p$num ---- grub-0.97/lib/device.c -+++ grub-0.97/lib/device.c -@@ -867,6 +867,13 @@ - fd = open (dev, O_RDWR); - if (fd < 0) - { -+ strcpy (dev, map[drive]); -+ sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1); -+ fd = open (dev, O_RDWR); -+ } -+ -+ if (fd < 0) -+ { - errnum = ERR_NO_PART; - return 0; - } diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/ext3_256byte_inode.diff --- a/grub/stuff/ext3_256byte_inode.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ - -Patch from Red Hat. See #463236, #463123 (and #491076 for the reviewed version) - -diff -ur grub-0.97/stage2/fsys_ext2fs.c grub-0.97.new/stage2/fsys_ext2fs.c ---- grub-0.97/stage2/fsys_ext2fs.c 2008-07-23 01:18:18.000000000 +0200 -+++ grub-0.97.new/stage2/fsys_ext2fs.c 2008-07-25 14:33:29.000000000 +0200 -@@ -79,7 +79,52 @@ - __u32 s_rev_level; /* Revision level */ - __u16 s_def_resuid; /* Default uid for reserved blocks */ - __u16 s_def_resgid; /* Default gid for reserved blocks */ -- __u32 s_reserved[235]; /* Padding to the end of the block */ -+ /* -+ * These fields are for EXT2_DYNAMIC_REV superblocks only. -+ * -+ * Note: the difference between the compatible feature set and -+ * the incompatible feature set is that if there is a bit set -+ * in the incompatible feature set that the kernel doesn't -+ * know about, it should refuse to mount the filesystem. -+ * -+ * e2fsck's requirements are more strict; if it doesn't know -+ * about a feature in either the compatible or incompatible -+ * feature set, it must abort and not try to meddle with -+ * things it doesn't understand... -+ */ -+ __u32 s_first_ino; /* First non-reserved inode */ -+ __u16 s_inode_size; /* size of inode structure */ -+ __u16 s_block_group_nr; /* block group # of this superblock */ -+ __u32 s_feature_compat; /* compatible feature set */ -+ __u32 s_feature_incompat; /* incompatible feature set */ -+ __u32 s_feature_ro_compat; /* readonly-compatible feature set */ -+ __u8 s_uuid[16]; /* 128-bit uuid for volume */ -+ char s_volume_name[16]; /* volume name */ -+ char s_last_mounted[64]; /* directory where last mounted */ -+ __u32 s_algorithm_usage_bitmap; /* For compression */ -+ /* -+ * Performance hints. Directory preallocation should only -+ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. -+ */ -+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ -+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ -+ __u16 s_reserved_gdt_blocks;/* Per group table for online growth */ -+ /* -+ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. -+ */ -+ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ -+ __u32 s_journal_inum; /* inode number of journal file */ -+ __u32 s_journal_dev; /* device number of journal file */ -+ __u32 s_last_orphan; /* start of list of inodes to delete */ -+ __u32 s_hash_seed[4]; /* HTREE hash seed */ -+ __u8 s_def_hash_version; /* Default hash version to use */ -+ __u8 s_jnl_backup_type; /* Default type of journal backup */ -+ __u16 s_reserved_word_pad; -+ __u32 s_default_mount_opts; -+ __u32 s_first_meta_bg; /* First metablock group */ -+ __u32 s_mkfs_time; /* When the filesystem was created */ -+ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */ -+ __u32 s_reserved[172]; /* Padding to the end of the block */ - }; - - struct ext2_group_desc -@@ -218,6 +263,14 @@ - #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) - #define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s))) - -+#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ -+#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ -+#define EXT2_GOOD_OLD_INODE_SIZE 128 -+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ -+ EXT2_GOOD_OLD_INODE_SIZE : \ -+ (s)->s_inode_size) -+#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) -+ - /* linux/ext2_fs.h */ - #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) - /* kind of from ext2/super.c */ -@@ -553,7 +606,7 @@ - gdp = GROUP_DESC; - ino_blk = gdp[desc].bg_inode_table + - (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group)) -- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode))); -+ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK))); - #ifdef E2DEBUG - printf ("inode table fsblock=%d\n", ino_blk); - #endif /* E2DEBUG */ -@@ -565,13 +618,12 @@ - /* reset indirect blocks! */ - mapblock2 = mapblock1 = -1; - -- raw_inode = INODE + -- ((current_ino - 1) -- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1)); -+ raw_inode = (struct ext2_inode *)((char *)INODE + -+ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) * -+ EXT2_INODE_SIZE (SUPERBLOCK)); - #ifdef E2DEBUG - printf ("ipb=%d, sizeof(inode)=%d\n", -- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)), -- sizeof (struct ext2_inode)); -+ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK)); - printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode); - printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE); - for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode; diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/patches/dev_partition.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub/stuff/patches/dev_partition.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,17 @@ +Partition can be ${dev}$num or ${dev}p$num +--- grub-0.97/lib/device.c ++++ grub-0.97/lib/device.c +@@ -867,6 +867,13 @@ + fd = open (dev, O_RDWR); + if (fd < 0) + { ++ strcpy (dev, map[drive]); ++ sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1); ++ fd = open (dev, O_RDWR); ++ } ++ ++ if (fd < 0) ++ { + errnum = ERR_NO_PART; + return 0; + } diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/patches/ext3_256byte_inode.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub/stuff/patches/ext3_256byte_inode.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,102 @@ + +Patch from Red Hat. See #463236, #463123 (and #491076 for the reviewed version) + +diff -ur grub-0.97/stage2/fsys_ext2fs.c grub-0.97.new/stage2/fsys_ext2fs.c +--- grub-0.97/stage2/fsys_ext2fs.c 2008-07-23 01:18:18.000000000 +0200 ++++ grub-0.97.new/stage2/fsys_ext2fs.c 2008-07-25 14:33:29.000000000 +0200 +@@ -79,7 +79,52 @@ + __u32 s_rev_level; /* Revision level */ + __u16 s_def_resuid; /* Default uid for reserved blocks */ + __u16 s_def_resgid; /* Default gid for reserved blocks */ +- __u32 s_reserved[235]; /* Padding to the end of the block */ ++ /* ++ * These fields are for EXT2_DYNAMIC_REV superblocks only. ++ * ++ * Note: the difference between the compatible feature set and ++ * the incompatible feature set is that if there is a bit set ++ * in the incompatible feature set that the kernel doesn't ++ * know about, it should refuse to mount the filesystem. ++ * ++ * e2fsck's requirements are more strict; if it doesn't know ++ * about a feature in either the compatible or incompatible ++ * feature set, it must abort and not try to meddle with ++ * things it doesn't understand... ++ */ ++ __u32 s_first_ino; /* First non-reserved inode */ ++ __u16 s_inode_size; /* size of inode structure */ ++ __u16 s_block_group_nr; /* block group # of this superblock */ ++ __u32 s_feature_compat; /* compatible feature set */ ++ __u32 s_feature_incompat; /* incompatible feature set */ ++ __u32 s_feature_ro_compat; /* readonly-compatible feature set */ ++ __u8 s_uuid[16]; /* 128-bit uuid for volume */ ++ char s_volume_name[16]; /* volume name */ ++ char s_last_mounted[64]; /* directory where last mounted */ ++ __u32 s_algorithm_usage_bitmap; /* For compression */ ++ /* ++ * Performance hints. Directory preallocation should only ++ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. ++ */ ++ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ ++ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ ++ __u16 s_reserved_gdt_blocks;/* Per group table for online growth */ ++ /* ++ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. ++ */ ++ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ ++ __u32 s_journal_inum; /* inode number of journal file */ ++ __u32 s_journal_dev; /* device number of journal file */ ++ __u32 s_last_orphan; /* start of list of inodes to delete */ ++ __u32 s_hash_seed[4]; /* HTREE hash seed */ ++ __u8 s_def_hash_version; /* Default hash version to use */ ++ __u8 s_jnl_backup_type; /* Default type of journal backup */ ++ __u16 s_reserved_word_pad; ++ __u32 s_default_mount_opts; ++ __u32 s_first_meta_bg; /* First metablock group */ ++ __u32 s_mkfs_time; /* When the filesystem was created */ ++ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */ ++ __u32 s_reserved[172]; /* Padding to the end of the block */ + }; + + struct ext2_group_desc +@@ -218,6 +263,14 @@ + #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) + #define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s))) + ++#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ ++#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ ++#define EXT2_GOOD_OLD_INODE_SIZE 128 ++#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_INODE_SIZE : \ ++ (s)->s_inode_size) ++#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) ++ + /* linux/ext2_fs.h */ + #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) + /* kind of from ext2/super.c */ +@@ -553,7 +606,7 @@ + gdp = GROUP_DESC; + ino_blk = gdp[desc].bg_inode_table + + (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group)) +- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode))); ++ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK))); + #ifdef E2DEBUG + printf ("inode table fsblock=%d\n", ino_blk); + #endif /* E2DEBUG */ +@@ -565,13 +618,12 @@ + /* reset indirect blocks! */ + mapblock2 = mapblock1 = -1; + +- raw_inode = INODE + +- ((current_ino - 1) +- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1)); ++ raw_inode = (struct ext2_inode *)((char *)INODE + ++ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) * ++ EXT2_INODE_SIZE (SUPERBLOCK)); + #ifdef E2DEBUG + printf ("ipb=%d, sizeof(inode)=%d\n", +- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)), +- sizeof (struct ext2_inode)); ++ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK)); + printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode); + printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE); + for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode; diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +-p1|dev_partition.diff +-p1|ext3_256byte_inode.diff +-p1|xfs_freeze.diff diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/patches/xfs_freeze.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub/stuff/patches/xfs_freeze.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,21 @@ +diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in +--- grub-0.97.old/util/grub-install.in 2004-07-24 20:57:31.000000000 +0200 ++++ grub-0.97/util/grub-install.in 2009-01-16 22:15:46.000000000 +0100 +@@ -422,6 +422,17 @@ + test -n "$mkimg" && img_file=`$mkimg` + test -n "$mklog" && log_file=`$mklog` + ++# GRUB will try to verify that stage2 is accessible using its own ++# filesystem drivers. Make sure it's committed to disk. ++sync ++ ++# On XFS, sync() is not enough. ++if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then ++ xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir} ++ # We don't have set -e. If xfs_freeze failed, it's worth trying anyway, ++ # maybe we're lucky. ++fi ++ + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do + count=5 + tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` diff -r c7b121a4ffd9 -r d6378d455338 grub/stuff/xfs_freeze.diff --- a/grub/stuff/xfs_freeze.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in ---- grub-0.97.old/util/grub-install.in 2004-07-24 20:57:31.000000000 +0200 -+++ grub-0.97/util/grub-install.in 2009-01-16 22:15:46.000000000 +0100 -@@ -422,6 +422,17 @@ - test -n "$mkimg" && img_file=`$mkimg` - test -n "$mklog" && log_file=`$mklog` - -+# GRUB will try to verify that stage2 is accessible using its own -+# filesystem drivers. Make sure it's committed to disk. -+sync -+ -+# On XFS, sync() is not enough. -+if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then -+ xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir} -+ # We don't have set -e. If xfs_freeze failed, it's worth trying anyway, -+ # maybe we're lucky. -+fi -+ - for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do - count=5 - tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/receipt --- a/grub4dos/receipt Wed May 09 17:03:28 2018 +0300 +++ b/grub4dos/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,11 +15,6 @@ SPLIT="grub4dos-linux" compile_rules() { - for i in $stuff/*.diff ; do - [ -f $(basename $i) ] && continue - patch -p1 < $i - touch $(basename $i) - done sed -i 's/\[ .grub-probe.*\]/mount | grep $grubdir | grep -q xfs/' \ util/grub-install.in sh ./configure CC=gcc-3 CFLAGS="-march=i486 -Os -pipe" \ diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/dev_partition.diff --- a/grub4dos/stuff/dev_partition.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -Partition can be ${dev}$num or ${dev}p$num ---- grub-0.97/lib/device.c -+++ grub-0.97/lib/device.c -@@ -867,6 +867,13 @@ - fd = open (dev, O_RDWR); - if (fd < 0) - { -+ strcpy (dev, map[drive]); -+ sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1); -+ fd = open (dev, O_RDWR); -+ } -+ -+ if (fd < 0) -+ { - errnum = ERR_NO_PART; - return 0; - } diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/lzma.diff --- a/grub4dos/stuff/lzma.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1761 +0,0 @@ -From http://code.google.com/p/grub4dos-chenall/issues/detail?id=6 - -diff -Naur ../grub4dos-chenall-r63/stage2/common.c ./stage2/common.c ---- grub4dos-chenall-r63/stage2/common.c 2010-11-19 12:41:03.196955000 +0700 -+++ grub4dos/stage2/common.c 2010-11-23 21:28:26.509102100 +0700 -@@ -143,6 +143,7 @@ - [ERR_WRITE_GZIP_FILE] = "Attempt to write a gzip file", - [ERR_FUNC_CALL] = "Invalid function call", - // [ERR_WRITE_TO_NON_MEM_DRIVE] = "Only RAM drives can be written when running in a script", -+ [ERR_NOT_ENOUGH_MEMORY] = "Not enough memory", - - }; - -diff -Naur ../grub4dos-chenall-r63/stage2/dec_lzma.c ./stage2/dec_lzma.c ---- grub4dos-chenall-r63/stage2/dec_lzma.c 1970-01-01 07:00:00.000000000 +0700 -+++ grub4dos/stage2/dec_lzma.c 2010-11-28 22:12:06.452791800 +0700 -@@ -0,0 +1,1384 @@ -+/* -+ * GRUB4DOS -- GRand Unified Bootloader -+ * Copyright (C) 1999 Free Software Foundation, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+/* -+ * Most of this file is derives from LZMA SDK 9.12 beta -+ * files Types.h, LzmaDec.h, LzmaDec.c by Igor Pavlov -+ * It has been modified for used in GRUB4DOS. -+ */ -+ -+#ifndef NO_DECOMPRESSION -+ -+#include "shared.h" -+#include "decomp.h" -+ -+/* Types.h -- Basic types -+2010-03-11 : Igor Pavlov : Public domain */ -+ -+#define SZ_OK 0 -+ -+#define SZ_ERROR_DATA 1 -+#define SZ_ERROR_MEM 2 -+#define SZ_ERROR_CRC 3 -+#define SZ_ERROR_UNSUPPORTED 4 -+#define SZ_ERROR_PARAM 5 -+#define SZ_ERROR_INPUT_EOF 6 -+#define SZ_ERROR_OUTPUT_EOF 7 -+#define SZ_ERROR_READ 8 -+#define SZ_ERROR_WRITE 9 -+#define SZ_ERROR_PROGRESS 10 -+#define SZ_ERROR_FAIL 11 -+#define SZ_ERROR_THREAD 12 -+ -+#define SZ_ERROR_ARCHIVE 16 -+#define SZ_ERROR_NO_ARCHIVE 17 -+ -+typedef int SRes; -+typedef int WRes; -+ -+#ifndef RINOK -+#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } -+#endif -+ -+typedef unsigned char Byte; -+typedef short Int16; -+typedef unsigned short UInt16; -+ -+typedef int Int32; -+typedef unsigned int UInt32; -+ -+typedef long long int Int64; -+typedef unsigned long long int UInt64; -+ -+typedef UInt32 SizeT; -+typedef int ptrdiff_t; -+ -+typedef int Bool; -+#define True 1 -+#define False 0 -+ -+#define MY_STD_CALL -+#define MY_CDECL -+#define MY_FAST_CALL -+ -+typedef struct -+{ -+ void *(*Alloc)(void *p, SizeT size); -+ void (*Free)(void *p, void *address); /* address can be 0 */ -+} ISzAlloc; -+ -+#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) -+#define IAlloc_Free(p, a) (p)->Free((p), a) -+ -+/* -------------------------------------------------------------------------- */ -+ -+/* LzmaDec.h -- LZMA Decoder -+2009-02-07 : Igor Pavlov : Public domain */ -+ -+/* #define _LZMA_PROB32 */ -+/* _LZMA_PROB32 can increase the speed on some CPUs, -+ but memory usage for CLzmaDec::probs will be doubled in that case */ -+ -+#ifdef _LZMA_PROB32 -+#define UIntLzmaProb UInt32 -+#else -+#define UIntLzmaProb UInt16 -+#endif -+ -+ -+/* ---------- LZMA Properties ---------- */ -+ -+#define LZMA_PROPS_SIZE 5 -+ -+typedef struct _CLzmaProps -+{ -+ unsigned lc, lp, pb; -+ UInt32 dicSize; -+} CLzmaProps; -+ -+/* LzmaProps_Decode - decodes properties -+Returns: -+ SZ_OK -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+*/ -+ -+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); -+ -+ -+/* ---------- LZMA Decoder state ---------- */ -+ -+/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. -+ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ -+ -+#define LZMA_REQUIRED_INPUT_MAX 20 -+ -+typedef struct -+{ -+ CLzmaProps prop; -+ UIntLzmaProb *probs; -+ const Byte *buf; -+ UInt32 range, code; -+ Byte *dic; -+ UInt32 dicPos; -+ UInt32 dicBufSize; -+ Byte *inp; -+ UInt32 inpPos, inpSize; -+ UInt32 inpBufSize; -+ UInt32 processedPos; -+ UInt32 checkDicSize; -+ unsigned state; -+ UInt32 reps[4]; -+ unsigned remainLen; -+ int needFlush; -+ int needInitState; -+ UInt32 numProbs; -+ unsigned tempBufSize; -+ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; -+ UInt64 inpFilePos; -+ UInt64 dicFilePos; -+ struct { -+ UInt64 fmax, fpos; -+ } filec, fileu; -+} CLzmaDec; -+ -+#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } -+ -+void LzmaDec_Init(CLzmaDec *p); -+ -+/* There are two types of LZMA streams: -+ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. -+ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ -+ -+typedef enum -+{ -+ LZMA_FINISH_ANY, /* finish at any point */ -+ LZMA_FINISH_END /* block must be finished at the end */ -+} ELzmaFinishMode; -+ -+/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! -+ -+ You must use LZMA_FINISH_END, when you know that current output buffer -+ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. -+ -+ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, -+ and output value of destLen will be less than output buffer size limit. -+ You can check status result also. -+ -+ You can use multiple checks to test data integrity after full decompression: -+ 1) Check Result and "status" variable. -+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. -+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. -+ You must use correct finish mode in that case. */ -+ -+typedef enum -+{ -+ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ -+ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ -+ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ -+ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ -+} ELzmaStatus; -+ -+/* ELzmaStatus is used only as output value for function call */ -+ -+ -+/* ---------- Interfaces ---------- */ -+ -+/* There are 3 levels of interfaces: -+ 1) Dictionary Interface -+ 2) Buffer Interface -+ 3) One Call Interface -+ You can select any of these interfaces, but don't mix functions from different -+ groups for same object. */ -+ -+ -+/* There are two variants to allocate state for Dictionary Interface: -+ 1) LzmaDec_Allocate / LzmaDec_Free -+ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs -+ You can use variant 2, if you set dictionary buffer manually. -+ For Buffer Interface you must always use variant 1. -+ -+LzmaDec_Allocate* can return: -+ SZ_OK -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+*/ -+ -+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); -+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); -+ -+SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); -+void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); -+ -+/* ---------- Dictionary Interface ---------- */ -+ -+/* You can use it, if you want to eliminate the overhead for data copying from -+ dictionary to some other external buffer. -+ You must work with CLzmaDec variables directly in this interface. -+ -+ STEPS: -+ LzmaDec_Constr() -+ LzmaDec_Allocate() -+ for (each new stream) -+ { -+ LzmaDec_Init() -+ while (it needs more decompression) -+ { -+ LzmaDec_DecodeToDic() -+ use data from CLzmaDec::dic and update CLzmaDec::dicPos -+ } -+ } -+ LzmaDec_Free() -+*/ -+ -+/* LzmaDec_DecodeToDic -+ -+ The decoding to internal dictionary buffer (CLzmaDec::dic). -+ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (dicLimit). -+ LZMA_FINISH_ANY - Decode just dicLimit bytes. -+ LZMA_FINISH_END - Stream must be finished after dicLimit. -+ -+Returns: -+ SZ_OK -+ status: -+ LZMA_STATUS_FINISHED_WITH_MARK -+ LZMA_STATUS_NOT_FINISHED -+ LZMA_STATUS_NEEDS_MORE_INPUT -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK -+ SZ_ERROR_DATA - Data error -+*/ -+ -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, -+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); -+ -+ -+/* ---------- Buffer Interface ---------- */ -+ -+/* It's zlib-like interface. -+ See LzmaDec_DecodeToDic description for information about STEPS and return results, -+ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need -+ to work with CLzmaDec variables manually. -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (*destLen). -+ LZMA_FINISH_ANY - Decode just destLen bytes. -+ LZMA_FINISH_END - Stream must be finished after (*destLen). -+*/ -+ -+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, -+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); -+ -+ -+/* ---------- One Call Interface ---------- */ -+ -+/* LzmaDecode -+ -+finishMode: -+ It has meaning only if the decoding reaches output limit (*destLen). -+ LZMA_FINISH_ANY - Decode just destLen bytes. -+ LZMA_FINISH_END - Stream must be finished after (*destLen). -+ -+Returns: -+ SZ_OK -+ status: -+ LZMA_STATUS_FINISHED_WITH_MARK -+ LZMA_STATUS_NOT_FINISHED -+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK -+ SZ_ERROR_DATA - Data error -+ SZ_ERROR_MEM - Memory allocation error -+ SZ_ERROR_UNSUPPORTED - Unsupported properties -+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). -+*/ -+ -+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, -+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, -+ ELzmaStatus *status, ISzAlloc *alloc); -+ -+/* -------------------------------------------------------------------------- */ -+ -+/* LzmaDec.c -- LZMA Decoder -+2009-09-20 : Igor Pavlov : Public domain */ -+ -+//#include "LzmaDec.h" -+ -+//#include -+ -+#define kNumTopBits 24 -+#define kTopValue ((UInt32)1 << kNumTopBits) -+ -+#define kNumBitModelTotalBits 11 -+#define kBitModelTotal (1 << kNumBitModelTotalBits) -+#define kNumMoveBits 5 -+ -+#define RC_INIT_SIZE 5 -+ -+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } -+ -+#define TEST_BIT_0(p) ({ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; (code < bound);}) -+#define UPDATE_0(p) range = bound; *(p) = (UIntLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); -+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (UIntLzmaProb)(ttt - (ttt >> kNumMoveBits)); -+#define GET_BIT2(p, i, A0, A1) if(TEST_BIT_0(p)) \ -+ { UPDATE_0(p); i = (i + i); A0; } else \ -+ { UPDATE_1(p); i = (i + i) + 1; A1; } -+#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) -+ -+#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } -+#define TREE_DECODE(probs, limit, i) \ -+ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } -+ -+/* #define _LZMA_SIZE_OPT */ -+ -+#ifdef _LZMA_SIZE_OPT -+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) -+#else -+#define TREE_6_DECODE(probs, i) \ -+ { i = 1; \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ TREE_GET_BIT(probs, i); \ -+ i -= 0x40; } -+#endif -+ -+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } -+ -+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -+#define UPDATE_0_CHECK range = bound; -+#define UPDATE_1_CHECK range -= bound; code -= bound; -+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ -+ { UPDATE_0_CHECK; i = (i + i); A0; } else \ -+ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } -+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) -+#define TREE_DECODE_CHECK(probs, limit, i) \ -+ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } -+ -+ -+#define kNumPosBitsMax 4 -+#define kNumPosStatesMax (1 << kNumPosBitsMax) -+ -+#define kLenNumLowBits 3 -+#define kLenNumLowSymbols (1 << kLenNumLowBits) -+#define kLenNumMidBits 3 -+#define kLenNumMidSymbols (1 << kLenNumMidBits) -+#define kLenNumHighBits 8 -+#define kLenNumHighSymbols (1 << kLenNumHighBits) -+ -+#define LenChoice 0 -+#define LenChoice2 (LenChoice + 1) -+#define LenLow (LenChoice2 + 1) -+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) -+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) -+#define kNumLenProbs (LenHigh + kLenNumHighSymbols) -+ -+ -+#define kNumStates 12 -+#define kNumLitStates 7 -+ -+#define kStartPosModelIndex 4 -+#define kEndPosModelIndex 14 -+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) -+ -+#define kNumPosSlotBits 6 -+#define kNumLenToPosStates 4 -+ -+#define kNumAlignBits 4 -+#define kAlignTableSize (1 << kNumAlignBits) -+ -+#define kMatchMinLen 2 -+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) -+ -+#define IsMatch 0 -+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) -+#define IsRepG0 (IsRep + kNumStates) -+#define IsRepG1 (IsRepG0 + kNumStates) -+#define IsRepG2 (IsRepG1 + kNumStates) -+#define IsRep0Long (IsRepG2 + kNumStates) -+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) -+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) -+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) -+#define LenCoder (Align + kAlignTableSize) -+#define RepLenCoder (LenCoder + kNumLenProbs) -+#define Literal (RepLenCoder + kNumLenProbs) -+ -+#define LZMA_BASE_SIZE 1846 -+#define LZMA_LIT_SIZE 768 -+ -+#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) -+ -+#if Literal != LZMA_BASE_SIZE -+StopCompilingDueBUG -+#endif -+ -+#define LZMA_DIC_MIN (1 << 12) -+ -+/* First LZMA-symbol is always decoded. -+And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization -+Out: -+ Result: -+ SZ_OK - OK -+ SZ_ERROR_DATA - Error -+ p->remainLen: -+ < kMatchSpecLenStart : normal remain -+ = kMatchSpecLenStart : finished -+ = kMatchSpecLenStart + 1 : Flush marker -+ = kMatchSpecLenStart + 2 : State Init Marker -+*/ -+ -+static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -+{ -+ UIntLzmaProb *probs = p->probs; -+ -+ unsigned state = p->state; -+ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; -+ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; -+ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; -+ unsigned lc = p->prop.lc; -+ -+ Byte *dic = p->dic; -+ SizeT dicBufSize = p->dicBufSize; -+ SizeT dicPos = p->dicPos; -+ -+ UInt32 processedPos = p->processedPos; -+ UInt32 checkDicSize = p->checkDicSize; -+ unsigned len = 0; -+ -+ const Byte *buf = p->buf; -+ UInt32 range = p->range; -+ UInt32 code = p->code; -+ -+ do -+ { -+ UIntLzmaProb *prob; -+ UInt32 bound; -+ unsigned ttt; -+ unsigned posState = processedPos & pbMask; -+ -+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; -+ if(TEST_BIT_0(prob)) -+ { -+ unsigned symbol; -+ UPDATE_0(prob); -+ prob = probs + Literal; -+ if (checkDicSize != 0 || processedPos != 0) -+ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + -+ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); -+ -+ if (state < kNumLitStates) -+ { -+ state -= (state < 4) ? state : 3; -+ symbol = 1; -+ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); -+ } -+ else -+ { -+ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ unsigned offs = 0x100; -+ state -= (state < 10) ? 3 : 6; -+ symbol = 1; -+ do -+ { -+ unsigned bit; -+ UIntLzmaProb *probLit; -+ matchByte <<= 1; -+ bit = (matchByte & offs); -+ probLit = prob + offs + bit + symbol; -+ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) -+ } -+ while (symbol < 0x100); -+ } -+ dic[dicPos++] = (Byte)symbol; -+ processedPos++; -+ continue; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ prob = probs + IsRep + state; -+ if(TEST_BIT_0(prob)) -+ { -+ UPDATE_0(prob); -+ state += kNumStates; -+ prob = probs + LenCoder; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ if (checkDicSize == 0 && processedPos == 0) -+ return SZ_ERROR_DATA; -+ prob = probs + IsRepG0 + state; -+ if(TEST_BIT_0(prob)) -+ { -+ UPDATE_0(prob); -+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; -+ if(TEST_BIT_0(prob)) -+ { -+ UPDATE_0(prob); -+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ dicPos++; -+ processedPos++; -+ state = state < kNumLitStates ? 9 : 11; -+ continue; -+ } -+ UPDATE_1(prob); -+ } -+ else -+ { -+ UInt32 distance; -+ UPDATE_1(prob); -+ prob = probs + IsRepG1 + state; -+ if(TEST_BIT_0(prob)) -+ { -+ UPDATE_0(prob); -+ distance = rep1; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ prob = probs + IsRepG2 + state; -+ if(TEST_BIT_0(prob)) -+ { -+ UPDATE_0(prob); -+ distance = rep2; -+ } -+ else -+ { -+ UPDATE_1(prob); -+ distance = rep3; -+ rep3 = rep2; -+ } -+ rep2 = rep1; -+ } -+ rep1 = rep0; -+ rep0 = distance; -+ } -+ state = state < kNumLitStates ? 8 : 11; -+ prob = probs + RepLenCoder; -+ } -+ { -+ unsigned limit, offset; -+ UIntLzmaProb *probLen = prob + LenChoice; -+ if(TEST_BIT_0(probLen)) -+ { -+ UPDATE_0(probLen); -+ probLen = prob + LenLow + (posState << kLenNumLowBits); -+ offset = 0; -+ limit = (1 << kLenNumLowBits); -+ } -+ else -+ { -+ UPDATE_1(probLen); -+ probLen = prob + LenChoice2; -+ if(TEST_BIT_0(probLen)) -+ { -+ UPDATE_0(probLen); -+ probLen = prob + LenMid + (posState << kLenNumMidBits); -+ offset = kLenNumLowSymbols; -+ limit = (1 << kLenNumMidBits); -+ } -+ else -+ { -+ UPDATE_1(probLen); -+ probLen = prob + LenHigh; -+ offset = kLenNumLowSymbols + kLenNumMidSymbols; -+ limit = (1 << kLenNumHighBits); -+ } -+ } -+ TREE_DECODE(probLen, limit, len); -+ len += offset; -+ } -+ -+ if (state >= kNumStates) -+ { -+ UInt32 distance; -+ prob = probs + PosSlot + -+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); -+ TREE_6_DECODE(prob, distance); -+ if (distance >= kStartPosModelIndex) -+ { -+ unsigned posSlot = (unsigned)distance; -+ int numDirectBits = (int)(((distance >> 1) - 1)); -+ distance = (2 | (distance & 1)); -+ if (posSlot < kEndPosModelIndex) -+ { -+ distance <<= numDirectBits; -+ prob = probs + SpecPos + distance - posSlot - 1; -+ { -+ UInt32 mask = 1; -+ unsigned i = 1; -+ do -+ { -+ GET_BIT2(prob + i, i, ; , distance |= mask); -+ mask <<= 1; -+ } -+ while (--numDirectBits != 0); -+ } -+ } -+ else -+ { -+ numDirectBits -= kNumAlignBits; -+ do -+ { -+ NORMALIZE -+ range >>= 1; -+ -+ { -+ UInt32 t; -+ code -= range; -+ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ -+ distance = (distance << 1) + (t + 1); -+ code += range & t; -+ } -+ /* -+ distance <<= 1; -+ if (code >= range) -+ { -+ code -= range; -+ distance |= 1; -+ } -+ */ -+ } -+ while (--numDirectBits != 0); -+ prob = probs + Align; -+ distance <<= kNumAlignBits; -+ { -+ unsigned i = 1; -+ GET_BIT2(prob + i, i, ; , distance |= 1); -+ GET_BIT2(prob + i, i, ; , distance |= 2); -+ GET_BIT2(prob + i, i, ; , distance |= 4); -+ GET_BIT2(prob + i, i, ; , distance |= 8); -+ } -+ if (distance == (UInt32)0xFFFFFFFF) -+ { -+ len += kMatchSpecLenStart; -+ state -= kNumStates; -+ break; -+ } -+ } -+ } -+ rep3 = rep2; -+ rep2 = rep1; -+ rep1 = rep0; -+ rep0 = distance + 1; -+ if (checkDicSize == 0) -+ { -+ if (distance >= processedPos) -+ return SZ_ERROR_DATA; -+ } -+ else if (distance >= checkDicSize) -+ return SZ_ERROR_DATA; -+ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; -+ } -+ -+ len += kMatchMinLen; -+ -+ if (limit == dicPos) -+ return SZ_ERROR_DATA; -+ { -+ SizeT rem = limit - dicPos; -+ unsigned curLen = ((rem < len) ? (unsigned)rem : len); -+ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); -+ -+ processedPos += curLen; -+ -+ len -= curLen; -+ if (pos + curLen <= dicBufSize) -+ { -+ Byte *dest = dic + dicPos; -+ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; -+ const Byte *lim = dest + curLen; -+ dicPos += curLen; -+ do -+ *(dest) = (Byte)(*(dest + src)); -+ while (++dest != lim); -+ } -+ else -+ { -+ do -+ { -+ dic[dicPos++] = dic[pos]; -+ if (++pos == dicBufSize) -+ pos = 0; -+ } -+ while (--curLen != 0); -+ } -+ } -+ } -+ } -+ while (dicPos < limit && buf < bufLimit); -+ NORMALIZE; -+ p->buf = buf; -+ p->range = range; -+ p->code = code; -+ p->remainLen = len; -+ p->dicPos = dicPos; -+ p->processedPos = processedPos; -+ p->reps[0] = rep0; -+ p->reps[1] = rep1; -+ p->reps[2] = rep2; -+ p->reps[3] = rep3; -+ p->state = state; -+ -+ return SZ_OK; -+} -+ -+static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) -+{ -+ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) -+ { -+ Byte *dic = p->dic; -+ SizeT dicPos = p->dicPos; -+ SizeT dicBufSize = p->dicBufSize; -+ unsigned len = p->remainLen; -+ UInt32 rep0 = p->reps[0]; -+ if (limit - dicPos < len) -+ len = (unsigned)(limit - dicPos); -+ -+ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) -+ p->checkDicSize = p->prop.dicSize; -+ -+ p->processedPos += len; -+ p->remainLen -= len; -+ while (len-- != 0) -+ { -+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; -+ dicPos++; -+ } -+ p->dicPos = dicPos; -+ } -+} -+ -+static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) -+{ -+ do -+ { -+ SizeT limit2 = limit; -+ if (p->checkDicSize == 0) -+ { -+ UInt32 rem = p->prop.dicSize - p->processedPos; -+ if (limit - p->dicPos > rem) -+ limit2 = p->dicPos + rem; -+ } -+ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); -+ if (p->processedPos >= p->prop.dicSize) -+ p->checkDicSize = p->prop.dicSize; -+ LzmaDec_WriteRem(p, limit); -+ } -+ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); -+ -+ if (p->remainLen > kMatchSpecLenStart) -+ { -+ p->remainLen = kMatchSpecLenStart; -+ } -+ return 0; -+} -+ -+typedef enum -+{ -+ DUMMY_ERROR, /* unexpected end of input stream */ -+ DUMMY_LIT, -+ DUMMY_MATCH, -+ DUMMY_REP -+} ELzmaDummy; -+ -+static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) -+{ -+ UInt32 range = p->range; -+ UInt32 code = p->code; -+ const Byte *bufLimit = buf + inSize; -+ UIntLzmaProb *probs = p->probs; -+ unsigned state = p->state; -+ ELzmaDummy res; -+ -+ { -+ UIntLzmaProb *prob; -+ UInt32 bound; -+ unsigned ttt; -+ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); -+ -+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK -+ -+ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ -+ -+ prob = probs + Literal; -+ if (p->checkDicSize != 0 || p->processedPos != 0) -+ prob += (LZMA_LIT_SIZE * -+ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + -+ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); -+ -+ if (state < kNumLitStates) -+ { -+ unsigned symbol = 1; -+ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); -+ } -+ else -+ { -+ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + -+ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; -+ unsigned offs = 0x100; -+ unsigned symbol = 1; -+ do -+ { -+ unsigned bit; -+ UIntLzmaProb *probLit; -+ matchByte <<= 1; -+ bit = (matchByte & offs); -+ probLit = prob + offs + bit + symbol; -+ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) -+ } -+ while (symbol < 0x100); -+ } -+ res = DUMMY_LIT; -+ } -+ else -+ { -+ unsigned len; -+ UPDATE_1_CHECK; -+ -+ prob = probs + IsRep + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ state = 0; -+ prob = probs + LenCoder; -+ res = DUMMY_MATCH; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ res = DUMMY_REP; -+ prob = probs + IsRepG0 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ NORMALIZE_CHECK; -+ return DUMMY_REP; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ } -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ prob = probs + IsRepG1 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ prob = probs + IsRepG2 + state; -+ IF_BIT_0_CHECK(prob) -+ { -+ UPDATE_0_CHECK; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ } -+ } -+ } -+ state = kNumStates; -+ prob = probs + RepLenCoder; -+ } -+ { -+ unsigned limit, offset; -+ UIntLzmaProb *probLen = prob + LenChoice; -+ IF_BIT_0_CHECK(probLen) -+ { -+ UPDATE_0_CHECK; -+ probLen = prob + LenLow + (posState << kLenNumLowBits); -+ offset = 0; -+ limit = 1 << kLenNumLowBits; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ probLen = prob + LenChoice2; -+ IF_BIT_0_CHECK(probLen) -+ { -+ UPDATE_0_CHECK; -+ probLen = prob + LenMid + (posState << kLenNumMidBits); -+ offset = kLenNumLowSymbols; -+ limit = 1 << kLenNumMidBits; -+ } -+ else -+ { -+ UPDATE_1_CHECK; -+ probLen = prob + LenHigh; -+ offset = kLenNumLowSymbols + kLenNumMidSymbols; -+ limit = 1 << kLenNumHighBits; -+ } -+ } -+ TREE_DECODE_CHECK(probLen, limit, len); -+ len += offset; -+ } -+ -+ if (state < 4) -+ { -+ unsigned posSlot; -+ prob = probs + PosSlot + -+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << -+ kNumPosSlotBits); -+ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); -+ if (posSlot >= kStartPosModelIndex) -+ { -+ int numDirectBits = ((posSlot >> 1) - 1); -+ -+ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ -+ -+ if (posSlot < kEndPosModelIndex) -+ { -+ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; -+ } -+ else -+ { -+ numDirectBits -= kNumAlignBits; -+ do -+ { -+ NORMALIZE_CHECK -+ range >>= 1; -+ code -= range & (((code - range) >> 31) - 1); -+ /* if (code >= range) code -= range; */ -+ } -+ while (--numDirectBits != 0); -+ prob = probs + Align; -+ numDirectBits = kNumAlignBits; -+ } -+ { -+ unsigned i = 1; -+ do -+ { -+ GET_BIT_CHECK(prob + i, i); -+ } -+ while (--numDirectBits != 0); -+ } -+ } -+ } -+ } -+ } -+ NORMALIZE_CHECK; -+ return res; -+} -+ -+ -+static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) -+{ -+ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); -+ p->range = 0xFFFFFFFF; -+ p->needFlush = 0; -+} -+ -+void LzmaDec_Init(CLzmaDec *p) -+{ -+ p->dicFilePos = 0; -+ p->dicPos = 0; -+ p->needFlush = 1; -+ p->remainLen = 0; -+ p->tempBufSize = 0; -+ p->processedPos = 0; -+ p->checkDicSize = 0; -+ p->needInitState = 1; -+ p->needInitState = 1; -+} -+ -+static void LzmaDec_InitStateReal(CLzmaDec *p) -+{ -+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); -+ UInt32 i; -+ UIntLzmaProb *probs = p->probs; -+ for (i = 0; i < numProbs; i++) -+ probs[i] = kBitModelTotal >> 1; -+ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; -+ p->state = 0; -+ p->needInitState = 0; -+} -+ -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, -+ ELzmaFinishMode finishMode, ELzmaStatus *status) -+{ -+ SizeT inSize = *srcLen; -+ (*srcLen) = 0; -+ LzmaDec_WriteRem(p, dicLimit); -+ -+ *status = LZMA_STATUS_NOT_SPECIFIED; -+ -+ while (p->remainLen != kMatchSpecLenStart) -+ { -+ int checkEndMarkNow; -+ -+ if (p->needFlush != 0) -+ { -+ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) -+ p->tempBuf[p->tempBufSize++] = *src++; -+ if (p->tempBufSize < RC_INIT_SIZE) -+ { -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (p->tempBuf[0] != 0) -+ return SZ_ERROR_DATA; -+ -+ LzmaDec_InitRc(p, p->tempBuf); -+ p->tempBufSize = 0; -+ } -+ -+ checkEndMarkNow = 0; -+ if (p->dicPos >= dicLimit) -+ { -+ if (p->remainLen == 0 && p->code == 0) -+ { -+ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; -+ return SZ_OK; -+ } -+ if (finishMode == LZMA_FINISH_ANY) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_OK; -+ } -+ if (p->remainLen != 0) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ checkEndMarkNow = 1; -+ } -+ -+ if (p->needInitState) -+ LzmaDec_InitStateReal(p); -+ -+ if (p->tempBufSize == 0) -+ { -+ SizeT processed; -+ const Byte *bufLimit; -+ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) -+ { -+ int dummyRes = LzmaDec_TryDummy(p, src, inSize); -+ if (dummyRes == DUMMY_ERROR) -+ { -+ memcpy(p->tempBuf, src, inSize); -+ p->tempBufSize = (unsigned)inSize; -+ (*srcLen) += inSize; -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ bufLimit = src; -+ } -+ else -+ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; -+ p->buf = src; -+ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) -+ return SZ_ERROR_DATA; -+ processed = (SizeT)(p->buf - src); -+ (*srcLen) += processed; -+ src += processed; -+ inSize -= processed; -+ } -+ else -+ { -+ unsigned rem = p->tempBufSize, lookAhead = 0; -+ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) -+ p->tempBuf[rem++] = src[lookAhead++]; -+ p->tempBufSize = rem; -+ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) -+ { -+ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); -+ if (dummyRes == DUMMY_ERROR) -+ { -+ (*srcLen) += lookAhead; -+ *status = LZMA_STATUS_NEEDS_MORE_INPUT; -+ return SZ_OK; -+ } -+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) -+ { -+ *status = LZMA_STATUS_NOT_FINISHED; -+ return SZ_ERROR_DATA; -+ } -+ } -+ p->buf = p->tempBuf; -+ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) -+ return SZ_ERROR_DATA; -+ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); -+ (*srcLen) += lookAhead; -+ src += lookAhead; -+ inSize -= lookAhead; -+ p->tempBufSize = 0; -+ } -+ } -+ if (p->code == 0) -+ *status = LZMA_STATUS_FINISHED_WITH_MARK; -+ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; -+} -+ -+/* -------------------------------------------------------------------------- */ -+ -+#define ReadUnalignedUInt32(p) ((UInt32)((Byte*)(p))[0] | ((UInt32)((Byte*)(p))[1]<<8) | ((UInt32)((Byte*)(p))[2]<<16) | ((UInt32)((Byte*)(p))[3]<<24)) -+#define ReadUnalignedUInt64(p) (ReadUnalignedUInt32(p) | ((UInt64)ReadUnalignedUInt32((Byte*)(p)+4)<<32)) -+ -+CLzmaDec lzmadec; -+ -+static unsigned long malloc_top = 0; -+static void *grub_malloc(unsigned long size) -+{ -+ if (!malloc_top) -+ malloc_top = RAW_ADDR ((saved_mem_upper << 10) + 0x100000); -+ malloc_top = (malloc_top - size) & ~3; -+ return (void *) malloc_top; -+} -+#define grub_free(x) -+ -+int -+dec_lzma_open (void) -+// return 1=success or 0=failure -+{ -+ unsigned char header[13]; -+ unsigned char d; -+ -+ if (no_decompression) return 0; -+ -+ // Now it does not support openning more than 1 file at a time. -+ // Make sure previously allocated memory blocks is freed. -+ // Don't need this line if grub_close is called for every openned file before grub_open is called for next file. -+ dec_lzma_close(); -+ -+ filepos = 0; -+ if (grub_read ((char *)header, 13, 0xedde0d90) == 13) -+ { -+ // check header -+ lzmadec.prop.dicSize = ReadUnalignedUInt32(header+1); -+ if (lzmadec.prop.dicSize < LZMA_DIC_MIN) -+ lzmadec.prop.dicSize = LZMA_DIC_MIN; -+ d = header[0]; -+ if (d < 9*5*5) -+ { -+ // valid LZMA file -+ lzmadec.prop.lc = d % 9; d /= 9; -+ lzmadec.prop.lp = d % 5; -+ lzmadec.prop.pb = d / 5; -+ lzmadec.fileu.fmax = ReadUnalignedUInt64(header+5); -+ lzmadec.fileu.fpos = 0; -+ lzmadec.dicBufSize = lzmadec.prop.dicSize; -+ lzmadec.dic = (Byte*) grub_malloc(lzmadec.dicBufSize); -+ //grub_printf("LZMA allocate memory\n"); -+ if (lzmadec.dic) -+ { -+ lzmadec.numProbs = LzmaProps_GetNumProbs(&lzmadec.prop); -+ lzmadec.probs = (UIntLzmaProb *) grub_malloc(lzmadec.numProbs * sizeof(UIntLzmaProb)); -+ if (lzmadec.probs) -+ { -+ lzmadec.inpBufSize = 0x8000; -+ lzmadec.inp = (Byte*) grub_malloc(lzmadec.inpBufSize); -+ if (lzmadec.inp) -+ { -+ lzmadec.inpFilePos = 0; -+ lzmadec.inpPos = 0; -+ lzmadec.inpSize = 0; -+ LzmaDec_Init(&lzmadec); -+ decomp_type = 1; -+ compressed_file = 1; -+ lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax; -+ lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos; -+ // success -+ //grub_printf("LZMA open success\n"); -+ errnum = 0; -+ return 1; -+ } -+ else -+ { -+ errnum = ERR_NOT_ENOUGH_MEMORY; -+ } -+ grub_free(lzmadec.probs); lzmadec.probs = 0; -+ } -+ else -+ { -+ errnum = ERR_NOT_ENOUGH_MEMORY; -+ } -+ grub_free(lzmadec.dic); lzmadec.dic = 0; -+ } -+ else -+ { -+ errnum = ERR_NOT_ENOUGH_MEMORY; -+ } -+ } -+ else -+ { -+ //grub_printf("LZMA allocate memory\n"); -+ errnum = ERR_BAD_GZIP_HEADER; -+ } -+ } -+ else -+ { -+ //grub_printf("LZMA error reading header\n"); -+ errnum = ERR_BAD_GZIP_HEADER; -+ } -+ //grub_printf("LZMA open fail\n"); -+ filepos = 0; -+ return 0; -+} -+ -+void -+dec_lzma_close (void) -+{ -+ if (lzmadec.inp ) { grub_free(lzmadec.inp ); lzmadec.inp = 0; } -+ if (lzmadec.dic ) { grub_free(lzmadec.dic ); lzmadec.dic = 0; } -+ if (lzmadec.probs) { grub_free(lzmadec.probs); lzmadec.probs = 0; } -+} -+ -+unsigned long -+dec_lzma_read (char *buf, unsigned long len, unsigned long write) -+{ -+ UInt64 outTx, outSkip; -+ //grub_printf("LZMA read buf=%ld len=%ld dic=%d inp=%d\n",buf,len,lzmadec.dic,lzmadec.inp); -+ -+ compressed_file = 0; -+ lzmadec.fileu.fmax = filemax; filemax = lzmadec.filec.fmax; -+ lzmadec.fileu.fpos = filepos; filepos = lzmadec.filec.fpos; -+ /* Now filepos, filemax is of compressed file -+ * fileu.fpos, fileu.fmax is of uncompressed data -+ * filec is not used -+ */ -+ -+ /* -+ * When dicPos>0, -+ * dic[0 ... dicPos-1] contains -+ * uncompressed_data [dicFilePos ... dicFilePos+dicPos-1]. -+ * When dicFilePos>0, -+ * dic[dicPos ... dicBufSize-1] contains -+ * uncompressed_data [dicFilePos-dicBufSize+dicFilePos ... dicFilePos-1] -+ */ -+ /* do we reset decompression to the beginning of the file? */ -+ if (lzmadec.dicFilePos && (lzmadec.fileu.fpos < lzmadec.dicFilePos-lzmadec.dicBufSize+lzmadec.dicFilePos)) -+ { -+ LzmaDec_Init(&lzmadec); -+ filepos = 13; -+ lzmadec.inpPos = lzmadec.inpSize = 0; -+ } -+ -+ outTx = 0; -+ outSkip = lzmadec.fileu.fpos - lzmadec.dicFilePos; -+ //grub_printf("fileu.fpos=%ld dicFilePos=%ld\n",lzmadec.fileu.fpos,lzmadec.dicFilePos); -+ -+ /* Copy uncompressed data from upper part of dic. dic[dicPos]...dic[dicBufSize-1] */ -+ if (lzmadec.dicFilePos > lzmadec.fileu.fpos) -+ { -+ UInt32 outTxCur = lzmadec.dicFilePos - lzmadec.fileu.fpos; -+ if (outTxCur > len) outTxCur = len; -+ if (buf) -+ { -+ grub_memmove(buf, lzmadec.dic+outSkip+lzmadec.dicBufSize, outTxCur); -+ buf += outTxCur; -+ } -+ outSkip = 0; -+ outTx += outTxCur; -+ lzmadec.fileu.fpos += outTxCur; -+ len -= outTxCur; -+ } -+ -+ while (len!=0) -+ { -+ SizeT inSizeCur, dicLimit; -+ UInt32 dicPos; -+ ELzmaStatus status; -+ SRes res; -+ -+ /* Copy uncompressed data from lower part of dic. dic[0]...dic[dicPos-1] */ -+ //grub_printf("Loop len=%ld outSkip=%ld dicPos=%d\n",len,outSkip,lzmadec.dicPos); -+ if (outSkip < lzmadec.dicPos) -+ { -+ UInt32 outTxCur = lzmadec.dicPos - outSkip; -+ //grub_printf("Copy %d byte ",outTxCur); -+ if (buf) -+ { -+ grub_memmove(buf, lzmadec.dic+outSkip, outTxCur); -+ buf += outTxCur; -+ } -+ outSkip = lzmadec.dicPos; -+ outTx += outTxCur; -+ lzmadec.fileu.fpos += outTxCur; -+ len -= outTxCur; -+ //grub_printf(" remaining len=%ld\n",len); -+ if (len==0) break; -+ } -+ /* All existing wanted data from dic have been copied. We will add more data to dic. */ -+ /* Read more input if there is no unprocessed input left. */ -+ if (lzmadec.inpPos == lzmadec.inpSize) -+ { -+ UInt32 inTxCur = (filemax-filepos%d\n",lzmadec.inpSize); -+ } -+ inSizeCur = lzmadec.inpSize - lzmadec.inpPos; -+ -+ /* Prepare output dicPos, dicLimit. */ -+ if (lzmadec.dicPos == lzmadec.dicBufSize) -+ { -+ lzmadec.dicPos = 0; -+ outSkip -= lzmadec.dicBufSize; -+ } -+ dicPos = lzmadec.dicPos; -+ dicLimit = (lzmadec.dicBufSize-dicPos < len)? lzmadec.dicBufSize: dicPos+len; -+ -+ /* Do decompression. */ -+ //grub_printf("DecodeToDic dicPos=%d limit=%d inPos=%d inSize=%d ",dicPos,dicLimit,lzmadec.inpPos,inSizeCur); -+ status = LZMA_STATUS_NOT_SPECIFIED; -+ res = LzmaDec_DecodeToDic(&lzmadec, dicLimit, lzmadec.inp+lzmadec.inpPos, &inSizeCur, LZMA_FINISH_ANY, &status); -+ //grub_printf("->%d\n",inSizeCur); -+ lzmadec.inpPos += inSizeCur; -+ if (inSizeCur==0 && lzmadec.dicPos==dicPos) -+ { -+ /* Error */ -+ //grub_printf("No more input and output\n"); -+ break; -+ } -+ } -+ compressed_file = 1; -+ lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax; -+ lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos; -+ /* Now filepos, file max is of uncompressed data -+ * filec.fpos, filwc.fmax is of compressed file -+ * fileu is not used -+ */ -+ -+ //grub_printf("LZMA read end %ld\n",outTx); -+ return outTx; -+} -+ -+#endif /* ! NO_DECOMPRESSION */ -diff -Naur ../grub4dos-chenall-r63/stage2/decomp.h ./stage2/decomp.h ---- grub4dos-chenall-r63/stage2/decomp.h 1970-01-01 07:00:00.000000000 +0700 -+++ grub4dos/stage2/decomp.h 2010-11-28 13:51:54.687217000 +0700 -@@ -0,0 +1,36 @@ -+/* decomp.h - abstract decompression interface */ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#ifndef ASM_FILE -+ -+struct decomp_entry -+{ -+ char *name; -+ int (*open_func) (void); -+ void (*close_func) (void); -+ unsigned long (*read_func) (char *buf, unsigned long len, unsigned long write); -+}; -+ -+#define NUM_DECOM 2 -+ -+extern struct decomp_entry decomp_table[NUM_DECOM]; -+extern int decomp_type; -+ -+#endif -\ No newline at end of file -diff -Naur ../grub4dos-chenall-r63/stage2/disk_io.c ./stage2/disk_io.c ---- grub4dos-chenall-r63/stage2/disk_io.c 2010-08-12 14:22:47.111207000 +0700 -+++ grub4dos/stage2/disk_io.c 2010-11-28 20:26:39.089887300 +0700 -@@ -21,6 +21,7 @@ - - #include - #include -+#include - #include - - #ifdef SUPPORT_NETBOOT -@@ -1872,7 +1873,16 @@ - #ifdef NO_DECOMPRESSION - return 1; - #else -- return gunzip_test_header (); -+ if (no_decompression) -+ return 1; -+ int i; -+ i = strlen(open_filename); -+ if (i>=5 && strcmp(open_filename+i-5,".lzma")==0) -+ dec_lzma_open (); -+ else -+ gunzip_test_header (); -+ errnum = 0; -+ return 1; - #endif - } - -@@ -1903,7 +1903,7 @@ - { - if (write == 0x900ddeed) - return !(errnum = ERR_WRITE_GZIP_FILE); -- return gunzip_read (buf, len); -+ return decomp_table[decomp_type].read_func (buf, len, write); - } - #endif /* NO_DECOMPRESSION */ - -@@ -1978,6 +1982,12 @@ - void - grub_close (void) - { -+#ifndef NO_DECOMPRESSION -+ if (compressed_file) -+ decomp_table[decomp_type].close_func (); -+ compressed_file = 0; -+#endif /* NO_DECOMPRESSION */ -+ - #ifndef NO_BLOCK_FILES - if (block_file) - return; -diff -Naur ../grub4dos-chenall-r63/stage2/gunzip.c ./stage2/gunzip.c ---- grub4dos-chenall-r63/stage2/gunzip.c 2010-07-26 19:35:48.440546000 +0700 -+++ grub4dos/stage2/gunzip.c 2010-11-28 14:20:56.983870700 +0700 -@@ -129,6 +129,8 @@ - - #include "filesys.h" - -+#include "decomp.h" -+ - /* so we can disable decompression */ - #ifdef GRUB_UTIL - int no_decompression = 0; -@@ -137,6 +139,15 @@ - /* used to tell if "read" should be redirected to "gunzip_read" */ - int compressed_file; - -+/* identify active decompressor */ -+int decomp_type; -+ -+struct decomp_entry decomp_table[NUM_DECOM] = -+{ -+ {"gz",gunzip_test_header,gunzip_close,gunzip_read}, -+ {"lzma",dec_lzma_open,dec_lzma_close,dec_lzma_read} -+}; -+ - /* internal variables only */ - static unsigned long long gzip_data_offset; - static unsigned long long gzip_filepos; -@@ -227,6 +238,7 @@ - /* Little-Endian defines for the 2-byte magic number for gzip files */ - #define GZIP_HDR_LE 0x8B1F - #define OLD_GZIP_HDR_LE 0x9E1F -+#define LZMA_HDR_LE 0x005D - - /* Compression methods (see algorithm.doc) */ - #define STORED 0 -@@ -281,10 +292,18 @@ - if (no_decompression - || grub_read ((char *)buf, 10, 0xedde0d90) != 10 - || ((*((unsigned short *) buf) != GZIP_HDR_LE) -- && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE))) -+ && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE) -+ && (*((unsigned short *) buf) != LZMA_HDR_LE))) - { - filepos = 0; - return ! errnum; -+ } -+ -+ if (*((unsigned short *) buf) == LZMA_HDR_LE) -+ { -+ filepos = 0; -+ dec_lzma_open(); -+ return 1; - } - - /* -@@ -323,6 +334,7 @@ - - initialize_tables (); - -+ decomp_type = 0; - compressed_file = 1; - gunzip_swap_values (); - /* -@@ -334,6 +346,11 @@ - return 1; - } - -+void -+gunzip_close (void) -+{ -+} -+ - - /* Huffman code lookup table entry--this entry is four bytes for machines - that have 16-bit pointers (e.g. PC's in the small or medium model). -@@ -1190,7 +1226,7 @@ - - - unsigned long --gunzip_read (char *buf, unsigned long len) -+gunzip_read (char *buf, unsigned long len, unsigned long write) - { - unsigned long ret = 0; - -diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.am ./stage2/Makefile.am ---- grub4dos-chenall-r63/stage2/Makefile.am 2010-08-12 14:22:47.111207000 +0700 -+++ grub4dos/stage2/Makefile.am 2010-11-28 16:35:18.724975900 +0700 -@@ -16,6 +16,7 @@ - # The library for /sbin/grub. - noinst_LIBRARIES = libgrub.a - libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \ -+ dec_lzma.c \ - disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \ - fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ - fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \ -@@ -100,7 +101,7 @@ - - # For stage2 target. - pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \ -- cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ -+ cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \ - fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ - fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \ - hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c -diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.in ./stage2/Makefile.in ---- grub4dos-chenall-r63/stage2/Makefile.in 2010-08-12 14:22:47.111207000 +0700 -+++ grub4dos/stage2/Makefile.in 2010-11-28 16:38:22.871508400 +0700 -@@ -104,10 +104,11 @@ - am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \ - libgrub_a-builtins.$(OBJEXT) libgrub_a-char_io.$(OBJEXT) \ - libgrub_a-cmdline.$(OBJEXT) libgrub_a-common.$(OBJEXT) \ -- libgrub_a-disk_io.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \ -- libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_ntfs.$(OBJEXT) \ -- libgrub_a-fsys_ffs.$(OBJEXT) libgrub_a-fsys_iso9660.$(OBJEXT) \ -- libgrub_a-fsys_jfs.$(OBJEXT) libgrub_a-fsys_minix.$(OBJEXT) \ -+ libgrub_a-dec_lzma.$(OBJEXT) libgrub_a-disk_io.$(OBJEXT) \ -+ libgrub_a-fsys_ext2fs.$(OBJEXT) libgrub_a-fsys_fat.$(OBJEXT) \ -+ libgrub_a-fsys_ntfs.$(OBJEXT) libgrub_a-fsys_ffs.$(OBJEXT) \ -+ libgrub_a-fsys_iso9660.$(OBJEXT) libgrub_a-fsys_jfs.$(OBJEXT) \ -+ libgrub_a-fsys_minix.$(OBJEXT) \ - libgrub_a-fsys_reiserfs.$(OBJEXT) \ - libgrub_a-fsys_ufs2.$(OBJEXT) libgrub_a-fsys_vstafs.$(OBJEXT) \ - libgrub_a-fsys_xfs.$(OBJEXT) libgrub_a-fsys_pxe.$(OBJEXT) \ -@@ -131,6 +132,7 @@ - diskless_exec-char_io.$(OBJEXT) \ - diskless_exec-cmdline.$(OBJEXT) diskless_exec-common.$(OBJEXT) \ - diskless_exec-console.$(OBJEXT) \ -+ diskless_exec-dec_lzma.$(OBJEXT) \ - diskless_exec-disk_io.$(OBJEXT) \ - diskless_exec-fsys_ext2fs.$(OBJEXT) \ - diskless_exec-fsys_fat.$(OBJEXT) \ -@@ -247,6 +249,7 @@ - pre_stage2_exec-cmdline.$(OBJEXT) \ - pre_stage2_exec-common.$(OBJEXT) \ - pre_stage2_exec-console.$(OBJEXT) \ -+ pre_stage2_exec-dec_lzma.$(OBJEXT) \ - pre_stage2_exec-disk_io.$(OBJEXT) \ - pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \ - pre_stage2_exec-fsys_fat.$(OBJEXT) \ -@@ -512,6 +513,7 @@ - # The library for /sbin/grub. - noinst_LIBRARIES = libgrub.a - libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \ -+ dec_lzma.c \ - disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \ - fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ - fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \ -@@ -559,7 +563,7 @@ - - # For stage2 target. - pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \ -- cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ -+ cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \ - fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ - fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \ - hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c -@@ -878,6 +882,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-common.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-console.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-dec_lzma.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@ -@@ -935,6 +940,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-char_io.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-cmdline.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-common.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-dec_lzma.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-disk_io.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_ext2fs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_fat.Po@am__quote@ -@@ -974,6 +980,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-console.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-dec_lzma.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@ -@@ -1315,6 +1322,20 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi` - -+libgrub_a-dec_lzma.o: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.o -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='libgrub_a-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c -+ -+libgrub_a-dec_lzma.obj: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='libgrub_a-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` -+ - libgrub_a-disk_io.o: disk_io.c - @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-disk_io.o -MD -MP -MF "$(DEPDIR)/libgrub_a-disk_io.Tpo" -c -o libgrub_a-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ - @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-disk_io.Tpo" "$(DEPDIR)/libgrub_a-disk_io.Po"; else rm -f "$(DEPDIR)/libgrub_a-disk_io.Tpo"; exit 1; fi -@@ -1693,6 +1714,20 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi` - -+diskless_exec-dec_lzma.o: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='diskless_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c -+ -+diskless_exec-dec_lzma.obj: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='diskless_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` -+ - diskless_exec-disk_io.o: disk_io.c - @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/diskless_exec-disk_io.Tpo" -c -o diskless_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ - @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-disk_io.Tpo" "$(DEPDIR)/diskless_exec-disk_io.Po"; else rm -f "$(DEPDIR)/diskless_exec-disk_io.Tpo"; exit 1; fi -@@ -2687,6 +2722,20 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi` - -+pre_stage2_exec-dec_lzma.o: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c -+ -+pre_stage2_exec-dec_lzma.obj: dec_lzma.c -+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` -+ - pre_stage2_exec-disk_io.o: disk_io.c - @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" -c -o pre_stage2_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ - @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" "$(DEPDIR)/pre_stage2_exec-disk_io.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo"; exit 1; fi -diff -Naur ../grub4dos-chenall-r63/stage2/shared.h ./stage2/shared.h ---- grub4dos-chenall-r63/stage2/shared.h 2010-11-17 15:33:51.826683000 +0700 -+++ grub4dos/stage2/shared.h 2010-11-27 01:16:46.996893700 +0700 -@@ -640,6 +640,7 @@ - ERR_WRITE_GZIP_FILE, - ERR_FUNC_CALL, - // ERR_WRITE_TO_NON_MEM_DRIVE, -+ ERR_NOT_ENOUGH_MEMORY, - - MAX_ERR_NUM - } grub_error_t; -@@ -1185,7 +1186,11 @@ - #ifndef NO_DECOMPRESSION - /* Compression support. */ - int gunzip_test_header (void); --unsigned long gunzip_read (char *buf, unsigned long len); -+void gunzip_close (void); -+unsigned long gunzip_read (char *buf, unsigned long len, unsigned long write); -+int dec_lzma_open (void); -+void dec_lzma_close (void); -+unsigned long dec_lzma_read (char *buf, unsigned long len, unsigned long write); - #endif /* NO_DECOMPRESSION */ - - int rawread (unsigned long drive, unsigned long sector, unsigned long byte_offset, unsigned long byte_len, char *buf, unsigned long write); diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/patches/dev_partition.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub4dos/stuff/patches/dev_partition.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,17 @@ +Partition can be ${dev}$num or ${dev}p$num +--- grub-0.97/lib/device.c ++++ grub-0.97/lib/device.c +@@ -867,6 +867,13 @@ + fd = open (dev, O_RDWR); + if (fd < 0) + { ++ strcpy (dev, map[drive]); ++ sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1); ++ fd = open (dev, O_RDWR); ++ } ++ ++ if (fd < 0) ++ { + errnum = ERR_NO_PART; + return 0; + } diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/patches/lzma.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub4dos/stuff/patches/lzma.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1761 @@ +From http://code.google.com/p/grub4dos-chenall/issues/detail?id=6 + +diff -Naur ../grub4dos-chenall-r63/stage2/common.c ./stage2/common.c +--- grub4dos-chenall-r63/stage2/common.c 2010-11-19 12:41:03.196955000 +0700 ++++ grub4dos/stage2/common.c 2010-11-23 21:28:26.509102100 +0700 +@@ -143,6 +143,7 @@ + [ERR_WRITE_GZIP_FILE] = "Attempt to write a gzip file", + [ERR_FUNC_CALL] = "Invalid function call", + // [ERR_WRITE_TO_NON_MEM_DRIVE] = "Only RAM drives can be written when running in a script", ++ [ERR_NOT_ENOUGH_MEMORY] = "Not enough memory", + + }; + +diff -Naur ../grub4dos-chenall-r63/stage2/dec_lzma.c ./stage2/dec_lzma.c +--- grub4dos-chenall-r63/stage2/dec_lzma.c 1970-01-01 07:00:00.000000000 +0700 ++++ grub4dos/stage2/dec_lzma.c 2010-11-28 22:12:06.452791800 +0700 +@@ -0,0 +1,1384 @@ ++/* ++ * GRUB4DOS -- GRand Unified Bootloader ++ * Copyright (C) 1999 Free Software Foundation, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++/* ++ * Most of this file is derives from LZMA SDK 9.12 beta ++ * files Types.h, LzmaDec.h, LzmaDec.c by Igor Pavlov ++ * It has been modified for used in GRUB4DOS. ++ */ ++ ++#ifndef NO_DECOMPRESSION ++ ++#include "shared.h" ++#include "decomp.h" ++ ++/* Types.h -- Basic types ++2010-03-11 : Igor Pavlov : Public domain */ ++ ++#define SZ_OK 0 ++ ++#define SZ_ERROR_DATA 1 ++#define SZ_ERROR_MEM 2 ++#define SZ_ERROR_CRC 3 ++#define SZ_ERROR_UNSUPPORTED 4 ++#define SZ_ERROR_PARAM 5 ++#define SZ_ERROR_INPUT_EOF 6 ++#define SZ_ERROR_OUTPUT_EOF 7 ++#define SZ_ERROR_READ 8 ++#define SZ_ERROR_WRITE 9 ++#define SZ_ERROR_PROGRESS 10 ++#define SZ_ERROR_FAIL 11 ++#define SZ_ERROR_THREAD 12 ++ ++#define SZ_ERROR_ARCHIVE 16 ++#define SZ_ERROR_NO_ARCHIVE 17 ++ ++typedef int SRes; ++typedef int WRes; ++ ++#ifndef RINOK ++#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } ++#endif ++ ++typedef unsigned char Byte; ++typedef short Int16; ++typedef unsigned short UInt16; ++ ++typedef int Int32; ++typedef unsigned int UInt32; ++ ++typedef long long int Int64; ++typedef unsigned long long int UInt64; ++ ++typedef UInt32 SizeT; ++typedef int ptrdiff_t; ++ ++typedef int Bool; ++#define True 1 ++#define False 0 ++ ++#define MY_STD_CALL ++#define MY_CDECL ++#define MY_FAST_CALL ++ ++typedef struct ++{ ++ void *(*Alloc)(void *p, SizeT size); ++ void (*Free)(void *p, void *address); /* address can be 0 */ ++} ISzAlloc; ++ ++#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) ++#define IAlloc_Free(p, a) (p)->Free((p), a) ++ ++/* -------------------------------------------------------------------------- */ ++ ++/* LzmaDec.h -- LZMA Decoder ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++/* #define _LZMA_PROB32 */ ++/* _LZMA_PROB32 can increase the speed on some CPUs, ++ but memory usage for CLzmaDec::probs will be doubled in that case */ ++ ++#ifdef _LZMA_PROB32 ++#define UIntLzmaProb UInt32 ++#else ++#define UIntLzmaProb UInt16 ++#endif ++ ++ ++/* ---------- LZMA Properties ---------- */ ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaProps ++{ ++ unsigned lc, lp, pb; ++ UInt32 dicSize; ++} CLzmaProps; ++ ++/* LzmaProps_Decode - decodes properties ++Returns: ++ SZ_OK ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); ++ ++ ++/* ---------- LZMA Decoder state ---------- */ ++ ++/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. ++ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ ++ ++#define LZMA_REQUIRED_INPUT_MAX 20 ++ ++typedef struct ++{ ++ CLzmaProps prop; ++ UIntLzmaProb *probs; ++ const Byte *buf; ++ UInt32 range, code; ++ Byte *dic; ++ UInt32 dicPos; ++ UInt32 dicBufSize; ++ Byte *inp; ++ UInt32 inpPos, inpSize; ++ UInt32 inpBufSize; ++ UInt32 processedPos; ++ UInt32 checkDicSize; ++ unsigned state; ++ UInt32 reps[4]; ++ unsigned remainLen; ++ int needFlush; ++ int needInitState; ++ UInt32 numProbs; ++ unsigned tempBufSize; ++ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; ++ UInt64 inpFilePos; ++ UInt64 dicFilePos; ++ struct { ++ UInt64 fmax, fpos; ++ } filec, fileu; ++} CLzmaDec; ++ ++#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } ++ ++void LzmaDec_Init(CLzmaDec *p); ++ ++/* There are two types of LZMA streams: ++ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. ++ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ ++ ++typedef enum ++{ ++ LZMA_FINISH_ANY, /* finish at any point */ ++ LZMA_FINISH_END /* block must be finished at the end */ ++} ELzmaFinishMode; ++ ++/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! ++ ++ You must use LZMA_FINISH_END, when you know that current output buffer ++ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. ++ ++ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, ++ and output value of destLen will be less than output buffer size limit. ++ You can check status result also. ++ ++ You can use multiple checks to test data integrity after full decompression: ++ 1) Check Result and "status" variable. ++ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. ++ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. ++ You must use correct finish mode in that case. */ ++ ++typedef enum ++{ ++ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ ++ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ ++ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ ++ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ ++} ELzmaStatus; ++ ++/* ELzmaStatus is used only as output value for function call */ ++ ++ ++/* ---------- Interfaces ---------- */ ++ ++/* There are 3 levels of interfaces: ++ 1) Dictionary Interface ++ 2) Buffer Interface ++ 3) One Call Interface ++ You can select any of these interfaces, but don't mix functions from different ++ groups for same object. */ ++ ++ ++/* There are two variants to allocate state for Dictionary Interface: ++ 1) LzmaDec_Allocate / LzmaDec_Free ++ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs ++ You can use variant 2, if you set dictionary buffer manually. ++ For Buffer Interface you must always use variant 1. ++ ++LzmaDec_Allocate* can return: ++ SZ_OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); ++ ++SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); ++ ++/* ---------- Dictionary Interface ---------- */ ++ ++/* You can use it, if you want to eliminate the overhead for data copying from ++ dictionary to some other external buffer. ++ You must work with CLzmaDec variables directly in this interface. ++ ++ STEPS: ++ LzmaDec_Constr() ++ LzmaDec_Allocate() ++ for (each new stream) ++ { ++ LzmaDec_Init() ++ while (it needs more decompression) ++ { ++ LzmaDec_DecodeToDic() ++ use data from CLzmaDec::dic and update CLzmaDec::dicPos ++ } ++ } ++ LzmaDec_Free() ++*/ ++ ++/* LzmaDec_DecodeToDic ++ ++ The decoding to internal dictionary buffer (CLzmaDec::dic). ++ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (dicLimit). ++ LZMA_FINISH_ANY - Decode just dicLimit bytes. ++ LZMA_FINISH_END - Stream must be finished after dicLimit. ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_NEEDS_MORE_INPUT ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++*/ ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- Buffer Interface ---------- */ ++ ++/* It's zlib-like interface. ++ See LzmaDec_DecodeToDic description for information about STEPS and return results, ++ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need ++ to work with CLzmaDec variables manually. ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++*/ ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaDecode ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). ++*/ ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc); ++ ++/* -------------------------------------------------------------------------- */ ++ ++/* LzmaDec.c -- LZMA Decoder ++2009-09-20 : Igor Pavlov : Public domain */ ++ ++//#include "LzmaDec.h" ++ ++//#include ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++ ++#define RC_INIT_SIZE 5 ++ ++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define TEST_BIT_0(p) ({ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; (code < bound);}) ++#define UPDATE_0(p) range = bound; *(p) = (UIntLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); ++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (UIntLzmaProb)(ttt - (ttt >> kNumMoveBits)); ++#define GET_BIT2(p, i, A0, A1) if(TEST_BIT_0(p)) \ ++ { UPDATE_0(p); i = (i + i); A0; } else \ ++ { UPDATE_1(p); i = (i + i) + 1; A1; } ++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) ++ ++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } ++#define TREE_DECODE(probs, limit, i) \ ++ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } ++ ++/* #define _LZMA_SIZE_OPT */ ++ ++#ifdef _LZMA_SIZE_OPT ++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) ++#else ++#define TREE_6_DECODE(probs, i) \ ++ { i = 1; \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ i -= 0x40; } ++#endif ++ ++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0_CHECK range = bound; ++#define UPDATE_1_CHECK range -= bound; code -= bound; ++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ ++ { UPDATE_0_CHECK; i = (i + i); A0; } else \ ++ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } ++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) ++#define TREE_DECODE_CHECK(probs, limit, i) \ ++ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } ++ ++ ++#define kNumPosBitsMax 4 ++#define kNumPosStatesMax (1 << kNumPosBitsMax) ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define LenChoice 0 ++#define LenChoice2 (LenChoice + 1) ++#define LenLow (LenChoice2 + 1) ++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) ++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) ++#define kNumLenProbs (LenHigh + kLenNumHighSymbols) ++ ++ ++#define kNumStates 12 ++#define kNumLitStates 7 ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#define kNumPosSlotBits 6 ++#define kNumLenToPosStates 4 ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++ ++#define kMatchMinLen 2 ++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define IsMatch 0 ++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) ++#define IsRepG0 (IsRep + kNumStates) ++#define IsRepG1 (IsRepG0 + kNumStates) ++#define IsRepG2 (IsRepG1 + kNumStates) ++#define IsRep0Long (IsRepG2 + kNumStates) ++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) ++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) ++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) ++#define LenCoder (Align + kAlignTableSize) ++#define RepLenCoder (LenCoder + kNumLenProbs) ++#define Literal (RepLenCoder + kNumLenProbs) ++ ++#define LZMA_BASE_SIZE 1846 ++#define LZMA_LIT_SIZE 768 ++ ++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) ++ ++#if Literal != LZMA_BASE_SIZE ++StopCompilingDueBUG ++#endif ++ ++#define LZMA_DIC_MIN (1 << 12) ++ ++/* First LZMA-symbol is always decoded. ++And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization ++Out: ++ Result: ++ SZ_OK - OK ++ SZ_ERROR_DATA - Error ++ p->remainLen: ++ < kMatchSpecLenStart : normal remain ++ = kMatchSpecLenStart : finished ++ = kMatchSpecLenStart + 1 : Flush marker ++ = kMatchSpecLenStart + 2 : State Init Marker ++*/ ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ UIntLzmaProb *probs = p->probs; ++ ++ unsigned state = p->state; ++ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; ++ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; ++ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; ++ unsigned lc = p->prop.lc; ++ ++ Byte *dic = p->dic; ++ SizeT dicBufSize = p->dicBufSize; ++ SizeT dicPos = p->dicPos; ++ ++ UInt32 processedPos = p->processedPos; ++ UInt32 checkDicSize = p->checkDicSize; ++ unsigned len = 0; ++ ++ const Byte *buf = p->buf; ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ ++ do ++ { ++ UIntLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = processedPos & pbMask; ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ if(TEST_BIT_0(prob)) ++ { ++ unsigned symbol; ++ UPDATE_0(prob); ++ prob = probs + Literal; ++ if (checkDicSize != 0 || processedPos != 0) ++ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + ++ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ state -= (state < 4) ? state : 3; ++ symbol = 1; ++ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ state -= (state < 10) ? 3 : 6; ++ symbol = 1; ++ do ++ { ++ unsigned bit; ++ UIntLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ dic[dicPos++] = (Byte)symbol; ++ processedPos++; ++ continue; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRep + state; ++ if(TEST_BIT_0(prob)) ++ { ++ UPDATE_0(prob); ++ state += kNumStates; ++ prob = probs + LenCoder; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ if (checkDicSize == 0 && processedPos == 0) ++ return SZ_ERROR_DATA; ++ prob = probs + IsRepG0 + state; ++ if(TEST_BIT_0(prob)) ++ { ++ UPDATE_0(prob); ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ if(TEST_BIT_0(prob)) ++ { ++ UPDATE_0(prob); ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ processedPos++; ++ state = state < kNumLitStates ? 9 : 11; ++ continue; ++ } ++ UPDATE_1(prob); ++ } ++ else ++ { ++ UInt32 distance; ++ UPDATE_1(prob); ++ prob = probs + IsRepG1 + state; ++ if(TEST_BIT_0(prob)) ++ { ++ UPDATE_0(prob); ++ distance = rep1; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRepG2 + state; ++ if(TEST_BIT_0(prob)) ++ { ++ UPDATE_0(prob); ++ distance = rep2; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ distance = rep3; ++ rep3 = rep2; ++ } ++ rep2 = rep1; ++ } ++ rep1 = rep0; ++ rep0 = distance; ++ } ++ state = state < kNumLitStates ? 8 : 11; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ UIntLzmaProb *probLen = prob + LenChoice; ++ if(TEST_BIT_0(probLen)) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = (1 << kLenNumLowBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenChoice2; ++ if(TEST_BIT_0(probLen)) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = (1 << kLenNumMidBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = (1 << kLenNumHighBits); ++ } ++ } ++ TREE_DECODE(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state >= kNumStates) ++ { ++ UInt32 distance; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); ++ TREE_6_DECODE(prob, distance); ++ if (distance >= kStartPosModelIndex) ++ { ++ unsigned posSlot = (unsigned)distance; ++ int numDirectBits = (int)(((distance >> 1) - 1)); ++ distance = (2 | (distance & 1)); ++ if (posSlot < kEndPosModelIndex) ++ { ++ distance <<= numDirectBits; ++ prob = probs + SpecPos + distance - posSlot - 1; ++ { ++ UInt32 mask = 1; ++ unsigned i = 1; ++ do ++ { ++ GET_BIT2(prob + i, i, ; , distance |= mask); ++ mask <<= 1; ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE ++ range >>= 1; ++ ++ { ++ UInt32 t; ++ code -= range; ++ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ ++ distance = (distance << 1) + (t + 1); ++ code += range & t; ++ } ++ /* ++ distance <<= 1; ++ if (code >= range) ++ { ++ code -= range; ++ distance |= 1; ++ } ++ */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ distance <<= kNumAlignBits; ++ { ++ unsigned i = 1; ++ GET_BIT2(prob + i, i, ; , distance |= 1); ++ GET_BIT2(prob + i, i, ; , distance |= 2); ++ GET_BIT2(prob + i, i, ; , distance |= 4); ++ GET_BIT2(prob + i, i, ; , distance |= 8); ++ } ++ if (distance == (UInt32)0xFFFFFFFF) ++ { ++ len += kMatchSpecLenStart; ++ state -= kNumStates; ++ break; ++ } ++ } ++ } ++ rep3 = rep2; ++ rep2 = rep1; ++ rep1 = rep0; ++ rep0 = distance + 1; ++ if (checkDicSize == 0) ++ { ++ if (distance >= processedPos) ++ return SZ_ERROR_DATA; ++ } ++ else if (distance >= checkDicSize) ++ return SZ_ERROR_DATA; ++ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; ++ } ++ ++ len += kMatchMinLen; ++ ++ if (limit == dicPos) ++ return SZ_ERROR_DATA; ++ { ++ SizeT rem = limit - dicPos; ++ unsigned curLen = ((rem < len) ? (unsigned)rem : len); ++ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); ++ ++ processedPos += curLen; ++ ++ len -= curLen; ++ if (pos + curLen <= dicBufSize) ++ { ++ Byte *dest = dic + dicPos; ++ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; ++ const Byte *lim = dest + curLen; ++ dicPos += curLen; ++ do ++ *(dest) = (Byte)(*(dest + src)); ++ while (++dest != lim); ++ } ++ else ++ { ++ do ++ { ++ dic[dicPos++] = dic[pos]; ++ if (++pos == dicBufSize) ++ pos = 0; ++ } ++ while (--curLen != 0); ++ } ++ } ++ } ++ } ++ while (dicPos < limit && buf < bufLimit); ++ NORMALIZE; ++ p->buf = buf; ++ p->range = range; ++ p->code = code; ++ p->remainLen = len; ++ p->dicPos = dicPos; ++ p->processedPos = processedPos; ++ p->reps[0] = rep0; ++ p->reps[1] = rep1; ++ p->reps[2] = rep2; ++ p->reps[3] = rep3; ++ p->state = state; ++ ++ return SZ_OK; ++} ++ ++static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) ++{ ++ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) ++ { ++ Byte *dic = p->dic; ++ SizeT dicPos = p->dicPos; ++ SizeT dicBufSize = p->dicBufSize; ++ unsigned len = p->remainLen; ++ UInt32 rep0 = p->reps[0]; ++ if (limit - dicPos < len) ++ len = (unsigned)(limit - dicPos); ++ ++ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) ++ p->checkDicSize = p->prop.dicSize; ++ ++ p->processedPos += len; ++ p->remainLen -= len; ++ while (len-- != 0) ++ { ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ } ++ p->dicPos = dicPos; ++ } ++} ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ do ++ { ++ SizeT limit2 = limit; ++ if (p->checkDicSize == 0) ++ { ++ UInt32 rem = p->prop.dicSize - p->processedPos; ++ if (limit - p->dicPos > rem) ++ limit2 = p->dicPos + rem; ++ } ++ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); ++ if (p->processedPos >= p->prop.dicSize) ++ p->checkDicSize = p->prop.dicSize; ++ LzmaDec_WriteRem(p, limit); ++ } ++ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); ++ ++ if (p->remainLen > kMatchSpecLenStart) ++ { ++ p->remainLen = kMatchSpecLenStart; ++ } ++ return 0; ++} ++ ++typedef enum ++{ ++ DUMMY_ERROR, /* unexpected end of input stream */ ++ DUMMY_LIT, ++ DUMMY_MATCH, ++ DUMMY_REP ++} ELzmaDummy; ++ ++static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) ++{ ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ const Byte *bufLimit = buf + inSize; ++ UIntLzmaProb *probs = p->probs; ++ unsigned state = p->state; ++ ELzmaDummy res; ++ ++ { ++ UIntLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK ++ ++ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ ++ ++ prob = probs + Literal; ++ if (p->checkDicSize != 0 || p->processedPos != 0) ++ prob += (LZMA_LIT_SIZE * ++ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + ++ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ unsigned symbol = 1; ++ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + ++ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ unsigned symbol = 1; ++ do ++ { ++ unsigned bit; ++ UIntLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ res = DUMMY_LIT; ++ } ++ else ++ { ++ unsigned len; ++ UPDATE_1_CHECK; ++ ++ prob = probs + IsRep + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ state = 0; ++ prob = probs + LenCoder; ++ res = DUMMY_MATCH; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ res = DUMMY_REP; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ NORMALIZE_CHECK; ++ return DUMMY_REP; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ } ++ state = kNumStates; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ UIntLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = 1 << kLenNumLowBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenChoice2; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = 1 << kLenNumMidBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = 1 << kLenNumHighBits; ++ } ++ } ++ TREE_DECODE_CHECK(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state < 4) ++ { ++ unsigned posSlot; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << ++ kNumPosSlotBits); ++ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); ++ if (posSlot >= kStartPosModelIndex) ++ { ++ int numDirectBits = ((posSlot >> 1) - 1); ++ ++ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ ++ ++ if (posSlot < kEndPosModelIndex) ++ { ++ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE_CHECK ++ range >>= 1; ++ code -= range & (((code - range) >> 31) - 1); ++ /* if (code >= range) code -= range; */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ numDirectBits = kNumAlignBits; ++ } ++ { ++ unsigned i = 1; ++ do ++ { ++ GET_BIT_CHECK(prob + i, i); ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ } ++ } ++ } ++ NORMALIZE_CHECK; ++ return res; ++} ++ ++ ++static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) ++{ ++ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); ++ p->range = 0xFFFFFFFF; ++ p->needFlush = 0; ++} ++ ++void LzmaDec_Init(CLzmaDec *p) ++{ ++ p->dicFilePos = 0; ++ p->dicPos = 0; ++ p->needFlush = 1; ++ p->remainLen = 0; ++ p->tempBufSize = 0; ++ p->processedPos = 0; ++ p->checkDicSize = 0; ++ p->needInitState = 1; ++ p->needInitState = 1; ++} ++ ++static void LzmaDec_InitStateReal(CLzmaDec *p) ++{ ++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); ++ UInt32 i; ++ UIntLzmaProb *probs = p->probs; ++ for (i = 0; i < numProbs; i++) ++ probs[i] = kBitModelTotal >> 1; ++ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; ++ p->state = 0; ++ p->needInitState = 0; ++} ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++ ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT inSize = *srcLen; ++ (*srcLen) = 0; ++ LzmaDec_WriteRem(p, dicLimit); ++ ++ *status = LZMA_STATUS_NOT_SPECIFIED; ++ ++ while (p->remainLen != kMatchSpecLenStart) ++ { ++ int checkEndMarkNow; ++ ++ if (p->needFlush != 0) ++ { ++ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) ++ p->tempBuf[p->tempBufSize++] = *src++; ++ if (p->tempBufSize < RC_INIT_SIZE) ++ { ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (p->tempBuf[0] != 0) ++ return SZ_ERROR_DATA; ++ ++ LzmaDec_InitRc(p, p->tempBuf); ++ p->tempBufSize = 0; ++ } ++ ++ checkEndMarkNow = 0; ++ if (p->dicPos >= dicLimit) ++ { ++ if (p->remainLen == 0 && p->code == 0) ++ { ++ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; ++ return SZ_OK; ++ } ++ if (finishMode == LZMA_FINISH_ANY) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_OK; ++ } ++ if (p->remainLen != 0) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ checkEndMarkNow = 1; ++ } ++ ++ if (p->needInitState) ++ LzmaDec_InitStateReal(p); ++ ++ if (p->tempBufSize == 0) ++ { ++ SizeT processed; ++ const Byte *bufLimit; ++ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, src, inSize); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ memcpy(p->tempBuf, src, inSize); ++ p->tempBufSize = (unsigned)inSize; ++ (*srcLen) += inSize; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ bufLimit = src; ++ } ++ else ++ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; ++ p->buf = src; ++ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) ++ return SZ_ERROR_DATA; ++ processed = (SizeT)(p->buf - src); ++ (*srcLen) += processed; ++ src += processed; ++ inSize -= processed; ++ } ++ else ++ { ++ unsigned rem = p->tempBufSize, lookAhead = 0; ++ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) ++ p->tempBuf[rem++] = src[lookAhead++]; ++ p->tempBufSize = rem; ++ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ (*srcLen) += lookAhead; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ } ++ p->buf = p->tempBuf; ++ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) ++ return SZ_ERROR_DATA; ++ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); ++ (*srcLen) += lookAhead; ++ src += lookAhead; ++ inSize -= lookAhead; ++ p->tempBufSize = 0; ++ } ++ } ++ if (p->code == 0) ++ *status = LZMA_STATUS_FINISHED_WITH_MARK; ++ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; ++} ++ ++/* -------------------------------------------------------------------------- */ ++ ++#define ReadUnalignedUInt32(p) ((UInt32)((Byte*)(p))[0] | ((UInt32)((Byte*)(p))[1]<<8) | ((UInt32)((Byte*)(p))[2]<<16) | ((UInt32)((Byte*)(p))[3]<<24)) ++#define ReadUnalignedUInt64(p) (ReadUnalignedUInt32(p) | ((UInt64)ReadUnalignedUInt32((Byte*)(p)+4)<<32)) ++ ++CLzmaDec lzmadec; ++ ++static unsigned long malloc_top = 0; ++static void *grub_malloc(unsigned long size) ++{ ++ if (!malloc_top) ++ malloc_top = RAW_ADDR ((saved_mem_upper << 10) + 0x100000); ++ malloc_top = (malloc_top - size) & ~3; ++ return (void *) malloc_top; ++} ++#define grub_free(x) ++ ++int ++dec_lzma_open (void) ++// return 1=success or 0=failure ++{ ++ unsigned char header[13]; ++ unsigned char d; ++ ++ if (no_decompression) return 0; ++ ++ // Now it does not support openning more than 1 file at a time. ++ // Make sure previously allocated memory blocks is freed. ++ // Don't need this line if grub_close is called for every openned file before grub_open is called for next file. ++ dec_lzma_close(); ++ ++ filepos = 0; ++ if (grub_read ((char *)header, 13, 0xedde0d90) == 13) ++ { ++ // check header ++ lzmadec.prop.dicSize = ReadUnalignedUInt32(header+1); ++ if (lzmadec.prop.dicSize < LZMA_DIC_MIN) ++ lzmadec.prop.dicSize = LZMA_DIC_MIN; ++ d = header[0]; ++ if (d < 9*5*5) ++ { ++ // valid LZMA file ++ lzmadec.prop.lc = d % 9; d /= 9; ++ lzmadec.prop.lp = d % 5; ++ lzmadec.prop.pb = d / 5; ++ lzmadec.fileu.fmax = ReadUnalignedUInt64(header+5); ++ lzmadec.fileu.fpos = 0; ++ lzmadec.dicBufSize = lzmadec.prop.dicSize; ++ lzmadec.dic = (Byte*) grub_malloc(lzmadec.dicBufSize); ++ //grub_printf("LZMA allocate memory\n"); ++ if (lzmadec.dic) ++ { ++ lzmadec.numProbs = LzmaProps_GetNumProbs(&lzmadec.prop); ++ lzmadec.probs = (UIntLzmaProb *) grub_malloc(lzmadec.numProbs * sizeof(UIntLzmaProb)); ++ if (lzmadec.probs) ++ { ++ lzmadec.inpBufSize = 0x8000; ++ lzmadec.inp = (Byte*) grub_malloc(lzmadec.inpBufSize); ++ if (lzmadec.inp) ++ { ++ lzmadec.inpFilePos = 0; ++ lzmadec.inpPos = 0; ++ lzmadec.inpSize = 0; ++ LzmaDec_Init(&lzmadec); ++ decomp_type = 1; ++ compressed_file = 1; ++ lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax; ++ lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos; ++ // success ++ //grub_printf("LZMA open success\n"); ++ errnum = 0; ++ return 1; ++ } ++ else ++ { ++ errnum = ERR_NOT_ENOUGH_MEMORY; ++ } ++ grub_free(lzmadec.probs); lzmadec.probs = 0; ++ } ++ else ++ { ++ errnum = ERR_NOT_ENOUGH_MEMORY; ++ } ++ grub_free(lzmadec.dic); lzmadec.dic = 0; ++ } ++ else ++ { ++ errnum = ERR_NOT_ENOUGH_MEMORY; ++ } ++ } ++ else ++ { ++ //grub_printf("LZMA allocate memory\n"); ++ errnum = ERR_BAD_GZIP_HEADER; ++ } ++ } ++ else ++ { ++ //grub_printf("LZMA error reading header\n"); ++ errnum = ERR_BAD_GZIP_HEADER; ++ } ++ //grub_printf("LZMA open fail\n"); ++ filepos = 0; ++ return 0; ++} ++ ++void ++dec_lzma_close (void) ++{ ++ if (lzmadec.inp ) { grub_free(lzmadec.inp ); lzmadec.inp = 0; } ++ if (lzmadec.dic ) { grub_free(lzmadec.dic ); lzmadec.dic = 0; } ++ if (lzmadec.probs) { grub_free(lzmadec.probs); lzmadec.probs = 0; } ++} ++ ++unsigned long ++dec_lzma_read (char *buf, unsigned long len, unsigned long write) ++{ ++ UInt64 outTx, outSkip; ++ //grub_printf("LZMA read buf=%ld len=%ld dic=%d inp=%d\n",buf,len,lzmadec.dic,lzmadec.inp); ++ ++ compressed_file = 0; ++ lzmadec.fileu.fmax = filemax; filemax = lzmadec.filec.fmax; ++ lzmadec.fileu.fpos = filepos; filepos = lzmadec.filec.fpos; ++ /* Now filepos, filemax is of compressed file ++ * fileu.fpos, fileu.fmax is of uncompressed data ++ * filec is not used ++ */ ++ ++ /* ++ * When dicPos>0, ++ * dic[0 ... dicPos-1] contains ++ * uncompressed_data [dicFilePos ... dicFilePos+dicPos-1]. ++ * When dicFilePos>0, ++ * dic[dicPos ... dicBufSize-1] contains ++ * uncompressed_data [dicFilePos-dicBufSize+dicFilePos ... dicFilePos-1] ++ */ ++ /* do we reset decompression to the beginning of the file? */ ++ if (lzmadec.dicFilePos && (lzmadec.fileu.fpos < lzmadec.dicFilePos-lzmadec.dicBufSize+lzmadec.dicFilePos)) ++ { ++ LzmaDec_Init(&lzmadec); ++ filepos = 13; ++ lzmadec.inpPos = lzmadec.inpSize = 0; ++ } ++ ++ outTx = 0; ++ outSkip = lzmadec.fileu.fpos - lzmadec.dicFilePos; ++ //grub_printf("fileu.fpos=%ld dicFilePos=%ld\n",lzmadec.fileu.fpos,lzmadec.dicFilePos); ++ ++ /* Copy uncompressed data from upper part of dic. dic[dicPos]...dic[dicBufSize-1] */ ++ if (lzmadec.dicFilePos > lzmadec.fileu.fpos) ++ { ++ UInt32 outTxCur = lzmadec.dicFilePos - lzmadec.fileu.fpos; ++ if (outTxCur > len) outTxCur = len; ++ if (buf) ++ { ++ grub_memmove(buf, lzmadec.dic+outSkip+lzmadec.dicBufSize, outTxCur); ++ buf += outTxCur; ++ } ++ outSkip = 0; ++ outTx += outTxCur; ++ lzmadec.fileu.fpos += outTxCur; ++ len -= outTxCur; ++ } ++ ++ while (len!=0) ++ { ++ SizeT inSizeCur, dicLimit; ++ UInt32 dicPos; ++ ELzmaStatus status; ++ SRes res; ++ ++ /* Copy uncompressed data from lower part of dic. dic[0]...dic[dicPos-1] */ ++ //grub_printf("Loop len=%ld outSkip=%ld dicPos=%d\n",len,outSkip,lzmadec.dicPos); ++ if (outSkip < lzmadec.dicPos) ++ { ++ UInt32 outTxCur = lzmadec.dicPos - outSkip; ++ //grub_printf("Copy %d byte ",outTxCur); ++ if (buf) ++ { ++ grub_memmove(buf, lzmadec.dic+outSkip, outTxCur); ++ buf += outTxCur; ++ } ++ outSkip = lzmadec.dicPos; ++ outTx += outTxCur; ++ lzmadec.fileu.fpos += outTxCur; ++ len -= outTxCur; ++ //grub_printf(" remaining len=%ld\n",len); ++ if (len==0) break; ++ } ++ /* All existing wanted data from dic have been copied. We will add more data to dic. */ ++ /* Read more input if there is no unprocessed input left. */ ++ if (lzmadec.inpPos == lzmadec.inpSize) ++ { ++ UInt32 inTxCur = (filemax-filepos%d\n",lzmadec.inpSize); ++ } ++ inSizeCur = lzmadec.inpSize - lzmadec.inpPos; ++ ++ /* Prepare output dicPos, dicLimit. */ ++ if (lzmadec.dicPos == lzmadec.dicBufSize) ++ { ++ lzmadec.dicPos = 0; ++ outSkip -= lzmadec.dicBufSize; ++ } ++ dicPos = lzmadec.dicPos; ++ dicLimit = (lzmadec.dicBufSize-dicPos < len)? lzmadec.dicBufSize: dicPos+len; ++ ++ /* Do decompression. */ ++ //grub_printf("DecodeToDic dicPos=%d limit=%d inPos=%d inSize=%d ",dicPos,dicLimit,lzmadec.inpPos,inSizeCur); ++ status = LZMA_STATUS_NOT_SPECIFIED; ++ res = LzmaDec_DecodeToDic(&lzmadec, dicLimit, lzmadec.inp+lzmadec.inpPos, &inSizeCur, LZMA_FINISH_ANY, &status); ++ //grub_printf("->%d\n",inSizeCur); ++ lzmadec.inpPos += inSizeCur; ++ if (inSizeCur==0 && lzmadec.dicPos==dicPos) ++ { ++ /* Error */ ++ //grub_printf("No more input and output\n"); ++ break; ++ } ++ } ++ compressed_file = 1; ++ lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax; ++ lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos; ++ /* Now filepos, file max is of uncompressed data ++ * filec.fpos, filwc.fmax is of compressed file ++ * fileu is not used ++ */ ++ ++ //grub_printf("LZMA read end %ld\n",outTx); ++ return outTx; ++} ++ ++#endif /* ! NO_DECOMPRESSION */ +diff -Naur ../grub4dos-chenall-r63/stage2/decomp.h ./stage2/decomp.h +--- grub4dos-chenall-r63/stage2/decomp.h 1970-01-01 07:00:00.000000000 +0700 ++++ grub4dos/stage2/decomp.h 2010-11-28 13:51:54.687217000 +0700 +@@ -0,0 +1,36 @@ ++/* decomp.h - abstract decompression interface */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef ASM_FILE ++ ++struct decomp_entry ++{ ++ char *name; ++ int (*open_func) (void); ++ void (*close_func) (void); ++ unsigned long (*read_func) (char *buf, unsigned long len, unsigned long write); ++}; ++ ++#define NUM_DECOM 2 ++ ++extern struct decomp_entry decomp_table[NUM_DECOM]; ++extern int decomp_type; ++ ++#endif +\ No newline at end of file +diff -Naur ../grub4dos-chenall-r63/stage2/disk_io.c ./stage2/disk_io.c +--- grub4dos-chenall-r63/stage2/disk_io.c 2010-08-12 14:22:47.111207000 +0700 ++++ grub4dos/stage2/disk_io.c 2010-11-28 20:26:39.089887300 +0700 +@@ -21,6 +21,7 @@ + + #include + #include ++#include + #include + + #ifdef SUPPORT_NETBOOT +@@ -1872,7 +1873,16 @@ + #ifdef NO_DECOMPRESSION + return 1; + #else +- return gunzip_test_header (); ++ if (no_decompression) ++ return 1; ++ int i; ++ i = strlen(open_filename); ++ if (i>=5 && strcmp(open_filename+i-5,".lzma")==0) ++ dec_lzma_open (); ++ else ++ gunzip_test_header (); ++ errnum = 0; ++ return 1; + #endif + } + +@@ -1903,7 +1903,7 @@ + { + if (write == 0x900ddeed) + return !(errnum = ERR_WRITE_GZIP_FILE); +- return gunzip_read (buf, len); ++ return decomp_table[decomp_type].read_func (buf, len, write); + } + #endif /* NO_DECOMPRESSION */ + +@@ -1978,6 +1982,12 @@ + void + grub_close (void) + { ++#ifndef NO_DECOMPRESSION ++ if (compressed_file) ++ decomp_table[decomp_type].close_func (); ++ compressed_file = 0; ++#endif /* NO_DECOMPRESSION */ ++ + #ifndef NO_BLOCK_FILES + if (block_file) + return; +diff -Naur ../grub4dos-chenall-r63/stage2/gunzip.c ./stage2/gunzip.c +--- grub4dos-chenall-r63/stage2/gunzip.c 2010-07-26 19:35:48.440546000 +0700 ++++ grub4dos/stage2/gunzip.c 2010-11-28 14:20:56.983870700 +0700 +@@ -129,6 +129,8 @@ + + #include "filesys.h" + ++#include "decomp.h" ++ + /* so we can disable decompression */ + #ifdef GRUB_UTIL + int no_decompression = 0; +@@ -137,6 +139,15 @@ + /* used to tell if "read" should be redirected to "gunzip_read" */ + int compressed_file; + ++/* identify active decompressor */ ++int decomp_type; ++ ++struct decomp_entry decomp_table[NUM_DECOM] = ++{ ++ {"gz",gunzip_test_header,gunzip_close,gunzip_read}, ++ {"lzma",dec_lzma_open,dec_lzma_close,dec_lzma_read} ++}; ++ + /* internal variables only */ + static unsigned long long gzip_data_offset; + static unsigned long long gzip_filepos; +@@ -227,6 +238,7 @@ + /* Little-Endian defines for the 2-byte magic number for gzip files */ + #define GZIP_HDR_LE 0x8B1F + #define OLD_GZIP_HDR_LE 0x9E1F ++#define LZMA_HDR_LE 0x005D + + /* Compression methods (see algorithm.doc) */ + #define STORED 0 +@@ -281,10 +292,18 @@ + if (no_decompression + || grub_read ((char *)buf, 10, 0xedde0d90) != 10 + || ((*((unsigned short *) buf) != GZIP_HDR_LE) +- && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE))) ++ && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE) ++ && (*((unsigned short *) buf) != LZMA_HDR_LE))) + { + filepos = 0; + return ! errnum; ++ } ++ ++ if (*((unsigned short *) buf) == LZMA_HDR_LE) ++ { ++ filepos = 0; ++ dec_lzma_open(); ++ return 1; + } + + /* +@@ -323,6 +334,7 @@ + + initialize_tables (); + ++ decomp_type = 0; + compressed_file = 1; + gunzip_swap_values (); + /* +@@ -334,6 +346,11 @@ + return 1; + } + ++void ++gunzip_close (void) ++{ ++} ++ + + /* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). +@@ -1190,7 +1226,7 @@ + + + unsigned long +-gunzip_read (char *buf, unsigned long len) ++gunzip_read (char *buf, unsigned long len, unsigned long write) + { + unsigned long ret = 0; + +diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.am ./stage2/Makefile.am +--- grub4dos-chenall-r63/stage2/Makefile.am 2010-08-12 14:22:47.111207000 +0700 ++++ grub4dos/stage2/Makefile.am 2010-11-28 16:35:18.724975900 +0700 +@@ -16,6 +16,7 @@ + # The library for /sbin/grub. + noinst_LIBRARIES = libgrub.a + libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \ ++ dec_lzma.c \ + disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \ + fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ + fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \ +@@ -100,7 +101,7 @@ + + # For stage2 target. + pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \ +- cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ ++ cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \ + fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ + fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \ + hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c +diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.in ./stage2/Makefile.in +--- grub4dos-chenall-r63/stage2/Makefile.in 2010-08-12 14:22:47.111207000 +0700 ++++ grub4dos/stage2/Makefile.in 2010-11-28 16:38:22.871508400 +0700 +@@ -104,10 +104,11 @@ + am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \ + libgrub_a-builtins.$(OBJEXT) libgrub_a-char_io.$(OBJEXT) \ + libgrub_a-cmdline.$(OBJEXT) libgrub_a-common.$(OBJEXT) \ +- libgrub_a-disk_io.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \ +- libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_ntfs.$(OBJEXT) \ +- libgrub_a-fsys_ffs.$(OBJEXT) libgrub_a-fsys_iso9660.$(OBJEXT) \ +- libgrub_a-fsys_jfs.$(OBJEXT) libgrub_a-fsys_minix.$(OBJEXT) \ ++ libgrub_a-dec_lzma.$(OBJEXT) libgrub_a-disk_io.$(OBJEXT) \ ++ libgrub_a-fsys_ext2fs.$(OBJEXT) libgrub_a-fsys_fat.$(OBJEXT) \ ++ libgrub_a-fsys_ntfs.$(OBJEXT) libgrub_a-fsys_ffs.$(OBJEXT) \ ++ libgrub_a-fsys_iso9660.$(OBJEXT) libgrub_a-fsys_jfs.$(OBJEXT) \ ++ libgrub_a-fsys_minix.$(OBJEXT) \ + libgrub_a-fsys_reiserfs.$(OBJEXT) \ + libgrub_a-fsys_ufs2.$(OBJEXT) libgrub_a-fsys_vstafs.$(OBJEXT) \ + libgrub_a-fsys_xfs.$(OBJEXT) libgrub_a-fsys_pxe.$(OBJEXT) \ +@@ -131,6 +132,7 @@ + diskless_exec-char_io.$(OBJEXT) \ + diskless_exec-cmdline.$(OBJEXT) diskless_exec-common.$(OBJEXT) \ + diskless_exec-console.$(OBJEXT) \ ++ diskless_exec-dec_lzma.$(OBJEXT) \ + diskless_exec-disk_io.$(OBJEXT) \ + diskless_exec-fsys_ext2fs.$(OBJEXT) \ + diskless_exec-fsys_fat.$(OBJEXT) \ +@@ -247,6 +249,7 @@ + pre_stage2_exec-cmdline.$(OBJEXT) \ + pre_stage2_exec-common.$(OBJEXT) \ + pre_stage2_exec-console.$(OBJEXT) \ ++ pre_stage2_exec-dec_lzma.$(OBJEXT) \ + pre_stage2_exec-disk_io.$(OBJEXT) \ + pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \ + pre_stage2_exec-fsys_fat.$(OBJEXT) \ +@@ -512,6 +513,7 @@ + # The library for /sbin/grub. + noinst_LIBRARIES = libgrub.a + libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \ ++ dec_lzma.c \ + disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \ + fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ + fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \ +@@ -559,7 +563,7 @@ + + # For stage2 target. + pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \ +- cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ ++ cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \ + fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ + fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \ + hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c +@@ -878,6 +882,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-common.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-console.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-dec_lzma.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@ +@@ -935,6 +940,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-char_io.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-cmdline.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-common.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-dec_lzma.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-disk_io.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_ext2fs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_fat.Po@am__quote@ +@@ -974,6 +980,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-console.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-dec_lzma.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@ +@@ -1315,6 +1322,20 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi` + ++libgrub_a-dec_lzma.o: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.o -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='libgrub_a-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c ++ ++libgrub_a-dec_lzma.obj: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='libgrub_a-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` ++ + libgrub_a-disk_io.o: disk_io.c + @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-disk_io.o -MD -MP -MF "$(DEPDIR)/libgrub_a-disk_io.Tpo" -c -o libgrub_a-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ + @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-disk_io.Tpo" "$(DEPDIR)/libgrub_a-disk_io.Po"; else rm -f "$(DEPDIR)/libgrub_a-disk_io.Tpo"; exit 1; fi +@@ -1693,6 +1714,20 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi` + ++diskless_exec-dec_lzma.o: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='diskless_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c ++ ++diskless_exec-dec_lzma.obj: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='diskless_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` ++ + diskless_exec-disk_io.o: disk_io.c + @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/diskless_exec-disk_io.Tpo" -c -o diskless_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ + @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-disk_io.Tpo" "$(DEPDIR)/diskless_exec-disk_io.Po"; else rm -f "$(DEPDIR)/diskless_exec-disk_io.Tpo"; exit 1; fi +@@ -2687,6 +2722,20 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi` + ++pre_stage2_exec-dec_lzma.o: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c ++ ++pre_stage2_exec-dec_lzma.obj: dec_lzma.c ++@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi` ++ + pre_stage2_exec-disk_io.o: disk_io.c + @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" -c -o pre_stage2_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \ + @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" "$(DEPDIR)/pre_stage2_exec-disk_io.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo"; exit 1; fi +diff -Naur ../grub4dos-chenall-r63/stage2/shared.h ./stage2/shared.h +--- grub4dos-chenall-r63/stage2/shared.h 2010-11-17 15:33:51.826683000 +0700 ++++ grub4dos/stage2/shared.h 2010-11-27 01:16:46.996893700 +0700 +@@ -640,6 +640,7 @@ + ERR_WRITE_GZIP_FILE, + ERR_FUNC_CALL, + // ERR_WRITE_TO_NON_MEM_DRIVE, ++ ERR_NOT_ENOUGH_MEMORY, + + MAX_ERR_NUM + } grub_error_t; +@@ -1185,7 +1186,11 @@ + #ifndef NO_DECOMPRESSION + /* Compression support. */ + int gunzip_test_header (void); +-unsigned long gunzip_read (char *buf, unsigned long len); ++void gunzip_close (void); ++unsigned long gunzip_read (char *buf, unsigned long len, unsigned long write); ++int dec_lzma_open (void); ++void dec_lzma_close (void); ++unsigned long dec_lzma_read (char *buf, unsigned long len, unsigned long write); + #endif /* NO_DECOMPRESSION */ + + int rawread (unsigned long drive, unsigned long sector, unsigned long byte_offset, unsigned long byte_len, char *buf, unsigned long write); diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub4dos/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +-p1|dev_partition.diff +-p1|lzma.diff +-p1|xfs_freeze.diff diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/patches/xfs_freeze.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/grub4dos/stuff/patches/xfs_freeze.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,21 @@ +diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in +--- grub-0.97.old/util/grub-install.in 2004-07-24 20:57:31.000000000 +0200 ++++ grub-0.97/util/grub-install.in 2009-01-16 22:15:46.000000000 +0100 +@@ -422,6 +422,17 @@ + test -n "$mkimg" && img_file=`$mkimg` + test -n "$mklog" && log_file=`$mklog` + ++# GRUB will try to verify that stage2 is accessible using its own ++# filesystem drivers. Make sure it's committed to disk. ++sync ++ ++# On XFS, sync() is not enough. ++if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then ++ xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir} ++ # We don't have set -e. If xfs_freeze failed, it's worth trying anyway, ++ # maybe we're lucky. ++fi ++ + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do + count=5 + tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` diff -r c7b121a4ffd9 -r d6378d455338 grub4dos/stuff/xfs_freeze.diff --- a/grub4dos/stuff/xfs_freeze.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in ---- grub-0.97.old/util/grub-install.in 2004-07-24 20:57:31.000000000 +0200 -+++ grub-0.97/util/grub-install.in 2009-01-16 22:15:46.000000000 +0100 -@@ -422,6 +422,17 @@ - test -n "$mkimg" && img_file=`$mkimg` - test -n "$mklog" && log_file=`$mklog` - -+# GRUB will try to verify that stage2 is accessible using its own -+# filesystem drivers. Make sure it's committed to disk. -+sync -+ -+# On XFS, sync() is not enough. -+if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then -+ xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir} -+ # We don't have set -e. If xfs_freeze failed, it's worth trying anyway, -+ # maybe we're lucky. -+fi -+ - for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do - count=5 - tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-albatross/receipt --- a/gtk-theme-albatross/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gtk-theme-albatross/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,8 +12,6 @@ WGET_URL="https://github.com/shimmerproject/Albatross/archive/v$VERSION.tar.gz" compile_rules() { - patch -p1 -i $stuff/define-sizes.patch - T='/usr/share/themes/Albatross' mkdir -p $install/$T cp -a \ diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-albatross/stuff/define-sizes.patch --- a/gtk-theme-albatross/stuff/define-sizes.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- a/gtk-2.0/gtkrc -+++ b/gtk-2.0/gtkrc -@@ -5,7 +5,7 @@ - - gtk-color-scheme = "fg_color:#202020\nbg_color:#EDEDED\nbase_color:#fff\ntext_color:#444\nselected_bg_color:#A9B7C4\nselected_fg_color:#333333\ntooltip_bg_color:#D6DCE4\ntooltip_fg_color:#222222" - --gtk-icon-sizes = "gtk-button = 16,16" -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" - - style "default" { - xthickness = 1 diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-albatross/stuff/patches/define-sizes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-albatross/stuff/patches/define-sizes.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- a/gtk-2.0/gtkrc ++++ b/gtk-2.0/gtkrc +@@ -5,7 +5,7 @@ + + gtk-color-scheme = "fg_color:#202020\nbg_color:#EDEDED\nbase_color:#fff\ntext_color:#444\nselected_bg_color:#A9B7C4\nselected_fg_color:#333333\ntooltip_bg_color:#D6DCE4\ntooltip_fg_color:#222222" + +-gtk-icon-sizes = "gtk-button = 16,16" ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" + + style "default" { + xthickness = 1 diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-albatross/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-albatross/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|define-sizes.patch diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-bluebird/receipt --- a/gtk-theme-bluebird/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gtk-theme-bluebird/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,7 +12,6 @@ WGET_URL="https://github.com/shimmerproject/Bluebird/archive/v$VERSION.tar.gz" compile_rules() { - patch -p1 -i $stuff/define-sizes.patch dos2unix $src/gtk-2.0/bars.rc dos2unix $src/gtk-2.0/gtkrc diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-bluebird/stuff/define-sizes.patch --- a/gtk-theme-bluebird/stuff/define-sizes.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- a/gtk-2.0/gtkrc -+++ b/gtk-2.0/gtkrc -@@ -17,7 +17,7 @@ - include "bars.rc" # Styles the menubar. - - ### ICONS ### --gtk-icon-sizes = "gtk-button=16,16" # This makes button icons smaller. -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" - - ### MISC ### - gtk-button-images = 1 # Enables icons in buttons diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-bluebird/stuff/patches/define-sizes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-bluebird/stuff/patches/define-sizes.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- a/gtk-2.0/gtkrc ++++ b/gtk-2.0/gtkrc +@@ -17,7 +17,7 @@ + include "bars.rc" # Styles the menubar. + + ### ICONS ### +-gtk-icon-sizes = "gtk-button=16,16" # This makes button icons smaller. ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" + + ### MISC ### + gtk-button-images = 1 # Enables icons in buttons diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-bluebird/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-bluebird/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|define-sizes.patch diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-greybird/receipt --- a/gtk-theme-greybird/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gtk-theme-greybird/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,8 +12,6 @@ WGET_URL="https://github.com/shimmerproject/Greybird/archive/v$VERSION.tar.gz" compile_rules() { - patch -p1 -i $stuff/define-sizes.patch - T='/usr/share/themes/Greybird' mkdir -p $install/$T cp -a \ diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-greybird/stuff/define-sizes.patch --- a/gtk-theme-greybird/stuff/define-sizes.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- a/gtk-2.0/gtkrc -+++ b/gtk-2.0/gtkrc -@@ -11,7 +11,7 @@ - gtk-color-scheme = "fm_color:#F7F7F7" # Color used in Nautilus and Thunar. - gtk-color-scheme = "bg_color_dark:#686868\ntext_color_dark:#FFF" - --gtk-icon-sizes = "panel-applications-menu=24,24:panel-menu=24,24:panel=16,16:gtk-button=16,16" -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" - gtk-button-images = 1 # Disables icons for buttons with text - gtk-toolbar-style = 0 # Disables text in toolbar - gtk-auto-mnemonics = 1 # Disables ugly lines under menu items diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-greybird/stuff/patches/define-sizes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-greybird/stuff/patches/define-sizes.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- a/gtk-2.0/gtkrc ++++ b/gtk-2.0/gtkrc +@@ -11,7 +11,7 @@ + gtk-color-scheme = "fm_color:#F7F7F7" # Color used in Nautilus and Thunar. + gtk-color-scheme = "bg_color_dark:#686868\ntext_color_dark:#FFF" + +-gtk-icon-sizes = "panel-applications-menu=24,24:panel-menu=24,24:panel=16,16:gtk-button=16,16" ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" + gtk-button-images = 1 # Disables icons for buttons with text + gtk-toolbar-style = 0 # Disables text in toolbar + gtk-auto-mnemonics = 1 # Disables ugly lines under menu items diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-greybird/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-greybird/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|define-sizes.patch diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-orion/receipt --- a/gtk-theme-orion/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gtk-theme-orion/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,8 +12,6 @@ WGET_URL="https://github.com/shimmerproject/Orion/archive/v$VERSION.tar.gz" compile_rules() { - patch -p1 -i $stuff/define-sizes.patch - T='/usr/share/themes/Orion' mkdir -p $install/$T cp -a \ diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-orion/stuff/define-sizes.patch --- a/gtk-theme-orion/stuff/define-sizes.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- a/gtk-2.0/gtkrc -+++ b/gtk-2.0/gtkrc -@@ -3,6 +3,7 @@ - # License: GPL-3.0+ - - gtk-color-scheme = "base_color:#fff\nfg_color:#555\ntooltip_fg_color:#fff\nselected_bg_color:#569be4\nselected_fg_color:#fff\ntext_color:#333\nbg_color:#eee\ntooltip_bg_color:#000\nlink_color:#569be4" -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" - - style "default" { - xthickness = 1 diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-orion/stuff/patches/define-sizes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-orion/stuff/patches/define-sizes.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- a/gtk-2.0/gtkrc ++++ b/gtk-2.0/gtkrc +@@ -3,6 +3,7 @@ + # License: GPL-3.0+ + + gtk-color-scheme = "base_color:#fff\nfg_color:#555\ntooltip_fg_color:#fff\nselected_bg_color:#569be4\nselected_fg_color:#fff\ntext_color:#333\nbg_color:#eee\ntooltip_bg_color:#000\nlink_color:#569be4" ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48" + + style "default" { + xthickness = 1 diff -r c7b121a4ffd9 -r d6378d455338 gtk-theme-orion/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-theme-orion/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|define-sizes.patch diff -r c7b121a4ffd9 -r d6378d455338 gtkglext/receipt --- a/gtkglext/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gtkglext/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ SPLIT="gtkglext-dev" compile_rules() { - patch -Np1 -i $stuff/gtk2.20.patch autoconf --force ./configure $CONFIGURE_ARGS && fix libtool && diff -r c7b121a4ffd9 -r d6378d455338 gtkglext/stuff/gtk2.20.patch --- a/gtkglext/stuff/gtk2.20.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -diff -Nur gtkglext-1.2.0.orig/gtk/gtkglwidget.c gtkglext-1.2.0/gtk/gtkglwidget.c ---- gtkglext-1.2.0.orig/gtk/gtkglwidget.c 2004-02-20 11:38:36.000000000 +0200 -+++ gtkglext-1.2.0/gtk/gtkglwidget.c 2010-04-20 19:29:42.941917275 +0300 -@@ -127,7 +127,7 @@ - * Synchronize OpenGL and window resizing request streams. - */ - -- if (GTK_WIDGET_REALIZED (widget) && private->is_realized) -+ if (gtk_widget_get_realized (widget) && private->is_realized) - { - gldrawable = gdk_window_get_gl_drawable (widget->window); - gdk_gl_drawable_wait_gdk (gldrawable); -@@ -154,7 +154,7 @@ - * Remove OpenGL-capability from widget->window. - */ - -- if (GTK_WIDGET_REALIZED (widget)) -+ if (gtk_widget_get_realized (widget)) - gdk_window_unset_gl_capability (widget->window); - - private->is_realized = FALSE; -@@ -174,7 +174,7 @@ - */ - - toplevel = gtk_widget_get_toplevel (widget); -- if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel)) -+ if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel)) - { - GTK_GL_NOTE (MISC, - g_message (" - Install colormap to the top-level window.")); -@@ -194,7 +194,7 @@ - * Set a background of "None" on window to avoid AIX X server crash. - */ - -- if (GTK_WIDGET_REALIZED (widget)) -+ if (gtk_widget_get_realized (widget)) - { - GTK_GL_NOTE (MISC, - g_message (" - window->bg_pixmap = %p", -@@ -250,8 +250,8 @@ - GTK_GL_NOTE_FUNC (); - - g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); -- g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE); -- g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE); -+ g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE); -+ g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE); - g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE); - - /* -@@ -432,7 +432,7 @@ - GTK_GL_NOTE_FUNC (); - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); -- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); -+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); - - gldrawable = gdk_window_get_gl_drawable (widget->window); - if (gldrawable == NULL) -@@ -474,7 +474,7 @@ - GLWidgetPrivate *private; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); -- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); -+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); - - private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private); - if (private == NULL) -@@ -501,7 +501,7 @@ - gtk_widget_get_gl_window (GtkWidget *widget) - { - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); -- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); -+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); - - return gdk_window_get_gl_window (widget->window); - } diff -r c7b121a4ffd9 -r d6378d455338 gtkglext/stuff/patches/gtk2.20.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtkglext/stuff/patches/gtk2.20.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,77 @@ +diff -Nur gtkglext-1.2.0.orig/gtk/gtkglwidget.c gtkglext-1.2.0/gtk/gtkglwidget.c +--- gtkglext-1.2.0.orig/gtk/gtkglwidget.c 2004-02-20 11:38:36.000000000 +0200 ++++ gtkglext-1.2.0/gtk/gtkglwidget.c 2010-04-20 19:29:42.941917275 +0300 +@@ -127,7 +127,7 @@ + * Synchronize OpenGL and window resizing request streams. + */ + +- if (GTK_WIDGET_REALIZED (widget) && private->is_realized) ++ if (gtk_widget_get_realized (widget) && private->is_realized) + { + gldrawable = gdk_window_get_gl_drawable (widget->window); + gdk_gl_drawable_wait_gdk (gldrawable); +@@ -154,7 +154,7 @@ + * Remove OpenGL-capability from widget->window. + */ + +- if (GTK_WIDGET_REALIZED (widget)) ++ if (gtk_widget_get_realized (widget)) + gdk_window_unset_gl_capability (widget->window); + + private->is_realized = FALSE; +@@ -174,7 +174,7 @@ + */ + + toplevel = gtk_widget_get_toplevel (widget); +- if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel)) ++ if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel)) + { + GTK_GL_NOTE (MISC, + g_message (" - Install colormap to the top-level window.")); +@@ -194,7 +194,7 @@ + * Set a background of "None" on window to avoid AIX X server crash. + */ + +- if (GTK_WIDGET_REALIZED (widget)) ++ if (gtk_widget_get_realized (widget)) + { + GTK_GL_NOTE (MISC, + g_message (" - window->bg_pixmap = %p", +@@ -250,8 +250,8 @@ + GTK_GL_NOTE_FUNC (); + + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); +- g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE); +- g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE); ++ g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE); ++ g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE); + g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE); + + /* +@@ -432,7 +432,7 @@ + GTK_GL_NOTE_FUNC (); + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); +- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); ++ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); + + gldrawable = gdk_window_get_gl_drawable (widget->window); + if (gldrawable == NULL) +@@ -474,7 +474,7 @@ + GLWidgetPrivate *private; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); +- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); ++ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); + + private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private); + if (private == NULL) +@@ -501,7 +501,7 @@ + gtk_widget_get_gl_window (GtkWidget *widget) + { + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); +- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); ++ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL); + + return gdk_window_get_gl_window (widget->window); + } diff -r c7b121a4ffd9 -r d6378d455338 gtkglext/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtkglext/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +gtk2.20.patch diff -r c7b121a4ffd9 -r d6378d455338 gxine/receipt --- a/gxine/receipt Wed May 09 17:03:28 2018 +0300 +++ b/gxine/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,9 +20,6 @@ sed -i "/&5 - $as_echo_n "checking for \"$llirc/liblirc_client.so\"... " >&6; } diff -r c7b121a4ffd9 -r d6378d455338 gxine/stuff/patches/gxine-0.5.907-lirc.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gxine/stuff/patches/gxine-0.5.907-lirc.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,15 @@ +--- configure.lirc 2012-02-20 20:10:20.000000000 +0100 ++++ configure 2012-02-22 14:11:53.873870212 +0100 +@@ -18463,10 +18463,10 @@ fi + + if test "$found_lirc" = no -a x"$cross_compiling" != xyes; then + if test x"$LIRC_PREFIX" != "x"; then +- lirc_libprefix="$LIRC_PREFIX/lib" ++ lirc_libprefix="$LIRC_PREFIX/$(libdir)" + LIRC_INCLUDE="-I$LIRC_PREFIX/include" + fi +- for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do ++ for llirc in $lirc_libprefix $(libdir); do + as_ac_File=`$as_echo "ac_cv_file_"$llirc/liblirc_client.so"" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"$llirc/liblirc_client.so\"" >&5 + $as_echo_n "checking for \"$llirc/liblirc_client.so\"... " >&6; } diff -r c7b121a4ffd9 -r d6378d455338 gxine/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gxine/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# Fix for lirc +#-p0|gxine-0.5.907-lirc.patch diff -r c7b121a4ffd9 -r d6378d455338 hal/receipt --- a/hal/receipt Wed May 09 17:03:28 2018 +0300 +++ b/hal/receipt Thu May 10 21:12:00 2018 +0300 @@ -22,8 +22,6 @@ hald/linux/probing/probe-video4linux.c sed -i 's|glib/gmain|glib|' hald/linux/addons/addon-*.c zcat /usr/share/misc/pci.ids.gz > /usr/share/misc/pci.ids - patch -p1 < $stuff/hal-scripts.u || return 1 - #patch -p1 < $stuff/hal-udev.patch || return 1 grep -qs 'define u8' hald/linux/probing/linux_dvd_rw_utils.c || sed -i 's|#include |#define u8 __u8\n&|' \ diff -r c7b121a4ffd9 -r d6378d455338 hal/stuff/hal-scripts.u --- a/hal/stuff/hal-scripts.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ ---- hal-0.5.13.ori/tools/linux/hal-system-power-reboot-linux Sun Aug 10 15:50:10 2008 -+++ hal-0.5.13/tools/linux/hal-system-power-reboot-linux Thu Feb 4 23:41:04 2010 -@@ -1,4 +1,6 @@ - #!/bin/sh -+# 2010-02-04 erjo@slitaz.org -+# * Use reboot first for Busybox. - - unsupported() { - echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2 -@@ -7,7 +9,10 @@ - } - - #Try for common tools --if [ -x "/sbin/shutdown" ] ; then -+if [ -x "/sbin/reboot" ] ; then -+ /sbin/reboot -+ exit $? -+elif [ -x "/sbin/shutdown" ] ; then - /sbin/shutdown -r now - exit $? - elif [ -x "/usr/sbin/shutdown" ] ; then diff -r c7b121a4ffd9 -r d6378d455338 hal/stuff/patches/hal-scripts.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal/stuff/patches/hal-scripts.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,21 @@ +--- hal-0.5.13.ori/tools/linux/hal-system-power-reboot-linux Sun Aug 10 15:50:10 2008 ++++ hal-0.5.13/tools/linux/hal-system-power-reboot-linux Thu Feb 4 23:41:04 2010 +@@ -1,4 +1,6 @@ + #!/bin/sh ++# 2010-02-04 erjo@slitaz.org ++# * Use reboot first for Busybox. + + unsupported() { + echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2 +@@ -7,7 +9,10 @@ + } + + #Try for common tools +-if [ -x "/sbin/shutdown" ] ; then ++if [ -x "/sbin/reboot" ] ; then ++ /sbin/reboot ++ exit $? ++elif [ -x "/sbin/shutdown" ] ; then + /sbin/shutdown -r now + exit $? + elif [ -x "/usr/sbin/shutdown" ] ; then diff -r c7b121a4ffd9 -r d6378d455338 hal/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|hal-scripts.u +#-p1|hal-udev.patch diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/receipt --- a/hardinfo/receipt Wed May 09 17:03:28 2018 +0300 +++ b/hardinfo/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,15 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - while read file; do - [ -f done.$file ] && continue - patch -p0 < $stuff/$file || return 1 - touch done.$file - done < -+#include -+ - void - scan_boots_real(void) - { -- FILE *last; -- char buffer[256]; -+ FILE *dev; -+ char buffer[2048]; -+ struct sysinfo info; -+ struct utsname uname_info; -+ time_t now; -+ char date[40]; -+ int i; - - scan_os(FALSE); - -@@ -29,33 +37,20 @@ - else - return; - -- last = popen("last", "r"); -- if (last) { -- while (fgets(buffer, 256, last)) { -- if (strstr(buffer, "system boot")) { -- gchar **tmp, *buf = buffer; -- -- strend(buffer, '\n'); -- -- while (*buf) { -- if (*buf == ' ' && *(buf + 1) == ' ') { -- strcpy(buf, buf + 1); -- -- buf--; -- } else { -- buf++; -- } -- } -- -- tmp = g_strsplit(buffer, " ", 5); -- computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s", -- computer->os->boots, -- tmp[4], -- tmp[3]); -- g_strfreev(tmp); -- } -- } -- -- pclose(last); -- } -+ time(&now); -+ sysinfo(&info); -+ uname(&uname_info); -+ now -= info.uptime; -+ strcpy(date,ctime(&now)); -+ for (i = 0; date[i] >= ' '; i++); -+ date[i] = 0; -+ computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s", -+ computer->os->boots, date, uname_info.release); -+ dev = fopen("/proc/cmdline", "r"); -+ if (!dev) -+ return; -+ if (fgets(buffer, sizeof(buffer), dev)) -+ computer->os->boots = h_strdup_cprintf("\nBoot options=%s", -+ computer->os->boots, buffer); -+ fclose(dev); - } diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/languages.patch --- a/hardinfo/stuff/languages.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- arch/common/languages.h 2008-04-26 10:04:42.000000000 +0200 -+++ arch/common/languages.h 2008-04-26 10:51:31.000000000 +0200 -@@ -21,6 +21,7 @@ - { - FILE *locale; - gchar buf[512], *retval = NULL; -+ int last = 0; - - locale = popen("locale -va", "r"); - if (!locale) -@@ -37,7 +38,8 @@ - *date = NULL, - *codeset = NULL; - -- while (fgets(buf, 512, locale)) { -+ while (fgets(buf, 512, locale) || last++ == 0) { -+ if (last) buf[0] = 0; - if (!strncmp(buf, "locale:", 7)) { - sscanf(buf, "locale: %s", name); - (void)fgets(buf, 128, locale); diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/os.patch --- a/hardinfo/stuff/os.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ ---- computer.h 2008-05-02 13:32:10.000000000 +0200 -+++ computer.h 2008-05-02 13:34:31.000000000 +0200 -@@ -23,6 +23,7 @@ - static struct { - gchar *file, *codename; - } distro_db[] = { -+ { DB_PREFIX "slitaz-release", "slitaz" }, - { DB_PREFIX "debian_version", "deb" }, - { DB_PREFIX "slackware-version", "slk" }, - { DB_PREFIX "mandrake-release", "mdk" }, ---- arch/linux/common/os.h 2008-05-02 13:43:33.000000000 +0200 -+++ arch/linux/common/os.h 2008-05-02 13:44:49.000000000 +0200 -@@ -215,6 +215,10 @@ - ((buf[0] >= '0' && buf[0] <= '9') || buf[0] != 'D')) { - os->distro = g_strdup_printf - ("Debian GNU/Linux %s", buf); -+ } -+ else if (!strncmp(distro_db[i].codename, "slitaz", 6)) { -+ os->distro = g_strdup_printf -+ ("Slitaz GNU/Linux %s", buf); - } else { - os->distro = g_strdup(buf); - } diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/patches/boots.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardinfo/stuff/patches/boots.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,74 @@ +--- arch/linux/common/boots.h 2008-04-26 10:38:31.000000000 +0200 ++++ arch/linux/common/boots.h 2008-04-26 11:15:20.000000000 +0200 +@@ -16,11 +16,19 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#include ++#include ++ + void + scan_boots_real(void) + { +- FILE *last; +- char buffer[256]; ++ FILE *dev; ++ char buffer[2048]; ++ struct sysinfo info; ++ struct utsname uname_info; ++ time_t now; ++ char date[40]; ++ int i; + + scan_os(FALSE); + +@@ -29,33 +37,20 @@ + else + return; + +- last = popen("last", "r"); +- if (last) { +- while (fgets(buffer, 256, last)) { +- if (strstr(buffer, "system boot")) { +- gchar **tmp, *buf = buffer; +- +- strend(buffer, '\n'); +- +- while (*buf) { +- if (*buf == ' ' && *(buf + 1) == ' ') { +- strcpy(buf, buf + 1); +- +- buf--; +- } else { +- buf++; +- } +- } +- +- tmp = g_strsplit(buffer, " ", 5); +- computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s", +- computer->os->boots, +- tmp[4], +- tmp[3]); +- g_strfreev(tmp); +- } +- } +- +- pclose(last); +- } ++ time(&now); ++ sysinfo(&info); ++ uname(&uname_info); ++ now -= info.uptime; ++ strcpy(date,ctime(&now)); ++ for (i = 0; date[i] >= ' '; i++); ++ date[i] = 0; ++ computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s", ++ computer->os->boots, date, uname_info.release); ++ dev = fopen("/proc/cmdline", "r"); ++ if (!dev) ++ return; ++ if (fgets(buffer, sizeof(buffer), dev)) ++ computer->os->boots = h_strdup_cprintf("\nBoot options=%s", ++ computer->os->boots, buffer); ++ fclose(dev); + } diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/patches/languages.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardinfo/stuff/patches/languages.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- arch/common/languages.h 2008-04-26 10:04:42.000000000 +0200 ++++ arch/common/languages.h 2008-04-26 10:51:31.000000000 +0200 +@@ -21,6 +21,7 @@ + { + FILE *locale; + gchar buf[512], *retval = NULL; ++ int last = 0; + + locale = popen("locale -va", "r"); + if (!locale) +@@ -37,7 +38,8 @@ + *date = NULL, + *codeset = NULL; + +- while (fgets(buf, 512, locale)) { ++ while (fgets(buf, 512, locale) || last++ == 0) { ++ if (last) buf[0] = 0; + if (!strncmp(buf, "locale:", 7)) { + sscanf(buf, "locale: %s", name); + (void)fgets(buf, 128, locale); diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/patches/os.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardinfo/stuff/patches/os.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,23 @@ +--- computer.h 2008-05-02 13:32:10.000000000 +0200 ++++ computer.h 2008-05-02 13:34:31.000000000 +0200 +@@ -23,6 +23,7 @@ + static struct { + gchar *file, *codename; + } distro_db[] = { ++ { DB_PREFIX "slitaz-release", "slitaz" }, + { DB_PREFIX "debian_version", "deb" }, + { DB_PREFIX "slackware-version", "slk" }, + { DB_PREFIX "mandrake-release", "mdk" }, +--- arch/linux/common/os.h 2008-05-02 13:43:33.000000000 +0200 ++++ arch/linux/common/os.h 2008-05-02 13:44:49.000000000 +0200 +@@ -215,6 +215,10 @@ + ((buf[0] >= '0' && buf[0] <= '9') || buf[0] != 'D')) { + os->distro = g_strdup_printf + ("Debian GNU/Linux %s", buf); ++ } ++ else if (!strncmp(distro_db[i].codename, "slitaz", 6)) { ++ os->distro = g_strdup_printf ++ ("Slitaz GNU/Linux %s", buf); + } else { + os->distro = g_strdup(buf); + } diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardinfo/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p0|languages.patch +-p0|os.patch diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/patches/usb.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardinfo/stuff/patches/usb.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,316 @@ +--- util.c ++++ util.c +@@ -1048,3 +1048,55 @@ + h_hash_table_remove_all_true, + NULL); + } ++ ++gfloat ++h_sysfs_read_float(gchar *endpoint, gchar *entry) ++{ ++ gchar *tmp, *buffer; ++ gfloat return_value = 0.0f; ++ ++ tmp = g_build_filename(endpoint, entry, NULL); ++ if (g_file_get_contents(tmp, &buffer, NULL, NULL)) ++ return_value = atof(buffer); ++ ++ g_free(tmp); ++ g_free(buffer); ++ ++ return return_value; ++} ++ ++gint ++h_sysfs_read_int(gchar *endpoint, gchar *entry) ++{ ++ gchar *tmp, *buffer; ++ gint return_value = 0.0f; ++ ++ tmp = g_build_filename(endpoint, entry, NULL); ++ if (g_file_get_contents(tmp, &buffer, NULL, NULL)) ++ return_value = atoi(buffer); ++ ++ g_free(tmp); ++ g_free(buffer); ++ ++ return return_value; ++} ++ ++gchar * ++h_sysfs_read_string(gchar *endpoint, gchar *entry) ++{ ++ gchar *tmp, *return_value; ++ ++ tmp = g_build_filename(endpoint, entry, NULL); ++ if (!g_file_get_contents(tmp, &return_value, NULL, NULL)) { ++ g_free(return_value); ++ ++ return_value = NULL; ++ } else { ++ return_value = g_strstrip(return_value); ++ } ++ ++ g_free(tmp); ++ ++ return return_value; ++} ++ + +--- arch/linux/common/usb.h ++++ arch/linux/common/usb.h +@@ -15,7 +15,6 @@ + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +- + static gboolean + remove_usb_devices(gpointer key, gpointer value, gpointer data) + { +@@ -23,8 +22,113 @@ + } + + static gchar *usb_list = NULL; +-void +-__scan_usb(void) ++ ++void __scan_usb_sysfs_add_device(gchar * endpoint, int n) ++{ ++ gchar *manufacturer, *product, *mxpwr, *tmp, *strhash; ++ gint bus, classid, vendor, prodid; ++ gchar *version, *speed; ++ ++ classid = h_sysfs_read_int(endpoint, "bDeviceClass"); ++ vendor = h_sysfs_read_int(endpoint, "idVendor"); ++ prodid = h_sysfs_read_int(endpoint, "idProduct"); ++ bus = h_sysfs_read_int(endpoint, "busnum"); ++ if (!(speed = h_sysfs_read_string(endpoint, "speed"))) { ++ speed = g_strdup("12"); ++ } ++ ++ if (!(version = h_sysfs_read_string(endpoint, "version"))) { ++ version = g_strdup(" 1.0 "); ++ } ++ ++ if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) { ++ mxpwr = g_strdup("0 mA"); ++ } ++ ++ if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) { ++ manufacturer = g_strdup("Unknown"); ++ } ++ ++ if (!(product = h_sysfs_read_string(endpoint, "product"))) { ++ if (classid == 9) { ++ product = g_strdup_printf("USB %.2f Hub", version); ++ } else { ++ product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid); ++ } ++ } ++ ++ const gchar *url = vendor_get_url(manufacturer); ++ if (url) { ++ tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url); ++ ++ g_free(manufacturer); ++ manufacturer = tmp; ++ } ++ ++ tmp = g_strdup_printf("USB%d", n); ++ usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product); ++ ++ strhash = g_strdup_printf("[Device Information]\n" ++ "Product=%s\n" ++ "Manufacturer=%s\n" ++ "Speed=%sMbit/s\n" ++ "Max Current=%s\n" ++ "[Misc]\n" ++ "USB Version=%s\n" ++ "Class=0x%x\n" ++ "Vendor=0x%x\n" ++ "Product ID=0x%x\n" ++ "Bus=%d\n", ++ product, ++ manufacturer, ++ speed, ++ mxpwr, ++ version, classid, vendor, prodid, bus); ++ ++ g_hash_table_insert(moreinfo, tmp, strhash); ++ ++ g_free(manufacturer); ++ g_free(product); ++ g_free(mxpwr); ++ g_free(speed); ++ g_free(version); ++} ++ ++void __scan_usb_sysfs(void) ++{ ++ GDir *sysfs; ++ gchar *filename; ++ const gchar *sysfs_path = "/sys/class/usb_endpoint"; ++ gint usb_device_number = 0; ++ ++ if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) { ++ return; ++ } ++ ++ if (usb_list) { ++ g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); ++ g_free(usb_list); ++ } ++ usb_list = g_strdup("[USB Devices]\n"); ++ ++ while ((filename = (gchar *) g_dir_read_name(sysfs))) { ++ gchar *endpoint = ++ g_build_filename(sysfs_path, filename, "device", NULL); ++ gchar *temp; ++ ++ temp = g_build_filename(endpoint, "idVendor", NULL); ++ if (g_file_test(temp, G_FILE_TEST_EXISTS)) { ++ __scan_usb_sysfs_add_device(endpoint, ++usb_device_number); ++ } ++ ++ g_free(temp); ++ g_free(endpoint); ++ } ++ ++ g_dir_close(sysfs); ++} ++ ++int __scan_usb_procfs(void) + { + FILE *dev; + gchar buffer[128]; +@@ -36,13 +140,13 @@ + + dev = fopen("/proc/bus/usb/devices", "r"); + if (!dev) +- return; ++ return 0; + + if (usb_list) { + g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); + g_free(usb_list); + } +- usb_list = g_strdup(""); ++ usb_list = g_strdup("[USB Devices]\n"); + + while (fgets(buffer, 128, dev)) { + tmp = buffer; +@@ -73,52 +177,60 @@ + mxpwr = strstr(buffer, "MxPwr=") + 6; + + tmp = g_strdup_printf("USB%d", ++n); +- ++ + if (*product == '\0') { +- g_free(product); +- if (classid == 9) { +- product = g_strdup_printf("USB %.2f Hub", ver); +- } else { +- product = g_strdup_printf("Unknown USB %.2f Device (class %d)", +- ver, classid); +- } ++ g_free(product); ++ if (classid == 9) { ++ product = g_strdup_printf("USB %.2f Hub", ver); ++ } else { ++ product = ++ g_strdup_printf ++ ("Unknown USB %.2f Device (class %d)", ver, ++ classid); ++ } + } +- ++ + + if (classid == 9) { /* hub */ +- usb_list = h_strdup_cprintf("[%s#%d]\n", +- usb_list, product, n); +- } else { /* everything else */ +- usb_list = h_strdup_cprintf("$%s$%s=\n", +- usb_list, tmp, product); +- +- const gchar *url = vendor_get_url(manuf); +- if (url) { +- gchar *tmp = g_strdup_printf("%s (%s)", manuf, url); +- g_free(manuf); +- manuf = tmp; +- } +- +- gchar *strhash = g_strdup_printf("[Device Information]\n" +- "Product=%s\n" +- "Manufacturer=%s\n" +- "[Port #%d]\n" +- "Speed=%.2fMbit/s\n" +- "Max Current=%s\n" +- "[Misc]\n" +- "USB Version=%.2f\n" +- "Revision=%.2f\n" +- "Class=0x%x\n" +- "Vendor=0x%x\n" +- "Product ID=0x%x\n" +- "Bus=%d\n" "Level=%d\n", +- product, manuf, +- port, speed, mxpwr, +- ver, rev, classid, +- vendor, prodid, bus, level); ++ usb_list = h_strdup_cprintf("[%s#%d]\n", ++ usb_list, product, n); ++ } else { /* everything else */ ++ usb_list = h_strdup_cprintf("$%s$%s=\n", ++ usb_list, tmp, product); ++ ++ const gchar *url = vendor_get_url(manuf); ++ if (url) { ++ gchar *tmp = ++ g_strdup_printf("%s (%s)", vendor_get_name(manuf), ++ url); ++ g_free(manuf); ++ manuf = tmp; ++ } ++ ++ gchar *strhash = g_strdup_printf("[Device Information]\n" ++ "Product=%s\n", ++ product); ++ if (manuf && strlen(manuf)) ++ strhash = h_strdup_cprintf("Manufacturer=%s\n", ++ strhash, manuf); ++ ++ strhash = h_strdup_cprintf("[Port #%d]\n" ++ "Speed=%.2fMbit/s\n" ++ "Max Current=%s\n" ++ "[Misc]\n" ++ "USB Version=%.2f\n" ++ "Revision=%.2f\n" ++ "Class=0x%x\n" ++ "Vendor=0x%x\n" ++ "Product ID=0x%x\n" ++ "Bus=%d\n" "Level=%d\n", ++ strhash, ++ port, speed, mxpwr, ++ ver, rev, classid, ++ vendor, prodid, bus, level); + +- g_hash_table_insert(moreinfo, tmp, strhash); +- } ++ g_hash_table_insert(moreinfo, tmp, strhash); ++ } + + g_free(manuf); + g_free(product); +@@ -128,4 +240,12 @@ + } + + fclose(dev); ++ ++ return n; ++} ++ ++void __scan_usb(void) ++{ ++ if (!__scan_usb_procfs()) ++ __scan_usb_sysfs(); + } diff -r c7b121a4ffd9 -r d6378d455338 hardinfo/stuff/usb.patch --- a/hardinfo/stuff/usb.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ ---- util.c -+++ util.c -@@ -1048,3 +1048,55 @@ - h_hash_table_remove_all_true, - NULL); - } -+ -+gfloat -+h_sysfs_read_float(gchar *endpoint, gchar *entry) -+{ -+ gchar *tmp, *buffer; -+ gfloat return_value = 0.0f; -+ -+ tmp = g_build_filename(endpoint, entry, NULL); -+ if (g_file_get_contents(tmp, &buffer, NULL, NULL)) -+ return_value = atof(buffer); -+ -+ g_free(tmp); -+ g_free(buffer); -+ -+ return return_value; -+} -+ -+gint -+h_sysfs_read_int(gchar *endpoint, gchar *entry) -+{ -+ gchar *tmp, *buffer; -+ gint return_value = 0.0f; -+ -+ tmp = g_build_filename(endpoint, entry, NULL); -+ if (g_file_get_contents(tmp, &buffer, NULL, NULL)) -+ return_value = atoi(buffer); -+ -+ g_free(tmp); -+ g_free(buffer); -+ -+ return return_value; -+} -+ -+gchar * -+h_sysfs_read_string(gchar *endpoint, gchar *entry) -+{ -+ gchar *tmp, *return_value; -+ -+ tmp = g_build_filename(endpoint, entry, NULL); -+ if (!g_file_get_contents(tmp, &return_value, NULL, NULL)) { -+ g_free(return_value); -+ -+ return_value = NULL; -+ } else { -+ return_value = g_strstrip(return_value); -+ } -+ -+ g_free(tmp); -+ -+ return return_value; -+} -+ - ---- arch/linux/common/usb.h -+++ arch/linux/common/usb.h -@@ -15,7 +15,6 @@ - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -- - static gboolean - remove_usb_devices(gpointer key, gpointer value, gpointer data) - { -@@ -23,8 +22,113 @@ - } - - static gchar *usb_list = NULL; --void --__scan_usb(void) -+ -+void __scan_usb_sysfs_add_device(gchar * endpoint, int n) -+{ -+ gchar *manufacturer, *product, *mxpwr, *tmp, *strhash; -+ gint bus, classid, vendor, prodid; -+ gchar *version, *speed; -+ -+ classid = h_sysfs_read_int(endpoint, "bDeviceClass"); -+ vendor = h_sysfs_read_int(endpoint, "idVendor"); -+ prodid = h_sysfs_read_int(endpoint, "idProduct"); -+ bus = h_sysfs_read_int(endpoint, "busnum"); -+ if (!(speed = h_sysfs_read_string(endpoint, "speed"))) { -+ speed = g_strdup("12"); -+ } -+ -+ if (!(version = h_sysfs_read_string(endpoint, "version"))) { -+ version = g_strdup(" 1.0 "); -+ } -+ -+ if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) { -+ mxpwr = g_strdup("0 mA"); -+ } -+ -+ if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) { -+ manufacturer = g_strdup("Unknown"); -+ } -+ -+ if (!(product = h_sysfs_read_string(endpoint, "product"))) { -+ if (classid == 9) { -+ product = g_strdup_printf("USB %.2f Hub", version); -+ } else { -+ product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid); -+ } -+ } -+ -+ const gchar *url = vendor_get_url(manufacturer); -+ if (url) { -+ tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url); -+ -+ g_free(manufacturer); -+ manufacturer = tmp; -+ } -+ -+ tmp = g_strdup_printf("USB%d", n); -+ usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product); -+ -+ strhash = g_strdup_printf("[Device Information]\n" -+ "Product=%s\n" -+ "Manufacturer=%s\n" -+ "Speed=%sMbit/s\n" -+ "Max Current=%s\n" -+ "[Misc]\n" -+ "USB Version=%s\n" -+ "Class=0x%x\n" -+ "Vendor=0x%x\n" -+ "Product ID=0x%x\n" -+ "Bus=%d\n", -+ product, -+ manufacturer, -+ speed, -+ mxpwr, -+ version, classid, vendor, prodid, bus); -+ -+ g_hash_table_insert(moreinfo, tmp, strhash); -+ -+ g_free(manufacturer); -+ g_free(product); -+ g_free(mxpwr); -+ g_free(speed); -+ g_free(version); -+} -+ -+void __scan_usb_sysfs(void) -+{ -+ GDir *sysfs; -+ gchar *filename; -+ const gchar *sysfs_path = "/sys/class/usb_endpoint"; -+ gint usb_device_number = 0; -+ -+ if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) { -+ return; -+ } -+ -+ if (usb_list) { -+ g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); -+ g_free(usb_list); -+ } -+ usb_list = g_strdup("[USB Devices]\n"); -+ -+ while ((filename = (gchar *) g_dir_read_name(sysfs))) { -+ gchar *endpoint = -+ g_build_filename(sysfs_path, filename, "device", NULL); -+ gchar *temp; -+ -+ temp = g_build_filename(endpoint, "idVendor", NULL); -+ if (g_file_test(temp, G_FILE_TEST_EXISTS)) { -+ __scan_usb_sysfs_add_device(endpoint, ++usb_device_number); -+ } -+ -+ g_free(temp); -+ g_free(endpoint); -+ } -+ -+ g_dir_close(sysfs); -+} -+ -+int __scan_usb_procfs(void) - { - FILE *dev; - gchar buffer[128]; -@@ -36,13 +140,13 @@ - - dev = fopen("/proc/bus/usb/devices", "r"); - if (!dev) -- return; -+ return 0; - - if (usb_list) { - g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL); - g_free(usb_list); - } -- usb_list = g_strdup(""); -+ usb_list = g_strdup("[USB Devices]\n"); - - while (fgets(buffer, 128, dev)) { - tmp = buffer; -@@ -73,52 +177,60 @@ - mxpwr = strstr(buffer, "MxPwr=") + 6; - - tmp = g_strdup_printf("USB%d", ++n); -- -+ - if (*product == '\0') { -- g_free(product); -- if (classid == 9) { -- product = g_strdup_printf("USB %.2f Hub", ver); -- } else { -- product = g_strdup_printf("Unknown USB %.2f Device (class %d)", -- ver, classid); -- } -+ g_free(product); -+ if (classid == 9) { -+ product = g_strdup_printf("USB %.2f Hub", ver); -+ } else { -+ product = -+ g_strdup_printf -+ ("Unknown USB %.2f Device (class %d)", ver, -+ classid); -+ } - } -- -+ - - if (classid == 9) { /* hub */ -- usb_list = h_strdup_cprintf("[%s#%d]\n", -- usb_list, product, n); -- } else { /* everything else */ -- usb_list = h_strdup_cprintf("$%s$%s=\n", -- usb_list, tmp, product); -- -- const gchar *url = vendor_get_url(manuf); -- if (url) { -- gchar *tmp = g_strdup_printf("%s (%s)", manuf, url); -- g_free(manuf); -- manuf = tmp; -- } -- -- gchar *strhash = g_strdup_printf("[Device Information]\n" -- "Product=%s\n" -- "Manufacturer=%s\n" -- "[Port #%d]\n" -- "Speed=%.2fMbit/s\n" -- "Max Current=%s\n" -- "[Misc]\n" -- "USB Version=%.2f\n" -- "Revision=%.2f\n" -- "Class=0x%x\n" -- "Vendor=0x%x\n" -- "Product ID=0x%x\n" -- "Bus=%d\n" "Level=%d\n", -- product, manuf, -- port, speed, mxpwr, -- ver, rev, classid, -- vendor, prodid, bus, level); -+ usb_list = h_strdup_cprintf("[%s#%d]\n", -+ usb_list, product, n); -+ } else { /* everything else */ -+ usb_list = h_strdup_cprintf("$%s$%s=\n", -+ usb_list, tmp, product); -+ -+ const gchar *url = vendor_get_url(manuf); -+ if (url) { -+ gchar *tmp = -+ g_strdup_printf("%s (%s)", vendor_get_name(manuf), -+ url); -+ g_free(manuf); -+ manuf = tmp; -+ } -+ -+ gchar *strhash = g_strdup_printf("[Device Information]\n" -+ "Product=%s\n", -+ product); -+ if (manuf && strlen(manuf)) -+ strhash = h_strdup_cprintf("Manufacturer=%s\n", -+ strhash, manuf); -+ -+ strhash = h_strdup_cprintf("[Port #%d]\n" -+ "Speed=%.2fMbit/s\n" -+ "Max Current=%s\n" -+ "[Misc]\n" -+ "USB Version=%.2f\n" -+ "Revision=%.2f\n" -+ "Class=0x%x\n" -+ "Vendor=0x%x\n" -+ "Product ID=0x%x\n" -+ "Bus=%d\n" "Level=%d\n", -+ strhash, -+ port, speed, mxpwr, -+ ver, rev, classid, -+ vendor, prodid, bus, level); - -- g_hash_table_insert(moreinfo, tmp, strhash); -- } -+ g_hash_table_insert(moreinfo, tmp, strhash); -+ } - - g_free(manuf); - g_free(product); -@@ -128,4 +240,12 @@ - } - - fclose(dev); -+ -+ return n; -+} -+ -+void __scan_usb(void) -+{ -+ if (!__scan_usb_procfs()) -+ __scan_usb_sysfs(); - } diff -r c7b121a4ffd9 -r d6378d455338 hplip/receipt --- a/hplip/receipt Wed May 09 17:03:28 2018 +0300 +++ b/hplip/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,9 +20,6 @@ BUGS="Unable to delete hplip.desktop from $fs. Using hack in post_install." compile_rules() { - # fix build with cups 1.6 - FC hplip-ipp-accessors.patch - patch -Np1 -i $stuff/cups-1.6-buildfix.diff - ./configure \ --disable-doc-build \ --enable-qt4 \ diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/cups-1.6-buildfix.diff --- a/hplip/stuff/cups-1.6-buildfix.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,392 +0,0 @@ -diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c ---- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors 2012-06-18 12:41:19.000000000 +0200 -+++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-07-19 17:11:47.606524137 +0200 -@@ -87,6 +87,46 @@ typedef int Py_ssize_t; - #define PY_SSIZE_T_MIN INT_MIN - #endif - -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetCount(attr) attr->num_values -+#define ippGetGroupTag(attr) attr->group_tag -+#define ippGetValueTag(attr) attr->value_tag -+#define ippGetName(attr) attr->name -+#define ippGetBoolean(attr, element) attr->values[element].boolean -+#define ippGetInteger(attr, element) attr->values[element].integer -+#define ippGetStatusCode(ipp) ipp->request.status.status_code -+#define ippGetString(attr, element, language) attr->values[element].string.text -+ -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) -+{ -+ if (!ipp) -+ return (NULL); -+ return (ipp->current = ipp->attrs); -+} -+ -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) -+{ -+ if (!ipp || !ipp->current) -+ return (NULL); -+ return (ipp->current = ipp->current->next); -+} -+ -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) -+{ -+ ipp->request.op.operation_id = op; -+ return (1); -+} -+ -+static int ippSetRequestId( ipp_t *ipp, int request_id ) -+{ -+ ipp->request.any.request_id = request_id; -+ return (1); -+} -+#endif - - int g_num_options = 0; - cups_option_t * g_options; -@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self, - request = ippNew(); - language = cupsLangDefault(); - -- request->request.op.operation_id = CUPS_GET_PRINTERS; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PRINTERS ); -+ ippSetRequestId ( request, 1); - - ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding( language ) ); -@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self, - ipp_pstate_t state; - int i = 0; - -- for ( attr = response->attrs; attr != NULL; attr = attr->next ) -+ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) ) - { -- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER ) -- attr = attr->next; -+ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER ) -+ attr = ippNextAttribute( response ); - - if ( attr == NULL ) - break; -@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self, - state = IPP_PRINTER_IDLE; - accepting = 0; - -- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER ) -+ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER ) - { -- if ( strcmp( attr->name, "printer-name" ) == 0 && -- attr->value_tag == IPP_TAG_NAME ) -- name = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "device-uri" ) == 0 && -- attr->value_tag == IPP_TAG_URI ) -- device_uri = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 && -- attr->value_tag == IPP_TAG_URI ) -- printer_uri = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-info" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- info = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-location" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- location = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- make_model = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-state" ) == 0 && -- attr->value_tag == IPP_TAG_ENUM ) -- state = ( ipp_pstate_t ) attr->values[ 0 ].integer; -- -- else if (!strcmp(attr->name, "printer-is-accepting-jobs") && -- attr->value_tag == IPP_TAG_BOOLEAN) -- accepting = attr->values[ 0 ].boolean; -+ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_NAME ) -+ name = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_URI ) -+ device_uri = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_URI ) -+ printer_uri = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ info = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ location = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ make_model = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_ENUM ) -+ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 ); -+ -+ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") && -+ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN) -+ accepting = ippGetBoolean( attr, 0 ); - -- attr = attr->next; -+ attr = ippNextAttribute( response ); - } - - if ( device_uri == NULL ) -@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self, - request = ippNew(); - language = cupsLangDefault(); - -- request->request.op.operation_id = CUPS_ADD_PRINTER; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_ADD_PRINTER ); -+ ippSetRequestId ( request, 1 ); - - ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding( language ) ); -@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self, - } - else - { -- status = response->request.status.status_code; -+ status = ippGetStatusCode( response ); - //ippDelete( response ); - r = 1; - } -@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self, - */ - request = ippNew(); - -- request->request.op.operation_id = CUPS_DELETE_PRINTER; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_DELETE_PRINTER ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self, - */ - response = cupsDoRequest( http, request, "/admin/" ); - -- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) -+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) - { - r = 1; - } -@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject * - - request = ippNew(); - -- request->request.op.operation_id = CUPS_SET_DEFAULT; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_SET_DEFAULT ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject * - - response = cupsDoRequest( http, request, "/admin/" ); - -- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) -+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) - { - r = 1; - } -@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se - - request = ippNew(); - -- request->request.op.operation_id = op; -- request->request.op.request_id = 1; -+ ippSetOperation( request, op ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se - - response = cupsDoRequest(http, request, "/admin/"); - -- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT)) -+ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT)) - { - r = 1; - } -@@ -837,7 +877,7 @@ abort: - if ( response != NULL ) - ippDelete( response ); - -- return Py_BuildValue( "i", r );; -+ return Py_BuildValue( "i", r ); - } - - -@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self, - - request = ippNew(); - -- request->request.op.operation_id = CUPS_GET_PPDS; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PPDS ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self, - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - -- for (attr = response->attrs; attr; attr = attr->next) -+ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response )) - { - PyObject *dict; - char *ppdname = NULL; - -- while (attr && attr->group_tag != IPP_TAG_PRINTER) -- attr = attr->next; -+ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) -+ attr = ippNextAttribute( response ); - - if (!attr) - break; - - dict = PyDict_New (); - -- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next) -+ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response )) - { - PyObject *val = NULL; - -- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME) -+ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME) - { -- ppdname = attr->values[0].string.text; -+ ppdname = ippGetString( attr, 0, NULL ); - - //sprintf( buf, "print '%s'", ppdname); - //PyRun_SimpleString( buf ); - } - -- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD) -- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) || -- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) || -- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) || -- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT)) -+ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD) -+ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) || -+ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || -+ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || -+ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT)) - { -- val = PyObj_from_UTF8(attr->values[0].string.text); -+ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL )); - } - - if (val) - { -- PyDict_SetItemString (dict, attr->name, val); -+ PyDict_SetItemString (dict, ippGetName( attr ), val); - Py_DECREF (val); - } - } -diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c ---- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors 2012-06-18 12:42:51.000000000 +0200 -+++ hplip-3.12.6/scan/sane/hpaio.c 2012-07-19 17:12:34.557848760 +0200 -@@ -47,6 +47,43 @@ - #define DEBUG_DECLARE_ONLY - #include "sanei_debug.h" - -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetGroupTag(attr) attr->group_tag -+#define ippGetValueTag(attr) attr->value_tag -+#define ippGetName(attr) attr->name -+#define ippGetString(attr, element, language) attr->values[element].string.text -+ -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) -+{ -+ if (!ipp) -+ return (NULL); -+ return (ipp->current = ipp->attrs); -+} -+ -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) -+{ -+ if (!ipp || !ipp->current) -+ return (NULL); -+ return (ipp->current = ipp->current->next); -+} -+ -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) -+{ -+ ipp->request.op.operation_id = op; -+ return (1); -+} -+ -+static int ippSetRequestId( ipp_t *ipp, int request_id ) -+{ -+ ipp->request.any.request_id = request_id; -+ return (1); -+} -+#endif -+ - static SANE_Device **DeviceList = NULL; - - static int AddDeviceList(char *uri, char *model, SANE_Device ***pd) -@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print - /* Assemble the IPP request */ - request = ippNew(); - -- request->request.op.operation_id = CUPS_GET_PRINTERS; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PRINTERS ); -+ ippSetRequestId( request, 1 ); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en"); -@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print - if ((response = cupsDoRequest(http, request, "/")) == NULL) - goto bugout; - -- for (attr = response->attrs; attr != NULL; attr = attr->next) -+ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response )) - { - /* Skip leading attributes until we hit a printer. */ -- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER) -- attr = attr->next; -+ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) -+ attr = ippNextAttribute( response ); - - if (attr == NULL) - break; - -- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) -+ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER) - { -- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0) -+ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0) - cnt++; -- attr = attr->next; -+ attr = ippNextAttribute( response ); - } - - if (attr == NULL) diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/hplip-3.9.4b-glibc210.u --- a/hplip/stuff/hplip-3.9.4b-glibc210.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ ---- prnt/hpijs/registry.cpp.orig 2009-04-29 22:41:07.000000000 +0200 -+++ prnt/hpijs/registry.cpp 2009-06-02 14:17:09.000000000 +0200 -@@ -292,7 +292,7 @@ DRIVER_ERROR DeviceRegistry::SelectDevic - device = eDJ3320; - match = TRUE; - } -- char *cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:"); -+ const char *cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:"); - if (!cmdStr) - { - cmdStr = strstr ((const char *) DevIDBuffer+2, "COMMAND SET:"); ---- prnt/hpijs/dj3320.cpp.orig 2009-04-29 22:41:07.000000000 +0200 -+++ prnt/hpijs/dj3320.cpp 2009-06-02 14:32:21.000000000 +0200 -@@ -429,7 +429,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE - pLDLEncap->bNewStatus = FALSE; - - // First 10 bytes of m_pbyReadBuff are packet header. Status query from printer has $S: -- if ((pcStr = strstr((const char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL) -+ if ((pcStr = strstr((char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL) - { - m_dsCurrentStatus = DISPLAY_COMM_PROBLEM; - return DISPLAY_COMM_PROBLEM; diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/hplip-cups-1.5.0-compatibility.patch --- a/hplip/stuff/hplip-cups-1.5.0-compatibility.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ ---- hplip-3.11.7~/prnt/hpps/hppsfilter.c 2011-07-24 18:58:05.000000000 +0000 -+++ hplip-3.11.7/prnt/hpps/hppsfilter.c 2011-08-09 20:51:54.150214165 +0000 -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - #include - #include diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/patches/cups-1.6-buildfix.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hplip/stuff/patches/cups-1.6-buildfix.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,392 @@ +diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c +--- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors 2012-06-18 12:41:19.000000000 +0200 ++++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-07-19 17:11:47.606524137 +0200 +@@ -87,6 +87,46 @@ typedef int Py_ssize_t; + #define PY_SSIZE_T_MIN INT_MIN + #endif + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetCount(attr) attr->num_values ++#define ippGetGroupTag(attr) attr->group_tag ++#define ippGetValueTag(attr) attr->value_tag ++#define ippGetName(attr) attr->name ++#define ippGetBoolean(attr, element) attr->values[element].boolean ++#define ippGetInteger(attr, element) attr->values[element].integer ++#define ippGetStatusCode(ipp) ipp->request.status.status_code ++#define ippGetString(attr, element, language) attr->values[element].string.text ++ ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) ++{ ++ if (!ipp) ++ return (NULL); ++ return (ipp->current = ipp->attrs); ++} ++ ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) ++{ ++ if (!ipp || !ipp->current) ++ return (NULL); ++ return (ipp->current = ipp->current->next); ++} ++ ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) ++{ ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++static int ippSetRequestId( ipp_t *ipp, int request_id ) ++{ ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif + + int g_num_options = 0; + cups_option_t * g_options; +@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self, + request = ippNew(); + language = cupsLangDefault(); + +- request->request.op.operation_id = CUPS_GET_PRINTERS; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PRINTERS ); ++ ippSetRequestId ( request, 1); + + ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, cupsLangEncoding( language ) ); +@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self, + ipp_pstate_t state; + int i = 0; + +- for ( attr = response->attrs; attr != NULL; attr = attr->next ) ++ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) ) + { +- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER ) +- attr = attr->next; ++ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER ) ++ attr = ippNextAttribute( response ); + + if ( attr == NULL ) + break; +@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self, + state = IPP_PRINTER_IDLE; + accepting = 0; + +- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER ) ++ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER ) + { +- if ( strcmp( attr->name, "printer-name" ) == 0 && +- attr->value_tag == IPP_TAG_NAME ) +- name = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "device-uri" ) == 0 && +- attr->value_tag == IPP_TAG_URI ) +- device_uri = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 && +- attr->value_tag == IPP_TAG_URI ) +- printer_uri = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-info" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- info = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-location" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- location = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- make_model = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-state" ) == 0 && +- attr->value_tag == IPP_TAG_ENUM ) +- state = ( ipp_pstate_t ) attr->values[ 0 ].integer; +- +- else if (!strcmp(attr->name, "printer-is-accepting-jobs") && +- attr->value_tag == IPP_TAG_BOOLEAN) +- accepting = attr->values[ 0 ].boolean; ++ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_NAME ) ++ name = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_URI ) ++ device_uri = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_URI ) ++ printer_uri = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ info = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ location = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ make_model = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_ENUM ) ++ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 ); ++ ++ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") && ++ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN) ++ accepting = ippGetBoolean( attr, 0 ); + +- attr = attr->next; ++ attr = ippNextAttribute( response ); + } + + if ( device_uri == NULL ) +@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self, + request = ippNew(); + language = cupsLangDefault(); + +- request->request.op.operation_id = CUPS_ADD_PRINTER; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_ADD_PRINTER ); ++ ippSetRequestId ( request, 1 ); + + ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, cupsLangEncoding( language ) ); +@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self, + } + else + { +- status = response->request.status.status_code; ++ status = ippGetStatusCode( response ); + //ippDelete( response ); + r = 1; + } +@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self, + */ + request = ippNew(); + +- request->request.op.operation_id = CUPS_DELETE_PRINTER; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_DELETE_PRINTER ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self, + */ + response = cupsDoRequest( http, request, "/admin/" ); + +- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) ++ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) + { + r = 1; + } +@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject * + + request = ippNew(); + +- request->request.op.operation_id = CUPS_SET_DEFAULT; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_SET_DEFAULT ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject * + + response = cupsDoRequest( http, request, "/admin/" ); + +- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) ++ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) + { + r = 1; + } +@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se + + request = ippNew(); + +- request->request.op.operation_id = op; +- request->request.op.request_id = 1; ++ ippSetOperation( request, op ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se + + response = cupsDoRequest(http, request, "/admin/"); + +- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT)) ++ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT)) + { + r = 1; + } +@@ -837,7 +877,7 @@ abort: + if ( response != NULL ) + ippDelete( response ); + +- return Py_BuildValue( "i", r );; ++ return Py_BuildValue( "i", r ); + } + + +@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self, + + request = ippNew(); + +- request->request.op.operation_id = CUPS_GET_PPDS; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PPDS ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self, + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { + +- for (attr = response->attrs; attr; attr = attr->next) ++ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response )) + { + PyObject *dict; + char *ppdname = NULL; + +- while (attr && attr->group_tag != IPP_TAG_PRINTER) +- attr = attr->next; ++ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) ++ attr = ippNextAttribute( response ); + + if (!attr) + break; + + dict = PyDict_New (); + +- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next) ++ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response )) + { + PyObject *val = NULL; + +- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME) ++ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME) + { +- ppdname = attr->values[0].string.text; ++ ppdname = ippGetString( attr, 0, NULL ); + + //sprintf( buf, "print '%s'", ppdname); + //PyRun_SimpleString( buf ); + } + +- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD) +- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) || +- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) || +- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) || +- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT)) ++ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD) ++ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) || ++ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || ++ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || ++ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT)) + { +- val = PyObj_from_UTF8(attr->values[0].string.text); ++ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL )); + } + + if (val) + { +- PyDict_SetItemString (dict, attr->name, val); ++ PyDict_SetItemString (dict, ippGetName( attr ), val); + Py_DECREF (val); + } + } +diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c +--- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors 2012-06-18 12:42:51.000000000 +0200 ++++ hplip-3.12.6/scan/sane/hpaio.c 2012-07-19 17:12:34.557848760 +0200 +@@ -47,6 +47,43 @@ + #define DEBUG_DECLARE_ONLY + #include "sanei_debug.h" + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetGroupTag(attr) attr->group_tag ++#define ippGetValueTag(attr) attr->value_tag ++#define ippGetName(attr) attr->name ++#define ippGetString(attr, element, language) attr->values[element].string.text ++ ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) ++{ ++ if (!ipp) ++ return (NULL); ++ return (ipp->current = ipp->attrs); ++} ++ ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) ++{ ++ if (!ipp || !ipp->current) ++ return (NULL); ++ return (ipp->current = ipp->current->next); ++} ++ ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) ++{ ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++static int ippSetRequestId( ipp_t *ipp, int request_id ) ++{ ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif ++ + static SANE_Device **DeviceList = NULL; + + static int AddDeviceList(char *uri, char *model, SANE_Device ***pd) +@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print + /* Assemble the IPP request */ + request = ippNew(); + +- request->request.op.operation_id = CUPS_GET_PRINTERS; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PRINTERS ); ++ ippSetRequestId( request, 1 ); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en"); +@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print + if ((response = cupsDoRequest(http, request, "/")) == NULL) + goto bugout; + +- for (attr = response->attrs; attr != NULL; attr = attr->next) ++ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response )) + { + /* Skip leading attributes until we hit a printer. */ +- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER) +- attr = attr->next; ++ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) ++ attr = ippNextAttribute( response ); + + if (attr == NULL) + break; + +- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) ++ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER) + { +- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0) ++ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0) + cnt++; +- attr = attr->next; ++ attr = ippNextAttribute( response ); + } + + if (attr == NULL) diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/patches/hplip-3.9.4b-glibc210.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hplip/stuff/patches/hplip-3.9.4b-glibc210.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,22 @@ +--- prnt/hpijs/registry.cpp.orig 2009-04-29 22:41:07.000000000 +0200 ++++ prnt/hpijs/registry.cpp 2009-06-02 14:17:09.000000000 +0200 +@@ -292,7 +292,7 @@ DRIVER_ERROR DeviceRegistry::SelectDevic + device = eDJ3320; + match = TRUE; + } +- char *cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:"); ++ const char *cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:"); + if (!cmdStr) + { + cmdStr = strstr ((const char *) DevIDBuffer+2, "COMMAND SET:"); +--- prnt/hpijs/dj3320.cpp.orig 2009-04-29 22:41:07.000000000 +0200 ++++ prnt/hpijs/dj3320.cpp 2009-06-02 14:32:21.000000000 +0200 +@@ -429,7 +429,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE + pLDLEncap->bNewStatus = FALSE; + + // First 10 bytes of m_pbyReadBuff are packet header. Status query from printer has $S: +- if ((pcStr = strstr((const char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL) ++ if ((pcStr = strstr((char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL) + { + m_dsCurrentStatus = DISPLAY_COMM_PROBLEM; + return DISPLAY_COMM_PROBLEM; diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/patches/hplip-cups-1.5.0-compatibility.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hplip/stuff/patches/hplip-cups-1.5.0-compatibility.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,9 @@ +--- hplip-3.11.7~/prnt/hpps/hppsfilter.c 2011-07-24 18:58:05.000000000 +0000 ++++ hplip-3.11.7/prnt/hpps/hppsfilter.c 2011-08-09 20:51:54.150214165 +0000 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include diff -r c7b121a4ffd9 -r d6378d455338 hplip/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hplip/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# fix build with cups 1.6 - FC hplip-ipp-accessors.patch +cups-1.6-buildfix.diff diff -r c7b121a4ffd9 -r d6378d455338 html2text/receipt --- a/html2text/receipt Wed May 09 17:03:28 2018 +0300 +++ b/html2text/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ # Rules to configure and make the package. compile_rules() { - # http://www.mbayer.de/html2text/downloads/patch-utf8-html2text-1.3.2a.diff - patch -p1 -i $stuff/patch-utf8-html2text-1.3.2a.diff - ./configure $CONFIGURE_ARGS sed -i 's|/usr/local/bin|/usr/bin|; s|/usr/local/man|/usr/share/man|; s|$(BINDIR)|$(DESTDIR)&|; s|$(MANDIR)|$(DESTDIR)&|; s|$(DOCDIR)|$(DESTDIR)&|' \ diff -r c7b121a4ffd9 -r d6378d455338 html2text/stuff/patch-utf8-html2text-1.3.2a.diff --- a/html2text/stuff/patch-utf8-html2text-1.3.2a.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,706 +0,0 @@ -diff -r -u -bB html2text-1.3.2a/Area.C html2text-1.3.2a-patched/Area.C ---- html2text-1.3.2a/Area.C 2003-11-23 12:05:29.000000000 +0100 -+++ html2text-1.3.2a-patched/Area.C 2005-05-13 22:19:59.862137688 +0200 -@@ -36,10 +36,13 @@ - #include - - #include "Area.h" -+#include "html.h" - #include "string.h" - - #define LATIN1_nbsp 160 - -+extern int use_encoding; -+ - /* ------------------------------------------------------------------------- */ - - #define malloc_array(type, size)\ -@@ -81,6 +84,27 @@ - - /* ------------------------------------------------------------------------- */ - -+/* utf_length() and utf_width() -+ * -+ * Very simplified algorithm of calculating length of UTF-8 -+ * string. No check for errors. Counting only ASCII bytes and -+ * leading bytes of UTF-8 multibyte sequences. All bytes like -+ * 10xxxxxx are dropped. If USE_UTF8 is false then returns -+ * usual length. --YS -+ */ -+ -+unsigned int -+Line::utf_length(size_type f, size_type t) const -+{ -+ size_type m = (t < length_ ? t : length_); -+ size_type r = m - f; -+ if(USE_UTF8) { -+ for (int i = f; i < m; i++) -+ if((cells_[i].character & 0xc0) == 0x80) r--; -+ } -+ return r; -+} -+ - void - Line::resize(size_type l) - { -@@ -236,6 +260,23 @@ - return *this; - } - -+unsigned int -+Area::utf_width() -+{ -+ size_type r = width_; -+ if(USE_UTF8) { r = 0; -+ for (size_type yy = 0; yy < height_; yy++) { -+ size_type r1 = 0; -+ for (int i = width_ - 1; i >= 0; i--) { -+ if(!r1 && isspace(cells_[yy][i].character)) continue; -+ if((cells_[yy][i].character & 0xc0) != 0x80) r1++; -+ } -+ if(r < r1) r = r1; -+ } -+ } -+ return r; -+} -+ - void - Area::resize(size_type w, size_type h) - { -@@ -439,7 +480,7 @@ - char c = p->character; - char a = p->attribute; - -- if (c == (char) LATIN1_nbsp) c = ' '; -+ if (c == (char) LATIN1_nbsp && !USE_UTF8) c = ' '; - - if (a == Cell::NONE) { - os << c; -Nur in html2text-1.3.2a-patched/: Area.C.orig. -diff -r -u -bB html2text-1.3.2a/Area.h html2text-1.3.2a-patched/Area.h ---- html2text-1.3.2a/Area.h 2003-11-23 12:05:29.000000000 +0100 -+++ html2text-1.3.2a-patched/Area.h 2005-05-13 22:19:59.863137536 +0200 -@@ -81,6 +81,8 @@ - Cell &operator[](size_type x) { return cells_[x]; } - const Cell *cells() const { return cells_; } - -+ unsigned int utf_length(size_type f, size_type t) const; -+ - void resize(size_type l); - void enlarge(size_type l) { if (l > length_) resize(l); } - -@@ -134,6 +136,8 @@ - Cell *operator[](size_type y) { return cells_[y]; } - const Area &operator>>=(size_type rs); - -+ unsigned int utf_width(); -+ - void resize(size_type w, size_type h); - void enlarge(size_type w, size_type h); - -Nur in html2text-1.3.2a-patched/: Area.h.orig. -diff -r -u -bB html2text-1.3.2a/format.C html2text-1.3.2a-patched/format.C ---- html2text-1.3.2a/format.C 2003-11-23 12:05:29.000000000 +0100 -+++ html2text-1.3.2a-patched/format.C 2005-05-13 22:19:59.865137232 +0200 -@@ -1210,6 +1210,7 @@ - } - - Line::size_type to = from + 1; -+ int to_from; - - Line::size_type lbp = (Line::size_type) -1; // "Last break position". - -@@ -1238,18 +1239,20 @@ - to++; - } - -- if (to - from > w && lbp != (Area::size_type) -1) { to = lbp; break; } -+ if (line.utf_length(from,to) > w && lbp != (Area::size_type) -1) -+ { to = lbp; break; } - } - -+ to_from = line.utf_length(from,to); - /* - * Copy the "from...to" range from the "line" to the bottom of the "res" - * Area. - */ - Area::size_type x = 0; - Area::size_type len = to - from; -- if (halign == Area::LEFT || len >= w) { ; } else -- if (halign == Area::CENTER) { x += (w - len) / 2; } else -- if (halign == Area::RIGHT) { x += w - len; } -+ if (halign == Area::LEFT || to_from >= w) { ; } else -+ if (halign == Area::CENTER) { x += (w - to_from) / 2; } else -+ if (halign == Area::RIGHT) { x += w - to_from; } - res->insert(line.cells() + from, len, x, res->height()); - - /* -Nur in html2text-1.3.2a-patched/: format.C.orig. -diff -r -u -bB html2text-1.3.2a/html2text.C html2text-1.3.2a-patched/html2text.C ---- html2text-1.3.2a/html2text.C 2003-11-23 12:05:29.000000000 +0100 -+++ html2text-1.3.2a-patched/html2text.C 2005-05-13 22:19:59.868136776 +0200 -@@ -148,9 +148,10 @@ - -o Redirect output into \n\ - -nobs Do not use backspaces for boldface and underlining\n\ - -ascii Use plain ASCII for output instead of ISO-8859-1\n\ -+ -utf8 Assume both terminal and input stream are in UTF-8 mode\n\ - "; - --int use_iso8859 = 1; -+int use_encoding = ISO8859; - - int - main(int argc, char **argv) -@@ -199,7 +200,8 @@ - if (!strcmp(arg, "-width" )) { width = atoi(argv[++i]); } else - if (!strcmp(arg, "-o" )) { output_file_name = argv[++i]; } else - if (!strcmp(arg, "-nobs" )) { use_backspaces = false; } else -- if (!strcmp(arg, "-ascii" )) { use_iso8859 = false; } else -+ if (!strcmp(arg, "-ascii" )) { use_encoding = ASCII; } else -+ if (!strcmp(arg, "-utf8" )) { use_encoding = UTF8; } else - { - std::cerr - << "Unrecognized command line option \"" -Nur in html2text-1.3.2a-patched/: html2text.C.orig. -diff -r -u -bB html2text-1.3.2a/html.h html2text-1.3.2a-patched/html.h ---- html2text-1.3.2a/html.h 2001-10-04 22:03:54.000000000 +0200 -+++ html2text-1.3.2a-patched/html.h 2005-05-13 22:19:59.866137080 +0200 -@@ -61,6 +61,11 @@ - - /* ------------------------------------------------------------------------- */ - -+enum {ASCII, ISO8859, UTF8}; -+#define USE_ISO8859 (use_encoding == ISO8859) -+#define USE_ASCII (use_encoding == ASCII) -+#define USE_UTF8 (use_encoding == UTF8) -+ - #define LATIN1_nbsp 160 - #define LATIN1_iexcl 161 - #define LATIN1_cent 162 -diff -r -u -bB html2text-1.3.2a/sgml.C html2text-1.3.2a-patched/sgml.C ---- html2text-1.3.2a/sgml.C 2003-11-23 12:09:11.000000000 +0100 -+++ html2text-1.3.2a-patched/sgml.C 2005-05-13 22:19:59.870136472 +0200 -@@ -62,261 +62,280 @@ - char name[8]; - int iso8859code; - char *asciistr; -+ unsigned long unicode; - } entities[] = { -- { "AElig", LATIN1_AElig, "AE" }, -- { "AMP", 0, "&" }, -- { "Aacute", LATIN1_Aacute, "A'" }, -- { "Acirc", LATIN1_Acirc, "A^" }, -- { "Agrave", LATIN1_Agrave, "A`" }, -- { "Alpha", 0, "A" }, -- { "Aring", LATIN1_Aring, "AA" }, -- { "Atilde", LATIN1_Atilde, "A~" }, -- { "Auml", LATIN1_Auml, "A\"" }, -- { "Beta", 0, "B" }, -- { "Ccedil", LATIN1_Ccedil, "C," }, -- { "Chi", 0, "H" }, -- { "Dagger", 0, "++" }, -- { "Delta", 0, "D" }, -- { "ETH", LATIN1_ETH, "D-" }, -- { "Eacute", LATIN1_Eacute, "E'" }, -- { "Ecirc", LATIN1_Ecirc, "E^" }, -- { "Egrave", LATIN1_Egrave, "E`" }, -- { "Epsilon", 0, "E" }, -- { "Eta", 0, "E" }, -- { "Euml", LATIN1_Euml, "E\"" }, -- { "GT", 0, ">" }, -- { "Gamma", 0, "G" }, -- { "Iacute", LATIN1_Iacute, "I'" }, -- { "Icirc", LATIN1_Icirc, "I^" }, -- { "Igrave", LATIN1_Igrave, "I`" }, -- { "Iota", 0, "I" }, -- { "Iuml", LATIN1_Iuml, "I\"" }, -- { "Kappa", 0, "K" }, -- { "LT", 0, "<" }, -- { "Lambda", 0, "L" }, -- { "Mu", 0, "M" }, -- { "Ntilde", LATIN1_Ntilde, "N~" }, -- { "Nu", 0, "N" }, -- { "OElig", 0, "OE" }, -- { "Oacute", LATIN1_Oacute, "O'" }, -- { "Ocirc", LATIN1_Ocirc, "O^" }, -- { "Ograve", LATIN1_Ograve, "O`" }, -- { "Omega", 0, "O" }, -- { "Omicron", 0, "O" }, -- { "Oslash", LATIN1_Oslash, "O/" }, -- { "Otilde", LATIN1_Otilde, "O~" }, -- { "Ouml", LATIN1_Ouml, "O\"" }, -- { "Phi", 0, "F" }, -- { "Pi", 0, "P" }, -- { "Prime", 0, "''" }, -- { "Psi", 0, "PS" }, -- { "QUOT", 0, "\"" }, -- { "Rho", 0, "R" }, -- { "Scaron", 0, "S" }, -- { "Sigma", 0, "S" }, -- { "THORN", LATIN1_THORN, "TH" }, -- { "Tau", 0, "T" }, -- { "Theta", 0, "TH" }, -- { "Uacute", LATIN1_Uacute, "U'" }, -- { "Ucirc", LATIN1_Ucirc, "U^" }, -- { "Ugrave", LATIN1_Ugrave, "U`" }, -- { "Upsilon", 0, "U" }, -- { "Uuml", LATIN1_Uuml, "U\"" }, -- { "Xi", 0, "X" }, -- { "Yacute", LATIN1_Yacute, "Y'" }, -- { "Yuml", 0, "Y\"" }, -- { "Zeta", 0, "Z" }, -- { "aacute", LATIN1_aacute, "a'" }, -- { "acirc", LATIN1_acirc, "a^" }, -- { "acute", LATIN1_acute, "'" }, -- { "aelig", LATIN1_aelig, "ae" }, -- { "agrave", LATIN1_agrave, "a`" }, -+ { "AElig", LATIN1_AElig, "AE", 0x00c6}, -+ { "AMP", 0, "&", 0x0026}, -+ { "Aacute", LATIN1_Aacute, "A'", 0x00c1}, -+ { "Acirc", LATIN1_Acirc, "A^", 0x00c2}, -+ { "Agrave", LATIN1_Agrave, "A`", 0x00c0}, -+ { "Alpha", 0, "A", 0x0391}, -+ { "Aring", LATIN1_Aring, "AA", 0x00c5}, -+ { "Atilde", LATIN1_Atilde, "A~", 0x00c3}, -+ { "Auml", LATIN1_Auml, "A\"", 0x00c4}, -+ { "Beta", 0, "B", 0x0392}, -+ { "Ccedil", LATIN1_Ccedil, "C,", 0x00c7}, -+ { "Chi", 0, "H", 0x03a7}, -+ { "Dagger", 0, "++", 0x2020}, -+ { "Delta", 0, "D", 0x0394}, -+ { "ETH", LATIN1_ETH, "D-", 0x00d0}, -+ { "Eacute", LATIN1_Eacute, "E'", 0x00c9}, -+ { "Ecirc", LATIN1_Ecirc, "E^", 0x00ca}, -+ { "Egrave", LATIN1_Egrave, "E`", 0x00c8}, -+ { "Epsilon", 0, "E", 0x0395}, -+ { "Eta", 0, "E", 0x0397}, -+ { "Euml", LATIN1_Euml, "E\"", 0x00cb}, -+ { "GT", 0, ">", 0x003e}, -+ { "Gamma", 0, "G", 0x0393}, -+ { "Iacute", LATIN1_Iacute, "I'", 0x00cd}, -+ { "Icirc", LATIN1_Icirc, "I^", 0x00ce}, -+ { "Igrave", LATIN1_Igrave, "I`", 0x00cc}, -+ { "Iota", 0, "I", 0x0399}, -+ { "Iuml", LATIN1_Iuml, "I\"", 0x00cf}, -+ { "Kappa", 0, "K", 0x039a}, -+ { "LT", 0, "<", 0x003c}, -+ { "Lambda", 0, "L", 0x039b}, -+ { "Mu", 0, "M", 0x039c}, -+ { "Ntilde", LATIN1_Ntilde, "N~", 0x00d1}, -+ { "Nu", 0, "N", 0x039d}, -+ { "OElig", 0, "OE", 0x0152}, -+ { "Oacute", LATIN1_Oacute, "O'", 0x00d3}, -+ { "Ocirc", LATIN1_Ocirc, "O^", 0x00d4}, -+ { "Ograve", LATIN1_Ograve, "O`", 0x00d2}, -+ { "Omega", 0, "O", 0x03a9}, -+ { "Omicron", 0, "O", 0x039f}, -+ { "Oslash", LATIN1_Oslash, "O/", 0x00d8}, -+ { "Otilde", LATIN1_Otilde, "O~", 0x00d5}, -+ { "Ouml", LATIN1_Ouml, "O\"", 0x00d6}, -+ { "Phi", 0, "F", 0x03a6}, -+ { "Pi", 0, "P", 0x03a0}, -+ { "Prime", 0, "''", }, -+ { "Psi", 0, "PS", 0x03a8}, -+ { "QUOT", 0, "\"", }, -+ { "Rho", 0, "R", 0x03a1}, -+ { "Scaron", 0, "S", 0x0161}, -+ { "Sigma", 0, "S", 0x03a3}, -+ { "THORN", LATIN1_THORN, "TH", 0x00de}, -+ { "Tau", 0, "T", 0x03a4}, -+ { "Theta", 0, "TH", 0x0398}, -+ { "Uacute", LATIN1_Uacute, "U'", 0x00da}, -+ { "Ucirc", LATIN1_Ucirc, "U^", 0x00db}, -+ { "Ugrave", LATIN1_Ugrave, "U`", 0x00d9}, -+ { "Upsilon", 0, "U", 0x03a5}, -+ { "Uuml", LATIN1_Uuml, "U\"", 0x00dc}, -+ { "Xi", 0, "X", 0x039e}, -+ { "Yacute", LATIN1_Yacute, "Y'", 0x00dd}, -+ { "Yuml", 0, "Y\"", 0x0178}, -+ { "Zeta", 0, "Z", 0x0396}, -+ { "aacute", LATIN1_aacute, "a'", 0x00e1}, -+ { "acirc", LATIN1_acirc, "a^", 0x00e2}, -+ { "acute", LATIN1_acute, "'", 0x00b4}, -+ { "aelig", LATIN1_aelig, "ae", 0x00e6}, -+ { "agrave", LATIN1_agrave, "a`", 0x00e0}, - { "alefsym", 0, "Aleph" }, -- { "alpha", 0, "a" }, -+ { "alpha", 0, "a", 0x03b1}, - { "amp", 0, "&" }, - { "and", 0, "AND" }, - { "ang", 0, "-V" }, - { "apos", 0, "'" }, -- { "aring", LATIN1_aring, "aa" }, -- { "asymp", 0, "~=" }, -- { "atilde", LATIN1_atilde, "a~" }, -- { "auml", LATIN1_auml, "a\"" }, -+ { "aring", LATIN1_aring, "aa", 0x00e5}, -+ { "asymp", 0, "~=", 0x2248}, -+ { "atilde", LATIN1_atilde, "a~", 0x00e3}, -+ { "auml", LATIN1_auml, "a\"", 0x00e5}, - { "bdquo", 0, "\"" }, -- { "beta", 0, "b" }, -- { "brvbar", LATIN1_brvbar, "|" }, -- { "bull", 0, " o " }, -+ { "beta", 0, "b", 0x03b2}, -+ { "brvbar", LATIN1_brvbar, "|", 0x00a6}, -+ { "bull", 0, " o ", 0x2022}, - { "cap", 0, "(U" }, -- { "ccedil", LATIN1_ccedil, "c," }, -- { "cedil", LATIN1_cedil, "," }, -- { "cent", LATIN1_cent, "-c-" }, -- { "chi", 0, "h" }, -- { "circ", 0, "^" }, -+ { "ccedil", LATIN1_ccedil, "c,", 0x00e7}, -+ { "cedil", LATIN1_cedil, ",", 0x00b8}, -+ { "cent", LATIN1_cent, "-c-", 0x00a2}, -+ { "chi", 0, "h", 0x03c7}, -+ { "circ", 0, "^", 0x005e}, - // { "clubs", 0, "[clubs]" }, - { "cong", 0, "?=" }, -- { "copy", LATIN1_copy, "(c)" }, -+ { "copy", LATIN1_copy, "(c)", 0x00a9}, - { "crarr", 0, "<-'" }, - { "cup", 0, ")U" }, -- { "curren", LATIN1_curren, "CUR" }, -+ { "curren", LATIN1_curren, "CUR", 0x00a4}, - { "dArr", 0, "vv" }, -- { "dagger", 0, "+" }, -+ { "dagger", 0, "+", 0x2020}, - { "darr", 0, "v" }, -- { "deg", LATIN1_deg, "DEG" }, -- { "delta", 0, "d" }, -+ { "deg", LATIN1_deg, "DEG", 0x00b0}, -+ { "delta", 0, "d", 0x03b4}, - // { "diams", 0, "[diamonds]" }, -- { "divide", LATIN1_divide, "/" }, -- { "eacute", LATIN1_eacute, "e'" }, -- { "ecirc", LATIN1_ecirc, "e^" }, -- { "egrave", LATIN1_egrave, "e`" }, -+ { "divide", LATIN1_divide, "/", 0x00f7}, -+ { "eacute", LATIN1_eacute, "e'", 0x00e9}, -+ { "ecirc", LATIN1_ecirc, "e^", 0x00ea}, -+ { "egrave", LATIN1_egrave, "e`", 0x00e8}, - { "empty", 0, "{}" }, -- { "epsilon", 0, "e" }, -- { "equiv", 0, "==" }, -- { "eta", 0, "e" }, -- { "eth", LATIN1_eth, "d-" }, -- { "euml", LATIN1_euml, "e\"" }, -- { "euro", 0, "EUR" }, -+ { "epsilon", 0, "e", 0x03b5}, -+ { "equiv", 0, "==", 0x2261}, -+ { "eta", 0, "e", 0x03b7}, -+ { "eth", LATIN1_eth, "d-", 0x00f0}, -+ { "euml", LATIN1_euml, "e\"", 0x00eb}, -+ { "euro", 0, "EUR", 0x20ac}, - { "exist", 0, "TE" }, - { "fnof", 0, "f" }, - { "forall", 0, "FA" }, -- { "frac12", LATIN1_frac12, " 1/2" }, -- { "frac14", LATIN1_frac14, " 1/4" }, -- { "frac34", LATIN1_frac34, " 3/4" }, -+ { "frac12", LATIN1_frac12, " 1/2",0x00bd}, -+ { "frac14", LATIN1_frac14, " 1/4",0x00bc}, -+ { "frac34", LATIN1_frac34, " 3/4",0x00be}, - { "frasl", 0, "/" }, -- { "gamma", 0, "g" }, -- { "ge", 0, ">=" }, -- { "gt", 0, ">" }, -+ { "gamma", 0, "g", 0x03b3}, -+ { "ge", 0, ">=", 0x2265}, -+ { "gt", 0, ">", 0x003e}, - { "hArr", 0, "<=>" }, - { "harr", 0, "<->" }, - // { "hearts", 0, "[hearts]" }, -- { "hellip", 0, "..." }, -- { "iacute", LATIN1_iacute, "i'" }, -- { "icirc", LATIN1_icirc, "i^" }, -- { "iexcl", LATIN1_iexcl, "!" }, -- { "igrave", LATIN1_igrave, "i`" }, -+ { "hellip", 0, "...", 0x2026}, -+ { "iacute", LATIN1_iacute, "i'", 0x00ed}, -+ { "icirc", LATIN1_icirc, "i^", 0x00ee}, -+ { "iexcl", LATIN1_iexcl, "!", 0x00a1}, -+ { "igrave", LATIN1_igrave, "i`", 0x00ec}, - { "image", 0, "Im" }, -- { "infin", 0, "oo" }, -- { "int", 0, "INT" }, -- { "iota", 0, "i" }, -- { "iquest", LATIN1_iquest, "?" }, -+ { "infin", 0, "oo", 0x221e}, -+ { "int", 0, "INT", 0x222b}, -+ { "iota", 0, "i", 0x03b9}, -+ { "iquest", LATIN1_iquest, "?", 0x00bf}, - { "isin", 0, "(-" }, -- { "iuml", LATIN1_iuml, "i\"" }, -- { "kappa", 0, "k" }, -+ { "iuml", LATIN1_iuml, "i\"", 0x00ef}, -+ { "kappa", 0, "k", 0x03ba}, - { "lArr", 0, "<=" }, -- { "lambda", 0, "l" }, -+ { "lambda", 0, "l", 0x03bb}, - { "lang", 0, "" }, - { "lsaquo", 0, "<" }, - { "lsquo", 0, "`" }, -- { "lt", 0, "<" }, -- { "macr", LATIN1_macr, "-" }, -+ { "lt", 0, "<", 0x003c}, -+ { "macr", LATIN1_macr, "-", 0x00af}, - { "mdash", 0, "--" }, -- { "micro", LATIN1_micro, "my" }, -- { "middot", LATIN1_middot, "." }, -- { "minus", 0, "-" }, -- { "mu", 0, "m" }, -+ { "micro", LATIN1_micro, "my", 0x00b5}, -+ { "middot", LATIN1_middot, ".", 0x00b7}, -+ { "minus", 0, "-", 0x2212}, -+ { "mu", 0, "m", 0x03bc}, - { "nabla", 0, "Nabla" }, -- { "nbsp", LATIN1_nbsp, " " }, -+ { "nbsp", LATIN1_nbsp, " ", 0x00a0}, - { "ndash", 0, "-" }, -- { "ne", 0, "!=" }, -+ { "ne", 0, "!=", 0x2260}, - { "ni", 0, "-)" }, - { "not", LATIN1_not, "NOT" }, - { "notin", 0, "!(-" }, - { "nsub", 0, "!(C" }, -- { "ntilde", LATIN1_ntilde, "n~" }, -- { "nu", 0, "n" }, -- { "oacute", LATIN1_oacute, "o'" }, -- { "ocirc", LATIN1_ocirc, "o^" }, -+ { "ntilde", LATIN1_ntilde, "n~", 0x00f1}, -+ { "nu", 0, "n", 0x03bd}, -+ { "oacute", LATIN1_oacute, "o'", 0x00f3}, -+ { "ocirc", LATIN1_ocirc, "o^", 0x00f4}, - { "oelig", 0, "oe" }, -- { "ograve", LATIN1_ograve, "o`" }, -+ { "ograve", LATIN1_ograve, "o`", 0x00f2}, - { "oline", LATIN1_macr, "-" }, -- { "omega", 0, "o" }, -- { "omicron", 0, "o" }, -+ { "omega", 0, "o", 0x03c9}, -+ { "omicron", 0, "o", 0x03bf}, - { "oplus", 0, "(+)" }, - { "or", 0, "OR" }, -- { "ordf", LATIN1_ordf, "-a" }, -- { "ordm", LATIN1_ordm, "-o" }, -- { "oslash", LATIN1_oslash, "o/" }, -- { "otilde", LATIN1_otilde, "o~" }, -+ { "ordf", LATIN1_ordf, "-a", 0x00aa}, -+ { "ordm", LATIN1_ordm, "-o", 0x00ba}, -+ { "oslash", LATIN1_oslash, "o/", 0x00f8}, -+ { "otilde", LATIN1_otilde, "o~", 0x00f5}, - { "otimes", 0, "(x)" }, -- { "ouml", LATIN1_ouml, "o\"" }, -- { "para", LATIN1_para, "P:" }, -- { "part", 0, "PART" }, -- { "permil", 0, " 0/00" }, -+ { "ouml", LATIN1_ouml, "o\"", 0x00f6}, -+ { "para", LATIN1_para, "P:", 0x00b6}, -+ { "part", 0, "PART",0x2202}, -+ { "permil", 0, " 0/00",0x2030}, - { "perp", 0, "-T" }, -- { "phi", 0, "f" }, -- { "pi", 0, "p" }, -+ { "phi", 0, "f", 0x03c6}, -+ { "pi", 0, "p", 0x03c0}, - { "piv", 0, "Pi" }, -- { "plusmn", LATIN1_plusmn, "+/-" }, -- { "pound", LATIN1_pound, "-L-" }, -+ { "plusmn", LATIN1_plusmn, "+/-", 0x00b1}, -+ { "pound", LATIN1_pound, "-L-", 0x00a3}, - { "prime", 0, "'" }, -- { "prod", 0, "PROD" }, -+ { "prod", 0, "PROD",0x220f}, - { "prop", 0, "0(" }, -- { "psi", 0, "ps" }, -+ { "psi", 0, "ps", 0x03c8}, - { "quot", 0, "\"" }, - { "rArr", 0, "=>" }, -- { "radic", 0, "SQRT" }, -+ { "radic", 0, "SQRT",0x221a}, - { "rang", 0, "/>" }, - { "raquo", LATIN1_raquo, ">>" }, -- { "rarr", 0, "->" }, -+ { "rarr", 0, "->", 0x2192}, - // { "rceil", 0, ">|" }, - { "rdquo", 0, "\"" }, - { "real", 0, "Re" }, -- { "reg", LATIN1_reg, "(R)" }, -+ { "reg", LATIN1_reg, "(R)", 0x00ae}, - // { "rfloor", 0, "|>" }, -- { "rho", 0, "r" }, -+ { "rho", 0, "r", 0x03c1}, - { "rsaquo", 0, ">" }, - { "rsquo", 0, "'" }, - { "sbquo", 0, "'" }, -- { "scaron", 0, "s" }, -+ { "scaron", 0, "s", 0x0161}, - { "sdot", 0, "DOT" }, -- { "sect", LATIN1_sect, "S:" }, -+ { "sect", LATIN1_sect, "S:", 0x00a7}, - { "shy", LATIN1_shy, "" }, -- { "sigma", 0, "s" }, -- { "sigmaf", 0, "s" }, -+ { "sigma", 0, "s", 0x03c3}, -+ { "sigmaf", 0, "s", 0x03c2}, - { "sim", 0, "~" }, - // { "spades", 0, "[spades]" }, - { "sub", 0, "(C" }, - { "sube", 0, "(_" }, -- { "sum", 0, "SUM" }, -+ { "sum", 0, "SUM", 0x2211}, - { "sup", 0, ")C" }, -- { "sup1", LATIN1_sup1, "^1" }, -- { "sup2", LATIN1_sup2, "^2" }, -- { "sup3", LATIN1_sup3, "^3" }, -+ { "sup1", LATIN1_sup1, "^1", 0x00b9}, -+ { "sup2", LATIN1_sup2, "^2", 0x00b2}, -+ { "sup3", LATIN1_sup3, "^3", 0x00b3}, - { "supe", 0, ")_" }, -- { "szlig", LATIN1_szlig, "ss" }, -- { "tau", 0, "t" }, -+ { "szlig", LATIN1_szlig, "ss", 0x00df}, -+ { "tau", 0, "t", 0x03c4}, - { "there4", 0, ".:" }, -- { "theta", 0, "th" }, -- { "thorn", LATIN1_thorn, "th" }, -- { "tilde", 0, "~" }, -- { "times", LATIN1_times, "x" }, -- { "trade", 0, "[TM]" }, -+ { "theta", 0, "th", 0x03b8}, -+ { "thorn", LATIN1_thorn, "th", 0x00fe}, -+ { "tilde", 0, "~", 0x02dc}, -+ { "times", LATIN1_times, "x", 0x00d7}, -+ { "trade", 0, "[TM]",0x2122}, - { "uArr", 0, "^^" }, -- { "uacute", LATIN1_uacute, "u'" }, -+ { "uacute", LATIN1_uacute, "u'", 0x00fa}, - { "uarr", 0, "^" }, -- { "ucirc", LATIN1_ucirc, "u^" }, -- { "ugrave", LATIN1_ugrave, "u`" }, -- { "uml", LATIN1_uml, "\"" }, -- { "upsilon", 0, "u" }, -- { "uuml", LATIN1_uuml, "u\"" }, -+ { "ucirc", LATIN1_ucirc, "u^", 0x00fb}, -+ { "ugrave", LATIN1_ugrave, "u`", 0x00f9}, -+ { "uml", LATIN1_uml, "\"", 0x00a8}, -+ { "upsilon", 0, "u", 0x03c5}, -+ { "uuml", LATIN1_uuml, "u\"", 0x00fc}, - { "weierp", 0, "P" }, -- { "xi", 0, "x" }, -- { "yacute", LATIN1_yacute, "y'" }, -- { "yen", LATIN1_yen, "YEN" }, -- { "yuml", LATIN1_yuml, "y\"" }, -- { "zeta", 0, "z" }, -+ { "xi", 0, "x", 0x03be}, -+ { "yacute", LATIN1_yacute, "y'", 0x00fd}, -+ { "yen", LATIN1_yen, "YEN", 0x00a5}, -+ { "yuml", LATIN1_yuml, "y\"", 0x00ff}, -+ { "zeta", 0, "z", 0x03b6}, - }; - --extern int use_iso8859; -+extern int use_encoding; - - /* ------------------------------------------------------------------------- */ - -+char ubuf[4]; -+ -+char *mkutf(unsigned long x) -+{ -+ memset(ubuf, 0, 4); -+ if(x < 128) ubuf[0] = x; -+ else if(x < 0x800) { -+ ubuf[0] = (0xc0 | ((x >> 6) & 0x1f)); -+ ubuf[1] = (0x80 | (x & 0x3f)); -+ } -+ else { -+ ubuf[0] = (0xe0 | ((x >> 12) & 0x0f)); -+ ubuf[1] = (0x80 | ((x >> 6) & 0x3f)); -+ ubuf[2] = (0x80 | (x & 0x3f)); -+ } -+ return ubuf; -+} -+ - void - replace_sgml_entities(string *s) - { -@@ -330,9 +349,9 @@ - */ - while (j < l && s->at(j) != '&') ++j; - /* -- * We could convert high-bit chars to "é" here if use_iso8859 -- * is off, then let them be translated or not. Is the purpose of -- * !use_iso8859 to allow SGML entities to be seen, or to strongly -+ * We could convert high-bit chars to "é" here if USE_ASCII -+ * is on, then let them be translated or not. Is the purpose of -+ * USE_ASCII to allow SGML entities to be seen, or to strongly - * filter against high-ASCII chars that might blow up a terminal - * that doesn't speak ISO8859? For the moment, "allow SGML entities - * to be seen" -- no filtering here. -@@ -370,7 +389,11 @@ - if (!isdigit(c)) break; - x = 10 * x + c - '0'; - } -- if (use_iso8859 || (x < 128)) { -+ if (USE_UTF8) { -+ s->replace(beg, j - beg, mkutf(x)); -+ j = beg + 1; -+ } -+ else if (USE_ISO8859 && (x < 256) || USE_ASCII && (x < 128)) { - s->replace(beg, j - beg, 1, (char) x); - j = beg + 1; - } else { -@@ -408,13 +431,17 @@ - (int (*)(const void *, const void *)) strcmp - ); - if (entity != NULL) { -- if (use_iso8859 && entity->iso8859code) { -+ if (USE_ISO8859 && entity->iso8859code) { - s->replace(beg, j - beg, 1, (char) entity->iso8859code); - j = beg + 1; -- } else if (entity->asciistr) { -+ } else if (USE_ASCII && entity->asciistr) { - s->replace(beg, j - beg, entity->asciistr); - j = beg + 1; - } /* else don't replace it at all, we don't have a translation */ -+ else if(USE_UTF8 && entity->unicode) { -+ s->replace(beg, j - beg, mkutf(entity->unicode)); -+ j = beg + 1; -+ } - } - } else { - ; /* EXTENSION: Allow literal '&' sometimes. */ -diff -r -u -bB html2text-1.3.2a/table.C html2text-1.3.2a-patched/table.C ---- html2text-1.3.2a/table.C 2002-07-22 13:32:50.000000000 +0200 -+++ html2text-1.3.2a-patched/table.C 2005-05-13 22:19:59.871136320 +0200 -@@ -175,7 +175,7 @@ - - (*number_of_columns_return - 1) * (column_spacing + 0), - Area::LEFT // Yields better results than "p->halign"! - )); -- p->width = tmp.get() ? tmp->width() : 0; -+ p->width = tmp.get() ? tmp->utf_width() : 0; - } - p->minimized = false; - -@@ -308,7 +308,7 @@ - left_of_column + old_column_width - 1, - Area::LEFT // Yields better results than "lc.halign"! - )); -- w = tmp->width(); -+ w = tmp->utf_width(); - if (w >= left_of_column + old_column_width) lc.minimized = true; - } - if (w > left_of_column + new_column_width) { diff -r c7b121a4ffd9 -r d6378d455338 html2text/stuff/patches/patch-utf8-html2text-1.3.2a.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html2text/stuff/patches/patch-utf8-html2text-1.3.2a.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,706 @@ +diff -r -u -bB html2text-1.3.2a/Area.C html2text-1.3.2a-patched/Area.C +--- html2text-1.3.2a/Area.C 2003-11-23 12:05:29.000000000 +0100 ++++ html2text-1.3.2a-patched/Area.C 2005-05-13 22:19:59.862137688 +0200 +@@ -36,10 +36,13 @@ + #include + + #include "Area.h" ++#include "html.h" + #include "string.h" + + #define LATIN1_nbsp 160 + ++extern int use_encoding; ++ + /* ------------------------------------------------------------------------- */ + + #define malloc_array(type, size)\ +@@ -81,6 +84,27 @@ + + /* ------------------------------------------------------------------------- */ + ++/* utf_length() and utf_width() ++ * ++ * Very simplified algorithm of calculating length of UTF-8 ++ * string. No check for errors. Counting only ASCII bytes and ++ * leading bytes of UTF-8 multibyte sequences. All bytes like ++ * 10xxxxxx are dropped. If USE_UTF8 is false then returns ++ * usual length. --YS ++ */ ++ ++unsigned int ++Line::utf_length(size_type f, size_type t) const ++{ ++ size_type m = (t < length_ ? t : length_); ++ size_type r = m - f; ++ if(USE_UTF8) { ++ for (int i = f; i < m; i++) ++ if((cells_[i].character & 0xc0) == 0x80) r--; ++ } ++ return r; ++} ++ + void + Line::resize(size_type l) + { +@@ -236,6 +260,23 @@ + return *this; + } + ++unsigned int ++Area::utf_width() ++{ ++ size_type r = width_; ++ if(USE_UTF8) { r = 0; ++ for (size_type yy = 0; yy < height_; yy++) { ++ size_type r1 = 0; ++ for (int i = width_ - 1; i >= 0; i--) { ++ if(!r1 && isspace(cells_[yy][i].character)) continue; ++ if((cells_[yy][i].character & 0xc0) != 0x80) r1++; ++ } ++ if(r < r1) r = r1; ++ } ++ } ++ return r; ++} ++ + void + Area::resize(size_type w, size_type h) + { +@@ -439,7 +480,7 @@ + char c = p->character; + char a = p->attribute; + +- if (c == (char) LATIN1_nbsp) c = ' '; ++ if (c == (char) LATIN1_nbsp && !USE_UTF8) c = ' '; + + if (a == Cell::NONE) { + os << c; +Nur in html2text-1.3.2a-patched/: Area.C.orig. +diff -r -u -bB html2text-1.3.2a/Area.h html2text-1.3.2a-patched/Area.h +--- html2text-1.3.2a/Area.h 2003-11-23 12:05:29.000000000 +0100 ++++ html2text-1.3.2a-patched/Area.h 2005-05-13 22:19:59.863137536 +0200 +@@ -81,6 +81,8 @@ + Cell &operator[](size_type x) { return cells_[x]; } + const Cell *cells() const { return cells_; } + ++ unsigned int utf_length(size_type f, size_type t) const; ++ + void resize(size_type l); + void enlarge(size_type l) { if (l > length_) resize(l); } + +@@ -134,6 +136,8 @@ + Cell *operator[](size_type y) { return cells_[y]; } + const Area &operator>>=(size_type rs); + ++ unsigned int utf_width(); ++ + void resize(size_type w, size_type h); + void enlarge(size_type w, size_type h); + +Nur in html2text-1.3.2a-patched/: Area.h.orig. +diff -r -u -bB html2text-1.3.2a/format.C html2text-1.3.2a-patched/format.C +--- html2text-1.3.2a/format.C 2003-11-23 12:05:29.000000000 +0100 ++++ html2text-1.3.2a-patched/format.C 2005-05-13 22:19:59.865137232 +0200 +@@ -1210,6 +1210,7 @@ + } + + Line::size_type to = from + 1; ++ int to_from; + + Line::size_type lbp = (Line::size_type) -1; // "Last break position". + +@@ -1238,18 +1239,20 @@ + to++; + } + +- if (to - from > w && lbp != (Area::size_type) -1) { to = lbp; break; } ++ if (line.utf_length(from,to) > w && lbp != (Area::size_type) -1) ++ { to = lbp; break; } + } + ++ to_from = line.utf_length(from,to); + /* + * Copy the "from...to" range from the "line" to the bottom of the "res" + * Area. + */ + Area::size_type x = 0; + Area::size_type len = to - from; +- if (halign == Area::LEFT || len >= w) { ; } else +- if (halign == Area::CENTER) { x += (w - len) / 2; } else +- if (halign == Area::RIGHT) { x += w - len; } ++ if (halign == Area::LEFT || to_from >= w) { ; } else ++ if (halign == Area::CENTER) { x += (w - to_from) / 2; } else ++ if (halign == Area::RIGHT) { x += w - to_from; } + res->insert(line.cells() + from, len, x, res->height()); + + /* +Nur in html2text-1.3.2a-patched/: format.C.orig. +diff -r -u -bB html2text-1.3.2a/html2text.C html2text-1.3.2a-patched/html2text.C +--- html2text-1.3.2a/html2text.C 2003-11-23 12:05:29.000000000 +0100 ++++ html2text-1.3.2a-patched/html2text.C 2005-05-13 22:19:59.868136776 +0200 +@@ -148,9 +148,10 @@ + -o Redirect output into \n\ + -nobs Do not use backspaces for boldface and underlining\n\ + -ascii Use plain ASCII for output instead of ISO-8859-1\n\ ++ -utf8 Assume both terminal and input stream are in UTF-8 mode\n\ + "; + +-int use_iso8859 = 1; ++int use_encoding = ISO8859; + + int + main(int argc, char **argv) +@@ -199,7 +200,8 @@ + if (!strcmp(arg, "-width" )) { width = atoi(argv[++i]); } else + if (!strcmp(arg, "-o" )) { output_file_name = argv[++i]; } else + if (!strcmp(arg, "-nobs" )) { use_backspaces = false; } else +- if (!strcmp(arg, "-ascii" )) { use_iso8859 = false; } else ++ if (!strcmp(arg, "-ascii" )) { use_encoding = ASCII; } else ++ if (!strcmp(arg, "-utf8" )) { use_encoding = UTF8; } else + { + std::cerr + << "Unrecognized command line option \"" +Nur in html2text-1.3.2a-patched/: html2text.C.orig. +diff -r -u -bB html2text-1.3.2a/html.h html2text-1.3.2a-patched/html.h +--- html2text-1.3.2a/html.h 2001-10-04 22:03:54.000000000 +0200 ++++ html2text-1.3.2a-patched/html.h 2005-05-13 22:19:59.866137080 +0200 +@@ -61,6 +61,11 @@ + + /* ------------------------------------------------------------------------- */ + ++enum {ASCII, ISO8859, UTF8}; ++#define USE_ISO8859 (use_encoding == ISO8859) ++#define USE_ASCII (use_encoding == ASCII) ++#define USE_UTF8 (use_encoding == UTF8) ++ + #define LATIN1_nbsp 160 + #define LATIN1_iexcl 161 + #define LATIN1_cent 162 +diff -r -u -bB html2text-1.3.2a/sgml.C html2text-1.3.2a-patched/sgml.C +--- html2text-1.3.2a/sgml.C 2003-11-23 12:09:11.000000000 +0100 ++++ html2text-1.3.2a-patched/sgml.C 2005-05-13 22:19:59.870136472 +0200 +@@ -62,261 +62,280 @@ + char name[8]; + int iso8859code; + char *asciistr; ++ unsigned long unicode; + } entities[] = { +- { "AElig", LATIN1_AElig, "AE" }, +- { "AMP", 0, "&" }, +- { "Aacute", LATIN1_Aacute, "A'" }, +- { "Acirc", LATIN1_Acirc, "A^" }, +- { "Agrave", LATIN1_Agrave, "A`" }, +- { "Alpha", 0, "A" }, +- { "Aring", LATIN1_Aring, "AA" }, +- { "Atilde", LATIN1_Atilde, "A~" }, +- { "Auml", LATIN1_Auml, "A\"" }, +- { "Beta", 0, "B" }, +- { "Ccedil", LATIN1_Ccedil, "C," }, +- { "Chi", 0, "H" }, +- { "Dagger", 0, "++" }, +- { "Delta", 0, "D" }, +- { "ETH", LATIN1_ETH, "D-" }, +- { "Eacute", LATIN1_Eacute, "E'" }, +- { "Ecirc", LATIN1_Ecirc, "E^" }, +- { "Egrave", LATIN1_Egrave, "E`" }, +- { "Epsilon", 0, "E" }, +- { "Eta", 0, "E" }, +- { "Euml", LATIN1_Euml, "E\"" }, +- { "GT", 0, ">" }, +- { "Gamma", 0, "G" }, +- { "Iacute", LATIN1_Iacute, "I'" }, +- { "Icirc", LATIN1_Icirc, "I^" }, +- { "Igrave", LATIN1_Igrave, "I`" }, +- { "Iota", 0, "I" }, +- { "Iuml", LATIN1_Iuml, "I\"" }, +- { "Kappa", 0, "K" }, +- { "LT", 0, "<" }, +- { "Lambda", 0, "L" }, +- { "Mu", 0, "M" }, +- { "Ntilde", LATIN1_Ntilde, "N~" }, +- { "Nu", 0, "N" }, +- { "OElig", 0, "OE" }, +- { "Oacute", LATIN1_Oacute, "O'" }, +- { "Ocirc", LATIN1_Ocirc, "O^" }, +- { "Ograve", LATIN1_Ograve, "O`" }, +- { "Omega", 0, "O" }, +- { "Omicron", 0, "O" }, +- { "Oslash", LATIN1_Oslash, "O/" }, +- { "Otilde", LATIN1_Otilde, "O~" }, +- { "Ouml", LATIN1_Ouml, "O\"" }, +- { "Phi", 0, "F" }, +- { "Pi", 0, "P" }, +- { "Prime", 0, "''" }, +- { "Psi", 0, "PS" }, +- { "QUOT", 0, "\"" }, +- { "Rho", 0, "R" }, +- { "Scaron", 0, "S" }, +- { "Sigma", 0, "S" }, +- { "THORN", LATIN1_THORN, "TH" }, +- { "Tau", 0, "T" }, +- { "Theta", 0, "TH" }, +- { "Uacute", LATIN1_Uacute, "U'" }, +- { "Ucirc", LATIN1_Ucirc, "U^" }, +- { "Ugrave", LATIN1_Ugrave, "U`" }, +- { "Upsilon", 0, "U" }, +- { "Uuml", LATIN1_Uuml, "U\"" }, +- { "Xi", 0, "X" }, +- { "Yacute", LATIN1_Yacute, "Y'" }, +- { "Yuml", 0, "Y\"" }, +- { "Zeta", 0, "Z" }, +- { "aacute", LATIN1_aacute, "a'" }, +- { "acirc", LATIN1_acirc, "a^" }, +- { "acute", LATIN1_acute, "'" }, +- { "aelig", LATIN1_aelig, "ae" }, +- { "agrave", LATIN1_agrave, "a`" }, ++ { "AElig", LATIN1_AElig, "AE", 0x00c6}, ++ { "AMP", 0, "&", 0x0026}, ++ { "Aacute", LATIN1_Aacute, "A'", 0x00c1}, ++ { "Acirc", LATIN1_Acirc, "A^", 0x00c2}, ++ { "Agrave", LATIN1_Agrave, "A`", 0x00c0}, ++ { "Alpha", 0, "A", 0x0391}, ++ { "Aring", LATIN1_Aring, "AA", 0x00c5}, ++ { "Atilde", LATIN1_Atilde, "A~", 0x00c3}, ++ { "Auml", LATIN1_Auml, "A\"", 0x00c4}, ++ { "Beta", 0, "B", 0x0392}, ++ { "Ccedil", LATIN1_Ccedil, "C,", 0x00c7}, ++ { "Chi", 0, "H", 0x03a7}, ++ { "Dagger", 0, "++", 0x2020}, ++ { "Delta", 0, "D", 0x0394}, ++ { "ETH", LATIN1_ETH, "D-", 0x00d0}, ++ { "Eacute", LATIN1_Eacute, "E'", 0x00c9}, ++ { "Ecirc", LATIN1_Ecirc, "E^", 0x00ca}, ++ { "Egrave", LATIN1_Egrave, "E`", 0x00c8}, ++ { "Epsilon", 0, "E", 0x0395}, ++ { "Eta", 0, "E", 0x0397}, ++ { "Euml", LATIN1_Euml, "E\"", 0x00cb}, ++ { "GT", 0, ">", 0x003e}, ++ { "Gamma", 0, "G", 0x0393}, ++ { "Iacute", LATIN1_Iacute, "I'", 0x00cd}, ++ { "Icirc", LATIN1_Icirc, "I^", 0x00ce}, ++ { "Igrave", LATIN1_Igrave, "I`", 0x00cc}, ++ { "Iota", 0, "I", 0x0399}, ++ { "Iuml", LATIN1_Iuml, "I\"", 0x00cf}, ++ { "Kappa", 0, "K", 0x039a}, ++ { "LT", 0, "<", 0x003c}, ++ { "Lambda", 0, "L", 0x039b}, ++ { "Mu", 0, "M", 0x039c}, ++ { "Ntilde", LATIN1_Ntilde, "N~", 0x00d1}, ++ { "Nu", 0, "N", 0x039d}, ++ { "OElig", 0, "OE", 0x0152}, ++ { "Oacute", LATIN1_Oacute, "O'", 0x00d3}, ++ { "Ocirc", LATIN1_Ocirc, "O^", 0x00d4}, ++ { "Ograve", LATIN1_Ograve, "O`", 0x00d2}, ++ { "Omega", 0, "O", 0x03a9}, ++ { "Omicron", 0, "O", 0x039f}, ++ { "Oslash", LATIN1_Oslash, "O/", 0x00d8}, ++ { "Otilde", LATIN1_Otilde, "O~", 0x00d5}, ++ { "Ouml", LATIN1_Ouml, "O\"", 0x00d6}, ++ { "Phi", 0, "F", 0x03a6}, ++ { "Pi", 0, "P", 0x03a0}, ++ { "Prime", 0, "''", }, ++ { "Psi", 0, "PS", 0x03a8}, ++ { "QUOT", 0, "\"", }, ++ { "Rho", 0, "R", 0x03a1}, ++ { "Scaron", 0, "S", 0x0161}, ++ { "Sigma", 0, "S", 0x03a3}, ++ { "THORN", LATIN1_THORN, "TH", 0x00de}, ++ { "Tau", 0, "T", 0x03a4}, ++ { "Theta", 0, "TH", 0x0398}, ++ { "Uacute", LATIN1_Uacute, "U'", 0x00da}, ++ { "Ucirc", LATIN1_Ucirc, "U^", 0x00db}, ++ { "Ugrave", LATIN1_Ugrave, "U`", 0x00d9}, ++ { "Upsilon", 0, "U", 0x03a5}, ++ { "Uuml", LATIN1_Uuml, "U\"", 0x00dc}, ++ { "Xi", 0, "X", 0x039e}, ++ { "Yacute", LATIN1_Yacute, "Y'", 0x00dd}, ++ { "Yuml", 0, "Y\"", 0x0178}, ++ { "Zeta", 0, "Z", 0x0396}, ++ { "aacute", LATIN1_aacute, "a'", 0x00e1}, ++ { "acirc", LATIN1_acirc, "a^", 0x00e2}, ++ { "acute", LATIN1_acute, "'", 0x00b4}, ++ { "aelig", LATIN1_aelig, "ae", 0x00e6}, ++ { "agrave", LATIN1_agrave, "a`", 0x00e0}, + { "alefsym", 0, "Aleph" }, +- { "alpha", 0, "a" }, ++ { "alpha", 0, "a", 0x03b1}, + { "amp", 0, "&" }, + { "and", 0, "AND" }, + { "ang", 0, "-V" }, + { "apos", 0, "'" }, +- { "aring", LATIN1_aring, "aa" }, +- { "asymp", 0, "~=" }, +- { "atilde", LATIN1_atilde, "a~" }, +- { "auml", LATIN1_auml, "a\"" }, ++ { "aring", LATIN1_aring, "aa", 0x00e5}, ++ { "asymp", 0, "~=", 0x2248}, ++ { "atilde", LATIN1_atilde, "a~", 0x00e3}, ++ { "auml", LATIN1_auml, "a\"", 0x00e5}, + { "bdquo", 0, "\"" }, +- { "beta", 0, "b" }, +- { "brvbar", LATIN1_brvbar, "|" }, +- { "bull", 0, " o " }, ++ { "beta", 0, "b", 0x03b2}, ++ { "brvbar", LATIN1_brvbar, "|", 0x00a6}, ++ { "bull", 0, " o ", 0x2022}, + { "cap", 0, "(U" }, +- { "ccedil", LATIN1_ccedil, "c," }, +- { "cedil", LATIN1_cedil, "," }, +- { "cent", LATIN1_cent, "-c-" }, +- { "chi", 0, "h" }, +- { "circ", 0, "^" }, ++ { "ccedil", LATIN1_ccedil, "c,", 0x00e7}, ++ { "cedil", LATIN1_cedil, ",", 0x00b8}, ++ { "cent", LATIN1_cent, "-c-", 0x00a2}, ++ { "chi", 0, "h", 0x03c7}, ++ { "circ", 0, "^", 0x005e}, + // { "clubs", 0, "[clubs]" }, + { "cong", 0, "?=" }, +- { "copy", LATIN1_copy, "(c)" }, ++ { "copy", LATIN1_copy, "(c)", 0x00a9}, + { "crarr", 0, "<-'" }, + { "cup", 0, ")U" }, +- { "curren", LATIN1_curren, "CUR" }, ++ { "curren", LATIN1_curren, "CUR", 0x00a4}, + { "dArr", 0, "vv" }, +- { "dagger", 0, "+" }, ++ { "dagger", 0, "+", 0x2020}, + { "darr", 0, "v" }, +- { "deg", LATIN1_deg, "DEG" }, +- { "delta", 0, "d" }, ++ { "deg", LATIN1_deg, "DEG", 0x00b0}, ++ { "delta", 0, "d", 0x03b4}, + // { "diams", 0, "[diamonds]" }, +- { "divide", LATIN1_divide, "/" }, +- { "eacute", LATIN1_eacute, "e'" }, +- { "ecirc", LATIN1_ecirc, "e^" }, +- { "egrave", LATIN1_egrave, "e`" }, ++ { "divide", LATIN1_divide, "/", 0x00f7}, ++ { "eacute", LATIN1_eacute, "e'", 0x00e9}, ++ { "ecirc", LATIN1_ecirc, "e^", 0x00ea}, ++ { "egrave", LATIN1_egrave, "e`", 0x00e8}, + { "empty", 0, "{}" }, +- { "epsilon", 0, "e" }, +- { "equiv", 0, "==" }, +- { "eta", 0, "e" }, +- { "eth", LATIN1_eth, "d-" }, +- { "euml", LATIN1_euml, "e\"" }, +- { "euro", 0, "EUR" }, ++ { "epsilon", 0, "e", 0x03b5}, ++ { "equiv", 0, "==", 0x2261}, ++ { "eta", 0, "e", 0x03b7}, ++ { "eth", LATIN1_eth, "d-", 0x00f0}, ++ { "euml", LATIN1_euml, "e\"", 0x00eb}, ++ { "euro", 0, "EUR", 0x20ac}, + { "exist", 0, "TE" }, + { "fnof", 0, "f" }, + { "forall", 0, "FA" }, +- { "frac12", LATIN1_frac12, " 1/2" }, +- { "frac14", LATIN1_frac14, " 1/4" }, +- { "frac34", LATIN1_frac34, " 3/4" }, ++ { "frac12", LATIN1_frac12, " 1/2",0x00bd}, ++ { "frac14", LATIN1_frac14, " 1/4",0x00bc}, ++ { "frac34", LATIN1_frac34, " 3/4",0x00be}, + { "frasl", 0, "/" }, +- { "gamma", 0, "g" }, +- { "ge", 0, ">=" }, +- { "gt", 0, ">" }, ++ { "gamma", 0, "g", 0x03b3}, ++ { "ge", 0, ">=", 0x2265}, ++ { "gt", 0, ">", 0x003e}, + { "hArr", 0, "<=>" }, + { "harr", 0, "<->" }, + // { "hearts", 0, "[hearts]" }, +- { "hellip", 0, "..." }, +- { "iacute", LATIN1_iacute, "i'" }, +- { "icirc", LATIN1_icirc, "i^" }, +- { "iexcl", LATIN1_iexcl, "!" }, +- { "igrave", LATIN1_igrave, "i`" }, ++ { "hellip", 0, "...", 0x2026}, ++ { "iacute", LATIN1_iacute, "i'", 0x00ed}, ++ { "icirc", LATIN1_icirc, "i^", 0x00ee}, ++ { "iexcl", LATIN1_iexcl, "!", 0x00a1}, ++ { "igrave", LATIN1_igrave, "i`", 0x00ec}, + { "image", 0, "Im" }, +- { "infin", 0, "oo" }, +- { "int", 0, "INT" }, +- { "iota", 0, "i" }, +- { "iquest", LATIN1_iquest, "?" }, ++ { "infin", 0, "oo", 0x221e}, ++ { "int", 0, "INT", 0x222b}, ++ { "iota", 0, "i", 0x03b9}, ++ { "iquest", LATIN1_iquest, "?", 0x00bf}, + { "isin", 0, "(-" }, +- { "iuml", LATIN1_iuml, "i\"" }, +- { "kappa", 0, "k" }, ++ { "iuml", LATIN1_iuml, "i\"", 0x00ef}, ++ { "kappa", 0, "k", 0x03ba}, + { "lArr", 0, "<=" }, +- { "lambda", 0, "l" }, ++ { "lambda", 0, "l", 0x03bb}, + { "lang", 0, "" }, + { "lsaquo", 0, "<" }, + { "lsquo", 0, "`" }, +- { "lt", 0, "<" }, +- { "macr", LATIN1_macr, "-" }, ++ { "lt", 0, "<", 0x003c}, ++ { "macr", LATIN1_macr, "-", 0x00af}, + { "mdash", 0, "--" }, +- { "micro", LATIN1_micro, "my" }, +- { "middot", LATIN1_middot, "." }, +- { "minus", 0, "-" }, +- { "mu", 0, "m" }, ++ { "micro", LATIN1_micro, "my", 0x00b5}, ++ { "middot", LATIN1_middot, ".", 0x00b7}, ++ { "minus", 0, "-", 0x2212}, ++ { "mu", 0, "m", 0x03bc}, + { "nabla", 0, "Nabla" }, +- { "nbsp", LATIN1_nbsp, " " }, ++ { "nbsp", LATIN1_nbsp, " ", 0x00a0}, + { "ndash", 0, "-" }, +- { "ne", 0, "!=" }, ++ { "ne", 0, "!=", 0x2260}, + { "ni", 0, "-)" }, + { "not", LATIN1_not, "NOT" }, + { "notin", 0, "!(-" }, + { "nsub", 0, "!(C" }, +- { "ntilde", LATIN1_ntilde, "n~" }, +- { "nu", 0, "n" }, +- { "oacute", LATIN1_oacute, "o'" }, +- { "ocirc", LATIN1_ocirc, "o^" }, ++ { "ntilde", LATIN1_ntilde, "n~", 0x00f1}, ++ { "nu", 0, "n", 0x03bd}, ++ { "oacute", LATIN1_oacute, "o'", 0x00f3}, ++ { "ocirc", LATIN1_ocirc, "o^", 0x00f4}, + { "oelig", 0, "oe" }, +- { "ograve", LATIN1_ograve, "o`" }, ++ { "ograve", LATIN1_ograve, "o`", 0x00f2}, + { "oline", LATIN1_macr, "-" }, +- { "omega", 0, "o" }, +- { "omicron", 0, "o" }, ++ { "omega", 0, "o", 0x03c9}, ++ { "omicron", 0, "o", 0x03bf}, + { "oplus", 0, "(+)" }, + { "or", 0, "OR" }, +- { "ordf", LATIN1_ordf, "-a" }, +- { "ordm", LATIN1_ordm, "-o" }, +- { "oslash", LATIN1_oslash, "o/" }, +- { "otilde", LATIN1_otilde, "o~" }, ++ { "ordf", LATIN1_ordf, "-a", 0x00aa}, ++ { "ordm", LATIN1_ordm, "-o", 0x00ba}, ++ { "oslash", LATIN1_oslash, "o/", 0x00f8}, ++ { "otilde", LATIN1_otilde, "o~", 0x00f5}, + { "otimes", 0, "(x)" }, +- { "ouml", LATIN1_ouml, "o\"" }, +- { "para", LATIN1_para, "P:" }, +- { "part", 0, "PART" }, +- { "permil", 0, " 0/00" }, ++ { "ouml", LATIN1_ouml, "o\"", 0x00f6}, ++ { "para", LATIN1_para, "P:", 0x00b6}, ++ { "part", 0, "PART",0x2202}, ++ { "permil", 0, " 0/00",0x2030}, + { "perp", 0, "-T" }, +- { "phi", 0, "f" }, +- { "pi", 0, "p" }, ++ { "phi", 0, "f", 0x03c6}, ++ { "pi", 0, "p", 0x03c0}, + { "piv", 0, "Pi" }, +- { "plusmn", LATIN1_plusmn, "+/-" }, +- { "pound", LATIN1_pound, "-L-" }, ++ { "plusmn", LATIN1_plusmn, "+/-", 0x00b1}, ++ { "pound", LATIN1_pound, "-L-", 0x00a3}, + { "prime", 0, "'" }, +- { "prod", 0, "PROD" }, ++ { "prod", 0, "PROD",0x220f}, + { "prop", 0, "0(" }, +- { "psi", 0, "ps" }, ++ { "psi", 0, "ps", 0x03c8}, + { "quot", 0, "\"" }, + { "rArr", 0, "=>" }, +- { "radic", 0, "SQRT" }, ++ { "radic", 0, "SQRT",0x221a}, + { "rang", 0, "/>" }, + { "raquo", LATIN1_raquo, ">>" }, +- { "rarr", 0, "->" }, ++ { "rarr", 0, "->", 0x2192}, + // { "rceil", 0, ">|" }, + { "rdquo", 0, "\"" }, + { "real", 0, "Re" }, +- { "reg", LATIN1_reg, "(R)" }, ++ { "reg", LATIN1_reg, "(R)", 0x00ae}, + // { "rfloor", 0, "|>" }, +- { "rho", 0, "r" }, ++ { "rho", 0, "r", 0x03c1}, + { "rsaquo", 0, ">" }, + { "rsquo", 0, "'" }, + { "sbquo", 0, "'" }, +- { "scaron", 0, "s" }, ++ { "scaron", 0, "s", 0x0161}, + { "sdot", 0, "DOT" }, +- { "sect", LATIN1_sect, "S:" }, ++ { "sect", LATIN1_sect, "S:", 0x00a7}, + { "shy", LATIN1_shy, "" }, +- { "sigma", 0, "s" }, +- { "sigmaf", 0, "s" }, ++ { "sigma", 0, "s", 0x03c3}, ++ { "sigmaf", 0, "s", 0x03c2}, + { "sim", 0, "~" }, + // { "spades", 0, "[spades]" }, + { "sub", 0, "(C" }, + { "sube", 0, "(_" }, +- { "sum", 0, "SUM" }, ++ { "sum", 0, "SUM", 0x2211}, + { "sup", 0, ")C" }, +- { "sup1", LATIN1_sup1, "^1" }, +- { "sup2", LATIN1_sup2, "^2" }, +- { "sup3", LATIN1_sup3, "^3" }, ++ { "sup1", LATIN1_sup1, "^1", 0x00b9}, ++ { "sup2", LATIN1_sup2, "^2", 0x00b2}, ++ { "sup3", LATIN1_sup3, "^3", 0x00b3}, + { "supe", 0, ")_" }, +- { "szlig", LATIN1_szlig, "ss" }, +- { "tau", 0, "t" }, ++ { "szlig", LATIN1_szlig, "ss", 0x00df}, ++ { "tau", 0, "t", 0x03c4}, + { "there4", 0, ".:" }, +- { "theta", 0, "th" }, +- { "thorn", LATIN1_thorn, "th" }, +- { "tilde", 0, "~" }, +- { "times", LATIN1_times, "x" }, +- { "trade", 0, "[TM]" }, ++ { "theta", 0, "th", 0x03b8}, ++ { "thorn", LATIN1_thorn, "th", 0x00fe}, ++ { "tilde", 0, "~", 0x02dc}, ++ { "times", LATIN1_times, "x", 0x00d7}, ++ { "trade", 0, "[TM]",0x2122}, + { "uArr", 0, "^^" }, +- { "uacute", LATIN1_uacute, "u'" }, ++ { "uacute", LATIN1_uacute, "u'", 0x00fa}, + { "uarr", 0, "^" }, +- { "ucirc", LATIN1_ucirc, "u^" }, +- { "ugrave", LATIN1_ugrave, "u`" }, +- { "uml", LATIN1_uml, "\"" }, +- { "upsilon", 0, "u" }, +- { "uuml", LATIN1_uuml, "u\"" }, ++ { "ucirc", LATIN1_ucirc, "u^", 0x00fb}, ++ { "ugrave", LATIN1_ugrave, "u`", 0x00f9}, ++ { "uml", LATIN1_uml, "\"", 0x00a8}, ++ { "upsilon", 0, "u", 0x03c5}, ++ { "uuml", LATIN1_uuml, "u\"", 0x00fc}, + { "weierp", 0, "P" }, +- { "xi", 0, "x" }, +- { "yacute", LATIN1_yacute, "y'" }, +- { "yen", LATIN1_yen, "YEN" }, +- { "yuml", LATIN1_yuml, "y\"" }, +- { "zeta", 0, "z" }, ++ { "xi", 0, "x", 0x03be}, ++ { "yacute", LATIN1_yacute, "y'", 0x00fd}, ++ { "yen", LATIN1_yen, "YEN", 0x00a5}, ++ { "yuml", LATIN1_yuml, "y\"", 0x00ff}, ++ { "zeta", 0, "z", 0x03b6}, + }; + +-extern int use_iso8859; ++extern int use_encoding; + + /* ------------------------------------------------------------------------- */ + ++char ubuf[4]; ++ ++char *mkutf(unsigned long x) ++{ ++ memset(ubuf, 0, 4); ++ if(x < 128) ubuf[0] = x; ++ else if(x < 0x800) { ++ ubuf[0] = (0xc0 | ((x >> 6) & 0x1f)); ++ ubuf[1] = (0x80 | (x & 0x3f)); ++ } ++ else { ++ ubuf[0] = (0xe0 | ((x >> 12) & 0x0f)); ++ ubuf[1] = (0x80 | ((x >> 6) & 0x3f)); ++ ubuf[2] = (0x80 | (x & 0x3f)); ++ } ++ return ubuf; ++} ++ + void + replace_sgml_entities(string *s) + { +@@ -330,9 +349,9 @@ + */ + while (j < l && s->at(j) != '&') ++j; + /* +- * We could convert high-bit chars to "é" here if use_iso8859 +- * is off, then let them be translated or not. Is the purpose of +- * !use_iso8859 to allow SGML entities to be seen, or to strongly ++ * We could convert high-bit chars to "é" here if USE_ASCII ++ * is on, then let them be translated or not. Is the purpose of ++ * USE_ASCII to allow SGML entities to be seen, or to strongly + * filter against high-ASCII chars that might blow up a terminal + * that doesn't speak ISO8859? For the moment, "allow SGML entities + * to be seen" -- no filtering here. +@@ -370,7 +389,11 @@ + if (!isdigit(c)) break; + x = 10 * x + c - '0'; + } +- if (use_iso8859 || (x < 128)) { ++ if (USE_UTF8) { ++ s->replace(beg, j - beg, mkutf(x)); ++ j = beg + 1; ++ } ++ else if (USE_ISO8859 && (x < 256) || USE_ASCII && (x < 128)) { + s->replace(beg, j - beg, 1, (char) x); + j = beg + 1; + } else { +@@ -408,13 +431,17 @@ + (int (*)(const void *, const void *)) strcmp + ); + if (entity != NULL) { +- if (use_iso8859 && entity->iso8859code) { ++ if (USE_ISO8859 && entity->iso8859code) { + s->replace(beg, j - beg, 1, (char) entity->iso8859code); + j = beg + 1; +- } else if (entity->asciistr) { ++ } else if (USE_ASCII && entity->asciistr) { + s->replace(beg, j - beg, entity->asciistr); + j = beg + 1; + } /* else don't replace it at all, we don't have a translation */ ++ else if(USE_UTF8 && entity->unicode) { ++ s->replace(beg, j - beg, mkutf(entity->unicode)); ++ j = beg + 1; ++ } + } + } else { + ; /* EXTENSION: Allow literal '&' sometimes. */ +diff -r -u -bB html2text-1.3.2a/table.C html2text-1.3.2a-patched/table.C +--- html2text-1.3.2a/table.C 2002-07-22 13:32:50.000000000 +0200 ++++ html2text-1.3.2a-patched/table.C 2005-05-13 22:19:59.871136320 +0200 +@@ -175,7 +175,7 @@ + - (*number_of_columns_return - 1) * (column_spacing + 0), + Area::LEFT // Yields better results than "p->halign"! + )); +- p->width = tmp.get() ? tmp->width() : 0; ++ p->width = tmp.get() ? tmp->utf_width() : 0; + } + p->minimized = false; + +@@ -308,7 +308,7 @@ + left_of_column + old_column_width - 1, + Area::LEFT // Yields better results than "lc.halign"! + )); +- w = tmp->width(); ++ w = tmp->utf_width(); + if (w >= left_of_column + old_column_width) lc.minimized = true; + } + if (w > left_of_column + new_column_width) { diff -r c7b121a4ffd9 -r d6378d455338 html2text/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/html2text/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# http://www.mbayer.de/html2text/downloads/patch-utf8-html2text-1.3.2a.diff +-p1|patch-utf8-html2text-1.3.2a.diff diff -r c7b121a4ffd9 -r d6378d455338 icmpshell/receipt --- a/icmpshell/receipt Wed May 09 17:03:28 2018 +0300 +++ b/icmpshell/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,7 +12,6 @@ WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" compile_rules() { - patch -p0 < $stuff/ishd.u make -j 1 linux || return 1 install -Dm755 $src/ish $install/usr/sbin/ish diff -r c7b121a4ffd9 -r d6378d455338 icmpshell/stuff/ishd.u --- a/icmpshell/stuff/ishd.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ ---- ishell.h -+++ ishell.h -@@ -39,6 +39,7 @@ - uint8_t type; /* icmp type to send packet as */ - uint16_t packetsize; /* packetsize of data */ - uint32_t seq; /* sequence number tracking */ -+ char *shell; - }; - - ---- ishd.c -+++ ishd.c -@@ -28,6 +28,7 @@ - " -i Set session id; range: 0-65535 (default: 1515)\n" - " -t Set ICMP type (default: 0)\n" - " -p Set packet size (default: 512)\n" -+ " -s Set shell (default: /bin/sh)\n" - "\nexample:\n" - "%s -i 65535 -t 0 -p 1024\n" - "\n", VERSION, program, program); -@@ -74,7 +75,7 @@ - int n, fd, maxfd; - char send_buf[ish_info.packetsize], recv_buf[ish_info.packetsize]; - -- fd = popen2("/bin/sh"); -+ fd = popen2(ish_info.shell); - sendhdr.cntrl = 0; - - while(1) { -@@ -122,7 +123,8 @@ - int opt, sockfd; - struct sockaddr_in sin; - -- while((opt = getopt(argc, argv, "hdi:t:p:")) != -1) { -+ ish_info.shell = "/bin/sh"; -+ while((opt = getopt(argc, argv, "hdi:t:p:s:")) != -1) { - switch(opt) { - case 'h': - usage(argv[0]); -@@ -138,6 +140,8 @@ - break; - case 'p': - ish_info.packetsize = atoi(optarg); -+ case 's': -+ ish_info.shell = optarg; - break; - } - } diff -r c7b121a4ffd9 -r d6378d455338 icmpshell/stuff/patches/ishd.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icmpshell/stuff/patches/ishd.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,48 @@ +--- ishell.h ++++ ishell.h +@@ -39,6 +39,7 @@ + uint8_t type; /* icmp type to send packet as */ + uint16_t packetsize; /* packetsize of data */ + uint32_t seq; /* sequence number tracking */ ++ char *shell; + }; + + +--- ishd.c ++++ ishd.c +@@ -28,6 +28,7 @@ + " -i Set session id; range: 0-65535 (default: 1515)\n" + " -t Set ICMP type (default: 0)\n" + " -p Set packet size (default: 512)\n" ++ " -s Set shell (default: /bin/sh)\n" + "\nexample:\n" + "%s -i 65535 -t 0 -p 1024\n" + "\n", VERSION, program, program); +@@ -74,7 +75,7 @@ + int n, fd, maxfd; + char send_buf[ish_info.packetsize], recv_buf[ish_info.packetsize]; + +- fd = popen2("/bin/sh"); ++ fd = popen2(ish_info.shell); + sendhdr.cntrl = 0; + + while(1) { +@@ -122,7 +123,8 @@ + int opt, sockfd; + struct sockaddr_in sin; + +- while((opt = getopt(argc, argv, "hdi:t:p:")) != -1) { ++ ish_info.shell = "/bin/sh"; ++ while((opt = getopt(argc, argv, "hdi:t:p:s:")) != -1) { + switch(opt) { + case 'h': + usage(argv[0]); +@@ -138,6 +140,8 @@ + break; + case 'p': + ish_info.packetsize = atoi(optarg); ++ case 's': ++ ish_info.shell = optarg; + break; + } + } diff -r c7b121a4ffd9 -r d6378d455338 icmpshell/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/icmpshell/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|ishd.u diff -r c7b121a4ffd9 -r d6378d455338 idesk/receipt --- a/idesk/receipt Wed May 09 17:03:28 2018 +0300 +++ b/idesk/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,8 +14,6 @@ BUILD_DEPENDS="imlib2-dev xorg-libXft-dev" compile_rules() { - patch -p 0 < $stuff/DesktopConfig.patch || exit 1 - ./configure \ --enable-xft \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 idesk/stuff/DesktopConfig.patch --- a/idesk/stuff/DesktopConfig.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ ---- src/DesktopConfig.cpp.0 -+++ src/DesktopConfig.cpp -@@ -24,6 +24,9 @@ - - #include "DesktopConfig.h" - #include "Util.h" -+#include -+#include -+#include - - //the initilizer list just sets the program defaults for non-necessary options - DesktopConfig::DesktopConfig(Database db, string ideskrcFile) : diff -r c7b121a4ffd9 -r d6378d455338 idesk/stuff/patches/DesktopConfig.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idesk/stuff/patches/DesktopConfig.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,12 @@ +--- src/DesktopConfig.cpp.0 ++++ src/DesktopConfig.cpp +@@ -24,6 +24,9 @@ + + #include "DesktopConfig.h" + #include "Util.h" ++#include ++#include ++#include + + //the initilizer list just sets the program defaults for non-necessary options + DesktopConfig::DesktopConfig(Database db, string ideskrcFile) : diff -r c7b121a4ffd9 -r d6378d455338 idesk/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idesk/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|DesktopConfig.patch diff -r c7b121a4ffd9 -r d6378d455338 john/receipt --- a/john/receipt Wed May 09 17:03:28 2018 +0300 +++ b/john/receipt Thu May 10 21:12:00 2018 +0300 @@ -22,7 +22,6 @@ zcat $SRC/$(basename $PATCH) | patch -p1 cd $src/src - patch -Np0 -i $stuff/params.h.patch sed -i 's|LIBS = -ldes|LIBS = -ldes -Ldes|' Makefile case $ARCH in diff -r c7b121a4ffd9 -r d6378d455338 john/stuff/params.h.patch --- a/john/stuff/params.h.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ ---- params.h.orig 2006-03-17 08:23:42.000000000 -0500 -+++ params.h 2006-03-17 08:50:35.000000000 -0500 -@@ -101,8 +101,8 @@ - /* - * File names. - */ --#define CFG_FULL_NAME "$JOHN/john.conf" --#define CFG_ALT_NAME "$JOHN/john.ini" -+#define CFG_FULL_NAME "/etc/john/john.conf" -+#define CFG_ALT_NAME "/etc/john/john.ini" - #if JOHN_SYSTEMWIDE - #define CFG_PRIVATE_FULL_NAME JOHN_PRIVATE_HOME "/john.conf" - #define CFG_PRIVATE_ALT_NAME JOHN_PRIVATE_HOME "/john.ini" diff -r c7b121a4ffd9 -r d6378d455338 john/stuff/patches/params.h.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/john/stuff/patches/params.h.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,13 @@ +--- a/src/params.h.orig 2006-03-17 08:23:42.000000000 -0500 ++++ b/src/params.h 2006-03-17 08:50:35.000000000 -0500 +@@ -101,8 +101,8 @@ + /* + * File names. + */ +-#define CFG_FULL_NAME "$JOHN/john.conf" +-#define CFG_ALT_NAME "$JOHN/john.ini" ++#define CFG_FULL_NAME "/etc/john/john.conf" ++#define CFG_ALT_NAME "/etc/john/john.ini" + #if JOHN_SYSTEMWIDE + #define CFG_PRIVATE_FULL_NAME JOHN_PRIVATE_HOME "/john.conf" + #define CFG_PRIVATE_ALT_NAME JOHN_PRIVATE_HOME "/john.ini" diff -r c7b121a4ffd9 -r d6378d455338 john/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/john/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +params.h.patch diff -r c7b121a4ffd9 -r d6378d455338 jwm/receipt --- a/jwm/receipt Wed May 09 17:03:28 2018 +0300 +++ b/jwm/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,8 +19,6 @@ arm*) ARCH_ARGS="--disable-nls";; *) ARCH_ARGS="";; esac - #[ -f done.resize-backgound.u ] || patch -p1 < $stuff/resize-backgound.u - #touch done.resize-backgound.u ./configure \ --sysconfdir=/etc/xdg/jwm \ diff -r c7b121a4ffd9 -r d6378d455338 jwm/stuff/patches/resize-backgound.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jwm/stuff/patches/resize-backgound.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,63 @@ +--- jwm-2.0.1/src/icon.c ++++ jwm-2.0.1/src/icon.c +@@ -55,3 +55,3 @@ + +-static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height); ++static ScaledIconNode *_GetScaledIcon(IconNode *icon, int width, int height); + +@@ -194,8 +194,26 @@ + int ix, iy; ++ int nwidth = width, nheight = height; + + Assert(icon); ++ Assert(icon->image); + +- /* Scale the icon. */ +- node = GetScaledIcon(icon, width, height); ++ if(nwidth == 0) { ++ nwidth = icon->image->width; ++ } ++ if(nheight == 0) { ++ nheight = icon->image->height; ++ } + ++ /* respect ratio if not background */ ++ if (x || y) { ++ double ratio; ++ ++ ratio = (double)icon->image->width / icon->image->height; ++ nwidth = Min(nwidth, nheight * ratio); ++ nheight = Min(nheight, nwidth / ratio); ++ nwidth = nheight * ratio; ++ } ++ ++ node = _GetScaledIcon(icon, nwidth, nheight); ++ + if(node) { +@@ -450,3 +468,3 @@ + /** Get a scaled icon. */ +-ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) { ++ScaledIconNode *_GetScaledIcon(IconNode *icon, int nwidth, int nheight) { + +@@ -460,4 +478,2 @@ + double srcx, srcy; +- double ratio; +- int nwidth, nheight; + int usesMask; +@@ -465,16 +481,2 @@ + +- Assert(icon); +- Assert(icon->image); +- +- if(rwidth == 0) { +- rwidth = icon->image->width; +- } +- if(rheight == 0) { +- rheight = icon->image->height; +- } +- +- ratio = (double)icon->image->width / icon->image->height; +- nwidth = Min(rwidth, rheight * ratio); +- nheight = Min(rheight, nwidth / ratio); +- nwidth = nheight * ratio; + if(nwidth < 1) { diff -r c7b121a4ffd9 -r d6378d455338 jwm/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jwm/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +#-p1|resize-backgound.u diff -r c7b121a4ffd9 -r d6378d455338 jwm/stuff/resize-backgound.u --- a/jwm/stuff/resize-backgound.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ ---- jwm-2.0.1/src/icon.c -+++ jwm-2.0.1/src/icon.c -@@ -55,3 +55,3 @@ - --static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height); -+static ScaledIconNode *_GetScaledIcon(IconNode *icon, int width, int height); - -@@ -194,8 +194,26 @@ - int ix, iy; -+ int nwidth = width, nheight = height; - - Assert(icon); -+ Assert(icon->image); - -- /* Scale the icon. */ -- node = GetScaledIcon(icon, width, height); -+ if(nwidth == 0) { -+ nwidth = icon->image->width; -+ } -+ if(nheight == 0) { -+ nheight = icon->image->height; -+ } - -+ /* respect ratio if not background */ -+ if (x || y) { -+ double ratio; -+ -+ ratio = (double)icon->image->width / icon->image->height; -+ nwidth = Min(nwidth, nheight * ratio); -+ nheight = Min(nheight, nwidth / ratio); -+ nwidth = nheight * ratio; -+ } -+ -+ node = _GetScaledIcon(icon, nwidth, nheight); -+ - if(node) { -@@ -450,3 +468,3 @@ - /** Get a scaled icon. */ --ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) { -+ScaledIconNode *_GetScaledIcon(IconNode *icon, int nwidth, int nheight) { - -@@ -460,4 +478,2 @@ - double srcx, srcy; -- double ratio; -- int nwidth, nheight; - int usesMask; -@@ -465,16 +481,2 @@ - -- Assert(icon); -- Assert(icon->image); -- -- if(rwidth == 0) { -- rwidth = icon->image->width; -- } -- if(rheight == 0) { -- rheight = icon->image->height; -- } -- -- ratio = (double)icon->image->width / icon->image->height; -- nwidth = Min(rwidth, rheight * ratio); -- nheight = Min(rheight, nwidth / ratio); -- nwidth = nheight * ratio; - if(nwidth < 1) { diff -r c7b121a4ffd9 -r d6378d455338 knock/receipt --- a/knock/receipt Wed May 09 17:03:28 2018 +0300 +++ b/knock/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,9 +14,6 @@ BUILD_DEPENDS="libpcap-dev" compile_rules() { - [ -f done.knock.u ] || patch -p1 < $stuff/knock.u - touch done.knock.u - ./configure $CONFIGURE_ARGS && make && make DESTDIR=$DESTDIR install || return 1 diff -r c7b121a4ffd9 -r d6378d455338 knock/stuff/knock.u --- a/knock/stuff/knock.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ ---- knock-0.5/knockd.conf -+++ knock-0.5/knockd.conf -@@ -1,4 +1,5 @@ - [options] -+ PidFile = /var/run/knockd.pid - logfile = /var/log/knockd.log - - [openSSH] - ---- knock-0.5/src/knockd.c -+++ knock-0.5/src/knockd.c -@@ -46,5 +46,6 @@ - #include - #include - #include -+#include - #include "list.h" - diff -r c7b121a4ffd9 -r d6378d455338 knock/stuff/patches/knock.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/knock/stuff/patches/knock.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,18 @@ +--- knock-0.5/knockd.conf ++++ knock-0.5/knockd.conf +@@ -1,4 +1,5 @@ + [options] ++ PidFile = /var/run/knockd.pid + logfile = /var/log/knockd.log + + [openSSH] + +--- knock-0.5/src/knockd.c ++++ knock-0.5/src/knockd.c +@@ -46,5 +46,6 @@ + #include + #include + #include ++#include + #include "list.h" + diff -r c7b121a4ffd9 -r d6378d455338 knock/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/knock/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|knock.u diff -r c7b121a4ffd9 -r d6378d455338 le/receipt --- a/le/receipt Wed May 09 17:03:28 2018 +0300 +++ b/le/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,7 +18,7 @@ compile_rules() { export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" - patch -p 0 < $stuff/gcc-4.patch || return 1 + ./configure \ --prefix=/usr \ --infodir=/usr/share/info \ diff -r c7b121a4ffd9 -r d6378d455338 le/stuff/gcc-4.patch --- a/le/stuff/gcc-4.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- src/options.cc 2009-09-22 20:30:26.000000000 +0200 -+++ src/options.cc 2009-09-22 20:30:01.000000000 +0200 -@@ -1245,7 +1245,7 @@ - FindColor(new_bw_pal,color_no)); - return -1; - } -- char *l=strchr(button,'&'); -+ const char *l=strchr(button,'&'); - if(!l) - return -1; - char res=toupper(l[1]); diff -r c7b121a4ffd9 -r d6378d455338 le/stuff/patches/gcc-4.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/le/stuff/patches/gcc-4.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- src/options.cc 2009-09-22 20:30:26.000000000 +0200 ++++ src/options.cc 2009-09-22 20:30:01.000000000 +0200 +@@ -1245,7 +1245,7 @@ + FindColor(new_bw_pal,color_no)); + return -1; + } +- char *l=strchr(button,'&'); ++ const char *l=strchr(button,'&'); + if(!l) + return -1; + char res=toupper(l[1]); diff -r c7b121a4ffd9 -r d6378d455338 le/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/le/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|gcc-4.patch diff -r c7b121a4ffd9 -r d6378d455338 libdvdread/receipt --- a/libdvdread/receipt Wed May 09 17:03:28 2018 +0300 +++ b/libdvdread/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,8 +16,6 @@ COOKOPTS="skip-log-errors" compile_rules() { - patch -Np1 -i $stuff/DVDFileStat.patch - ./autogen.sh \ $CONFIGURE_ARGS && fix libtool && diff -r c7b121a4ffd9 -r d6378d455338 libdvdread/stuff/DVDFileStat.patch --- a/libdvdread/stuff/DVDFileStat.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +0,0 @@ -diff -pruN libdvdread-4.1.3/src/dvd_reader.c libdvdread-4.1.3.new/src/dvd_reader.c ---- libdvdread-4.1.3/src/dvd_reader.c 2008-09-06 23:55:51.000000000 +0200 -+++ libdvdread-4.1.3.new/src/dvd_reader.c 2009-02-28 01:36:20.000000000 +0100 -@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file - } - } - -+static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, -+ int menu, dvd_stat_t *statbuf) -+{ -+ char filename[ MAX_UDF_FILE_NAME_LEN ]; -+ uint32_t size; -+ off_t tot_size; -+ off_t parts_size[9]; -+ int nr_parts = 0; -+ int n; -+ -+ if( title == 0 ) { -+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); -+ } else { -+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); -+ } -+ if(!UDFFindFile( dvd, filename, &size )) { -+ return -1; -+ } -+ tot_size = size; -+ nr_parts = 1; -+ parts_size[0] = size; -+ -+ if( !menu ) { -+ int cur; -+ -+ for( cur = 2; cur < 10; cur++ ) { -+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur ); -+ if( !UDFFindFile( dvd, filename, &size ) ) { -+ break; -+ } -+ parts_size[nr_parts] = size; -+ tot_size += size; -+ nr_parts++; -+ } -+ } -+ -+ statbuf->size = tot_size; -+ statbuf->nr_parts = nr_parts; -+ for(n = 0; n < nr_parts; n++) { -+ statbuf->parts_size[n] = parts_size[n]; -+ } -+ return 0; -+} -+ -+ -+static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title, -+ int menu, dvd_stat_t *statbuf ) -+{ -+ char filename[ MAX_UDF_FILE_NAME_LEN ]; -+ char full_path[ PATH_MAX + 1 ]; -+ struct stat fileinfo; -+ off_t tot_size; -+ off_t parts_size[9]; -+ int nr_parts = 0; -+ int n; -+ -+ -+ -+ if( title == 0 ) { -+ sprintf( filename, "VIDEO_TS.VOB" ); -+ } else { -+ sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); -+ } -+ if( !findDVDFile( dvd, filename, full_path ) ) { -+ return -1; -+ } -+ -+ if( stat( full_path, &fileinfo ) < 0 ) { -+ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); -+ return -1; -+ } -+ -+ -+ tot_size = fileinfo.st_size; -+ nr_parts = 1; -+ parts_size[0] = fileinfo.st_size; -+ -+ if( !menu ) { -+ int cur; -+ -+ for( cur = 2; cur < 10; cur++ ) { -+ -+ sprintf( filename, "VTS_%02d_%d.VOB", title, cur ); -+ if( !findDVDFile( dvd, filename, full_path ) ) { -+ break; -+ } -+ -+ if( stat( full_path, &fileinfo ) < 0 ) { -+ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); -+ break; -+ } -+ -+ parts_size[nr_parts] = fileinfo.st_size; -+ tot_size += parts_size[nr_parts]; -+ nr_parts++; -+ } -+ } -+ -+ statbuf->size = tot_size; -+ statbuf->nr_parts = nr_parts; -+ for(n = 0; n < nr_parts; n++) { -+ statbuf->parts_size[n] = parts_size[n]; -+ } -+ return 0; -+} -+ -+ -+int DVDFileStat(dvd_reader_t *dvd, int titlenum, -+ dvd_read_domain_t domain, dvd_stat_t *statbuf) -+{ -+ char filename[ MAX_UDF_FILE_NAME_LEN ]; -+ char full_path[ PATH_MAX + 1 ]; -+ struct stat fileinfo; -+ uint32_t size; -+ -+ /* Check arguments. */ -+ if( dvd == NULL || titlenum < 0 ) { -+ errno = EINVAL; -+ return -1; -+ } -+ -+ switch( domain ) { -+ case DVD_READ_INFO_FILE: -+ if( titlenum == 0 ) { -+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" ); -+ } else { -+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum ); -+ } -+ break; -+ case DVD_READ_INFO_BACKUP_FILE: -+ if( titlenum == 0 ) { -+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" ); -+ } else { -+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum ); -+ } -+ break; -+ case DVD_READ_MENU_VOBS: -+ if( dvd->isImageFile ) { -+ return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf ); -+ } else { -+ return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf ); -+ } -+ break; -+ case DVD_READ_TITLE_VOBS: -+ if( titlenum == 0 ) { -+ return -1; -+ } -+ if( dvd->isImageFile ) { -+ return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf ); -+ } else { -+ return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf ); -+ } -+ break; -+ default: -+ fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" ); -+ errno = EINVAL; -+ return -1; -+ } -+ -+ if( dvd->isImageFile ) { -+ if( UDFFindFile( dvd, filename, &size ) ) { -+ statbuf->size = size; -+ statbuf->nr_parts = 1; -+ statbuf->parts_size[0] = size; -+ return 0; -+ } -+ } else { -+ if( findDVDFile( dvd, filename, full_path ) ) { -+ if( stat( full_path, &fileinfo ) < 0 ) { -+ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); -+ } else { -+ statbuf->size = fileinfo.st_size; -+ statbuf->nr_parts = 1; -+ statbuf->parts_size[0] = statbuf->size; -+ return 0; -+ } -+ } -+ } -+ return -1; -+} -+ - /* Internal, but used from dvd_udf.c */ - int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, - size_t block_count, unsigned char *data, -diff -pruN libdvdread-4.1.3/src/dvd_reader.h libdvdread-4.1.3.new/src/dvd_reader.h ---- libdvdread-4.1.3/src/dvd_reader.h 2008-09-06 23:55:51.000000000 +0200 -+++ libdvdread-4.1.3.new/src/dvd_reader.h 2009-02-28 01:36:49.000000000 +0100 -@@ -115,6 +115,42 @@ typedef enum { - } dvd_read_domain_t; - - /** -+ * -+ */ -+typedef struct { -+ off_t size; /**< Total size of file in bytes */ -+ int nr_parts; /**< Number of file parts */ -+ off_t parts_size[9]; /**< Size of each part in bytes */ -+} dvd_stat_t; -+ -+/** -+ * Stats a file on the DVD given the title number and domain. -+ * The information about the file is stored in a dvd_stat_t -+ * which contains information about the size of the file and -+ * the number of parts in case of a multipart file and the respective -+ * sizes of the parts. -+ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB -+ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0], -+ * VTS_02_2.VOB in stat->parts_size[1], ... -+ * The total size (sum of all parts) is stored in stat->size and -+ * stat->nr_parts will hold the number of parts. -+ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files. -+ * -+ * This function is only of use if you want to get the size of each file -+ * in the filesystem. These sizes are not needed to use any other -+ * functions in libdvdread. -+ * -+ * @param dvd A dvd read handle. -+ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0. -+ * @param domain Which domain. -+ * @param stat Pointer to where the result is stored. -+ * @return If successful 0, otherwise -1. -+ * -+ * int DVDFileStat(dvd, titlenum, domain, stat); -+ */ -+int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *); -+ -+/** - * Opens a file on the DVD given the title number and domain. - * - * If the title number is 0, the video manager information is opened diff -r c7b121a4ffd9 -r d6378d455338 libdvdread/stuff/patches/DVDFileStat.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libdvdread/stuff/patches/DVDFileStat.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,237 @@ +diff -pruN libdvdread-4.1.3/src/dvd_reader.c libdvdread-4.1.3.new/src/dvd_reader.c +--- libdvdread-4.1.3/src/dvd_reader.c 2008-09-06 23:55:51.000000000 +0200 ++++ libdvdread-4.1.3.new/src/dvd_reader.c 2009-02-28 01:36:20.000000000 +0100 +@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file + } + } + ++static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, ++ int menu, dvd_stat_t *statbuf) ++{ ++ char filename[ MAX_UDF_FILE_NAME_LEN ]; ++ uint32_t size; ++ off_t tot_size; ++ off_t parts_size[9]; ++ int nr_parts = 0; ++ int n; ++ ++ if( title == 0 ) { ++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); ++ } else { ++ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); ++ } ++ if(!UDFFindFile( dvd, filename, &size )) { ++ return -1; ++ } ++ tot_size = size; ++ nr_parts = 1; ++ parts_size[0] = size; ++ ++ if( !menu ) { ++ int cur; ++ ++ for( cur = 2; cur < 10; cur++ ) { ++ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur ); ++ if( !UDFFindFile( dvd, filename, &size ) ) { ++ break; ++ } ++ parts_size[nr_parts] = size; ++ tot_size += size; ++ nr_parts++; ++ } ++ } ++ ++ statbuf->size = tot_size; ++ statbuf->nr_parts = nr_parts; ++ for(n = 0; n < nr_parts; n++) { ++ statbuf->parts_size[n] = parts_size[n]; ++ } ++ return 0; ++} ++ ++ ++static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title, ++ int menu, dvd_stat_t *statbuf ) ++{ ++ char filename[ MAX_UDF_FILE_NAME_LEN ]; ++ char full_path[ PATH_MAX + 1 ]; ++ struct stat fileinfo; ++ off_t tot_size; ++ off_t parts_size[9]; ++ int nr_parts = 0; ++ int n; ++ ++ ++ ++ if( title == 0 ) { ++ sprintf( filename, "VIDEO_TS.VOB" ); ++ } else { ++ sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); ++ } ++ if( !findDVDFile( dvd, filename, full_path ) ) { ++ return -1; ++ } ++ ++ if( stat( full_path, &fileinfo ) < 0 ) { ++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); ++ return -1; ++ } ++ ++ ++ tot_size = fileinfo.st_size; ++ nr_parts = 1; ++ parts_size[0] = fileinfo.st_size; ++ ++ if( !menu ) { ++ int cur; ++ ++ for( cur = 2; cur < 10; cur++ ) { ++ ++ sprintf( filename, "VTS_%02d_%d.VOB", title, cur ); ++ if( !findDVDFile( dvd, filename, full_path ) ) { ++ break; ++ } ++ ++ if( stat( full_path, &fileinfo ) < 0 ) { ++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); ++ break; ++ } ++ ++ parts_size[nr_parts] = fileinfo.st_size; ++ tot_size += parts_size[nr_parts]; ++ nr_parts++; ++ } ++ } ++ ++ statbuf->size = tot_size; ++ statbuf->nr_parts = nr_parts; ++ for(n = 0; n < nr_parts; n++) { ++ statbuf->parts_size[n] = parts_size[n]; ++ } ++ return 0; ++} ++ ++ ++int DVDFileStat(dvd_reader_t *dvd, int titlenum, ++ dvd_read_domain_t domain, dvd_stat_t *statbuf) ++{ ++ char filename[ MAX_UDF_FILE_NAME_LEN ]; ++ char full_path[ PATH_MAX + 1 ]; ++ struct stat fileinfo; ++ uint32_t size; ++ ++ /* Check arguments. */ ++ if( dvd == NULL || titlenum < 0 ) { ++ errno = EINVAL; ++ return -1; ++ } ++ ++ switch( domain ) { ++ case DVD_READ_INFO_FILE: ++ if( titlenum == 0 ) { ++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" ); ++ } else { ++ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum ); ++ } ++ break; ++ case DVD_READ_INFO_BACKUP_FILE: ++ if( titlenum == 0 ) { ++ sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" ); ++ } else { ++ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum ); ++ } ++ break; ++ case DVD_READ_MENU_VOBS: ++ if( dvd->isImageFile ) { ++ return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf ); ++ } else { ++ return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf ); ++ } ++ break; ++ case DVD_READ_TITLE_VOBS: ++ if( titlenum == 0 ) { ++ return -1; ++ } ++ if( dvd->isImageFile ) { ++ return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf ); ++ } else { ++ return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf ); ++ } ++ break; ++ default: ++ fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" ); ++ errno = EINVAL; ++ return -1; ++ } ++ ++ if( dvd->isImageFile ) { ++ if( UDFFindFile( dvd, filename, &size ) ) { ++ statbuf->size = size; ++ statbuf->nr_parts = 1; ++ statbuf->parts_size[0] = size; ++ return 0; ++ } ++ } else { ++ if( findDVDFile( dvd, filename, full_path ) ) { ++ if( stat( full_path, &fileinfo ) < 0 ) { ++ fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); ++ } else { ++ statbuf->size = fileinfo.st_size; ++ statbuf->nr_parts = 1; ++ statbuf->parts_size[0] = statbuf->size; ++ return 0; ++ } ++ } ++ } ++ return -1; ++} ++ + /* Internal, but used from dvd_udf.c */ + int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, + size_t block_count, unsigned char *data, +diff -pruN libdvdread-4.1.3/src/dvd_reader.h libdvdread-4.1.3.new/src/dvd_reader.h +--- libdvdread-4.1.3/src/dvd_reader.h 2008-09-06 23:55:51.000000000 +0200 ++++ libdvdread-4.1.3.new/src/dvd_reader.h 2009-02-28 01:36:49.000000000 +0100 +@@ -115,6 +115,42 @@ typedef enum { + } dvd_read_domain_t; + + /** ++ * ++ */ ++typedef struct { ++ off_t size; /**< Total size of file in bytes */ ++ int nr_parts; /**< Number of file parts */ ++ off_t parts_size[9]; /**< Size of each part in bytes */ ++} dvd_stat_t; ++ ++/** ++ * Stats a file on the DVD given the title number and domain. ++ * The information about the file is stored in a dvd_stat_t ++ * which contains information about the size of the file and ++ * the number of parts in case of a multipart file and the respective ++ * sizes of the parts. ++ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB ++ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0], ++ * VTS_02_2.VOB in stat->parts_size[1], ... ++ * The total size (sum of all parts) is stored in stat->size and ++ * stat->nr_parts will hold the number of parts. ++ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files. ++ * ++ * This function is only of use if you want to get the size of each file ++ * in the filesystem. These sizes are not needed to use any other ++ * functions in libdvdread. ++ * ++ * @param dvd A dvd read handle. ++ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0. ++ * @param domain Which domain. ++ * @param stat Pointer to where the result is stored. ++ * @return If successful 0, otherwise -1. ++ * ++ * int DVDFileStat(dvd, titlenum, domain, stat); ++ */ ++int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *); ++ ++/** + * Opens a file on the DVD given the title number and domain. + * + * If the title number is 0, the video manager information is opened diff -r c7b121a4ffd9 -r d6378d455338 libdvdread/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libdvdread/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +DVDFileStat.patch diff -r c7b121a4ffd9 -r d6378d455338 libee/receipt --- a/libee/receipt Wed May 09 17:03:28 2018 +0300 +++ b/libee/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,9 +15,6 @@ SPLIT="libee-dev" compile_rules() { - # Patch from http://www.gossamer-threads.com/lists/rsyslog/users/4600 - patch -p 1 < $stuff/libee-build-fix.patch - ./configure \ --disable-testbench \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 libee/stuff/libee-build-fix.patch --- a/libee/stuff/libee-build-fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- libee-0.3.2-ori/src/Makefile.am -+++ libee-0.3.2/src/Makefile.am -@@ -39,6 +39,6 @@ - - convert_SOURCES = convert.c - convert_CPPFLAGS = -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) $(LIBXML2_CFLAGS) --convert_LDADD = $(LIBEE_LIBS) $(LIBXML2_LIBS) $(LIBESTR_LIBS) -+convert_LDADD = libee.la $(LIBXML2_LIBS) $(LIBESTR_LIBS) - - include_HEADERS = diff -r c7b121a4ffd9 -r d6378d455338 libee/stuff/patches/libee-build-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libee/stuff/patches/libee-build-fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- libee-0.3.2-ori/src/Makefile.am ++++ libee-0.3.2/src/Makefile.am +@@ -39,6 +39,6 @@ + + convert_SOURCES = convert.c + convert_CPPFLAGS = -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) $(LIBXML2_CFLAGS) +-convert_LDADD = $(LIBEE_LIBS) $(LIBXML2_LIBS) $(LIBESTR_LIBS) ++convert_LDADD = libee.la $(LIBXML2_LIBS) $(LIBESTR_LIBS) + + include_HEADERS = diff -r c7b121a4ffd9 -r d6378d455338 libee/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libee/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# Patch from http://www.gossamer-threads.com/lists/rsyslog/users/4600 +-p1|libee-build-fix.patch diff -r c7b121a4ffd9 -r d6378d455338 libimobiledevice/receipt --- a/libimobiledevice/receipt Wed May 09 17:03:28 2018 +0300 +++ b/libimobiledevice/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,8 +17,6 @@ SPLIT="libimobiledevice-dev" compile_rules() { - patch -Np1 -i $stuff/swig-version-check.patch - ./configure $CONFIGURE_ARGS && fix libtool && make && diff -r c7b121a4ffd9 -r d6378d455338 libimobiledevice/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libimobiledevice/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +swig-version-check.patch diff -r c7b121a4ffd9 -r d6378d455338 libimobiledevice/stuff/patches/swig-version-check.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libimobiledevice/stuff/patches/swig-version-check.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +diff -Nur libimobiledevice-1.0.3.old/configure libimobiledevice-1.0.3/configure +--- libimobiledevice-1.0.3.old/configure 2010-10-04 07:38:37.000000000 -0700 ++++ libimobiledevice-1.0.3/configure 2010-10-08 05:43:05.466686656 -0700 +@@ -3477,9 +3477,7 @@ + if test -z "$available_patch" ; then + available_patch=0 + fi +- if test $available_major -ne $required_major \ +- -o $available_minor -ne $required_minor \ +- -o $available_patch -lt $required_patch ; then ++ if test $available_major -lt $required_major ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.21 is required. You have $swig_version. You should look at http://www.swig.org" >&5 + $as_echo "$as_me: WARNING: SWIG version >= 1.3.21 is required. You have $swig_version. You should look at http://www.swig.org" >&2;} + SWIG=false diff -r c7b121a4ffd9 -r d6378d455338 libimobiledevice/stuff/swig-version-check.patch --- a/libimobiledevice/stuff/swig-version-check.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -Nur libimobiledevice-1.0.3.old/configure libimobiledevice-1.0.3/configure ---- libimobiledevice-1.0.3.old/configure 2010-10-04 07:38:37.000000000 -0700 -+++ libimobiledevice-1.0.3/configure 2010-10-08 05:43:05.466686656 -0700 -@@ -3477,9 +3477,7 @@ - if test -z "$available_patch" ; then - available_patch=0 - fi -- if test $available_major -ne $required_major \ -- -o $available_minor -ne $required_minor \ -- -o $available_patch -lt $required_patch ; then -+ if test $available_major -lt $required_major ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.21 is required. You have $swig_version. You should look at http://www.swig.org" >&5 - $as_echo "$as_me: WARNING: SWIG version >= 1.3.21 is required. You have $swig_version. You should look at http://www.swig.org" >&2;} - SWIG=false diff -r c7b121a4ffd9 -r d6378d455338 liblognorm/receipt --- a/liblognorm/receipt Wed May 09 17:03:28 2018 +0300 +++ b/liblognorm/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,8 +15,6 @@ SPLIT="liblognorm-dev" compile_rules() { - patch -p 1 < $stuff/liblognorm-build-fix.patch - ./configure $CONFIGURE_ARGS && fix libtool && make && diff -r c7b121a4ffd9 -r d6378d455338 liblognorm/stuff/liblognorm-build-fix.patch --- a/liblognorm/stuff/liblognorm-build-fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- liblognorm-0.3.2-ori/src/Makefile.am -+++ liblognorm-0.3.2/src/Makefile.am -@@ -9,7 +9,7 @@ - bin_PROGRAMS = normalizer - normalizer_SOURCES = normalizer.c - normalizer_CPPFLAGS = -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) --normalizer_LDADD = $(LIBEE_LIBS) $(LIBLOGNORM_LIBS) $(LIBESTR_LIBS) -+normalizer_LDADD = $(LIBEE_LIBS) liblognorm.la $(LIBESTR_LIBS) - - lib_LTLIBRARIES = liblognorm.la - diff -r c7b121a4ffd9 -r d6378d455338 liblognorm/stuff/patches/liblognorm-build-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblognorm/stuff/patches/liblognorm-build-fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- liblognorm-0.3.2-ori/src/Makefile.am ++++ liblognorm-0.3.2/src/Makefile.am +@@ -9,7 +9,7 @@ + bin_PROGRAMS = normalizer + normalizer_SOURCES = normalizer.c + normalizer_CPPFLAGS = -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) +-normalizer_LDADD = $(LIBEE_LIBS) $(LIBLOGNORM_LIBS) $(LIBESTR_LIBS) ++normalizer_LDADD = $(LIBEE_LIBS) liblognorm.la $(LIBESTR_LIBS) + + lib_LTLIBRARIES = liblognorm.la + diff -r c7b121a4ffd9 -r d6378d455338 liblognorm/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblognorm/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|liblognorm-build-fix.patch diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/receipt --- a/liblrdf/receipt Wed May 09 17:03:28 2018 +0300 +++ b/liblrdf/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ SPLIT="liblrdf-dev" compile_rules() { - patch -Np1 -i $stuff/md5.patch - patch -Np0 -i $stuff/raptor2.diff - patch -Np1 -i $stuff/pkgconfig-raptor.patch autoreconf -vfi ./configure $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/md5.patch --- a/liblrdf/stuff/md5.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ ---- liblrdf-0.4.0.orig/src/lrdf_md5.h -+++ liblrdf-0.4.0/src/lrdf_md5.h -@@ -32,6 +32,15 @@ - #ifndef __MD5_H__ - #define __MD5_H__ - -+/* Change function names to prevent symbol conflicts */ -+#define md5_init _lrdf_md5_init -+#define md5_buffer _lrdf_md5_buffer -+#define md5_sig_from_string _lrdf_md5_sig_from_string -+#define md5_finish _lrdf_md5_finish -+#define md5_process _lrdf_md5_process -+#define md5_sig_to_string _lrdf_md5_sig_to_string -+#define md5_get_result _lrdf_md5_get_result -+ - /* - * Size of a standard MD5 signature in bytes. This definition is for - * external programs only. The MD5 routines themselves reference the diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/patches/md5.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblrdf/stuff/patches/md5.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,18 @@ +--- liblrdf-0.4.0.orig/src/lrdf_md5.h ++++ liblrdf-0.4.0/src/lrdf_md5.h +@@ -32,6 +32,15 @@ + #ifndef __MD5_H__ + #define __MD5_H__ + ++/* Change function names to prevent symbol conflicts */ ++#define md5_init _lrdf_md5_init ++#define md5_buffer _lrdf_md5_buffer ++#define md5_sig_from_string _lrdf_md5_sig_from_string ++#define md5_finish _lrdf_md5_finish ++#define md5_process _lrdf_md5_process ++#define md5_sig_to_string _lrdf_md5_sig_to_string ++#define md5_get_result _lrdf_md5_get_result ++ + /* + * Size of a standard MD5 signature in bytes. This definition is for + * external programs only. The MD5 routines themselves reference the diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/patches/pkgconfig-raptor.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblrdf/stuff/patches/pkgconfig-raptor.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,9 @@ +--- liblrdf-0.4.0/lrdf.pc.in.orig 2011-10-03 19:28:16.702773254 +0000 ++++ liblrdf-0.4.0/lrdf.pc.in 2011-10-03 19:28:43.003017477 +0000 +@@ -7,4 +7,5 @@ + Version: @VERSION@ + Description: liblrdf, a lightweight RDF library with extensions for LADSPA + Libs: -L${libdir} -llrdf +-Cflags: -I${includedir} ++Libs.private: @RAPTOR_LIBS@ ++Cflags: @RAPTOR_CFLAGS@ -I${includedir} diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/patches/raptor2.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblrdf/stuff/patches/raptor2.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,193 @@ +--- src/Makefile.am ++++ src/Makefile.am +@@ -4,5 +4,5 @@ lib_LTLIBRARIES = liblrdf.la + noinst_HEADERS = lrdf_md5.h md5_loc.h ladspa.h + + liblrdf_la_SOURCES = lrdf.c lrdf_multi.c md5.c +-liblrdf_la_LIBADD = -lraptor ++liblrdf_la_LIBADD = -lraptor2 + liblrdf_la_LDFLAGS = -version-info @LRDF_LIBTOOL_VERSION@ +--- src/lrdf.c ++++ src/lrdf.c +@@ -18,6 +18,7 @@ + static unsigned int lrdf_uid = 0; /* A unique(ish) id to append to genid's to + * avoid clashses */ + ++static raptor_world *world = NULL; + static lrdf_statement *triples = NULL; + static lrdf_statement *free_triples; + static lrdf_string_hash *resources_hash[LRDF_HASH_SIZE]; +@@ -43,8 +44,7 @@ static void lrdf_remove_triple_hash(lrdf_triple_hash ** tbl, + lrdf_hash hash, lrdf_statement * s); + static void lrdf_add_closure_hash(lrdf_closure_hash ** tbl, + lrdf_hash subject, lrdf_hash object); +-static void lrdf_store(void *user_data, +- const raptor_statement * statement); ++static void lrdf_store(void *user_data, raptor_statement * statement); + void lrdf_free_statements(lrdf_statement * s); + void lrdf_copy_statement(lrdf_statement * from, lrdf_statement * to); + void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl, +@@ -71,7 +71,7 @@ void lrdf_init() + unsigned int i; + struct timeval tv; + +- raptor_init(); ++ world = raptor_new_world(); + lrdf_more_triples(256); + + /* A UID to add to genids to make them safer */ +@@ -112,7 +112,8 @@ void lrdf_more_triples(int count) + + void lrdf_cleanup() + { +- raptor_finish(); ++ raptor_free_world(world); ++ world = NULL; + + lrdf_free_string_hash(resources_hash); + lrdf_free_string_hash(literals_hash); +@@ -232,26 +233,29 @@ void lrdf_remove_matches(lrdf_statement *pattern) + } + } + +-static void lrdf_store(void *user_data, const raptor_statement * statement) ++static const char *lrdf_term_as_string(char *tmp, int tmp_len, ++ const raptor_term *term) ++{ ++ switch (term->type) { ++ case RAPTOR_TERM_TYPE_URI: ++ return (const char *) raptor_uri_as_string(term->value.uri); ++ case RAPTOR_TERM_TYPE_LITERAL: ++ return (const char *) term->value.literal.string; ++ case RAPTOR_TERM_TYPE_BLANK: ++ snprintf(tmp, tmp_len, "_:%s.%x", term->value.blank.string, lrdf_uid); ++ return tmp; ++ default: ++ return "(?)"; ++ } ++} ++ ++static void lrdf_store(void *user_data, raptor_statement * statement) + { + lrdf_statement *s = lrdf_alloc_statement(); + char tmps[128], tmpp[128], tmpo[128]; +- char *subj = (char *) statement->subject, +- *pred = (char *) statement->predicate, +- *obj = (char *) statement->object; +- +- if (statement->subject_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { +- snprintf(tmps, 127, "_:%s.%x", subj, lrdf_uid); +- subj = tmps; +- } +- if (statement->predicate_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { +- snprintf(tmpp, 127, "_:%s.%x", pred, lrdf_uid); +- pred = tmpp; +- } +- if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { +- snprintf(tmpo, 127, "_:%s.%x", obj, lrdf_uid); +- obj = tmpo; +- } ++ const char *subj = lrdf_term_as_string(tmps, 128, statement->subject), ++ *pred = lrdf_term_as_string(tmpp, 128, statement->predicate), ++ *obj = lrdf_term_as_string(tmpo, 128, statement->object); + + s->shash = lrdf_gen_hash(subj); + s->phash = lrdf_gen_hash(pred); +@@ -261,7 +265,7 @@ static void lrdf_store(void *user_data, const raptor_statement * statement) + + s->subject = lrdf_check_hash(resources_hash, s->shash, subj); + s->predicate = lrdf_check_hash(resources_hash, s->phash, pred); +- if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_LITERAL) { ++ if (statement->object->type == RAPTOR_TERM_TYPE_LITERAL) { + s->object = lrdf_check_hash(literals_hash, s->ohash, obj); + s->object_type = lrdf_literal; + } else { +@@ -537,28 +541,22 @@ void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl, + free(pathto); + } + +-static void lrdf_error_handler(void *data, raptor_locator * locator, +- const char *message); ++static void lrdf_log_handler(void *data, raptor_log_message *message); + +-static void lrdf_error_handler(void *data, raptor_locator * locator, +- const char *message) ++static void lrdf_log_handler(void *data, raptor_log_message *message) + { +- fprintf(stderr, "liblrdf: error - "); +- raptor_print_locator(stderr, locator); +- fprintf(stderr, " - %s\n", message); +- +- raptor_parse_abort((raptor_parser*)data); +-} ++ const char *severity = "error"; ++ if (message->level == RAPTOR_LOG_LEVEL_WARN) { ++ severity = "warning"; ++ } + +-static void lrdf_warning_handler(void *data, raptor_locator * locator, +- const char *message); ++ fprintf(stderr, "liblrdf: %s - ", severity); ++ raptor_locator_print(message->locator, stderr); ++ fprintf(stderr, " - %s\n", message->text); + +-static void lrdf_warning_handler(void *data, raptor_locator * locator, +- const char *message) +-{ +- fprintf(stderr, "liblrdf: warning - "); +- raptor_print_locator(stderr, locator); +- fprintf(stderr, " - %s\n", message); ++ if (message->level != RAPTOR_LOG_LEVEL_WARN) { ++ raptor_parser_parse_abort((raptor_parser*)data); ++ } + } + + +@@ -593,15 +591,15 @@ int lrdf_read_file_intl(const char *uri) + lrdf_hash source; + + //printf("lrdf: reading %s\n", uri); +- ruri = raptor_new_uri(uri); +- furi = raptor_new_uri(uri); ++ ruri = raptor_new_uri(world, (const unsigned char *) uri); ++ furi = raptor_new_uri(world, (const unsigned char *) uri); + source = lrdf_gen_hash(uri); + lrdf_check_hash(resources_hash, source, uri); + + if (strstr(uri, ".rdf")) { +- parser = raptor_new_parser("rdfxml"); ++ parser = raptor_new_parser(world, "rdfxml"); + } else { +- parser = raptor_new_parser("ntriples"); ++ parser = raptor_new_parser(world, "ntriples"); + } + if (!parser) { + fprintf(stderr, "liblrdf: failed to create parser\n"); +@@ -609,12 +607,11 @@ int lrdf_read_file_intl(const char *uri) + return 1; + } + +- raptor_set_error_handler(parser, parser, lrdf_error_handler); +- raptor_set_warning_handler(parser, NULL, lrdf_warning_handler); +- raptor_set_statement_handler(parser, &source, lrdf_store); +- raptor_set_default_generate_id_parameters(parser, NULL, ++lrdf_uid); ++ raptor_world_set_log_handler(world, parser, lrdf_log_handler); ++ raptor_parser_set_statement_handler(parser, &source, lrdf_store); ++ raptor_world_set_generate_bnodeid_parameters(world, NULL, ++lrdf_uid); + +- if (raptor_parse_file(parser, furi, ruri)) { ++ if (raptor_parser_parse_file(parser, furi, ruri)) { + raptor_free_uri(furi); + raptor_free_uri(ruri); + raptor_free_parser(parser); +--- configure.ac ++++ configure.ac +@@ -18,7 +18,7 @@ + AC_HEADER_STDC + AC_CHECK_HEADERS([errno.h limits.h stdlib.h string.h unistd.h]) + +-PKG_CHECK_MODULES(RAPTOR, raptor >= 0.9.11) ++PKG_CHECK_MODULES(RAPTOR, raptor2 >= 0.9.11) + + # Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liblrdf/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +-Np1|md5.patch +-Np0|raptor2.diff +-Np1|pkgconfig-raptor.patch diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/pkgconfig-raptor.patch --- a/liblrdf/stuff/pkgconfig-raptor.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ ---- liblrdf-0.4.0/lrdf.pc.in.orig 2011-10-03 19:28:16.702773254 +0000 -+++ liblrdf-0.4.0/lrdf.pc.in 2011-10-03 19:28:43.003017477 +0000 -@@ -7,4 +7,5 @@ - Version: @VERSION@ - Description: liblrdf, a lightweight RDF library with extensions for LADSPA - Libs: -L${libdir} -llrdf --Cflags: -I${includedir} -+Libs.private: @RAPTOR_LIBS@ -+Cflags: @RAPTOR_CFLAGS@ -I${includedir} diff -r c7b121a4ffd9 -r d6378d455338 liblrdf/stuff/raptor2.diff --- a/liblrdf/stuff/raptor2.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ ---- src/Makefile.am -+++ src/Makefile.am -@@ -4,5 +4,5 @@ lib_LTLIBRARIES = liblrdf.la - noinst_HEADERS = lrdf_md5.h md5_loc.h ladspa.h - - liblrdf_la_SOURCES = lrdf.c lrdf_multi.c md5.c --liblrdf_la_LIBADD = -lraptor -+liblrdf_la_LIBADD = -lraptor2 - liblrdf_la_LDFLAGS = -version-info @LRDF_LIBTOOL_VERSION@ ---- src/lrdf.c -+++ src/lrdf.c -@@ -18,6 +18,7 @@ - static unsigned int lrdf_uid = 0; /* A unique(ish) id to append to genid's to - * avoid clashses */ - -+static raptor_world *world = NULL; - static lrdf_statement *triples = NULL; - static lrdf_statement *free_triples; - static lrdf_string_hash *resources_hash[LRDF_HASH_SIZE]; -@@ -43,8 +44,7 @@ static void lrdf_remove_triple_hash(lrdf_triple_hash ** tbl, - lrdf_hash hash, lrdf_statement * s); - static void lrdf_add_closure_hash(lrdf_closure_hash ** tbl, - lrdf_hash subject, lrdf_hash object); --static void lrdf_store(void *user_data, -- const raptor_statement * statement); -+static void lrdf_store(void *user_data, raptor_statement * statement); - void lrdf_free_statements(lrdf_statement * s); - void lrdf_copy_statement(lrdf_statement * from, lrdf_statement * to); - void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl, -@@ -71,7 +71,7 @@ void lrdf_init() - unsigned int i; - struct timeval tv; - -- raptor_init(); -+ world = raptor_new_world(); - lrdf_more_triples(256); - - /* A UID to add to genids to make them safer */ -@@ -112,7 +112,8 @@ void lrdf_more_triples(int count) - - void lrdf_cleanup() - { -- raptor_finish(); -+ raptor_free_world(world); -+ world = NULL; - - lrdf_free_string_hash(resources_hash); - lrdf_free_string_hash(literals_hash); -@@ -232,26 +233,29 @@ void lrdf_remove_matches(lrdf_statement *pattern) - } - } - --static void lrdf_store(void *user_data, const raptor_statement * statement) -+static const char *lrdf_term_as_string(char *tmp, int tmp_len, -+ const raptor_term *term) -+{ -+ switch (term->type) { -+ case RAPTOR_TERM_TYPE_URI: -+ return (const char *) raptor_uri_as_string(term->value.uri); -+ case RAPTOR_TERM_TYPE_LITERAL: -+ return (const char *) term->value.literal.string; -+ case RAPTOR_TERM_TYPE_BLANK: -+ snprintf(tmp, tmp_len, "_:%s.%x", term->value.blank.string, lrdf_uid); -+ return tmp; -+ default: -+ return "(?)"; -+ } -+} -+ -+static void lrdf_store(void *user_data, raptor_statement * statement) - { - lrdf_statement *s = lrdf_alloc_statement(); - char tmps[128], tmpp[128], tmpo[128]; -- char *subj = (char *) statement->subject, -- *pred = (char *) statement->predicate, -- *obj = (char *) statement->object; -- -- if (statement->subject_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { -- snprintf(tmps, 127, "_:%s.%x", subj, lrdf_uid); -- subj = tmps; -- } -- if (statement->predicate_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { -- snprintf(tmpp, 127, "_:%s.%x", pred, lrdf_uid); -- pred = tmpp; -- } -- if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) { -- snprintf(tmpo, 127, "_:%s.%x", obj, lrdf_uid); -- obj = tmpo; -- } -+ const char *subj = lrdf_term_as_string(tmps, 128, statement->subject), -+ *pred = lrdf_term_as_string(tmpp, 128, statement->predicate), -+ *obj = lrdf_term_as_string(tmpo, 128, statement->object); - - s->shash = lrdf_gen_hash(subj); - s->phash = lrdf_gen_hash(pred); -@@ -261,7 +265,7 @@ static void lrdf_store(void *user_data, const raptor_statement * statement) - - s->subject = lrdf_check_hash(resources_hash, s->shash, subj); - s->predicate = lrdf_check_hash(resources_hash, s->phash, pred); -- if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_LITERAL) { -+ if (statement->object->type == RAPTOR_TERM_TYPE_LITERAL) { - s->object = lrdf_check_hash(literals_hash, s->ohash, obj); - s->object_type = lrdf_literal; - } else { -@@ -537,28 +541,22 @@ void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl, - free(pathto); - } - --static void lrdf_error_handler(void *data, raptor_locator * locator, -- const char *message); -+static void lrdf_log_handler(void *data, raptor_log_message *message); - --static void lrdf_error_handler(void *data, raptor_locator * locator, -- const char *message) -+static void lrdf_log_handler(void *data, raptor_log_message *message) - { -- fprintf(stderr, "liblrdf: error - "); -- raptor_print_locator(stderr, locator); -- fprintf(stderr, " - %s\n", message); -- -- raptor_parse_abort((raptor_parser*)data); --} -+ const char *severity = "error"; -+ if (message->level == RAPTOR_LOG_LEVEL_WARN) { -+ severity = "warning"; -+ } - --static void lrdf_warning_handler(void *data, raptor_locator * locator, -- const char *message); -+ fprintf(stderr, "liblrdf: %s - ", severity); -+ raptor_locator_print(message->locator, stderr); -+ fprintf(stderr, " - %s\n", message->text); - --static void lrdf_warning_handler(void *data, raptor_locator * locator, -- const char *message) --{ -- fprintf(stderr, "liblrdf: warning - "); -- raptor_print_locator(stderr, locator); -- fprintf(stderr, " - %s\n", message); -+ if (message->level != RAPTOR_LOG_LEVEL_WARN) { -+ raptor_parser_parse_abort((raptor_parser*)data); -+ } - } - - -@@ -593,15 +591,15 @@ int lrdf_read_file_intl(const char *uri) - lrdf_hash source; - - //printf("lrdf: reading %s\n", uri); -- ruri = raptor_new_uri(uri); -- furi = raptor_new_uri(uri); -+ ruri = raptor_new_uri(world, (const unsigned char *) uri); -+ furi = raptor_new_uri(world, (const unsigned char *) uri); - source = lrdf_gen_hash(uri); - lrdf_check_hash(resources_hash, source, uri); - - if (strstr(uri, ".rdf")) { -- parser = raptor_new_parser("rdfxml"); -+ parser = raptor_new_parser(world, "rdfxml"); - } else { -- parser = raptor_new_parser("ntriples"); -+ parser = raptor_new_parser(world, "ntriples"); - } - if (!parser) { - fprintf(stderr, "liblrdf: failed to create parser\n"); -@@ -609,12 +607,11 @@ int lrdf_read_file_intl(const char *uri) - return 1; - } - -- raptor_set_error_handler(parser, parser, lrdf_error_handler); -- raptor_set_warning_handler(parser, NULL, lrdf_warning_handler); -- raptor_set_statement_handler(parser, &source, lrdf_store); -- raptor_set_default_generate_id_parameters(parser, NULL, ++lrdf_uid); -+ raptor_world_set_log_handler(world, parser, lrdf_log_handler); -+ raptor_parser_set_statement_handler(parser, &source, lrdf_store); -+ raptor_world_set_generate_bnodeid_parameters(world, NULL, ++lrdf_uid); - -- if (raptor_parse_file(parser, furi, ruri)) { -+ if (raptor_parser_parse_file(parser, furi, ruri)) { - raptor_free_uri(furi); - raptor_free_uri(ruri); - raptor_free_parser(parser); ---- configure.ac -+++ configure.ac -@@ -18,7 +18,7 @@ - AC_HEADER_STDC - AC_CHECK_HEADERS([errno.h limits.h stdlib.h string.h unistd.h]) - --PKG_CHECK_MODULES(RAPTOR, raptor >= 0.9.11) -+PKG_CHECK_MODULES(RAPTOR, raptor2 >= 0.9.11) - - # Checks for typedefs, structures, and compiler characteristics. - AC_C_CONST diff -r c7b121a4ffd9 -r d6378d455338 libquicktime/receipt --- a/libquicktime/receipt Wed May 09 17:03:28 2018 +0300 +++ b/libquicktime/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,8 +16,6 @@ SPLIT="libquicktime-dev" compile_rules() { - patch -p0 < $stuff/ffmpeg.u - ./configure \ --enable-gpl \ --with-ffmpeg \ diff -r c7b121a4ffd9 -r d6378d455338 libquicktime/stuff/ffmpeg.u --- a/libquicktime/stuff/ffmpeg.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ ---- plugins/ffmpeg/audio.c -+++ plugins/ffmpeg/audio.c -@@ -45,6 +45,11 @@ - #define ENCODE_AUDIO 1 - #endif - -+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE -+/* from libavcodec/avcodec.h dated Dec 23 2012 */ -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio -+#endif -+ - /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */ - - /* MPEG Audio header parsing code */ ---- plugins/ffmpeg/params.c -+++ plugins/ffmpeg/params.c -@@ -101,6 +101,17 @@ - } \ - } - -+#define PARAM_DICT_INT(name, dict_name) \ -+ { \ -+ if(!strcasecmp(name, key)) \ -+ { \ -+ char buf[128]; \ -+ snprintf(buf, sizeof(buf), "%d", *(int*)value); \ -+ av_dict_set(options, dict_name, buf, 0); \ -+ found = 1; \ -+ } \ -+ } -+ - #define PARAM_DICT_FLAG(name, dict_name) \ - { \ - if(!strcasecmp(name, key)) \ -@@ -202,8 +213,15 @@ - PARAM_INT("ff_max_b_frames",max_b_frames); - PARAM_FLOAT("ff_b_quant_factor",b_quant_factor); - PARAM_INT("ff_b_frame_strategy",b_frame_strategy); -+ -+#if LIBAVCODEC_VERSION_MAJOR >= 55 -+ PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold"); -+ PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold"); -+#else - PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold); - PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold); -+#endif -+ - PARAM_INT("ff_strict_std_compliance",strict_std_compliance); - PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset); - PARAM_INT("ff_rc_min_rate",rc_min_rate); -@@ -241,8 +259,15 @@ - PARAM_QP2LAMBDA("ff_lmax", lmax); - PARAM_INT("ff_noise_reduction",noise_reduction); - PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000); -+ -+#if LIBAVCODEC_VERSION_MAJOR >= 55 -+ PARAM_DICT_INT("ff_inter_threshold","inter_threshold"); -+ PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping"); -+#else - PARAM_INT("ff_inter_threshold",inter_threshold); - PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping); -+#endif -+ - PARAM_INT("ff_thread_count",thread_count); - PARAM_INT("ff_me_threshold",me_threshold); - PARAM_INT("ff_mb_threshold",mb_threshold); -@@ -272,8 +297,16 @@ - PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT); - PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED); - // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused -+ -+#if LIBAVCODEC_VERSION_MAJOR >= 55 -+ PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd"); -+ PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd"); -+ PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop"); -+#else - PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD); - PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD); -+ PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); -+#endif - - #if LIBAVCODEC_VERSION_MAJOR >= 54 - PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv"); -@@ -288,7 +321,6 @@ - PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER); - PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP); - PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST); -- PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); - PARAM_ENUM("ff_coder_type",coder_type,coder_type); - - } diff -r c7b121a4ffd9 -r d6378d455338 libquicktime/stuff/gtk22.patch --- a/libquicktime/stuff/gtk22.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -diff -Nur libquicktime-1.1.5.orig/utils/gtk/libquicktime_config.c libquicktime-1.1.5/utils/gtk/libquicktime_config.c ---- libquicktime-1.1.5.orig/utils/gtk/libquicktime_config.c 2008-12-30 08:05:36.000000000 -0800 -+++ libquicktime-1.1.5/utils/gtk/libquicktime_config.c 2010-10-15 05:46:21.956697112 -0700 -@@ -112,9 +112,9 @@ - G_CALLBACK(main_window_button_callback), - (gpointer)ret); - -- GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT); -- GTK_WIDGET_SET_FLAGS (ret->save_button, GTK_CAN_DEFAULT); -- -+ gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE); -+ gtk_widget_set_can_default(GTK_WIDGET(ret->save_button), TRUE); -+ - gtk_widget_show(ret->close_button); - gtk_widget_show(ret->save_button); - -diff -Nur libquicktime-1.1.5.orig/utils/gtk/lqt_gtk.c libquicktime-1.1.5/utils/gtk/lqt_gtk.c ---- libquicktime-1.1.5.orig/utils/gtk/lqt_gtk.c 2009-03-11 07:25:50.000000000 -0700 -+++ libquicktime-1.1.5/utils/gtk/lqt_gtk.c 2010-10-15 05:47:14.720013265 -0700 -@@ -941,9 +941,9 @@ - G_CALLBACK(codec_config_window_button_callback), - (gpointer)ret); - -- GTK_WIDGET_SET_FLAGS (ret->apply_button, GTK_CAN_DEFAULT); -- GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT); -- GTK_WIDGET_SET_FLAGS (ret->restore_button, GTK_CAN_DEFAULT); -+ gtk_widget_set_can_default(GTK_WIDGET(ret->apply_button), TRUE); -+ gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE); -+ gtk_widget_set_can_default(GTK_WIDGET(ret->restore_button), TRUE); - - gtk_widget_show(ret->apply_button); - gtk_widget_show(ret->close_button); -@@ -1240,7 +1240,7 @@ - ret->mainbox = gtk_vbox_new(0, 10); - - ret->close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); -- GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT); -+ gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE); - - g_signal_connect(G_OBJECT(ret->close_button), "clicked", - G_CALLBACK(codec_info_window_button_callback), diff -r c7b121a4ffd9 -r d6378d455338 libquicktime/stuff/patches/ffmpeg.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libquicktime/stuff/patches/ffmpeg.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,91 @@ +--- plugins/ffmpeg/audio.c ++++ plugins/ffmpeg/audio.c +@@ -45,6 +45,11 @@ + #define ENCODE_AUDIO 1 + #endif + ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++/* from libavcodec/avcodec.h dated Dec 23 2012 */ ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio ++#endif ++ + /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */ + + /* MPEG Audio header parsing code */ +--- plugins/ffmpeg/params.c ++++ plugins/ffmpeg/params.c +@@ -101,6 +101,17 @@ + } \ + } + ++#define PARAM_DICT_INT(name, dict_name) \ ++ { \ ++ if(!strcasecmp(name, key)) \ ++ { \ ++ char buf[128]; \ ++ snprintf(buf, sizeof(buf), "%d", *(int*)value); \ ++ av_dict_set(options, dict_name, buf, 0); \ ++ found = 1; \ ++ } \ ++ } ++ + #define PARAM_DICT_FLAG(name, dict_name) \ + { \ + if(!strcasecmp(name, key)) \ +@@ -202,8 +213,15 @@ + PARAM_INT("ff_max_b_frames",max_b_frames); + PARAM_FLOAT("ff_b_quant_factor",b_quant_factor); + PARAM_INT("ff_b_frame_strategy",b_frame_strategy); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold"); ++ PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold"); ++#else + PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold); + PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold); ++#endif ++ + PARAM_INT("ff_strict_std_compliance",strict_std_compliance); + PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset); + PARAM_INT("ff_rc_min_rate",rc_min_rate); +@@ -241,8 +259,15 @@ + PARAM_QP2LAMBDA("ff_lmax", lmax); + PARAM_INT("ff_noise_reduction",noise_reduction); + PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_inter_threshold","inter_threshold"); ++ PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping"); ++#else + PARAM_INT("ff_inter_threshold",inter_threshold); + PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping); ++#endif ++ + PARAM_INT("ff_thread_count",thread_count); + PARAM_INT("ff_me_threshold",me_threshold); + PARAM_INT("ff_mb_threshold",mb_threshold); +@@ -272,8 +297,16 @@ + PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT); + PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED); + // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd"); ++ PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd"); ++ PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop"); ++#else + PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD); + PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD); ++ PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); ++#endif + + #if LIBAVCODEC_VERSION_MAJOR >= 54 + PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv"); +@@ -288,7 +321,6 @@ + PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER); + PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP); + PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST); +- PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); + PARAM_ENUM("ff_coder_type",coder_type,coder_type); + + } diff -r c7b121a4ffd9 -r d6378d455338 libquicktime/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libquicktime/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|ffmpeg.u diff -r c7b121a4ffd9 -r d6378d455338 libwrap/receipt --- a/libwrap/receipt Wed May 09 17:03:28 2018 +0300 +++ b/libwrap/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,10 +16,6 @@ # Rules to configure and make the package. compile_rules() { - # Patch from Linux From Scratch - [ -f done.tcp_wrappers-7.6-shared_lib_plus_plus-1.patch ] || - patch -p1 -i $stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch - touch done.tcp_wrappers-7.6-shared_lib_plus_plus-1.patch sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux diff -r c7b121a4ffd9 -r d6378d455338 libwrap/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libwrap/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# Patch from Linux From Scratch +-p1|tcp_wrappers-7.6-shared_lib_plus_plus-1.patch diff -r c7b121a4ffd9 -r d6378d455338 libwrap/stuff/patches/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libwrap/stuff/patches/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1035 @@ +Submitted By: Tushar Teredesai +Date: 2003-10-04 +Initial Package Version: 7.6 +Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html +Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink. +This patch provides the following improvements: + * Install libwrap.so along with libwrap.a. + * Create an install target for tcp_wrappers. + * Compilation and security fixes. + * Documentation fixes. +diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile +--- tcp_wrappers_7.6/Makefile 1997-03-21 12:27:21.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/Makefile 2002-07-15 16:07:21.000000000 -0500 +@@ -1,5 +1,10 @@ ++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h) ++ + # @(#) Makefile 1.23 97/03/21 19:27:20 + ++# unset the HOSTNAME environment variable ++HOSTNAME = ++ + what: + @echo + @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:" +@@ -19,7 +24,7 @@ + @echo " generic (most bsd-ish systems with sys5 compatibility)" + @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543" + @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix" +- @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" ++ @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" + @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4" + @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" + @echo " uts215 uxp" +@@ -43,8 +48,8 @@ + # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx + #REAL_DAEMON_DIR=/usr/etc + # +-# SysV.4 Solaris 2.x OSF AIX +-#REAL_DAEMON_DIR=/usr/sbin ++# SysV.4 Solaris 2.x OSF AIX Linux ++REAL_DAEMON_DIR=/usr/sbin + # + # BSD 4.4 + #REAL_DAEMON_DIR=/usr/libexec +@@ -141,10 +146,21 @@ + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ + EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all + ++ifneq ($(GLIBC),0) ++MYLIB=-lnsl ++endif ++ + linux: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ +- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all ++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ ++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT" ++ ++gnu: ++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ ++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ ++ EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" + + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. + hpux hpux8 hpux9 hpux10: +@@ -391,7 +407,7 @@ + # the ones provided with this source distribution. The environ.c module + # implements setenv(), getenv(), and putenv(). + +-AUX_OBJ= setenv.o ++#AUX_OBJ= setenv.o + #AUX_OBJ= environ.o + #AUX_OBJ= environ.o strcasecmp.o + +@@ -454,7 +470,8 @@ + # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work + # around this. The workaround does no harm on other Solaris versions. + +-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK ++BUGS = ++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG + +@@ -464,7 +481,7 @@ + # If your system supports NIS or YP-style netgroups, enable the following + # macro definition. Netgroups are used only for host access control. + # +-#NETGROUP= -DNETGROUP ++NETGROUP= -DNETGROUP + + ############################################################### + # System dependencies: whether or not your system has vsyslog() +@@ -491,7 +508,7 @@ + # Uncomment the next definition to turn on the language extensions + # (examples: allow, deny, banners, twist and spawn). + # +-#STYLE = -DPROCESS_OPTIONS # Enable language extensions. ++STYLE = -DPROCESS_OPTIONS # Enable language extensions. + + ################################################################ + # Optional: Changing the default disposition of logfile records +@@ -514,7 +531,7 @@ + # + # The LOG_XXX names below are taken from the /usr/include/syslog.h file. + +-FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use ++FACILITY= LOG_DAEMON # LOG_MAIL is what most sendmail daemons use + + # The syslog priority at which successful connections are logged. + +@@ -610,7 +627,7 @@ + # Paranoid mode implies hostname lookup. In order to disable hostname + # lookups altogether, see the next section. + +-PARANOID= -DPARANOID ++#PARANOID= -DPARANOID + + ######################################## + # Optional: turning off hostname lookups +@@ -623,7 +640,7 @@ + # In order to perform selective hostname lookups, disable paranoid + # mode (see previous section) and comment out the following definition. + +-HOSTNAME= -DALWAYS_HOSTNAME ++#HOSTNAME= -DALWAYS_HOSTNAME + + ############################################# + # Optional: Turning on host ADDRESS checking +@@ -649,28 +666,46 @@ + # source-routed traffic in the kernel. Examples: 4.4BSD derivatives, + # Solaris 2.x, and Linux. See your system documentation for details. + # +-# KILL_OPT= -DKILL_IP_OPTIONS ++KILL_OPT= -DKILL_IP_OPTIONS + + ## End configuration options + ############################ + + # Protection against weird shells or weird make programs. + ++CC = gcc + SHELL = /bin/sh +-.c.o:; $(CC) $(CFLAGS) -c $*.c ++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c ++ ++SOMAJOR = 0 ++SOMINOR = 7.6 ++ ++LIB = libwrap.a ++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR) ++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR) ++SHLIBSO = shared/libwrap.so ++SHLIBFLAGS = -Lshared -lwrap + +-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ ++shared/%.o: %.c ++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ ++ ++CFLAGS = -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ + $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ + $(VSYSLOG) $(HOSTNAME) + ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS) ++SHCFLAGS = -fPIC -shared -D_REENTRANT ++ + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ + $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ + update.o misc.o diag.o percent_m.o myvsyslog.o + ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); ++ + FROM_OBJ= fromhost.o + + KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ +@@ -684,46 +719,80 @@ + refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ + scaffold.h tcpdmatch.8 README.NIS + +-LIB = libwrap.a +- +-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk ++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) + + # Invalidate all object files when the compiler options (CFLAGS) have changed. + + config-check: + @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; } +- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \ +- if cmp cflags /tmp/cflags.$$$$ ; \ +- then rm /tmp/cflags.$$$$ ; \ +- else mv /tmp/cflags.$$$$ cflags ; \ ++ @set +e; echo $(CFLAGS) >cflags.new ; \ ++ if cmp cflags cflags.new ; \ ++ then rm cflags.new ; \ ++ else mv cflags.new cflags ; \ + fi >/dev/null 2>/dev/null ++ @if [ ! -d shared ]; then mkdir shared; fi + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) + $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) + -$(RANLIB) $(LIB) + +-tcpd: tcpd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) ++$(SHLIB): $(SHLIB_OBJ) ++ rm -f $(SHLIB) ++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) ++ ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ) ++ ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) ++ ++tcpd: tcpd.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) + +-miscd: miscd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) ++miscd: miscd.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS) + +-safe_finger: safe_finger.o $(LIB) +- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) ++safe_finger: safe_finger.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) + + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o + +-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) ++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) + +-try-from: try-from.o fakelog.o $(LIB) +- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) ++try-from: try-from.o fakelog.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) + + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o + +-tcpdchk: $(TCPDCHK_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) ++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) ++ ++install: install-lib install-bin install-dev ++ ++install-lib: ++ install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/ ++ ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ)) ++ ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO)) ++ ++install-bin: ++ install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/ ++ install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/ ++ install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/ ++ install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/ ++ ++install-dev: ++ install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/ ++ install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/ ++ install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/ ++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3 ++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3 ++ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3 + + shar: $(KIT) + @shar $(KIT) +@@ -739,7 +808,8 @@ + + clean: + rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \ +- cflags ++ cflags libwrap*.so* ++ rm -rf shared + + tidy: clean + chmod -R a+r . +@@ -885,5 +955,6 @@ + update.o: mystdarg.h + update.o: tcpd.h + vfprintf.o: cflags ++weak_symbols.o: tcpd.h + workarounds.o: cflags + workarounds.o: tcpd.h +diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c +--- tcp_wrappers_7.6/fix_options.c 1997-04-07 19:29:19.000000000 -0500 ++++ tcp_wrappers_7.6.gimli/fix_options.c 2002-01-07 08:50:19.000000000 -0600 +@@ -35,7 +35,12 @@ + #ifdef IP_OPTIONS + unsigned char optbuf[BUFFER_SIZE / 3], *cp; + char lbuf[BUFFER_SIZE], *lp; ++#if !defined(__GLIBC__) + int optsize = sizeof(optbuf), ipproto; ++#else /* __GLIBC__ */ ++ size_t optsize = sizeof(optbuf); ++ int ipproto; ++#endif /* __GLIBC__ */ + struct protoent *ip; + int fd = request->fd; + unsigned int opt; +diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3 +--- tcp_wrappers_7.6/hosts_access.3 1996-02-11 10:01:27.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/hosts_access.3 2002-01-07 08:50:19.000000000 -0600 +@@ -3,7 +3,7 @@ + hosts_access, hosts_ctl, request_init, request_set \- access control library + .SH SYNOPSIS + .nf +-#include "tcpd.h" ++#include + + extern int allow_severity; + extern int deny_severity; +diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5 +--- tcp_wrappers_7.6/hosts_access.5 1995-01-30 12:51:47.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/hosts_access.5 2002-01-07 08:50:19.000000000 -0600 +@@ -8,9 +8,9 @@ + impatient reader is encouraged to skip to the EXAMPLES section for a + quick introduction. + .PP +-An extended version of the access control language is described in the +-\fIhosts_options\fR(5) document. The extensions are turned on at +-program build time by building with -DPROCESS_OPTIONS. ++The extended version of the access control language is described in the ++\fIhosts_options\fR(5) document. \fBNote that this language supersedes ++the meaning of \fIshell_command\fB as documented below.\fR + .PP + In the following text, \fIdaemon\fR is the the process name of a + network daemon process, and \fIclient\fR is the name and/or address of +@@ -40,7 +40,7 @@ + character. This permits you to break up long lines so that they are + easier to edit. + .IP \(bu +-Blank lines or lines that begin with a `#\' character are ignored. ++Blank lines or lines that begin with a `#' character are ignored. + This permits you to insert comments and whitespace so that the tables + are easier to read. + .IP \(bu +@@ -69,26 +69,33 @@ + .SH PATTERNS + The access control language implements the following patterns: + .IP \(bu +-A string that begins with a `.\' character. A host name is matched if ++A string that begins with a `.' character. A host name is matched if + the last components of its name match the specified pattern. For +-example, the pattern `.tue.nl\' matches the host name +-`wzv.win.tue.nl\'. ++example, the pattern `.tue.nl' matches the host name ++`wzv.win.tue.nl'. + .IP \(bu +-A string that ends with a `.\' character. A host address is matched if ++A string that ends with a `.' character. A host address is matched if + its first numeric fields match the given string. For example, the +-pattern `131.155.\' matches the address of (almost) every host on the ++pattern `131.155.' matches the address of (almost) every host on the + Eind\%hoven University network (131.155.x.x). + .IP \(bu +-A string that begins with an `@\' character is treated as an NIS ++A string that begins with an `@' character is treated as an NIS + (formerly YP) netgroup name. A host name is matched if it is a host + member of the specified netgroup. Netgroup matches are not supported + for daemon process names or for client user names. + .IP \(bu +-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a +-`net/mask\' pair. A host address is matched if `net\' is equal to the +-bitwise AND of the address and the `mask\'. For example, the net/mask +-pattern `131.155.72.0/255.255.254.0\' matches every address in the +-range `131.155.72.0\' through `131.155.73.255\'. ++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a ++`net/mask' pair. A host address is matched if `net' is equal to the ++bitwise AND of the address and the `mask'. For example, the net/mask ++pattern `131.155.72.0/255.255.254.0' matches every address in the ++range `131.155.72.0' through `131.155.73.255'. ++.IP \(bu ++A string that begins with a `/' character is treated as a file ++name. A host name or address is matched if it matches any host name ++or address pattern listed in the named file. The file format is ++zero or more lines with zero or more host name or address patterns ++separated by whitespace. A file name pattern can be used anywhere ++a host name or address pattern can be used. + .SH WILDCARDS + The access control language supports explicit wildcards: + .IP ALL +@@ -115,19 +122,19 @@ + .ne 6 + .SH OPERATORS + .IP EXCEPT +-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct ++Intended use is of the form: `list_1 EXCEPT list_2'; this construct + matches anything that matches \fIlist_1\fR unless it matches + \fIlist_2\fR. The EXCEPT operator can be used in daemon_lists and in + client_lists. The EXCEPT operator can be nested: if the control +-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\' +-would parse as `(a EXCEPT (b EXCEPT c))\'. ++language would permit the use of parentheses, `a EXCEPT b EXCEPT c' ++would parse as `(a EXCEPT (b EXCEPT c))'. + .br + .ne 6 + .SH SHELL COMMANDS + If the first-matched access control rule contains a shell command, that + command is subjected to % substitutions (see next section). + The result is executed by a \fI/bin/sh\fR child process with standard +-input, output and error connected to \fI/dev/null\fR. Specify an `&\' ++input, output and error connected to \fI/dev/null\fR. Specify an `&' + at the end of the command if you do not want to wait until it has + completed. + .PP +@@ -159,7 +166,7 @@ + .IP %u + The client user name (or "unknown"). + .IP %% +-Expands to a single `%\' character. ++Expands to a single `%' character. + .PP + Characters in % expansions that may confuse the shell are replaced by + underscores. +@@ -243,9 +250,9 @@ + less trustworthy. It is possible for an intruder to spoof both the + client connection and the IDENT lookup, although doing so is much + harder than spoofing just a client connection. It may also be that +-the client\'s IDENT server is lying. ++the client's IDENT server is lying. + .PP +-Note: IDENT lookups don\'t work with UDP services. ++Note: IDENT lookups don't work with UDP services. + .SH EXAMPLES + The language is flexible enough that different types of access control + policy can be expressed with a minimum of fuss. Although the language +@@ -285,7 +292,7 @@ + .br + ALL: .foobar.edu EXCEPT terminalserver.foobar.edu + .PP +-The first rule permits access from hosts in the local domain (no `.\' ++The first rule permits access from hosts in the local domain (no `.' + in the host name) and from members of the \fIsome_netgroup\fP + netgroup. The second rule permits access from all hosts in the + \fIfoobar.edu\fP domain (notice the leading dot), with the exception of +@@ -322,8 +329,8 @@ + /etc/hosts.deny: + .in +3 + .nf +-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\ +- /usr/ucb/mail -s %d-%h root) & ++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\ ++ /usr/bin/mail -s %d-%h root) & + .fi + .PP + The safe_finger command comes with the tcpd wrapper and should be +@@ -349,7 +356,7 @@ + capacity of an internal buffer; when an access control rule is not + terminated by a newline character; when the result of % + expansion would overflow an internal buffer; when a system call fails +-that shouldn\'t. All problems are reported via the syslog daemon. ++that shouldn't. All problems are reported via the syslog daemon. + .SH FILES + .na + .nf +diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c +--- tcp_wrappers_7.6/hosts_access.c 1997-02-11 19:13:23.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/hosts_access.c 2002-01-07 08:50:19.000000000 -0600 +@@ -240,6 +240,26 @@ + } + } + ++/* hostfile_match - look up host patterns from file */ ++ ++static int hostfile_match(path, host) ++char *path; ++struct hosts_info *host; ++{ ++ char tok[BUFSIZ]; ++ int match = NO; ++ FILE *fp; ++ ++ if ((fp = fopen(path, "r")) != 0) { ++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host))) ++ /* void */ ; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", path); ++ } ++ return (match); ++} ++ + /* host_match - match host name and/or address against pattern */ + + static int host_match(tok, host) +@@ -267,6 +287,8 @@ + tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */ + return (NO); + #endif ++ } else if (tok[0] == '/') { /* /file hack */ ++ return (hostfile_match(tok, host)); + } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */ + char *name = eval_hostname(host); + return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name)); +diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5 +--- tcp_wrappers_7.6/hosts_options.5 1994-12-28 10:42:29.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/hosts_options.5 2002-01-07 08:50:19.000000000 -0600 +@@ -58,12 +58,12 @@ + Execute, in a child process, the specified shell command, after + performing the % expansions described in the hosts_access(5) + manual page. The command is executed with stdin, stdout and stderr +-connected to the null device, so that it won\'t mess up the ++connected to the null device, so that it won't mess up the + conversation with the client host. Example: + .sp + .nf + .ti +3 +-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) & ++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) & + .fi + .sp + executes, in a background child process, the shell command "safe_finger +diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c +--- tcp_wrappers_7.6/options.c 1996-02-11 10:01:32.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/options.c 2002-01-07 08:50:19.000000000 -0600 +@@ -473,6 +473,9 @@ + #ifdef LOG_CRON + "cron", LOG_CRON, + #endif ++#ifdef LOG_FTP ++ "ftp", LOG_FTP, ++#endif + #ifdef LOG_LOCAL0 + "local0", LOG_LOCAL0, + #endif +diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c +--- tcp_wrappers_7.6/percent_m.c 1994-12-28 10:42:37.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/percent_m.c 2002-01-07 08:50:19.000000000 -0600 +@@ -13,7 +13,7 @@ + #include + + extern int errno; +-#ifndef SYS_ERRLIST_DEFINED ++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR) + extern char *sys_errlist[]; + extern int sys_nerr; + #endif +@@ -29,11 +29,15 @@ + + while (*bp = *cp) + if (*cp == '%' && cp[1] == 'm') { ++#ifdef HAVE_STRERROR ++ strcpy(bp, strerror(errno)); ++#else + if (errno < sys_nerr && errno > 0) { + strcpy(bp, sys_errlist[errno]); + } else { + sprintf(bp, "Unknown error %d", errno); + } ++#endif + bp += strlen(bp); + cp += 2; + } else { +diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c +--- tcp_wrappers_7.6/rfc931.c 1995-01-02 09:11:34.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/rfc931.c 2002-01-07 08:50:19.000000000 -0600 +@@ -33,7 +33,7 @@ + + int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ + +-static jmp_buf timebuf; ++static sigjmp_buf timebuf; + + /* fsocket - open stdio stream on top of socket */ + +@@ -62,7 +62,7 @@ + static void timeout(sig) + int sig; + { +- longjmp(timebuf, sig); ++ siglongjmp(timebuf, sig); + } + + /* rfc931 - return remote user name, given socket structures */ +@@ -99,7 +99,7 @@ + * Set up a timer so we won't get stuck while waiting for the server. + */ + +- if (setjmp(timebuf) == 0) { ++ if (sigsetjmp(timebuf,1) == 0) { + signal(SIGALRM, timeout); + alarm(rfc931_timeout); + +diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8 +--- tcp_wrappers_7.6/safe_finger.8 1969-12-31 18:00:00.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/safe_finger.8 2002-01-07 08:50:19.000000000 -0600 +@@ -0,0 +1,34 @@ ++.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual" ++.SH NAME ++safe_finger \- finger client wrapper that protects against nasty stuff ++from finger servers ++.SH SYNOPSIS ++.B safe_finger [finger_options] ++.SH DESCRIPTION ++The ++.B safe_finger ++command protects against nasty stuff from finger servers. Use this ++program for automatic reverse finger probes from the ++.B tcp_wrapper ++.B (tcpd) ++, not the raw finger command. The ++.B safe_finger ++command makes sure that the finger client is not run with root ++privileges. It also runs the finger client with a defined PATH ++environment. ++.B safe_finger ++will also protect you from problems caused by the output of some ++finger servers. The problem: some programs may react to stuff in ++the first column. Other programs may get upset by thrash anywhere ++on a line. File systems may fill up as the finger server keeps ++sending data. Text editors may bomb out on extremely long lines. ++The finger server may take forever because it is somehow wedged. ++.B safe_finger ++takes care of all this badness. ++.SH SEE ALSO ++.BR hosts_access (5), ++.BR hosts_options (5), ++.BR tcpd (8) ++.SH AUTHOR ++Wietse Venema, Eindhoven University of Technology, The Netherlands. ++ +diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c +--- tcp_wrappers_7.6/safe_finger.c 1994-12-28 10:42:42.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/safe_finger.c 2002-01-07 08:50:19.000000000 -0600 +@@ -26,21 +26,24 @@ + #include + #include + #include ++#include + + extern void exit(); + + /* Local stuff */ + +-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin"; ++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin"; + + #define TIME_LIMIT 60 /* Do not keep listinging forever */ + #define INPUT_LENGTH 100000 /* Do not keep listinging forever */ + #define LINE_LENGTH 128 /* Editors can choke on long lines */ + #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */ + #define UNPRIV_NAME "nobody" /* Preferred privilege level */ +-#define UNPRIV_UGID 32767 /* Default uid and gid */ ++#define UNPRIV_UGID 65534 /* Default uid and gid */ + + int finger_pid; ++int allow_severity = SEVERITY; ++int deny_severity = LOG_WARNING; + + void cleanup(sig) + int sig; +diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c +--- tcp_wrappers_7.6/scaffold.c 1997-03-21 12:27:24.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/scaffold.c 2002-01-07 08:50:19.000000000 -0600 +@@ -180,10 +180,12 @@ + + /* ARGSUSED */ + +-void rfc931(request) +-struct request_info *request; ++void rfc931(rmt_sin, our_sin, dest) ++struct sockaddr_in *rmt_sin; ++struct sockaddr_in *our_sin; ++char *dest; + { +- strcpy(request->user, unknown); ++ strcpy(dest, unknown); + } + + /* check_path - examine accessibility */ +diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c +--- tcp_wrappers_7.6/socket.c 1997-03-21 12:27:25.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/socket.c 2002-01-07 08:50:19.000000000 -0600 +@@ -76,7 +76,11 @@ + { + static struct sockaddr_in client; + static struct sockaddr_in server; ++#if !defined (__GLIBC__) + int len; ++#else /* __GLIBC__ */ ++ size_t len; ++#endif /* __GLIBC__ */ + char buf[BUFSIZ]; + int fd = request->fd; + +@@ -224,7 +228,11 @@ + { + char buf[BUFSIZ]; + struct sockaddr_in sin; ++#if !defined(__GLIBC__) + int size = sizeof(sin); ++#else /* __GLIBC__ */ ++ size_t size = sizeof(sin); ++#endif /* __GLIBC__ */ + + /* + * Eat up the not-yet received datagram. Some systems insist on a +diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8 +--- tcp_wrappers_7.6/tcpd.8 1996-02-21 09:39:16.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/tcpd.8 2002-01-07 08:50:19.000000000 -0600 +@@ -94,7 +94,7 @@ + .PP + The example assumes that the network daemons live in /usr/etc. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, or have +-no `in.\' prefix to their name. ++no `in.' prefix to their name. + .SH EXAMPLE 2 + This example applies when \fItcpd\fR expects that the network daemons + are left in their original place. +@@ -110,26 +110,26 @@ + becomes: + .sp + .ti +5 +-finger stream tcp nowait nobody /some/where/tcpd in.fingerd ++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd + .sp + .fi + .PP + The example assumes that the network daemons live in /usr/etc. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, the +-daemons have no `in.\' prefix to their name, or there is no userid ++daemons have no `in.' prefix to their name, or there is no userid + field in the inetd configuration file. + .PP + Similar changes will be needed for the other services that are to be +-covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8) ++covered by \fItcpd\fR. Send a `kill -HUP' to the \fIinetd\fR(8) + process to make the changes effective. AIX users may also have to +-execute the `inetimp\' command. ++execute the `inetimp' command. + .SH EXAMPLE 3 + In the case of daemons that do not live in a common directory ("secret" + or otherwise), edit the \fIinetd\fR configuration file so that it + specifies an absolute path name for the process name field. For example: + .nf + .sp +- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd ++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.ntalkd + .sp + .fi + .PP +diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h +--- tcp_wrappers_7.6/tcpd.h 1996-03-19 09:22:25.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/tcpd.h 2002-01-07 08:50:19.000000000 -0600 +@@ -4,6 +4,25 @@ + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ + ++#ifndef _TCPWRAPPERS_TCPD_H ++#define _TCPWRAPPERS_TCPD_H ++ ++/* someone else may have defined this */ ++#undef __P ++ ++/* use prototypes if we have an ANSI C compiler or are using C++ */ ++#if defined(__STDC__) || defined(__cplusplus) ++#define __P(args) args ++#else ++#define __P(args) () ++#endif ++ ++/* Need definitions of struct sockaddr_in and FILE. */ ++#include ++#include ++ ++__BEGIN_DECLS ++ + /* Structure to describe one communications endpoint. */ + + #define STRING_LENGTH 128 /* hosts, users, processes */ +@@ -25,10 +44,10 @@ + char pid[10]; /* access via eval_pid(request) */ + struct host_info client[1]; /* client endpoint info */ + struct host_info server[1]; /* server endpoint info */ +- void (*sink) (); /* datagram sink function or 0 */ +- void (*hostname) (); /* address to printable hostname */ +- void (*hostaddr) (); /* address to printable address */ +- void (*cleanup) (); /* cleanup function or 0 */ ++ void (*sink) __P((int)); /* datagram sink function or 0 */ ++ void (*hostname) __P((struct host_info *)); /* address to printable hostname */ ++ void (*hostaddr) __P((struct host_info *)); /* address to printable address */ ++ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */ + struct netconfig *config; /* netdir handle */ + }; + +@@ -61,25 +80,30 @@ + /* Global functions. */ + + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) +-extern void fromhost(); /* get/validate client host info */ ++extern void fromhost __P((struct request_info *)); /* get/validate client host info */ + #else + #define fromhost sock_host /* no TLI support needed */ + #endif + +-extern int hosts_access(); /* access control */ +-extern void shell_cmd(); /* execute shell command */ +-extern char *percent_x(); /* do % expansion */ +-extern void rfc931(); /* client name from RFC 931 daemon */ +-extern void clean_exit(); /* clean up and exit */ +-extern void refuse(); /* clean up and exit */ +-extern char *xgets(); /* fgets() on steroids */ +-extern char *split_at(); /* strchr() and split */ +-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ ++extern void shell_cmd __P((char *)); /* execute shell command */ ++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do % expansion */ ++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */ ++extern void clean_exit __P((struct request_info *)); /* clean up and exit */ ++extern void refuse __P((struct request_info *)); /* clean up and exit */ ++extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */ ++extern char *split_at __P((char *, int)); /* strchr() and split */ ++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */ + + /* Global variables. */ + ++#ifdef HAVE_WEAKSYMS ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */ ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */ ++#else + extern int allow_severity; /* for connection logging */ + extern int deny_severity; /* for connection logging */ ++#endif ++ + extern char *hosts_allow_table; /* for verification mode redirection */ + extern char *hosts_deny_table; /* for verification mode redirection */ + extern int hosts_access_verbose; /* for verbose matching mode */ +@@ -92,9 +116,14 @@ + */ + + #ifdef __STDC__ ++extern int hosts_access(struct request_info *request); ++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, ++ char *client_user); + extern struct request_info *request_init(struct request_info *,...); + extern struct request_info *request_set(struct request_info *,...); + #else ++extern int hosts_access(); ++extern int hosts_ctl(); + extern struct request_info *request_init(); /* initialize request */ + extern struct request_info *request_set(); /* update request structure */ + #endif +@@ -117,27 +146,31 @@ + * host_info structures serve as caches for the lookup results. + */ + +-extern char *eval_user(); /* client user */ +-extern char *eval_hostname(); /* printable hostname */ +-extern char *eval_hostaddr(); /* printable host address */ +-extern char *eval_hostinfo(); /* host name or address */ +-extern char *eval_client(); /* whatever is available */ +-extern char *eval_server(); /* whatever is available */ ++extern char *eval_user __P((struct request_info *)); /* client user */ ++extern char *eval_hostname __P((struct host_info *)); /* printable hostname */ ++extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */ ++extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */ ++extern char *eval_client __P((struct request_info *)); /* whatever is available */ ++extern char *eval_server __P((struct request_info *)); /* whatever is available */ + #define eval_daemon(r) ((r)->daemon) /* daemon process name */ + #define eval_pid(r) ((r)->pid) /* process id */ + + /* Socket-specific methods, including DNS hostname lookups. */ + +-extern void sock_host(); /* look up endpoint addresses */ +-extern void sock_hostname(); /* translate address to hostname */ +-extern void sock_hostaddr(); /* address to printable address */ ++/* look up endpoint addresses */ ++extern void sock_host __P((struct request_info *)); ++/* translate address to hostname */ ++extern void sock_hostname __P((struct host_info *)); ++/* address to printable address */ ++extern void sock_hostaddr __P((struct host_info *)); ++ + #define sock_methods(r) \ + { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } + + /* The System V Transport-Level Interface (TLI) interface. */ + + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) +-extern void tli_host(); /* look up endpoint addresses etc. */ ++extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */ + #endif + + /* +@@ -178,7 +211,7 @@ + * behavior. + */ + +-extern void process_options(); /* execute options */ ++extern void process_options __P((char *, struct request_info *)); /* execute options */ + extern int dry_run; /* verification flag */ + + /* Bug workarounds. */ +@@ -217,3 +250,7 @@ + #define strtok my_strtok + extern char *my_strtok(); + #endif ++ ++__END_DECLS ++ ++#endif /* tcpd.h */ +diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c +--- tcp_wrappers_7.6/tcpdchk.c 1997-02-11 19:13:25.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/tcpdchk.c 2002-01-07 08:50:19.000000000 -0600 +@@ -350,6 +350,8 @@ + { + if (pat[0] == '@') { + tcpd_warn("%s: daemon name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: daemon name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: daemon name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -382,6 +384,8 @@ + { + if (pat[0] == '@') { /* @netgroup */ + tcpd_warn("%s: user name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: user name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: user name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -402,8 +406,13 @@ + static int check_host(pat) + char *pat; + { ++ char buf[BUFSIZ]; + char *mask; + int addr_count = 1; ++ FILE *fp; ++ struct tcpd_context saved_context; ++ char *cp; ++ char *wsp = " \t\r\n"; + + if (pat[0] == '@') { /* @netgroup */ + #ifdef NO_NETGRENT +@@ -422,6 +431,21 @@ + tcpd_warn("netgroup support disabled"); + #endif + #endif ++ } else if (pat[0] == '/') { /* /path/name */ ++ if ((fp = fopen(pat, "r")) != 0) { ++ saved_context = tcpd_context; ++ tcpd_context.file = pat; ++ tcpd_context.line = 0; ++ while (fgets(buf, sizeof(buf), fp)) { ++ tcpd_context.line++; ++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp)) ++ check_host(cp); ++ } ++ tcpd_context = saved_context; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", pat); ++ } + } else if (mask = split_at(pat, '/')) { /* network/netmask */ + if (dot_quad_addr(pat) == INADDR_NONE + || dot_quad_addr(mask) == INADDR_NONE) +diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8 +--- tcp_wrappers_7.6/try-from.8 1969-12-31 18:00:00.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/try-from.8 2002-01-07 08:50:19.000000000 -0600 +@@ -0,0 +1,28 @@ ++.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual" ++.SH NAME ++try-from \- test program for the tcp_wrapper ++.SH SYNOPSIS ++.B try-from ++.SH DESCRIPTION ++The ++.B try-from ++command can be called via a remote shell command to find out ++if the hostname and address are properly recognized ++by the ++.B tcp_wrapper ++library, if username lookup works, and (SysV only) if the TLI ++on top of IP heuristics work. Diagnostics are reported through ++.BR syslog (3) ++and redirected to stderr. ++ ++Example: ++ ++rsh host /some/where/try-from ++ ++.SH SEE ALSO ++.BR hosts_access (5), ++.BR hosts_options (5), ++.BR tcpd (8) ++.SH AUTHOR ++Wietse Venema, Eindhoven University of Technology, The Netherlands. ++ +diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c +--- tcp_wrappers_7.6/weak_symbols.c 1969-12-31 18:00:00.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/weak_symbols.c 2002-01-07 08:50:19.000000000 -0600 +@@ -0,0 +1,11 @@ ++ /* ++ * @(#) weak_symbols.h 1.5 99/12/29 23:50 ++ * ++ * Author: Anthony Towns ++ */ ++ ++#ifdef HAVE_WEAKSYMS ++#include ++int deny_severity = LOG_WARNING; ++int allow_severity = SEVERITY; ++#endif +diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c +--- tcp_wrappers_7.6/workarounds.c 1996-03-19 09:22:26.000000000 -0600 ++++ tcp_wrappers_7.6.gimli/workarounds.c 2002-01-07 08:50:19.000000000 -0600 +@@ -163,7 +163,11 @@ + int fix_getpeername(sock, sa, len) + int sock; + struct sockaddr *sa; ++#if !defined(__GLIBC__) + int *len; ++#else /* __GLIBC__ */ ++size_t *len; ++#endif /* __GLIBC__ */ + { + int ret; + struct sockaddr_in *sin = (struct sockaddr_in *) sa; diff -r c7b121a4ffd9 -r d6378d455338 libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch --- a/libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1035 +0,0 @@ -Submitted By: Tushar Teredesai -Date: 2003-10-04 -Initial Package Version: 7.6 -Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html -Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink. -This patch provides the following improvements: - * Install libwrap.so along with libwrap.a. - * Create an install target for tcp_wrappers. - * Compilation and security fixes. - * Documentation fixes. -diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile ---- tcp_wrappers_7.6/Makefile 1997-03-21 12:27:21.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/Makefile 2002-07-15 16:07:21.000000000 -0500 -@@ -1,5 +1,10 @@ -+GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h) -+ - # @(#) Makefile 1.23 97/03/21 19:27:20 - -+# unset the HOSTNAME environment variable -+HOSTNAME = -+ - what: - @echo - @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:" -@@ -19,7 +24,7 @@ - @echo " generic (most bsd-ish systems with sys5 compatibility)" - @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543" - @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix" -- @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" -+ @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" - @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4" - @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" - @echo " uts215 uxp" -@@ -43,8 +48,8 @@ - # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx - #REAL_DAEMON_DIR=/usr/etc - # --# SysV.4 Solaris 2.x OSF AIX --#REAL_DAEMON_DIR=/usr/sbin -+# SysV.4 Solaris 2.x OSF AIX Linux -+REAL_DAEMON_DIR=/usr/sbin - # - # BSD 4.4 - #REAL_DAEMON_DIR=/usr/libexec -@@ -141,10 +146,21 @@ - LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ - EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all - -+ifneq ($(GLIBC),0) -+MYLIB=-lnsl -+endif -+ - linux: - @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ -- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ -- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all -+ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ -+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ -+ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT" -+ -+gnu: -+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ -+ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ -+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \ -+ EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" - - # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. - hpux hpux8 hpux9 hpux10: -@@ -391,7 +407,7 @@ - # the ones provided with this source distribution. The environ.c module - # implements setenv(), getenv(), and putenv(). - --AUX_OBJ= setenv.o -+#AUX_OBJ= setenv.o - #AUX_OBJ= environ.o - #AUX_OBJ= environ.o strcasecmp.o - -@@ -454,7 +470,8 @@ - # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work - # around this. The workaround does no harm on other Solaris versions. - --BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK -+BUGS = -+#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK - #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG - #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG - -@@ -464,7 +481,7 @@ - # If your system supports NIS or YP-style netgroups, enable the following - # macro definition. Netgroups are used only for host access control. - # --#NETGROUP= -DNETGROUP -+NETGROUP= -DNETGROUP - - ############################################################### - # System dependencies: whether or not your system has vsyslog() -@@ -491,7 +508,7 @@ - # Uncomment the next definition to turn on the language extensions - # (examples: allow, deny, banners, twist and spawn). - # --#STYLE = -DPROCESS_OPTIONS # Enable language extensions. -+STYLE = -DPROCESS_OPTIONS # Enable language extensions. - - ################################################################ - # Optional: Changing the default disposition of logfile records -@@ -514,7 +531,7 @@ - # - # The LOG_XXX names below are taken from the /usr/include/syslog.h file. - --FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use -+FACILITY= LOG_DAEMON # LOG_MAIL is what most sendmail daemons use - - # The syslog priority at which successful connections are logged. - -@@ -610,7 +627,7 @@ - # Paranoid mode implies hostname lookup. In order to disable hostname - # lookups altogether, see the next section. - --PARANOID= -DPARANOID -+#PARANOID= -DPARANOID - - ######################################## - # Optional: turning off hostname lookups -@@ -623,7 +640,7 @@ - # In order to perform selective hostname lookups, disable paranoid - # mode (see previous section) and comment out the following definition. - --HOSTNAME= -DALWAYS_HOSTNAME -+#HOSTNAME= -DALWAYS_HOSTNAME - - ############################################# - # Optional: Turning on host ADDRESS checking -@@ -649,28 +666,46 @@ - # source-routed traffic in the kernel. Examples: 4.4BSD derivatives, - # Solaris 2.x, and Linux. See your system documentation for details. - # --# KILL_OPT= -DKILL_IP_OPTIONS -+KILL_OPT= -DKILL_IP_OPTIONS - - ## End configuration options - ############################ - - # Protection against weird shells or weird make programs. - -+CC = gcc - SHELL = /bin/sh --.c.o:; $(CC) $(CFLAGS) -c $*.c -+.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c -+ -+SOMAJOR = 0 -+SOMINOR = 7.6 -+ -+LIB = libwrap.a -+SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR) -+SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR) -+SHLIBSO = shared/libwrap.so -+SHLIBFLAGS = -Lshared -lwrap - --CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ -+shared/%.o: %.c -+ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ -+ -+CFLAGS = -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ - $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ - -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ - -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ - $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ - $(VSYSLOG) $(HOSTNAME) - -+SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS) -+SHCFLAGS = -fPIC -shared -D_REENTRANT -+ - LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ - hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ - $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ - update.o misc.o diag.o percent_m.o myvsyslog.o - -+SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); -+ - FROM_OBJ= fromhost.o - - KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ -@@ -684,46 +719,80 @@ - refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ - scaffold.h tcpdmatch.8 README.NIS - --LIB = libwrap.a -- --all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk -+all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) - - # Invalidate all object files when the compiler options (CFLAGS) have changed. - - config-check: - @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; } -- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \ -- if cmp cflags /tmp/cflags.$$$$ ; \ -- then rm /tmp/cflags.$$$$ ; \ -- else mv /tmp/cflags.$$$$ cflags ; \ -+ @set +e; echo $(CFLAGS) >cflags.new ; \ -+ if cmp cflags cflags.new ; \ -+ then rm cflags.new ; \ -+ else mv cflags.new cflags ; \ - fi >/dev/null 2>/dev/null -+ @if [ ! -d shared ]; then mkdir shared; fi - - $(LIB): $(LIB_OBJ) - rm -f $(LIB) - $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) - -$(RANLIB) $(LIB) - --tcpd: tcpd.o $(LIB) -- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) -+$(SHLIB): $(SHLIB_OBJ) -+ rm -f $(SHLIB) -+ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) -+ ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ) -+ ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) -+ -+tcpd: tcpd.o $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) - --miscd: miscd.o $(LIB) -- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) -+miscd: miscd.o $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS) - --safe_finger: safe_finger.o $(LIB) -- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) -+safe_finger: safe_finger.o $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) - - TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o - --tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) -- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) -+tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) - --try-from: try-from.o fakelog.o $(LIB) -- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) -+try-from: try-from.o fakelog.o $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) - - TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o - --tcpdchk: $(TCPDCHK_OBJ) $(LIB) -- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) -+tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) -+ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) -+ -+install: install-lib install-bin install-dev -+ -+install-lib: -+ install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/ -+ ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ)) -+ ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO)) -+ -+install-bin: -+ install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/ -+ install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/ -+ install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/ -+ install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/ -+ install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/ -+ install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/ -+ install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/ -+ install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/ -+ install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/ -+ install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/ -+ install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/ -+ install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/ -+ -+install-dev: -+ install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/ -+ install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/ -+ install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/ -+ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3 -+ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3 -+ ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3 - - shar: $(KIT) - @shar $(KIT) -@@ -739,7 +808,8 @@ - - clean: - rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \ -- cflags -+ cflags libwrap*.so* -+ rm -rf shared - - tidy: clean - chmod -R a+r . -@@ -885,5 +955,6 @@ - update.o: mystdarg.h - update.o: tcpd.h - vfprintf.o: cflags -+weak_symbols.o: tcpd.h - workarounds.o: cflags - workarounds.o: tcpd.h -diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c ---- tcp_wrappers_7.6/fix_options.c 1997-04-07 19:29:19.000000000 -0500 -+++ tcp_wrappers_7.6.gimli/fix_options.c 2002-01-07 08:50:19.000000000 -0600 -@@ -35,7 +35,12 @@ - #ifdef IP_OPTIONS - unsigned char optbuf[BUFFER_SIZE / 3], *cp; - char lbuf[BUFFER_SIZE], *lp; -+#if !defined(__GLIBC__) - int optsize = sizeof(optbuf), ipproto; -+#else /* __GLIBC__ */ -+ size_t optsize = sizeof(optbuf); -+ int ipproto; -+#endif /* __GLIBC__ */ - struct protoent *ip; - int fd = request->fd; - unsigned int opt; -diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3 ---- tcp_wrappers_7.6/hosts_access.3 1996-02-11 10:01:27.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/hosts_access.3 2002-01-07 08:50:19.000000000 -0600 -@@ -3,7 +3,7 @@ - hosts_access, hosts_ctl, request_init, request_set \- access control library - .SH SYNOPSIS - .nf --#include "tcpd.h" -+#include - - extern int allow_severity; - extern int deny_severity; -diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5 ---- tcp_wrappers_7.6/hosts_access.5 1995-01-30 12:51:47.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/hosts_access.5 2002-01-07 08:50:19.000000000 -0600 -@@ -8,9 +8,9 @@ - impatient reader is encouraged to skip to the EXAMPLES section for a - quick introduction. - .PP --An extended version of the access control language is described in the --\fIhosts_options\fR(5) document. The extensions are turned on at --program build time by building with -DPROCESS_OPTIONS. -+The extended version of the access control language is described in the -+\fIhosts_options\fR(5) document. \fBNote that this language supersedes -+the meaning of \fIshell_command\fB as documented below.\fR - .PP - In the following text, \fIdaemon\fR is the the process name of a - network daemon process, and \fIclient\fR is the name and/or address of -@@ -40,7 +40,7 @@ - character. This permits you to break up long lines so that they are - easier to edit. - .IP \(bu --Blank lines or lines that begin with a `#\' character are ignored. -+Blank lines or lines that begin with a `#' character are ignored. - This permits you to insert comments and whitespace so that the tables - are easier to read. - .IP \(bu -@@ -69,26 +69,33 @@ - .SH PATTERNS - The access control language implements the following patterns: - .IP \(bu --A string that begins with a `.\' character. A host name is matched if -+A string that begins with a `.' character. A host name is matched if - the last components of its name match the specified pattern. For --example, the pattern `.tue.nl\' matches the host name --`wzv.win.tue.nl\'. -+example, the pattern `.tue.nl' matches the host name -+`wzv.win.tue.nl'. - .IP \(bu --A string that ends with a `.\' character. A host address is matched if -+A string that ends with a `.' character. A host address is matched if - its first numeric fields match the given string. For example, the --pattern `131.155.\' matches the address of (almost) every host on the -+pattern `131.155.' matches the address of (almost) every host on the - Eind\%hoven University network (131.155.x.x). - .IP \(bu --A string that begins with an `@\' character is treated as an NIS -+A string that begins with an `@' character is treated as an NIS - (formerly YP) netgroup name. A host name is matched if it is a host - member of the specified netgroup. Netgroup matches are not supported - for daemon process names or for client user names. - .IP \(bu --An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a --`net/mask\' pair. A host address is matched if `net\' is equal to the --bitwise AND of the address and the `mask\'. For example, the net/mask --pattern `131.155.72.0/255.255.254.0\' matches every address in the --range `131.155.72.0\' through `131.155.73.255\'. -+An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a -+`net/mask' pair. A host address is matched if `net' is equal to the -+bitwise AND of the address and the `mask'. For example, the net/mask -+pattern `131.155.72.0/255.255.254.0' matches every address in the -+range `131.155.72.0' through `131.155.73.255'. -+.IP \(bu -+A string that begins with a `/' character is treated as a file -+name. A host name or address is matched if it matches any host name -+or address pattern listed in the named file. The file format is -+zero or more lines with zero or more host name or address patterns -+separated by whitespace. A file name pattern can be used anywhere -+a host name or address pattern can be used. - .SH WILDCARDS - The access control language supports explicit wildcards: - .IP ALL -@@ -115,19 +122,19 @@ - .ne 6 - .SH OPERATORS - .IP EXCEPT --Intended use is of the form: `list_1 EXCEPT list_2\'; this construct -+Intended use is of the form: `list_1 EXCEPT list_2'; this construct - matches anything that matches \fIlist_1\fR unless it matches - \fIlist_2\fR. The EXCEPT operator can be used in daemon_lists and in - client_lists. The EXCEPT operator can be nested: if the control --language would permit the use of parentheses, `a EXCEPT b EXCEPT c\' --would parse as `(a EXCEPT (b EXCEPT c))\'. -+language would permit the use of parentheses, `a EXCEPT b EXCEPT c' -+would parse as `(a EXCEPT (b EXCEPT c))'. - .br - .ne 6 - .SH SHELL COMMANDS - If the first-matched access control rule contains a shell command, that - command is subjected to % substitutions (see next section). - The result is executed by a \fI/bin/sh\fR child process with standard --input, output and error connected to \fI/dev/null\fR. Specify an `&\' -+input, output and error connected to \fI/dev/null\fR. Specify an `&' - at the end of the command if you do not want to wait until it has - completed. - .PP -@@ -159,7 +166,7 @@ - .IP %u - The client user name (or "unknown"). - .IP %% --Expands to a single `%\' character. -+Expands to a single `%' character. - .PP - Characters in % expansions that may confuse the shell are replaced by - underscores. -@@ -243,9 +250,9 @@ - less trustworthy. It is possible for an intruder to spoof both the - client connection and the IDENT lookup, although doing so is much - harder than spoofing just a client connection. It may also be that --the client\'s IDENT server is lying. -+the client's IDENT server is lying. - .PP --Note: IDENT lookups don\'t work with UDP services. -+Note: IDENT lookups don't work with UDP services. - .SH EXAMPLES - The language is flexible enough that different types of access control - policy can be expressed with a minimum of fuss. Although the language -@@ -285,7 +292,7 @@ - .br - ALL: .foobar.edu EXCEPT terminalserver.foobar.edu - .PP --The first rule permits access from hosts in the local domain (no `.\' -+The first rule permits access from hosts in the local domain (no `.' - in the host name) and from members of the \fIsome_netgroup\fP - netgroup. The second rule permits access from all hosts in the - \fIfoobar.edu\fP domain (notice the leading dot), with the exception of -@@ -322,8 +329,8 @@ - /etc/hosts.deny: - .in +3 - .nf --in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\ -- /usr/ucb/mail -s %d-%h root) & -+in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\ -+ /usr/bin/mail -s %d-%h root) & - .fi - .PP - The safe_finger command comes with the tcpd wrapper and should be -@@ -349,7 +356,7 @@ - capacity of an internal buffer; when an access control rule is not - terminated by a newline character; when the result of % - expansion would overflow an internal buffer; when a system call fails --that shouldn\'t. All problems are reported via the syslog daemon. -+that shouldn't. All problems are reported via the syslog daemon. - .SH FILES - .na - .nf -diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c ---- tcp_wrappers_7.6/hosts_access.c 1997-02-11 19:13:23.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/hosts_access.c 2002-01-07 08:50:19.000000000 -0600 -@@ -240,6 +240,26 @@ - } - } - -+/* hostfile_match - look up host patterns from file */ -+ -+static int hostfile_match(path, host) -+char *path; -+struct hosts_info *host; -+{ -+ char tok[BUFSIZ]; -+ int match = NO; -+ FILE *fp; -+ -+ if ((fp = fopen(path, "r")) != 0) { -+ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host))) -+ /* void */ ; -+ fclose(fp); -+ } else if (errno != ENOENT) { -+ tcpd_warn("open %s: %m", path); -+ } -+ return (match); -+} -+ - /* host_match - match host name and/or address against pattern */ - - static int host_match(tok, host) -@@ -267,6 +287,8 @@ - tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */ - return (NO); - #endif -+ } else if (tok[0] == '/') { /* /file hack */ -+ return (hostfile_match(tok, host)); - } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */ - char *name = eval_hostname(host); - return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name)); -diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5 ---- tcp_wrappers_7.6/hosts_options.5 1994-12-28 10:42:29.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/hosts_options.5 2002-01-07 08:50:19.000000000 -0600 -@@ -58,12 +58,12 @@ - Execute, in a child process, the specified shell command, after - performing the % expansions described in the hosts_access(5) - manual page. The command is executed with stdin, stdout and stderr --connected to the null device, so that it won\'t mess up the -+connected to the null device, so that it won't mess up the - conversation with the client host. Example: - .sp - .nf - .ti +3 --spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) & -+spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) & - .fi - .sp - executes, in a background child process, the shell command "safe_finger -diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c ---- tcp_wrappers_7.6/options.c 1996-02-11 10:01:32.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/options.c 2002-01-07 08:50:19.000000000 -0600 -@@ -473,6 +473,9 @@ - #ifdef LOG_CRON - "cron", LOG_CRON, - #endif -+#ifdef LOG_FTP -+ "ftp", LOG_FTP, -+#endif - #ifdef LOG_LOCAL0 - "local0", LOG_LOCAL0, - #endif -diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c ---- tcp_wrappers_7.6/percent_m.c 1994-12-28 10:42:37.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/percent_m.c 2002-01-07 08:50:19.000000000 -0600 -@@ -13,7 +13,7 @@ - #include - - extern int errno; --#ifndef SYS_ERRLIST_DEFINED -+#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR) - extern char *sys_errlist[]; - extern int sys_nerr; - #endif -@@ -29,11 +29,15 @@ - - while (*bp = *cp) - if (*cp == '%' && cp[1] == 'm') { -+#ifdef HAVE_STRERROR -+ strcpy(bp, strerror(errno)); -+#else - if (errno < sys_nerr && errno > 0) { - strcpy(bp, sys_errlist[errno]); - } else { - sprintf(bp, "Unknown error %d", errno); - } -+#endif - bp += strlen(bp); - cp += 2; - } else { -diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c ---- tcp_wrappers_7.6/rfc931.c 1995-01-02 09:11:34.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/rfc931.c 2002-01-07 08:50:19.000000000 -0600 -@@ -33,7 +33,7 @@ - - int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ - --static jmp_buf timebuf; -+static sigjmp_buf timebuf; - - /* fsocket - open stdio stream on top of socket */ - -@@ -62,7 +62,7 @@ - static void timeout(sig) - int sig; - { -- longjmp(timebuf, sig); -+ siglongjmp(timebuf, sig); - } - - /* rfc931 - return remote user name, given socket structures */ -@@ -99,7 +99,7 @@ - * Set up a timer so we won't get stuck while waiting for the server. - */ - -- if (setjmp(timebuf) == 0) { -+ if (sigsetjmp(timebuf,1) == 0) { - signal(SIGALRM, timeout); - alarm(rfc931_timeout); - -diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8 ---- tcp_wrappers_7.6/safe_finger.8 1969-12-31 18:00:00.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/safe_finger.8 2002-01-07 08:50:19.000000000 -0600 -@@ -0,0 +1,34 @@ -+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual" -+.SH NAME -+safe_finger \- finger client wrapper that protects against nasty stuff -+from finger servers -+.SH SYNOPSIS -+.B safe_finger [finger_options] -+.SH DESCRIPTION -+The -+.B safe_finger -+command protects against nasty stuff from finger servers. Use this -+program for automatic reverse finger probes from the -+.B tcp_wrapper -+.B (tcpd) -+, not the raw finger command. The -+.B safe_finger -+command makes sure that the finger client is not run with root -+privileges. It also runs the finger client with a defined PATH -+environment. -+.B safe_finger -+will also protect you from problems caused by the output of some -+finger servers. The problem: some programs may react to stuff in -+the first column. Other programs may get upset by thrash anywhere -+on a line. File systems may fill up as the finger server keeps -+sending data. Text editors may bomb out on extremely long lines. -+The finger server may take forever because it is somehow wedged. -+.B safe_finger -+takes care of all this badness. -+.SH SEE ALSO -+.BR hosts_access (5), -+.BR hosts_options (5), -+.BR tcpd (8) -+.SH AUTHOR -+Wietse Venema, Eindhoven University of Technology, The Netherlands. -+ -diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c ---- tcp_wrappers_7.6/safe_finger.c 1994-12-28 10:42:42.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/safe_finger.c 2002-01-07 08:50:19.000000000 -0600 -@@ -26,21 +26,24 @@ - #include - #include - #include -+#include - - extern void exit(); - - /* Local stuff */ - --char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin"; -+char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin"; - - #define TIME_LIMIT 60 /* Do not keep listinging forever */ - #define INPUT_LENGTH 100000 /* Do not keep listinging forever */ - #define LINE_LENGTH 128 /* Editors can choke on long lines */ - #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */ - #define UNPRIV_NAME "nobody" /* Preferred privilege level */ --#define UNPRIV_UGID 32767 /* Default uid and gid */ -+#define UNPRIV_UGID 65534 /* Default uid and gid */ - - int finger_pid; -+int allow_severity = SEVERITY; -+int deny_severity = LOG_WARNING; - - void cleanup(sig) - int sig; -diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c ---- tcp_wrappers_7.6/scaffold.c 1997-03-21 12:27:24.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/scaffold.c 2002-01-07 08:50:19.000000000 -0600 -@@ -180,10 +180,12 @@ - - /* ARGSUSED */ - --void rfc931(request) --struct request_info *request; -+void rfc931(rmt_sin, our_sin, dest) -+struct sockaddr_in *rmt_sin; -+struct sockaddr_in *our_sin; -+char *dest; - { -- strcpy(request->user, unknown); -+ strcpy(dest, unknown); - } - - /* check_path - examine accessibility */ -diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c ---- tcp_wrappers_7.6/socket.c 1997-03-21 12:27:25.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/socket.c 2002-01-07 08:50:19.000000000 -0600 -@@ -76,7 +76,11 @@ - { - static struct sockaddr_in client; - static struct sockaddr_in server; -+#if !defined (__GLIBC__) - int len; -+#else /* __GLIBC__ */ -+ size_t len; -+#endif /* __GLIBC__ */ - char buf[BUFSIZ]; - int fd = request->fd; - -@@ -224,7 +228,11 @@ - { - char buf[BUFSIZ]; - struct sockaddr_in sin; -+#if !defined(__GLIBC__) - int size = sizeof(sin); -+#else /* __GLIBC__ */ -+ size_t size = sizeof(sin); -+#endif /* __GLIBC__ */ - - /* - * Eat up the not-yet received datagram. Some systems insist on a -diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8 ---- tcp_wrappers_7.6/tcpd.8 1996-02-21 09:39:16.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/tcpd.8 2002-01-07 08:50:19.000000000 -0600 -@@ -94,7 +94,7 @@ - .PP - The example assumes that the network daemons live in /usr/etc. On some - systems, network daemons live in /usr/sbin or in /usr/libexec, or have --no `in.\' prefix to their name. -+no `in.' prefix to their name. - .SH EXAMPLE 2 - This example applies when \fItcpd\fR expects that the network daemons - are left in their original place. -@@ -110,26 +110,26 @@ - becomes: - .sp - .ti +5 --finger stream tcp nowait nobody /some/where/tcpd in.fingerd -+finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd - .sp - .fi - .PP - The example assumes that the network daemons live in /usr/etc. On some - systems, network daemons live in /usr/sbin or in /usr/libexec, the --daemons have no `in.\' prefix to their name, or there is no userid -+daemons have no `in.' prefix to their name, or there is no userid - field in the inetd configuration file. - .PP - Similar changes will be needed for the other services that are to be --covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8) -+covered by \fItcpd\fR. Send a `kill -HUP' to the \fIinetd\fR(8) - process to make the changes effective. AIX users may also have to --execute the `inetimp\' command. -+execute the `inetimp' command. - .SH EXAMPLE 3 - In the case of daemons that do not live in a common directory ("secret" - or otherwise), edit the \fIinetd\fR configuration file so that it - specifies an absolute path name for the process name field. For example: - .nf - .sp -- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd -+ ntalk dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.ntalkd - .sp - .fi - .PP -diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h ---- tcp_wrappers_7.6/tcpd.h 1996-03-19 09:22:25.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/tcpd.h 2002-01-07 08:50:19.000000000 -0600 -@@ -4,6 +4,25 @@ - * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. - */ - -+#ifndef _TCPWRAPPERS_TCPD_H -+#define _TCPWRAPPERS_TCPD_H -+ -+/* someone else may have defined this */ -+#undef __P -+ -+/* use prototypes if we have an ANSI C compiler or are using C++ */ -+#if defined(__STDC__) || defined(__cplusplus) -+#define __P(args) args -+#else -+#define __P(args) () -+#endif -+ -+/* Need definitions of struct sockaddr_in and FILE. */ -+#include -+#include -+ -+__BEGIN_DECLS -+ - /* Structure to describe one communications endpoint. */ - - #define STRING_LENGTH 128 /* hosts, users, processes */ -@@ -25,10 +44,10 @@ - char pid[10]; /* access via eval_pid(request) */ - struct host_info client[1]; /* client endpoint info */ - struct host_info server[1]; /* server endpoint info */ -- void (*sink) (); /* datagram sink function or 0 */ -- void (*hostname) (); /* address to printable hostname */ -- void (*hostaddr) (); /* address to printable address */ -- void (*cleanup) (); /* cleanup function or 0 */ -+ void (*sink) __P((int)); /* datagram sink function or 0 */ -+ void (*hostname) __P((struct host_info *)); /* address to printable hostname */ -+ void (*hostaddr) __P((struct host_info *)); /* address to printable address */ -+ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */ - struct netconfig *config; /* netdir handle */ - }; - -@@ -61,25 +80,30 @@ - /* Global functions. */ - - #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) --extern void fromhost(); /* get/validate client host info */ -+extern void fromhost __P((struct request_info *)); /* get/validate client host info */ - #else - #define fromhost sock_host /* no TLI support needed */ - #endif - --extern int hosts_access(); /* access control */ --extern void shell_cmd(); /* execute shell command */ --extern char *percent_x(); /* do % expansion */ --extern void rfc931(); /* client name from RFC 931 daemon */ --extern void clean_exit(); /* clean up and exit */ --extern void refuse(); /* clean up and exit */ --extern char *xgets(); /* fgets() on steroids */ --extern char *split_at(); /* strchr() and split */ --extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ -+extern void shell_cmd __P((char *)); /* execute shell command */ -+extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do % expansion */ -+extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */ -+extern void clean_exit __P((struct request_info *)); /* clean up and exit */ -+extern void refuse __P((struct request_info *)); /* clean up and exit */ -+extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */ -+extern char *split_at __P((char *, int)); /* strchr() and split */ -+extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */ - - /* Global variables. */ - -+#ifdef HAVE_WEAKSYMS -+extern int allow_severity __attribute__ ((weak)); /* for connection logging */ -+extern int deny_severity __attribute__ ((weak)); /* for connection logging */ -+#else - extern int allow_severity; /* for connection logging */ - extern int deny_severity; /* for connection logging */ -+#endif -+ - extern char *hosts_allow_table; /* for verification mode redirection */ - extern char *hosts_deny_table; /* for verification mode redirection */ - extern int hosts_access_verbose; /* for verbose matching mode */ -@@ -92,9 +116,14 @@ - */ - - #ifdef __STDC__ -+extern int hosts_access(struct request_info *request); -+extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, -+ char *client_user); - extern struct request_info *request_init(struct request_info *,...); - extern struct request_info *request_set(struct request_info *,...); - #else -+extern int hosts_access(); -+extern int hosts_ctl(); - extern struct request_info *request_init(); /* initialize request */ - extern struct request_info *request_set(); /* update request structure */ - #endif -@@ -117,27 +146,31 @@ - * host_info structures serve as caches for the lookup results. - */ - --extern char *eval_user(); /* client user */ --extern char *eval_hostname(); /* printable hostname */ --extern char *eval_hostaddr(); /* printable host address */ --extern char *eval_hostinfo(); /* host name or address */ --extern char *eval_client(); /* whatever is available */ --extern char *eval_server(); /* whatever is available */ -+extern char *eval_user __P((struct request_info *)); /* client user */ -+extern char *eval_hostname __P((struct host_info *)); /* printable hostname */ -+extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */ -+extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */ -+extern char *eval_client __P((struct request_info *)); /* whatever is available */ -+extern char *eval_server __P((struct request_info *)); /* whatever is available */ - #define eval_daemon(r) ((r)->daemon) /* daemon process name */ - #define eval_pid(r) ((r)->pid) /* process id */ - - /* Socket-specific methods, including DNS hostname lookups. */ - --extern void sock_host(); /* look up endpoint addresses */ --extern void sock_hostname(); /* translate address to hostname */ --extern void sock_hostaddr(); /* address to printable address */ -+/* look up endpoint addresses */ -+extern void sock_host __P((struct request_info *)); -+/* translate address to hostname */ -+extern void sock_hostname __P((struct host_info *)); -+/* address to printable address */ -+extern void sock_hostaddr __P((struct host_info *)); -+ - #define sock_methods(r) \ - { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } - - /* The System V Transport-Level Interface (TLI) interface. */ - - #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) --extern void tli_host(); /* look up endpoint addresses etc. */ -+extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */ - #endif - - /* -@@ -178,7 +211,7 @@ - * behavior. - */ - --extern void process_options(); /* execute options */ -+extern void process_options __P((char *, struct request_info *)); /* execute options */ - extern int dry_run; /* verification flag */ - - /* Bug workarounds. */ -@@ -217,3 +250,7 @@ - #define strtok my_strtok - extern char *my_strtok(); - #endif -+ -+__END_DECLS -+ -+#endif /* tcpd.h */ -diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c ---- tcp_wrappers_7.6/tcpdchk.c 1997-02-11 19:13:25.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/tcpdchk.c 2002-01-07 08:50:19.000000000 -0600 -@@ -350,6 +350,8 @@ - { - if (pat[0] == '@') { - tcpd_warn("%s: daemon name begins with \"@\"", pat); -+ } else if (pat[0] == '/') { -+ tcpd_warn("%s: daemon name begins with \"/\"", pat); - } else if (pat[0] == '.') { - tcpd_warn("%s: daemon name begins with dot", pat); - } else if (pat[strlen(pat) - 1] == '.') { -@@ -382,6 +384,8 @@ - { - if (pat[0] == '@') { /* @netgroup */ - tcpd_warn("%s: user name begins with \"@\"", pat); -+ } else if (pat[0] == '/') { -+ tcpd_warn("%s: user name begins with \"/\"", pat); - } else if (pat[0] == '.') { - tcpd_warn("%s: user name begins with dot", pat); - } else if (pat[strlen(pat) - 1] == '.') { -@@ -402,8 +406,13 @@ - static int check_host(pat) - char *pat; - { -+ char buf[BUFSIZ]; - char *mask; - int addr_count = 1; -+ FILE *fp; -+ struct tcpd_context saved_context; -+ char *cp; -+ char *wsp = " \t\r\n"; - - if (pat[0] == '@') { /* @netgroup */ - #ifdef NO_NETGRENT -@@ -422,6 +431,21 @@ - tcpd_warn("netgroup support disabled"); - #endif - #endif -+ } else if (pat[0] == '/') { /* /path/name */ -+ if ((fp = fopen(pat, "r")) != 0) { -+ saved_context = tcpd_context; -+ tcpd_context.file = pat; -+ tcpd_context.line = 0; -+ while (fgets(buf, sizeof(buf), fp)) { -+ tcpd_context.line++; -+ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp)) -+ check_host(cp); -+ } -+ tcpd_context = saved_context; -+ fclose(fp); -+ } else if (errno != ENOENT) { -+ tcpd_warn("open %s: %m", pat); -+ } - } else if (mask = split_at(pat, '/')) { /* network/netmask */ - if (dot_quad_addr(pat) == INADDR_NONE - || dot_quad_addr(mask) == INADDR_NONE) -diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8 ---- tcp_wrappers_7.6/try-from.8 1969-12-31 18:00:00.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/try-from.8 2002-01-07 08:50:19.000000000 -0600 -@@ -0,0 +1,28 @@ -+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual" -+.SH NAME -+try-from \- test program for the tcp_wrapper -+.SH SYNOPSIS -+.B try-from -+.SH DESCRIPTION -+The -+.B try-from -+command can be called via a remote shell command to find out -+if the hostname and address are properly recognized -+by the -+.B tcp_wrapper -+library, if username lookup works, and (SysV only) if the TLI -+on top of IP heuristics work. Diagnostics are reported through -+.BR syslog (3) -+and redirected to stderr. -+ -+Example: -+ -+rsh host /some/where/try-from -+ -+.SH SEE ALSO -+.BR hosts_access (5), -+.BR hosts_options (5), -+.BR tcpd (8) -+.SH AUTHOR -+Wietse Venema, Eindhoven University of Technology, The Netherlands. -+ -diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c ---- tcp_wrappers_7.6/weak_symbols.c 1969-12-31 18:00:00.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/weak_symbols.c 2002-01-07 08:50:19.000000000 -0600 -@@ -0,0 +1,11 @@ -+ /* -+ * @(#) weak_symbols.h 1.5 99/12/29 23:50 -+ * -+ * Author: Anthony Towns -+ */ -+ -+#ifdef HAVE_WEAKSYMS -+#include -+int deny_severity = LOG_WARNING; -+int allow_severity = SEVERITY; -+#endif -diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c ---- tcp_wrappers_7.6/workarounds.c 1996-03-19 09:22:26.000000000 -0600 -+++ tcp_wrappers_7.6.gimli/workarounds.c 2002-01-07 08:50:19.000000000 -0600 -@@ -163,7 +163,11 @@ - int fix_getpeername(sock, sa, len) - int sock; - struct sockaddr *sa; -+#if !defined(__GLIBC__) - int *len; -+#else /* __GLIBC__ */ -+size_t *len; -+#endif /* __GLIBC__ */ - { - int ret; - struct sockaddr_in *sin = (struct sockaddr_in *) sa; diff -r c7b121a4ffd9 -r d6378d455338 lite/receipt --- a/lite/receipt Wed May 09 17:03:28 2018 +0300 +++ b/lite/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,9 +21,6 @@ export CPPFLAGS="$CPPFLAGS -I/cross/arm/sysroot/usr/include/directfb" ;; esac - patch -Np1 -i ${stuff}/lite_fix_stat_naming.patch || return 1 - patch -Np1 -i ${stuff}/lite_fix_pkgconfig.patch || return 1 - ./configure $CONFIGURE_ARGS && fix libtool && make && diff -r c7b121a4ffd9 -r d6378d455338 lite/stuff/lite_fix_pkgconfig.patch --- a/lite/stuff/lite_fix_pkgconfig.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -diff -upr LiTE-0.8.10.orig/lite.pc.in LiTE-0.8.10/lite.pc.in ---- LiTE-0.8.10.orig/lite.pc.in 2008-06-20 23:34:10.000000000 +0200 -+++ LiTE-0.8.10/lite.pc.in 2013-06-29 09:56:37.910000014 +0200 -@@ -9,4 +9,4 @@ Description: "LiTE" is a Toolkit Engine - Requires: directfb >= @DFB_REQUIRED_VERSION@ - Version: @VERSION@ - Libs: -L${libdir} -llite --Cflags: -I${includedir} -DLITEFONTDIR=\\\"@LITEFONTDIR@\\\" -+Cflags: -I${includedir} -DLITEFONTDIR=\"@LITEFONTDIR@\" diff -r c7b121a4ffd9 -r d6378d455338 lite/stuff/lite_fix_stat_naming.patch --- a/lite/stuff/lite_fix_stat_naming.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -diff -upr LiTE-0.8.10.orig/examples/dfbspy.c LiTE-0.8.10/examples/dfbspy.c ---- LiTE-0.8.10.orig/examples/dfbspy.c 2013-06-23 17:01:22.360000002 +0200 -+++ LiTE-0.8.10/examples/dfbspy.c 2013-06-23 17:07:03.370000001 +0200 -@@ -45,6 +45,8 @@ - #include - #include - -+#define stat cur_stat -+ - /**************************************************************************************************/ - - typedef struct { diff -r c7b121a4ffd9 -r d6378d455338 lite/stuff/patches/lite_fix_pkgconfig.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lite/stuff/patches/lite_fix_pkgconfig.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,9 @@ +diff -upr LiTE-0.8.10.orig/lite.pc.in LiTE-0.8.10/lite.pc.in +--- LiTE-0.8.10.orig/lite.pc.in 2008-06-20 23:34:10.000000000 +0200 ++++ LiTE-0.8.10/lite.pc.in 2013-06-29 09:56:37.910000014 +0200 +@@ -9,4 +9,4 @@ Description: "LiTE" is a Toolkit Engine + Requires: directfb >= @DFB_REQUIRED_VERSION@ + Version: @VERSION@ + Libs: -L${libdir} -llite +-Cflags: -I${includedir} -DLITEFONTDIR=\\\"@LITEFONTDIR@\\\" ++Cflags: -I${includedir} -DLITEFONTDIR=\"@LITEFONTDIR@\" diff -r c7b121a4ffd9 -r d6378d455338 lite/stuff/patches/lite_fix_stat_naming.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lite/stuff/patches/lite_fix_stat_naming.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,12 @@ +diff -upr LiTE-0.8.10.orig/examples/dfbspy.c LiTE-0.8.10/examples/dfbspy.c +--- LiTE-0.8.10.orig/examples/dfbspy.c 2013-06-23 17:01:22.360000002 +0200 ++++ LiTE-0.8.10/examples/dfbspy.c 2013-06-23 17:07:03.370000001 +0200 +@@ -45,6 +45,8 @@ + #include + #include + ++#define stat cur_stat ++ + /**************************************************************************************************/ + + typedef struct { diff -r c7b121a4ffd9 -r d6378d455338 lite/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lite/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +lite_fix_stat_naming.patch +lite_fix_pkgconfig.patch diff -r c7b121a4ffd9 -r d6378d455338 loderunner/receipt --- a/loderunner/receipt Wed May 09 17:03:28 2018 +0300 +++ b/loderunner/receipt Thu May 10 21:12:00 2018 +0300 @@ -1,31 +1,28 @@ -# SliTaz package receipt. +# SliTaz package receipt v2. PACKAGE="loderunner" VERSION="2.01c.3" CATEGORY="games" -SHORT_DESC="Lode runner game clone in html5." +SHORT_DESC="Lode runner game clone in HTML5" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="unknown" +WEB_SITE="http://loderunnerwebgame.com/LodeRunner/" + TARBALL="$PACKAGE-$VERSION.tar.gz" -WEB_SITE="http://loderunnerwebgame.com/LodeRunner/" WGET_URL="https://github.com/SimonHung/LodeRunner_TotalRecall/archive/v$VERSION.tar.gz" -DEPENDS="browser-html5" -# Rules to gen a SliTaz package suitable for Tazpkg. -genpkg_rules() -{ - mkdir -p $fs/var/www $fs/usr/share/applications - cp -a $src $fs/var/www/loderunner - ln -s lodeRunner.html $fs/var/www/loderunner/index.html - rm -rf $fs/var/www/loderunner/tools $fs/var/www/loderunner/README.md - cat > $fs/usr/share/applications/loderunner.desktop < - #include - #include -+#include - #include "Parser.h" - #include "Utils.h" - #include "Channel.h" - ---- lostirc-0.4.6/src/libirc/Socket.cpp -+++ lostirc-0.4.6/src/libirc/Socket.cpp -@@ -27,6 +27,7 @@ - - #include - #include -+#include - #include - #include - #include - ---- lostirc-0.4.6/src/gtkmm/TextWidget.cpp -+++ lostirc-0.4.6/src/gtkmm/TextWidget.cpp -@@ -210,11 +210,11 @@ - std::vector< Glib::RefPtr > tags; - - Glib::RefPtr fg = buffer->get_tag_table()->lookup(Glib::ustring("f")+crop(tp.fgnumber)); -- if (fg == 0) -+ if (!fg) - fg = buffer->get_tag_table()->lookup("f0"); - - Glib::RefPtr bg = buffer->get_tag_table()->lookup(Glib::ustring("b")+crop(tp.bgnumber)); -- if (bg == 0) -+ if (!bg) - bg = buffer->get_tag_table()->lookup("b0"); - - tags.push_back(fg); - diff -r c7b121a4ffd9 -r d6378d455338 lostirc/stuff/patches/gcc.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lostirc/stuff/patches/gcc.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,39 @@ +--- lostirc-0.4.6/src/libirc/Parser.cpp ++++ lostirc-0.4.6/src/libirc/Parser.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include "Parser.h" + #include "Utils.h" + #include "Channel.h" + +--- lostirc-0.4.6/src/libirc/Socket.cpp ++++ lostirc-0.4.6/src/libirc/Socket.cpp +@@ -27,6 +27,7 @@ + + #include + #include ++#include + #include + #include + #include + +--- lostirc-0.4.6/src/gtkmm/TextWidget.cpp ++++ lostirc-0.4.6/src/gtkmm/TextWidget.cpp +@@ -210,11 +210,11 @@ + std::vector< Glib::RefPtr > tags; + + Glib::RefPtr fg = buffer->get_tag_table()->lookup(Glib::ustring("f")+crop(tp.fgnumber)); +- if (fg == 0) ++ if (!fg) + fg = buffer->get_tag_table()->lookup("f0"); + + Glib::RefPtr bg = buffer->get_tag_table()->lookup(Glib::ustring("b")+crop(tp.bgnumber)); +- if (bg == 0) ++ if (!bg) + bg = buffer->get_tag_table()->lookup("b0"); + + tags.push_back(fg); + diff -r c7b121a4ffd9 -r d6378d455338 lostirc/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lostirc/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|gcc.u diff -r c7b121a4ffd9 -r d6378d455338 lsdvd/receipt --- a/lsdvd/receipt Wed May 09 17:03:28 2018 +0300 +++ b/lsdvd/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,10 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - [ -f done.lsdvd-0.16-configure.patch ] || - patch -p1 -i $stuff/lsdvd-0.16-configure.patch - touch done.lsdvd-0.16-configure.patch ./configure $CONFIGURE_ARGS && make && make install } diff -r c7b121a4ffd9 -r d6378d455338 lsdvd/stuff/lsdvd-0.16-configure.patch --- a/lsdvd/stuff/lsdvd-0.16-configure.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ ---- lsdvd-0.16-ori/configure Mon Dec 12 21:22:45 2005 -+++ lsdvd-0.16/configure Sat Apr 19 17:20:11 2008 -@@ -2887,8 +2887,9 @@ - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ -+#include - #include -- #include -+ - int - main () - { ---- lsdvd-0.16-ori/configure.in Mon Dec 12 21:11:01 2005 -+++ lsdvd-0.16/configure.in Sat Apr 19 17:19:36 2008 -@@ -10,8 +10,8 @@ - - AC_CHECK_LIB(dvdread, DVDOpen, , AC_MSG_ERROR([libdvdread not found!])) - AC_MSG_CHECKING([for dvdread/ifo_read.h]) --AC_TRY_COMPILE([#include -- #include ], , -+AC_TRY_COMPILE([#include -+ #include ], , - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Header files for dvdread not found])) ---- lsdvd-0.16-ori/lsdvd.c Thu Mar 2 14:48:11 2006 -+++ lsdvd-0.16/lsdvd.c Sat Apr 19 17:26:06 2008 -@@ -13,13 +13,13 @@ - * 2003-04-19 Cleanups get_title_name, added dvdtime2msec, added helper macros, - * output info structures in form of a Perl module, by Henk Vergonet. - */ --#include - #include - #include - #include - #include - #include - #include -+#include - #include "lsdvd.h" - #include "ocode.h" - diff -r c7b121a4ffd9 -r d6378d455338 lsdvd/stuff/patches/lsdvd-0.16-configure.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lsdvd/stuff/patches/lsdvd-0.16-configure.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,43 @@ +--- lsdvd-0.16-ori/configure Mon Dec 12 21:22:45 2005 ++++ lsdvd-0.16/configure Sat Apr 19 17:20:11 2008 +@@ -2887,8 +2887,9 @@ + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ ++#include + #include +- #include ++ + int + main () + { +--- lsdvd-0.16-ori/configure.in Mon Dec 12 21:11:01 2005 ++++ lsdvd-0.16/configure.in Sat Apr 19 17:19:36 2008 +@@ -10,8 +10,8 @@ + + AC_CHECK_LIB(dvdread, DVDOpen, , AC_MSG_ERROR([libdvdread not found!])) + AC_MSG_CHECKING([for dvdread/ifo_read.h]) +-AC_TRY_COMPILE([#include +- #include ], , ++AC_TRY_COMPILE([#include ++ #include ], , + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Header files for dvdread not found])) +--- lsdvd-0.16-ori/lsdvd.c Thu Mar 2 14:48:11 2006 ++++ lsdvd-0.16/lsdvd.c Sat Apr 19 17:26:06 2008 +@@ -13,13 +13,13 @@ + * 2003-04-19 Cleanups get_title_name, added dvdtime2msec, added helper macros, + * output info structures in form of a Perl module, by Henk Vergonet. + */ +-#include + #include + #include + #include + #include + #include + #include ++#include + #include "lsdvd.h" + #include "ocode.h" + diff -r c7b121a4ffd9 -r d6378d455338 lsdvd/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lsdvd/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|lsdvd-0.16-configure.patch diff -r c7b121a4ffd9 -r d6378d455338 luasocket/receipt --- a/luasocket/receipt Wed May 09 17:03:28 2018 +0300 +++ b/luasocket/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,16 +16,6 @@ # Rules to configure and make the package. compile_rules() { - echo $src - cd $src - while read file; do - [ -f done.$file ] && continue - echo "Apply $file..." - patch -p1 < $stuff/$file || return 1 - touch done.$file - done < -Upstream-Status: Pending -Bug-Debian: https://bugs.debian.org/812054 - ---- a/src/miniacc.h -+++ b/src/miniacc.h -@@ -4461,12 +4461,12 @@ - #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150) - #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) - #else -- ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0) -+ ACCCHK_ASSERT((int)(1u << (8*SIZEOF_INT-1)) < 0) - #endif - ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0) - #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) - #else -- ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0) -+ ACCCHK_ASSERT((long)(1ul << (8*SIZEOF_LONG-1)) < 0) - #endif - ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0) - #if defined(acc_int16e_t) -@@ -4695,7 +4695,7 @@ - #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC) - #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) - #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1) -- ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) -+ ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) - #endif - #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560)) - # pragma option pop diff -r c7b121a4ffd9 -r d6378d455338 lzop/stuff/patches/lzop-gcc6.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lzop/stuff/patches/lzop-gcc6.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,39 @@ +Origin: vendor, https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch +Description: Compatibility with gcc6 + gcc-6 has additional errors e.g. + . + ./test.c:1:12: error: variably modified '__acc_cta' at file scope + extern int __acc_cta[1-2*!((1l << (8*8 -1)) < 0)]; + ^~~~~~~~~ + . + This is rightly pointed out since that index is undefined +Signed-off-by: Khem Raj +Upstream-Status: Pending +Bug-Debian: https://bugs.debian.org/812054 + +--- a/src/miniacc.h ++++ b/src/miniacc.h +@@ -4461,12 +4461,12 @@ + #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150) + #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) + #else +- ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0) ++ ACCCHK_ASSERT((int)(1u << (8*SIZEOF_INT-1)) < 0) + #endif + ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0) + #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) + #else +- ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0) ++ ACCCHK_ASSERT((long)(1ul << (8*SIZEOF_LONG-1)) < 0) + #endif + ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0) + #if defined(acc_int16e_t) +@@ -4695,7 +4695,7 @@ + #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC) + #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) + #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1) +- ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) ++ ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) + #endif + #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560)) + # pragma option pop diff -r c7b121a4ffd9 -r d6378d455338 lzop/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lzop/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|lzop-gcc6.patch diff -r c7b121a4ffd9 -r d6378d455338 man2html/receipt --- a/man2html/receipt Wed May 09 17:03:28 2018 +0300 +++ b/man2html/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/man2html-slitaz.diff make && make install # translations diff -r c7b121a4ffd9 -r d6378d455338 man2html/stuff/man2html-slitaz.diff --- a/man2html/stuff/man2html-slitaz.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2357 +0,0 @@ ---- /dev/null -+++ b/Makefile -@@ -0,0 +1,89 @@ -+CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"gunzip"' `pkg-config --cflags --libs glib-2.0` -+# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 -+OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o -+bindir = $(DESTDIR)$(PREFIX)/usr/bin -+mandir = $(DESTDIR)$(PREFIX)/usr/share/man -+vardir = $(DESTDIR)$(PREFIX)/var -+httpdir = $(DESTDIR)$(PREFIX)/home/httpd -+cgidir = $(DESTDIR)$(PREFIX)/var/www -+sharedir = $(DESTDIR)$(PREFIX)/usr/share/man2html -+cgiowner = www -+cgigroup = www -+CC ?= gcc -+ -+all: man2html hman -+ -+man2html: $(OBJECTS) -+ $(CC) -o man2html $(OBJECTS) $(CFLAGS) -+ -+pot: -+ mkdir -p po -+ xgettext -o po/man2html.pot -k_ -kN_ \ -+ --package-name="man2html" \ -+ --from-code="UTF-8" \ -+ cgibase.c man2html.c hman.sh man.sh -+ -+msgmerge: -+ @for l in $(LINGUAS); do \ -+ echo -n "Updating $$l po file."; \ -+ msgmerge -U po/$$l.po po/man2html.pot; \ -+ done; -+ -+msgfmt: -+ @for l in $(LINGUAS); do \ -+ echo "Compiling $$l mo file..."; \ -+ mkdir -p po/mo/$$l/LC_MESSAGES; \ -+ msgfmt -o po/mo/$$l/LC_MESSAGES/man2html.mo po/$$l.po; \ -+ done; -+ -+ -+# man2html: ../src/version.h -+ -+# This installs the man2html utility -+install: man2html -+ mkdir -p $(bindir) -+ install -m 755 man2html $(bindir) -+ mkdir -p $(mandir)/man1 -+ install -m 644 man2html.1 $(mandir)/man1/man2html.1 -+ -+install-scripts: install-man-scripts install-glimpse-stuff install-hman -+ -+# These are the scripts that allow pointing a browser at -+# http://localhost/cgi-bin/man/man2html -+# to work. -+install-man-scripts: -+ mkdir -p $(cgidir) -+ mkdir -p $(sharedir) -+ install -m 755 scripts/cgi-bin/man/* $(cgidir) -+ install -m 644 scripts/cgi-aux/man/* $(sharedir) -+ install -d -o $(cgiowner) -g $(cgigroup) -m 775 $(vardir)/man2html -+# (aux was renamed to cgi-aux since aux causes problems under DOS) -+ -+# If you have installed glimpse, and have compressed man pages, -+# then perhaps you also want these filters. -+install-glimpse-stuff: -+ install -m 644 glimpse_filters $(vardir)/man2html/.glimpse_filters -+ -+# In order not to have to type a long command like -+# netscape http://localhost/cgi-bin/man/man2html?section+topic -+# or -+# lynx lynxcgi:/home/httpd/cgi-bin/man/man2html?section+topic -+# it is convenient to have some shell script as a wrapper. -+# The script hman can be aliased to man. It uses an environment -+# variable MANHTMLPAGER to find out which browser you use, and -+# you can set MANHTMLHOST if the pages are not on localhost. -+hman: hman.sh -+ rm -f hman -+ sed -e 's,%version%,1.6g-7,' hman.sh > hman -+ -+install-hman: hman -+ install -m 555 hman $(bindir)/hman -+ install -m 644 hman.1 $(mandir)/man1/hman.1 -+ -+clean: -+ rm -f core hman man2html $(OBJECTS) *~ -+ -+spotless: clean -+ rm -f Makefile -+ -+$(OBJECTS): defs.h ---- a/abbrev.c -+++ b/abbrev.c -@@ -27,7 +27,7 @@ - "SSO", "System Services Overview", - "TEXT", "Editing Text Files", - "DOCS", "Formatting Documents", -- "TROFF", "Using nroff and troff", -+ "TROFF", "Using nroff and troff", - "INDEX", "Global Index", - "CPG", "C Programmer's Guide", - "CREF", "C Reference Manual", -@@ -46,7 +46,7 @@ - "CGI", "SunCGI Reference Manual", - "CORE", "SunCore Reference Manual", - "4ASSY", "Sun-4 Assembly Language Reference", -- "SARCH", "SPARC Architecture Manual", -+ "SARCH", "SPARC Architecture Manual", - "KR", "The C Programming Language", - 0, 0 }; - ---- a/cgibase.c -+++ b/cgibase.c -@@ -8,6 +8,8 @@ - #include /* tolower() */ - #include /* strlen() */ - #include "defs.h" -+#include -+#include - - /* - * The default is to use cgibase. With relative html style -@@ -21,8 +23,8 @@ - * and uses lynx, and we use lynxcgi:/usr/lib/cgi-bin. - */ - --static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */ --static char *cgibase_format = "http://%s"; /* host.domain:port */ -+static char *man2htmlpath = ""; /* default */ -+static char *cgibase_format = "%s"; /* host.domain:port */ - static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */ - static char *cgibase = ""; /* default */ - -@@ -68,76 +70,46 @@ - relat_html_style = 1; - } - --/* What shall we say in case of relat_html_style? */ --static char *signature = "
\n" --"This document was created by\n" --"man2html,\n" --"using the manual pages.
\n" --"%s\n"; -- --#define TIMEFORMAT "%T GMT, %B %d, %Y" --#define TIMEBUFSZ 500 -- - void print_sig() - { -- char timebuf[TIMEBUFSZ]; -- struct tm *timetm; -- time_t now; -- -- timebuf[0] = 0; --#ifdef TIMEFORMAT -- sprintf(timebuf, "Time: "); -- now=time(NULL); -- timetm=gmtime(&now); -- strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm); -- timebuf[TIMEBUFSZ-1] = 0; --#endif -- printf(signature, cgibase, man2htmlpath, timebuf); -+ printf("\n
\n

%s

\n
\n", -+ _("This document was created by man2html using the manual pages.")); - } - - void - include_file_html(char *g) { -- printf("%s>", g,g); -+ printf("%s>", g,g); - } - - void - man_page_html(char *sec, char *h) { -- if (relat_html_style) { -- if (!h) -- printf("" -- "Return to Main Contents"); -- else -- printf("%s", -- sec, h, sec, h); -- } else { -- if (!h) -- printf("Return to Main Contents", -- cgibase, man2htmlpath); -- else if (!sec) -- printf("%s", -- cgibase, man2htmlpath, sep, h, h); -- else -- printf("%s", -- cgibase, man2htmlpath, sep, sec, h, h); -- } -+ if (!h) -+ printf("%s", -+ _("Return to Main Contents")); -+ else if (!sec) -+ printf("%s", -+ h, h); -+ else -+ printf("%s", -+ sec, h, h); - } - - void - ftp_html(char *f) { -- printf("%s", f, f); -+ printf("%s", f, f); - } - - void - www_html(char *f) { -- printf("%s", f, f); -+ printf("%s", f, f); - } - - void - mailto_html(char *g) { -- printf("%s", g, g); -+ printf("%s", g, g); - } - - void - url_html(char *g) { -- printf("%s", g, g); -+ printf("%s", g, g); - } ---- a/hman.sh -+++ b/hman.sh -@@ -8,99 +8,83 @@ - # Usage examples: - # hman - get start page - # hman man2html - get man page for man2html --# hman 7 locale - get section 7 man page for locale -+# hman 7 locale - get section 7 man page for locale - # hman 1 - section 1 index of names only - # hman 3 index - section 3 index names+descriptions - # hman -k editor - search all man pages for some string --# hman -P arena ./twm.man - specify browser; specify man page -+# hman -P arena ./twm.man - specify browser; specify man page - # --# hman from %version% -+# hman from 1.6g-7 - # - --if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then -- echo "`basename $0` from %version%" -+. /usr/lib/slitaz/httphelper.sh -+. /lib/libtaz.sh -+ -+# Internationalization -+export TEXTDOMAIN='man2html' -+_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; } -+ -+ -+if [ "$1" == '-v' ] || [ "$1" == '-V' ]; then -+ echo "$(basename $0) v. 1.6g-slitaz" - exit 0 - fi - - # The user has to set MANHTMLPAGER (or he will get httpd-free lynx). - # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ... --if [ x"$MANHTMLPAGER" = x ] && ! which lynx > /dev/null ; then -- HMAN_BROWSER=sensible-browser --else -- HMAN_BROWSER=${MANHTMLPAGER-lynxcgi} --fi -+HMAN_BROWSER="${MANHTMLPAGER:-tazweb}" - --# - # If the man pages are on a remote host, specify it in MANHTMLHOST. --HOST=${MANHTMLHOST-localhost} -+HOST=${MANHTMLHOST:-localhost} - - # Perhaps the browser was specified on the command line? --if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then -- HMAN_BROWSER="$2" -- shift; shift -+if [ "$#" -gt 1 ] && [ "$1" == '-P' ]; then -+ HMAN_BROWSER="$2" -+ shift; shift - fi - - # Perhaps the host was specified on the command line? --if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then -- HOST="$2" -- shift; shift -+if [ "$#" -gt 1 ] && [ "$1" == '-H' ]; then -+ HOST="$2" -+ shift; shift - fi - --# Interface to a live (already running) netscape browser. --nsfunc () { -- if ( /bin/ps xc | grep -q 'netscape$' ) ; then -- if [ -x netscape-remote ] ; then -- exec netscape-remote -remote "openURL($1,new_window)" -- else -- exec netscape -remote "openURL($1,new_window)" -- fi -- else -- netscape $1 & -- fi --} -+CGI="http://$HOST/man.cgi" - --urlencode() { -- echo "$@" | perl -pe 'chomp(); s/([^A-Za-z0-9\ \_\-\.\/])/"%" . unpack("H*", $1)/eg; tr/ /+/;' -+enc() { -+ echo "$@" | sed -e 's|+|%2B|g; s| |+|g'; - } - -- --case "$HMAN_BROWSER" in -- lynxcgi) -- HMAN_BROWSER=lynx -- CG="lynxcgi:/usr/lib/cgi-bin/man" -- ;; -- netscape) -- HMAN_BROWSER=nsfunc -- CG="http://$HOST/cgi-bin/man" -- ;; -- *) -- CG="http://$HOST/cgi-bin/man" -- ;; -+case "$#" in -+ 0) -+ $HMAN_BROWSER "$CGI";; -+ 1) -+ case "$1" in -+ 1|2|3|4|5|6|7|8|l|n) -+ $HMAN_BROWSER "$CGI?$1";; -+ /*) -+ $HMAN_BROWSER "$CGI?$(enc "$1")";; -+ */*) -+ $HMAN_BROWSER "$CGI?$(enc "$(realpath "$PWD/$1")")";; -+ *) -+ $HMAN_BROWSER "$CGI?$(enc "$1")";; -+ esac -+ ;; -+ 2) -+# case "$1" in -+# -k) -+# $HMAN_BROWSER "$CGI?search=$(enc "$2")";; -+# *) -+# if [ "$2" == 'index' ]; then -+# $HMAN_BROWSER "$CGI?whatis=$(enc "$1")" -+# else -+ $HMAN_BROWSER "$CGI?$(enc "$1 $2")" -+# fi -+# ;; -+# esac -+ ;; -+ *) -+ _ 'bad number of args';; - esac -- -- case "$#" in -- 0) $HMAN_BROWSER "$CG/man2html" ;; -- 1) case "$1" in -- 1|2|3|4|5|6|7|8|l|n) -- $HMAN_BROWSER "$CG/mansec?query=$1" ;; -- /*) -- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;; -- */*) -- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$PWD/$1"`" ;; -- *) -- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;; -- esac ;; -- 2) case "$1" in -- -k) -- $HMAN_BROWSER "$CG/mansearch?query=`urlencode "$2"`" ;; -- *) -- if [ "$2" = index ]; then -- $HMAN_BROWSER "$CG/manwhatis?query=`urlencode "$1"`" -- else -- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1 $2"`" -- fi ;; -- esac ;; -- *) echo "bad number of args" ;; -- esac - - exit 0 ---- /dev/null -+++ b/man.sh -@@ -0,0 +1,292 @@ -+#!/bin/sh -+# man2html cgi script - uses /usr/bin/man2html to format man pages -+# aeb@cwi.nl - 980109 -+# Aleksej Bobylev , 2015-2016 -+ -+. /usr/lib/slitaz/httphelper.sh -+. /lib/libtaz.sh -+ -+# Internationalization. -+[ -e /etc/locale.conf ] && . /etc/locale.conf -+export TEXTDOMAIN='man2html' -+export LANG LC_ALL -+_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; } -+ -+ -+SECTIONS="$(_ 'User Commands'):$(_ 'System Calls'):$(_ 'C Library Functions'):\ -+$(_ 'Devices and Network Interfaces'):$(_ 'File Formats'):\ -+$(_ 'Games and Demos'):$(_ 'Environments, Tables, and Troff Macros'):\ -+$(_ 'Maintenance Commands'):$(_ 'All available manual pages')" -+ -+query="$(GET query)" -+if [ -z "$query" ]; then -+ set -- $(echo $(GET) | tr '+' ' ') -+else -+ set -- $(echo $(GET query) | tr '+' ' ') -+fi -+ -+ -+if [ $1 == 'css' ]; then -+ # post css file on query -+ header 'Content-Type: text/css' -+ cat /usr/share/doc/slitaz-doc.css -+fi -+ -+if [ $# -eq 1 ]; then -+ case $1 in -+ 1|2|3|4|5|6|7|8|all) -+ if [ "$1" == 'all' ]; then -+ sec_n='9'; sec_folder='man?' -+ else -+ sec_n="$1"; sec_folder="man$1" -+ fi -+ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $sec_n) -+ header -+ cat < -+ -+ -+ $1. $sec_desc -+ -+ -+

$(_ 'Section %s: %s' $1 "$sec_desc")

-+
$(_ 'Manual Pages')
-+

-+EOT -+ -+ case $1 in -+ 1) _ "Section 1 of the manual describes user commands and tools, for example, file \ -+manipulation tools, shells, compilers, web browsers, file and image viewers and editors, and so \ -+on.";; -+ 2) _ "Section 2 of the manual describes the Linux system calls. A system call is \ -+an entry point into the Linux kernel.";; -+ 3) _ "Section 3 of the manual describes all library functions excluding the \ -+library functions (system call wrappers) described in Section 2, which implement system calls.";; -+ 4) _ "Section 4 of the manual describes special files (devices).";; -+ 5) _ "Section 5 of the manual describes various file formats, as well as the \ -+corresponding C structures, if any.";; -+ 6) _ "Section 6 of the manual describes all the games and funny little programs \ -+available on the system.";; -+ 7) _ "Section 7 of the manual provides overviews on various topics, and describes \ -+conventions and protocols, character set standards, the standard filesystem layout, and \ -+miscellaneous other things.";; -+ 8) _ "Section 8 of the manual describes commands which either can be or are used \ -+only by the superuser, like system-administration commands, daemons, and hardware-related \ -+commands.";; -+ esac -+ -+ [ "$1" != 'all' ] && echo "intro($1)" -+ echo '

' -+ -+ temp="$(mktemp)"; temp2="$(mktemp)" -+ for dir in $(find /usr/share/man -type d -name "$sec_folder"); do -+ ls $dir | sed 's|\.\([0-9]\)\.*[bgx]*z*2*$|:\1|' -+ # fix sorting 'feature': leading '_' always ignored by `sort` -+ done | sed 's|_|zzzzzzzz|g' | sort -fu | sed 's|zzzzzzzz|_|g' | \ -+ awk -F' ' -vtemp="$temp" -vtemp2="$temp2" ' -+ { -+ split($1, man, ":"); -+ -+ letter = tolower(substr(man[1], 1, 1)); -+ if (letter != last_letter) { -+ last_letter = letter; -+ letter_index[++num_letters] = letter; -+ print "

" toupper(letter) "

" > temp; -+ } -+ lnk = man[1]; gsub("+", "%2b", lnk); -+ printf "%s(%s) ", lnk, man[2], man[1], man[2] > temp; -+ } -+ END { -+ # Print out alphabetic quick index and other links -+ for (i = 1; i <= num_letters; i++) { -+ print "" toupper(letter_index[i]) "" > temp2; -+ } -+ } -+ ' -+ if [ -s "$temp" ]; then -+ echo '
'; cat "$temp2"; echo '
' -+ cat "$temp" -+ echo '
'; cat "$temp2"; echo '
' -+ fi -+ -+ rm -f "$temp" "$temp2" -+ -+ cat < -+
$(_ 'Sections')
-+
    -+EOT -+ for i in $(seq 8); do -+ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i) -+ echo "
  1. $sec_desc
  2. " -+ done -+ cat < -+

    $(_ 'All Sections')

    -+
-+ -+ -+ -+EOT -+ exit 0 -+ ;; -+ esac -+fi -+ -+# Find the required page - expect to be called with "man2html [sec] page". -+# There may a prefixed "-M manpath" option. -+ -+if [ $# -ge 2 -a "$1" == '-M' ]; then -+ MANPATH="$2" -+ export MANPATH -+ shift; shift -+ MP=' using the given MANPATH' -+else -+ MP='' -+fi -+ -+ -+# If no arguments given, show a start page. -+ -+if [ $# -eq 0 ]; then -+ header -+ cat < -+ -+ -+ -+ $(_ 'Manual Pages - Main Contents') -+ -+ -+ -+

$(_ 'Manual Pages - Main Contents')

-+
$(_ 'Name and Section lookup')
-+
-+ -+ -+
-+

$(_ "You can enter a program name, possibly preceded by the section, the directories to search \ -+(with -M) or a full name. For example:")

-+ -+
    -+
  • find
  • -+
  • 1 find
  • -+
  • -M /usr/share/man:/opt/man:/usr/local/share/man find
  • -+
  • /usr/share/man/man1/gperf.1
  • -+
-+
-+ -+
$(_ 'Index of pages')
-+ -+
    -+EOT -+ for i in $(seq 8); do -+ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i) -+ echo "
  1. $sec_desc
  2. " -+ done -+ cat < -+

    $(_ 'All Sections')

    -+
-+ -+ -+ -+ -+EOT -+ exit 0 -+fi -+ -+if [ $# -gt 2 ]; then -+ man2html -E "man2html: bad invocation: too many arguments" -+ exit 0 -+fi -+ -+# A single argument may be an explicitly give path name -+# Otherwise, find it -+ -+if [ $# -eq 1 ]; then -+ arg=${1//%2b/+} -+ case "$arg" in -+ /*) PAGE="$arg";; -+ *.*) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg" -o -name "$arg.gz" -o -name "$arg.bz2" -o -name "$arg.xz" \));; -+ *) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg.*" -o -name "$arg.*.gz" -o -name "$arg.*.bz2" -o -name "$arg.*.xz" \));; -+ esac -+else -+ arg=${2//%2b/+} -+ PAGE="$( -+ for dir in $(find /usr/share/man -type d -name man$1); do -+ find $dir \( -type f -o -type l \) -name "$arg.$1*" -+ done)" -+fi -+ -+if [ -z "$PAGE" ]; then -+ complaint="$(_ 'Cannot find a page')" -+ if [ $# -eq 1 ]; then -+ complaint="$(_ 'Cannot find a page for %s %s' $1 $MP)" -+ else -+ complaint="$(_ 'Cannot find a page for %s in section %s %s') $2 $1 $MP" -+ fi -+ man2html -E "

$complaint

" -+ exit 0 -+fi -+ -+if [ "$(echo "$PAGE" | wc -l)" -gt 1 ]; then -+ header -+ cat < -+$(_ 'Multiple pages') -+ -+

$(_ 'Multiple pages found')

-+
-+
    -+EOT -+ echo "$PAGE" | awk -F'/' '{ -+ if ($5 ~ "man") { -+ split($6, man, "."); -+ printf "
  • %s (%s)
  • \n", $0, man[1], man[2]; -+ } else { -+ split($7, man, "."); -+ printf "
  • %s (%s) — %s
  • \n", $0, man[1], man[2], $5; -+ } -+ }' -+ sed 's|^.*$|
  • &
  • |' -+ echo '
' -+ exit 0 -+fi -+ -+if [ -r "$PAGE" ]; then -+ tmpman="$(mktemp)" -+ # Unpack man page -+ case "$PAGE" in -+ *.gz) zcat "$PAGE" > "$tmpman";; -+ *.bz2) bzcat "$PAGE" > "$tmpman";; -+ *.xz) xzcat "$PAGE" > "$tmpman";; -+ *) cp "$PAGE" "$tmpman";; -+ esac -+ -+ # Check for link -+ line="$(fgrep -v '.\"' "$tmpman" | head -n1)" -+ case "$line" in -+ .so*) -+ link="$(echo "$line" | cut -d'/' -f2)" -+ header "HTTP/1.1 301 Moved Permanently" \ -+ "Location: ?$link" -+ ;; -+ *) -+ # Convert page to HTML -+ man2html "$tmpman" -+ ;; -+ esac -+ -+ # Clean -+ rm "$tmpman" -+else -+ man2html -E "Strange... Cannot find (or read) $PAGE." -+fi -+exit 0 ---- a/man2html.c -+++ b/man2html.c -@@ -21,14 +21,17 @@ - #include - #include - #include "defs.h" --#include "../src/version.h" -+#include "version.h" -+#include -+#include -+#define GETTEXT_PACKAGE "man2html" - - /* BSD mandoc Bd/Ed example(?) blocks */ - #define BD_LITERAL 1 - #define BD_INDENT 2 - - #define SIZE(a) (sizeof(a)/sizeof(*a)) --#define DOCTYPE "\n" -+#define DOCTYPE "\n" - #define CONTENTTYPE "Content-type: text/html; charset=UTF-8\n\n" - - static char NEWLINE[2]="\n"; -@@ -58,28 +61,13 @@ - - static char charb[3]; - --#ifdef GUNZIP --/* from src/utils.c */ --static int --is_shell_safe(const char *ss, int quoted) { -- char *bad = " ;'\\\"<>|"; -- char *p; - -- if (quoted) -- bad++; /* allow a space inside quotes */ -- for (p = bad; *p; p++) -- if (strchr(ss, *p)) -- return 0; -- return 1; --} --#endif -- - /* reads the entire manpage into buffer *buf and returns number of chars read */ - static int - read_manpage_into_buffer(char *path, char **buf) { - int compressed = 0; - FILE * f = NULL; -- char * ext; -+ /* char * ext; */ - int l = 0; - struct stat stbuf; - -@@ -94,26 +82,6 @@ - char * tmp = NULL; - char * command = NULL; - char * openpath = path; --#ifdef GUNZIP -- -- if (is_shell_safe(openpath, 1)) { -- ext = strrchr(openpath, '.'); -- compressed = (ext && !strcmp(ext, ".gz")); -- -- if (!compressed && stat(openpath, &stbuf)) { -- tmp = (char*) xmalloc(strlen(path) + 4); -- sprintf(tmp, "%s.gz", path); -- if ((compressed = !stat(tmp, &stbuf))) -- openpath = tmp; -- } -- } -- -- if (compressed) { -- command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4); -- sprintf(command, GUNZIP " '%s'", openpath); -- f = popen(command, "r"); -- } else --#endif - f = fopen(openpath, "r"); - - if (tmp) free(tmp); -@@ -170,7 +138,7 @@ - - h = chardef; - if (h->nr != V('*','*')) { -- printf("chardef corrupted\n"); -+ printf("%s\n", _("chardef corrupted")); - exit(1); - } - -@@ -216,7 +184,7 @@ - ** Add the links to the output. - ** At the moment the following are recognized: - ** -- ** name(*) -> ../man?/name.* -+ ** name(*) -> ?name.* - ** method://string -> method://string - ** www.host.name -> http://www.host.name - ** ftp.host.name -> ftp://ftp.host.name -@@ -453,8 +421,8 @@ - #define DL 1 - #define UL 2 - #define OL 3 --static char *dl_open[4] = { "", "
\n", "
    ", "
      " }; --static char *dl_close[4] = { "", "
\n", "", "" }; -+static char *dl_open[4] = { "", "
\n", "
    ", "
      " }; -+static char *dl_close[4] = { "", "
\n", "", "" }; - - static inline void - dl_begin(void) { -@@ -462,7 +430,7 @@ - out_html(dl_open[DL]); - dl_set[itemdepth]=DL; - } -- out_html("
"); -+ out_html("
"); - } - - static inline void -@@ -481,14 +449,14 @@ - itemdepth++; - if (itemdepth < SIZE(dl_set)) - dl_set[itemdepth]=noDL; -- out_html("
"); -+ out_html("
"); - } - - static inline void - dl_endlevel(void) { - if (itemdepth) { - dl_end(); -- out_html("
\n"); -+ out_html("
\n"); - itemdepth--; - } - } -@@ -538,12 +506,12 @@ - - #define FO0 "" - #define FC0 "" --#define FO1 "" --#define FC1 "" --#define FO2 "" --#define FC2 "" --#define FO3 "" --#define FC3 "" -+#define FO1 "" -+#define FC1 "" -+#define FO2 "" -+#define FC2 "" -+#define FO3 "" -+#define FC3 "" - - char *switchfont[16] = { "" , FC0 FO1, FC0 FO2, FC0 FO3, - FC1 FO0, "" , FC1 FO2, FC1 FO3, -@@ -588,14 +556,16 @@ - i=current_font; - sizebuf[0]=0; - strcat(sizebuf, change_to_font(0)); -- if (current_size) strcat(sizebuf, ""); -+ if (current_size) strcat(sizebuf, ""); - current_size=nr; - if (nr) { - int l; -- strcat(sizebuf, "0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr; - sizebuf[l++]=nr+'0'; -+ sizebuf[l++]='p'; -+ sizebuf[l++]='t'; - sizebuf[l++]='"'; - sizebuf[l++]='>'; - sizebuf[l]=0; -@@ -775,7 +745,7 @@ - skip_escape=exskipescape; - intresult=j; - break; -- case 'l': h="
"; curpos=0; -+ case 'l': h="
"; curpos=0; - case 'b': - case 'v': - case 'x': -@@ -812,7 +782,7 @@ - case 'c': no_newline_output=1; break; - case '{': newline_for_fun++; h="";break; - case '}': if (newline_for_fun) newline_for_fun--; h="";break; -- case 'p': h="
\n";curpos=0; break; -+ case 'p': h="
\n";curpos=0; break; - case 't': h="\t";curpos=(curpos+8)&0xfff8; break; - case '<': h="<";curpos++; break; - case '>': h=">";curpos++; break; -@@ -1021,7 +991,7 @@ - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; -- out_html(""); -+ out_html(""); - } - while (*h && *h!='\n') h++; - if (h[-1]==';') { -@@ -1197,45 +1167,45 @@ - currow=currow->prev; - } - /* produce html output */ -- if (center) out_html("
"); -- if (box==2) out_html("
"); -- out_html(""); -+ if (box==2) out_html(""); -+ out_html(""); - curfield=currow->first; - while (curfield) { - if (curfield->align!='S' && curfield->align!='^') { -- out_html("align) { - case 'N': - curfield->space+=4; - case 'R': -- out_html(" ALIGN=right"); -+ out_html(" style=\"text-align: right\""); - break; - case 'C': -- out_html(" ALIGN=center"); -+ out_html(" style=\"text-align: center\""); - default: - break; - } - if (!curfield->valign && curfield->rowspan>1) -- out_html(" VALIGN=center"); -+ out_html(" style=\"vertical-align: center\""); - if (curfield->colspan>1) { - char buf[5]; -- out_html(" COLSPAN="); -+ out_html(" colspan="); - sprintf(buf, "%i", curfield->colspan); - out_html(buf); - } - if (curfield->rowspan>1) { - char buf[5]; -- out_html(" ROWSPAN="); -+ out_html(" rowspan="); - sprintf(buf, "%i", curfield->rowspan); - out_html(buf); - } -@@ -1244,8 +1214,8 @@ - if (curfield->size) out_html(change_to_size(curfield->size)); - if (curfield->font) out_html(change_to_font(curfield->font)); - switch (curfield->align) { -- case '=': out_html("

"); break; -- case '_': out_html("
"); break; -+ case '=': out_html("

"); break; -+ case '_': out_html("
"); break; - default: - if (curfield->contents) out_html(curfield->contents); - break; -@@ -1255,20 +1225,20 @@ - if (curfield->font) out_html(change_to_font(0)); - if (curfield->size) out_html(change_to_size(0)); - if (j>=maxcol && curfield->align>'@' && curfield->align!='_') -- out_html("
"); -- out_html(""); -+ out_html("
"); -+ out_html(""); - } - curfield=curfield->next; - } -- out_html("
\n"); -+ out_html("\n"); - currow=currow->next; - } -- if (box && !border) out_html("
"); -+ out_html("
\n"); - currow=layout; - while (currow) { - j=0; -- out_html("
"); -- out_html("
"); -- if (box==2) out_html(""); -- if (center) out_html("
\n"); -+ if (box && !border) out_html(""); -+ out_html(""); -+ if (box==2) out_html(""); -+ if (center) out_html("\n"); - else out_html("\n"); -- if (!oldfillout) out_html("
");
-+    if (!oldfillout) out_html("
");
-     fillout=oldfillout;
-     out_html(change_to_size(oldsize));
-     out_html(change_to_font(oldfont));
-@@ -1401,7 +1371,7 @@
- 		case '&': value = (value && value2); break;
- 		case ':': value = (value || value2); break;
- 		default: fprintf(stderr,
--				 "man2html: Unknown operator %c.\n", oper);
-+				_("man2html: Unknown operator %c.\n"), oper);
- 		}
- 		oper=0;
- 	    }
-@@ -1489,42 +1459,42 @@
- 
- 
- char *section_list[] = {
--    "1", "User Commands ",
--    "1C", "User Commands",
--    "1G", "User Commands",
--    "1S", "User Commands",
--    "1V", "User Commands ",
--    "2", "System Calls",
--    "2V", "System Calls",
--    "3", "C Library Functions",
--    "3C", "Compatibility Functions",
--    "3F", "Fortran Library Routines",
--    "3K", "Kernel VM Library Functions",
--    "3L", "Lightweight Processes Library",
--    "3M", "Mathematical Library",
--    "3N", "Network Functions",
--    "3R", "RPC Services Library",
--    "3S", "Standard I/O Functions",
--    "3V", "C Library Functions",
--    "3X", "Miscellaneous Library Functions",
--    "4", "Devices and Network Interfaces",
--    "4F", "Protocol Families",
--    "4I", "Devices and Network Interfaces",
--    "4M", "Devices and Network Interfaces",
--    "4N", "Devices and Network Interfaces",
--    "4P", "Protocols",
--    "4S", "Devices and Network Interfaces",
--    "4V", "Devices and Network Interfaces",
--    "5", "File Formats",
--    "5V", "File Formats",
--    "6", "Games and Demos",
--    "7", "Environments, Tables, and Troff Macros",
--    "7V", "Environments, Tables, and Troff Macros",
--    "8", "Maintenance Commands",
--    "8C", "Maintenance Commands",
--    "8S", "Maintenance Commands",
--    "8V", "Maintenance Commands",
--    "L", "Local Commands",
-+    "1",  N_("User Commands"),
-+    "1C", N_("User Commands"),
-+    "1G", N_("User Commands"),
-+    "1S", N_("User Commands"),
-+    "1V", N_("User Commands"),
-+    "2",  N_("System Calls"),
-+    "2V", N_("System Calls"),
-+    "3",  N_("C Library Functions"),
-+    "3C", N_("Compatibility Functions"),
-+    "3F", N_("Fortran Library Routines"),
-+    "3K", N_("Kernel VM Library Functions"),
-+    "3L", N_("Lightweight Processes Library"),
-+    "3M", N_("Mathematical Library"),
-+    "3N", N_("Network Functions"),
-+    "3R", N_("RPC Services Library"),
-+    "3S", N_("Standard I/O Functions"),
-+    "3V", N_("C Library Functions"),
-+    "3X", N_("Miscellaneous Library Functions"),
-+    "4",  N_("Devices and Network Interfaces"),
-+    "4F", N_("Protocol Families"),
-+    "4I", N_("Devices and Network Interfaces"),
-+    "4M", N_("Devices and Network Interfaces"),
-+    "4N", N_("Devices and Network Interfaces"),
-+    "4P", N_("Protocols"),
-+    "4S", N_("Devices and Network Interfaces"),
-+    "4V", N_("Devices and Network Interfaces"),
-+    "5",  N_("File Formats"),
-+    "5V", N_("File Formats"),
-+    "6",  N_("Games and Demos"),
-+    "7",  N_("Environments, Tables, and Troff Macros"),
-+    "7V", N_("Environments, Tables, and Troff Macros"),
-+    "8",  N_("Maintenance Commands"),
-+    "8C", N_("Maintenance Commands"),
-+    "8S", N_("Maintenance Commands"),
-+    "8V", N_("Maintenance Commands"),
-+    "L",  N_("Local Commands"),
- /* for Solaris: 
-     "1", "User Commands",
-     "1B", "SunOS/BSD Compatibility Package Commands",
-@@ -1593,7 +1563,7 @@
-     "9s", "DDI and DKI Data Structures",
-     "L", "Local Commands",
- */
--    NULL, "Misc. Reference Manual Pages",
-+    NULL, N_("Misc. Reference Manual Pages"),
-     NULL, NULL
- };
- 
-@@ -1604,7 +1574,7 @@
- 
-     if (!c) return "";
-     while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
--    if (section_list[i+1]) return section_list[i+1];
-+    if (section_list[i+1]) return _(section_list[i+1]);
-     else return c;
- }
- 
-@@ -1636,10 +1606,10 @@
-     if (level != subs) {
- 	manidx_need(6);
- 	if (subs) {
--	    strcpy(manidx+mip, "\n");
-+	    strcpy(manidx+mip, "\n");
- 	    mip += 6;
- 	} else {
--	    strcpy(manidx+mip, "
\n"); -+ strcpy(manidx+mip, "
\n"); - mip += 5; - } - } -@@ -1647,7 +1617,7 @@ - - scan_troff(item, 1, &c); - manidx_need(100 + strlen(c)); -- sprintf(manidx+mip, "
%s
\n", label, c); -+ sprintf(manidx+mip, "
%s
\n", label, c); - if (c) free(c); - while (manidx[mip]) mip++; - } -@@ -1834,8 +1804,8 @@ - } - break; - case V('b','r'): -- if (still_dd) out_html("
"); -- else out_html("
\n"); -+ if (still_dd) out_html("
"); -+ else out_html("
\n"); - curpos=0; - c=c+j; - if (c[0] == escapesym) { c=scan_escape(c+1); } -@@ -1865,17 +1835,17 @@ - c=skip_till_newline(c); - /* center next i lines */ - if (i>0) { -- out_html("
\n"); -+ out_html("
\n"); - while (i && *c) { - char *line=NULL; - c=scan_troff(c,1, &line); -- if (line && strncmp(line, "
", 4)) { -+ if (line && strncmp(line, "
", 4)) { - out_html(line); -- out_html("
\n"); -+ out_html("
\n"); - i--; - } - } -- out_html("
\n"); -+ out_html("\n"); - curpos=0; - } - break; -@@ -1906,7 +1876,7 @@ - if (!fillout) { - out_html(change_to_font(0)); - out_html(change_to_size('0')); -- out_html("
\n"); -+ out_html("
\n"); - } - curpos=0; - fillout=1; -@@ -1981,7 +1951,7 @@ - if (fillout) { - out_html(change_to_font(0)); - out_html(change_to_size('0')); -- out_html("
\n");
-+		out_html("
\n");
- 	    }
- 	    curpos=0;
- 	    fillout=0;
-@@ -2002,7 +1972,7 @@
- 	    break;
- 	case V('s','p'):
- 	    c=c+j;
--	    if (fillout) out_html("

"); else { -+ if (fillout) out_html("

"); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2033,30 +2003,15 @@ - *c = 0; - scan_troff(h,1, &name); - if (name[3] == '/') h=name+3; else h=name; --#if NOCGI -- if (!out_length) { -- char *t,*s; -- t=strrchr(fname, '/'); -- if (!t) t=fname; -- fprintf(stderr, "ln -s %s.html %s.html\n", h, t); -- s=strrchr(t, '.');if (!s) s=t; -- printf(CONTENTTYPE DOCTYPE); -- printf(" Man page of %s\n" -- "\n" -- "See the man page for %s.\n" -- "\n", -- s, h, h); -- } else --#endif - { - /* this works alright, except for section 3 */ - if ((l = read_manpage_into_buffer(h, &buf)) < 0) { - fprintf(stderr, -- "man2html: unable to open or read file %s\n", h); -- out_html("

" -- "man2html: unable to open or read file\n"); -+ _("man2html: unable to open or read file %s\n"), h); -+ out_html("
"); -+ out_html(_("man2html: unable to open or read file\n")); - out_html(h); -- out_html("
\n"); -+ out_html("
\n"); - } else { - buf[0]=buf[l]='\n'; - buf[l+1]=buf[l+2]=0; -@@ -2085,7 +2040,7 @@ - #if 0 - dl_down(); - #endif -- out_html("
\n"); -+ out_html("
\n"); - c=c+j; - c=scan_expression(c, &j); - for (i=0; i"); -+ out_html("
"); - curpos = 0; - break; - case V('T','P'): -@@ -2172,7 +2127,7 @@ - /* somewhere a definition ends with '.TP' */ - if (!*c) still_dd=1; else { - c=scan_troff(c,1,NULL); -- out_html("
"); -+ out_html("
"); - } - curpos=0; - break; -@@ -2195,20 +2150,20 @@ - fprintf(idxfile,"\n"); - } - #endif -- out_html("' and '<' solves it, but creates - ** some space. A normal space does not work. - */ -- out_html("\">"); -+ out_html("\">"); - break; - case V('P',' '): - case V('P','\n'): - case V('L','P'): - case V('P','P'): - dl_end(); -- if (fillout) out_html("

\n"); else { -+ if (fillout) out_html("

\n"); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2272,19 +2227,29 @@ - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; -- out_html("

"); -+ out_html("
"); - } - trans_char(c,'"', '\a'); - add_to_index(mode, c); -- out_html(" \n

"); -- else out_html("\"> \n

"); -+ -+ if (mode) { -+ out_html("

"); -+ } else { -+ out_html("

\n\n
\n

"); -+ } -+ - mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0); - c = (mandoc_command ? scan_troff_mandoc : scan_troff)(c,1,NULL); -- if (mode) out_html("

\n"); -- else out_html("\n"); -+ -+ if (mode) -+ out_html("\n"); -+ else -+ out_html("\n"); -+ - curpos=0; - break; - case V('T','S'): -@@ -2315,7 +2280,7 @@ - int skip=0; - output_possible=1; - printf(CONTENTTYPE DOCTYPE); -- out_html("Man page of "); -+ out_html("<html><head>\n<meta charset=\"UTF-8\">\n<title>"); - scan_troff(wordlist[0], 0, &t); - /* we need to remove all html tags */ - for (s=q=t; *s; s++) { -@@ -2324,11 +2289,14 @@ - else if (!skip) *q++ = *s; - } - *q = '\0'; -- out_html(t); -+ char buff[256]; -+ sprintf(buff, _("Man page of %s"), t); -+ out_html(buff); - free(t); -- out_html("\n\n

"); -+ out_html("\n\n\n

"); - scan_troff(wordlist[0], 0, NULL); -- out_html("

\nSection: "); -+ out_html("

\n
\n"); -+ out_html(_("Section: ")); - if (words>4) - scan_troff(wordlist[4], 0, NULL); - else -@@ -2336,14 +2304,17 @@ - out_html(" ("); - scan_troff(wordlist[1], 0, NULL); - if (words>2) { -- out_html(")
Updated: "); -+ out_html(")
"); -+ out_html(_("Updated: ")); - scan_troff(wordlist[2], 1, NULL); - } else out_html(")"); -- out_html("
Index\n"); -+ out_html("
"); -+ out_html(_("Index")); -+ out_html("\n"); - man_page_html(0,0); /* Return to Main Contents */ - *sl='\n'; -- out_html("
\n"); -- if (mandoc_command) out_html("
BSD mandoc
"); -+ out_html("
\n"); -+ if (mandoc_command) out_html("
\nBSD mandoc
"); - } - c = sl+1; - } else -@@ -2507,7 +2478,7 @@ - dl_newlevel_type(DL); - if (nl) - *nl = t; -- if (fillout) out_html("

\n"); else { -+ if (fillout) out_html("

\n"); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2518,7 +2489,7 @@ - case V('E','l'): /* BSD mandoc */ - c=c+j; - dl_endlevel_type(); -- if (fillout) out_html("

\n"); else { -+ if (fillout) out_html("

\n"); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2528,7 +2499,7 @@ - case V('I','t'): /* BSD mandoc */ - c=c+j; - if (dl_type(DL)) { -- out_html("

"); -+ out_html("
"); - out_html(change_to_font('B')); - if (*c == '\n') { - /* Don't allow embedded comms after a newline */ -@@ -2543,9 +2514,9 @@ - if (inXo) - still_dd = 1; - else -- out_html("
"); -+ out_html("
"); - } else if (dl_type(UL) || dl_type(OL)) { -- out_html("
  • "); -+ out_html("
  • "); - c=scan_troff_mandoc(c,1,NULL); - out_html(NEWLINE); - } -@@ -2559,7 +2530,7 @@ - c=c+j; - if (inXo) { - if (still_dd) -- out_html("
    "); -+ out_html("
    "); - inXo = 0; - } - break; -@@ -2594,12 +2565,12 @@ - case V('D','l'): /* BSD mandoc */ - c=c+j; - out_html(NEWLINE); -- out_html("
    "); -+ out_html("
    "); - out_html(change_to_font('L')); - if (*c == '\n') c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); -- out_html("
    "); -+ out_html("
    "); - if (fillout) curpos++; else curpos=0; - break; - case V('B','d'): /* BSD mandoc */ -@@ -2615,14 +2586,14 @@ - mandoc_bd_options = 0; /* Remember options for terminating Bl */ - if (strstr(c, "-offset indent")) { - mandoc_bd_options |= BD_INDENT; -- out_html("
    \n"); -+ out_html("
    \n"); - } - if (strstr(c, "-literal") || strstr(c, "-unfilled")) { - if (fillout) { - mandoc_bd_options |= BD_LITERAL; - out_html(change_to_font(0)); - out_html(change_to_size('0')); -- out_html("
    \n");
    -+		       out_html("
    \n");
    - 		  }
    - 		  curpos=0;
    - 		  fillout=0;
    -@@ -2637,18 +2608,18 @@
    - 		  if (!fillout) {
    - 		       out_html(change_to_font(0));
    - 		       out_html(change_to_size('0'));
    --		       out_html("
    \n"); -+ out_html("
    \n"); - } - } - if (mandoc_bd_options & BD_INDENT) -- out_html("
    \n"); -+ out_html("
    \n"); - curpos=0; - fillout=1; - c=skip_till_newline(c); - break; - case V('B','e'): /* BSD mandoc */ - c=c+j; -- if (fillout) out_html("

    "); else { -+ if (fillout) out_html("

    "); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2715,7 +2686,7 @@ - if (fillout) curpos++; else curpos=0; - break; - case V('P','p'): /* BSD mandoc */ -- if (fillout) out_html("

    \n"); else { -+ if (fillout) out_html("

    \n"); else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } -@@ -2726,9 +2697,9 @@ - trans_char(c,'"','\a'); - c=c+j; - if (*c == '\n') c++; -- out_html("``"); -+ out_html("“"); - c=scan_troff_mandoc(c, 1, NULL); -- out_html("''"); -+ out_html("”"); - out_html(NEWLINE); - if (fillout) curpos++; else curpos=0; - break; -@@ -2800,12 +2771,22 @@ - trans_char(c,'"','\a'); - c=c+j; - if (*c == '\n') c++; -- out_html("`"); -+ out_html("‘"); - c=scan_troff_mandoc(c, 1, NULL); -- out_html("'"); -+ out_html("’"); - out_html(NEWLINE); - if (fillout) curpos++; else curpos=0; - break; -+ case V('A','q'): /* BSD mandoc */ -+ trans_char(c,'"','\a'); -+ c=c+j; -+ if (*c == '\n') c++; -+ out_html("⟨"); -+ c=scan_troff_mandoc(c, 1, NULL); -+ out_html("⟩"); -+ out_html(NEWLINE); -+ if (fillout) curpos++; else curpos=0; -+ break; - case V('A','r'): /* BSD mandoc */ - /* parse one line in italics */ - out_html(change_to_font('I')); -@@ -2855,7 +2836,7 @@ - */ - static int count = 0; /* Don't break on the first Nm */ - if (count) { -- out_html("
    "); -+ out_html("
    "); - } else { - char *end, t=0 /* just for gcc */; - end = strchr(c, '\n'); -@@ -3038,7 +3019,7 @@ - if (h[-1] == '\n' && still_dd && isalnum(*h)) { - /* sometimes a .HP request is not followed by a .br request */ - FLUSHIBP; -- out_html("

    "); -+ out_html("
    "); - curpos=0; - still_dd=0; - } -@@ -3108,12 +3089,12 @@ - curpos++; - } - } else { -- out_html(""); -+ out_html(""); - while (curpos < tabstops[curtab]) { - out_html(" "); - curpos++; - } -- out_html(""); -+ out_html(""); - } - } - } -@@ -3122,7 +3103,7 @@ - if (*h == ' ' && (h[-1] == '\n' || usenbsp)) { - FLUSHIBP; - if (!usenbsp && fillout) { -- out_html("
    "); -+ out_html("
    "); - curpos=0; - } - usenbsp=fillout; -@@ -3196,13 +3177,13 @@ - - switch(status) { - case 403: -- printf("Status: 403 Forbidden\n"); -+ printf("HTTP/1.1 403 Forbidden\n"); - break; - case 404: -- printf("Status: 404 Not Found\n"); -+ printf("HTTP/1.1 404 Not Found\n"); - break; - case 500: -- printf("Status: 500 Internal Server Error\n"); -+ printf("HTTP/1.1 500 Internal Server Error\n"); - break; - case 0: - default: -@@ -3210,12 +3191,13 @@ - } - - printf(CONTENTTYPE DOCTYPE); -- printf("%s\n" -- "\n

    %s

    \n", s, s); -+ printf("\n\n\n%s\n" -+ "\n\n" -+ "\n

    %s

    \n
    \n", s, s); - va_start(p, t); - vfprintf(stdout, t, p); - va_end(p); -- printf("\n"); -+ printf("
    \n\n"); - exit(0); - } - -@@ -3223,8 +3205,8 @@ - xstrdup(const char *s) { - char *p = strdup(s); - if (p == NULL) -- error_page(500, "Out of memory", -- "Sorry, out of memory, aborting...\n"); -+ error_page(500, _("Out of memory"), -+ _("Sorry, out of memory, aborting...\n")); - return p; - } - -@@ -3232,8 +3214,8 @@ - xmalloc(size_t size) { - void *p = malloc(size); - if (p == NULL) -- error_page(500, "Out of memory", -- "Sorry, out of memory, aborting...\n"); -+ error_page(500, _("Out of memory"), -+ _("Sorry, out of memory, aborting...\n")); - return p; - } - -@@ -3241,16 +3223,16 @@ - xrealloc(void *ptr, size_t size) { - void *p = realloc(ptr,size); - if (p == NULL) -- error_page(500, "Out of memory", -- "Sorry, out of memory, aborting...\n"); -+ error_page(500, _("Out of memory"), -+ _("Sorry, out of memory, aborting...\n")); - return p; - } - - static void - usage(void) { -- error_page(500, "man2html: bad invocation", -- "Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n" -- "or: man2html -r [filename]\n"); -+ error_page(500, _("man2html: bad invocation"), -+ _("Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n" -+ "or: man2html -r [filename]\n")); - } - - static void -@@ -3273,7 +3255,7 @@ - } - #if 0 - else /* complain or not - this need not be fatal */ -- error_page("Error", "man2html: could not chdir to %s", s); -+ error_page(_("Error"), _("man2html: could not chdir to %s"), s); - #endif - } - } -@@ -3291,6 +3273,11 @@ - */ - int - main(int argc, char **argv) { -+ setlocale (LC_ALL, ""); -+ bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale"); -+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); -+ textdomain (GETTEXT_PACKAGE); -+ - int l, c; - char *buf, *filename, *fnam = NULL; - -@@ -3309,7 +3296,7 @@ - case 'D': - goto_dir(optarg, 0, 0); break; - case 'E': -- error_page(0, "Error", "%s", optarg); break; -+ error_page(0, _("Error"), "%s", optarg); break; - case 'h': - set_cgibase("localhost"); break; - case 'H': -@@ -3362,7 +3349,7 @@ - - l = read_manpage_into_buffer(fnam, &buf); - if (l < 0) -- error_page(404, "File not found", "Could not open %s\n", fname); -+ error_page(404, _("File not found"), _("Could not open %s\n"), fname); - - buf[0] = '\n'; - buf[l+1] = '\n'; -@@ -3379,34 +3366,34 @@ - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; -- out_html(""); -+ out_html(""); - } - out_html(NEWLINE); - if (output_possible) { - /*   for mosaic users */ - if (manidx) { -- printf("
    \n 

    Index

    \n
    \n"); -+ printf("
  • \n\n
    \n

    %s

    \n\n
    \n", _("Index")); - manidx[mip]=0; - printf("%s", manidx); -- if (subs) printf("
    \n"); -- printf("\n"); -+ if (subs) printf("\n"); -+ printf("\n"); - } - print_sig(); -- printf("\n\n"); -+ printf("\n\n"); - } else { - if (!filename) - filename = fname; - if (*filename == '/') -- error_page(403, "Invalid Man Page", -- "The requested file %s is not a valid (unformatted) " -+ error_page(403, _("Invalid Man Page"), -+ _("The requested file %s is not a valid (unformatted) " - "man page.\nIf the file is a formatted man page, " - "you could try to load the\n" -- "plain file.\n", -+ "plain file.\n"), - filename, filename); - else -- error_page(403, "Invalid Man Page", -- "The requested file %s is not a valid (unformatted) " -- "man page.", filename); -+ error_page(403, _("Invalid Man Page"), -+ _("The requested file %s is not a valid (unformatted) " -+ "man page."), filename); - } - if (idxfile) - fclose(idxfile); ---- a/scripts/cgi-bin/man/man2html -+++ b/scripts/cgi-bin/man/man2html -@@ -8,11 +8,11 @@ - - # Do we need lynxcgi URLs? For the moment our criterion is - # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. --AGENT="${HTTP_USER_AGENT-unknown}" -+AGENT="${HTTP_USER_AGENT:-unknown}" - - case "$AGENT" in - Lynx*|lynx*) -- HH="${HTTP_HOST-nohh}" -+ HH="${HTTP_HOST:-nohh}" - SED="s/%lynx //" - ;; - *) -@@ -21,7 +21,7 @@ - ;; - esac - --SERVER="${SERVER_NAME-localhost}" -+SERVER="${SERVER_NAME:-localhost}" - case "$HH" in - nohh) - LL="-l" ---- a/scripts/cgi-bin/man/mansearch -+++ b/scripts/cgi-bin/man/mansearch -@@ -7,11 +7,11 @@ - - # Do we need lynxcgi URLs? For the moment our criterion is - # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. --AGENT="${HTTP_USER_AGENT-unknown}" -+AGENT="${HTTP_USER_AGENT:-unknown}" - - case "$AGENT" in - Lynx*|lynx*) -- HH="${HTTP_HOST-nohh}" -+ HH="${HTTP_HOST:-nohh}" - SED="s/%lynx //" - ;; - *) -@@ -20,7 +20,7 @@ - ;; - esac - --SERVER="${SERVER_NAME-localhost}" -+SERVER="${SERVER_NAME:-localhost}" - case "$HH" in - nohh) - CG="lynxcgi:/usr/lib/cgi-bin/man" ---- a/scripts/cgi-bin/man/mansearchhelp -+++ b/scripts/cgi-bin/man/mansearchhelp -@@ -4,17 +4,17 @@ - - # Do we need lynxcgi URLs? For the moment our criterion is - # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. --AGENT="${HTTP_USER_AGENT-unknown}" -+AGENT="${HTTP_USER_AGENT:-unknown}" - case "$AGENT" in - Lynx*|lynx*) -- HH="${HTTP_HOST-nohh}" -+ HH="${HTTP_HOST:-nohh}" - ;; - *) - HH=nolynx - ;; - esac - --SERVER="${SERVER_NAME-localhost}" -+SERVER="${SERVER_NAME:-localhost}" - case "$HH" in - nohh) - CG="lynxcgi:/usr/lib/cgi-bin/man" ---- a/strdefs.c -+++ b/strdefs.c -@@ -27,266 +27,333 @@ - { V('.','V'), 1, 0, NULL }, /* the me package tests for this */ - { 0, 0, 0, NULL } }; - -+ -+/* Characters written according to http://mdocml.bsd.lv/man/mandoc_char.7.html */ -+ - static STRDEF standardstring[] = { -- { V('<','='), 2, "<=", NULL }, /* less equal */ -- { V('>','='), 2, ">=;", NULL }, /* greather equal */ -- { V('A','m'), 1, "&", NULL }, /* infinity */ -- { V('B','a'), 1, "|", NULL }, /* vartical bar */ -- { V('G','e'), 2, ">=;", NULL }, /* greather equal */ -- { V('G','t'), 1, ">", NULL }, /* greather than */ -- { V('I','f'), 1, "∞", NULL }, /* infinity */ -- { V('L','e'), 2, "<=", NULL }, /* less equal */ -- { V('L','q'), 1, "“", NULL }, /* left double quote */ -- { V('L','t'), 1, "<", NULL }, /* less than */ -- { V('N','a'), 3, "NaN", NULL }, /* not a number */ -- { V('N','e'), 2, "!=", NULL }, /* not equal */ -- { V('P','i'), 2, "Pi", NULL }, /* pi */ -- { V('P','m'), 1, "±", NULL }, /* plus minus */ -- { V('R',' '), 1, "®", NULL }, -- { V('R','q'), 1, "”", NULL }, /* right double quote */ -- { V('a','a'), 1, "'", NULL }, /* accute accent */ -- { V('g','a'), 1, "`", NULL }, /* grave accent */ -- { V('l','q'), 2, "``", NULL }, -- { V('q',' '), 1, """, NULL }, /* straight double quote */ -- { V('r','q'), 2, "''", NULL }, -- { V('u','a'), 1, "^", NULL }, /* upwards arrow */ -+ { V('<','='), 1, "≤", NULL }, /* less-than-equal */ -+ { V('>','='), 1, "≥", NULL }, /* greater-than-equal */ -+ { V('A','i'), 4, "ANSI", NULL }, /* ANSI standard name */ -+ { V('A','m'), 1, "&", NULL }, /* ampersand */ -+ { V('B','a'), 1, "|", NULL }, /* vertical bar */ -+ { V('G','e'), 1, "≥", NULL }, /* greater-than-equal */ -+ { V('G','t'), 1, ">", NULL }, /* greater-than */ -+ { V('I','f'), 8, "infinity", NULL }, /* infinity */ -+ { V('L','e'), 1, "≤", NULL }, /* less-than-equal */ -+ { V('L','q'), 1, "“", NULL }, /* left-double-quote */ -+ { V('L','t'), 1, "<", NULL }, /* less-than */ -+ { V('N','a'), 3, "NaN", NULL }, /* NaN */ -+ { V('N','e'), 1, "≠", NULL }, /* not equal */ -+ { V('P','i'), 2, "pi", NULL }, /* pi */ -+ { V('P','m'), 1, "±", NULL }, /* plus-minus */ -+ { V('P','x'), 5, "POSIX", NULL }, /* POSIX standard name */ -+ { V('R',' '), 1, "®", NULL }, /* restricted mark */ -+ { V('R','q'), 1, "”", NULL }, /* right-double-quote */ -+ { V('T','m'), 4, "(Tm)", NULL }, /* trade mark */ -+ { V('a','a'), 1, "´", NULL }, /* acute */ -+ { V('g','a'), 1, "`", NULL }, /* grave */ -+ { V('l','p'), 1, "(", NULL }, /* left-parenthesis */ -+ { V('l','q'), 1, "“", NULL }, /* left double-quote */ -+ { V('q',' '), 1, """, NULL }, /* double-quote */ -+ { V('r','p'), 1, ")", NULL }, /* right-parenthesis */ -+ { V('r','q'), 1, "”", NULL }, /* right double-quote */ -+ { V('u','a'), 1, "↑", NULL }, /* up-arrow */ -+ { V('v','a'), 1, "↕", NULL }, /* up-down arrow */ - { 0, 0, NULL, NULL} - }; - - static STRDEF standardchar[] = { -- { V('*','*'), 1, "*", NULL }, /* math star */ -- { V('*','A'), 1, "Α", NULL }, -- { V('*','B'), 1, "Β", NULL }, -- { V('*','C'), 1, "Ξ", NULL }, -- { V('*','D'), 1, "Δ", NULL }, -- { V('*','E'), 1, "Ε", NULL }, -- { V('*','F'), 1, "Φ", NULL }, -- { V('*','G'), 1, "Γ", NULL }, -- { V('*','H'), 1, "Θ", NULL }, -- { V('*','I'), 1, "Ι", NULL }, -- { V('*','K'), 1, "Κ", NULL }, -- { V('*','L'), 1, "Λ", NULL }, -- { V('*','M'), 1, "Μ", NULL }, -- { V('*','N'), 1, "Ν", NULL }, -- { V('*','O'), 1, "Ο", NULL }, -- { V('*','P'), 1, "Π", NULL }, -- { V('*','Q'), 1, "Ψ", NULL }, -- { V('*','R'), 1, "Ρ", NULL }, -- { V('*','S'), 1, "Σ", NULL }, -- { V('*','T'), 1, "Τ", NULL }, -- { V('*','U'), 1, "Υ", NULL }, -- { V('*','W'), 1, "Ω", NULL }, -- { V('*','X'), 1, "Χ", NULL }, -- { V('*','Y'), 1, "Η", NULL }, -- { V('*','Z'), 1, "Ζ", NULL }, -- { V('*','a'), 1, "α", NULL }, -- { V('*','b'), 1, "β", NULL }, -- { V('*','c'), 1, "ξ", NULL }, -- { V('*','d'), 1, "δ", NULL }, -- { V('*','e'), 1, "ε", NULL }, -- { V('*','f'), 1, "φ", NULL }, -- { V('*','g'), 1, "γ", NULL }, -- { V('*','h'), 1, "θ", NULL }, -- { V('*','i'), 1, "ι", NULL }, -- { V('*','k'), 1, "κ", NULL }, -- { V('*','l'), 1, "λ", NULL }, -- { V('*','m'), 1, "μ", NULL }, -- { V('*','n'), 1, "ν", NULL }, -- { V('*','o'), 1, "ο", NULL }, -- { V('*','p'), 1, "π", NULL }, -- { V('*','q'), 1, "ψ", NULL }, -- { V('*','r'), 1, "ρ", NULL }, -- { V('*','s'), 1, "σ", NULL }, -- { V('*','t'), 1, "τ", NULL }, -- { V('*','u'), 1, "υ", NULL }, -- { V('*','w'), 1, "ω", NULL }, -- { V('*','x'), 1, "χ", NULL }, -- { V('*','y'), 1, "η", NULL }, -- { V('*','z'), 1, "ζ", NULL }, -- { V('\'','A'), 1, "Á", NULL }, -- { V('\'','E'), 1, "É", NULL }, -- { V('\'','I'), 1, "Í", NULL }, -- { V('\'','O'), 1, "Ó", NULL }, -- { V('\'','U'), 1, "Ú", NULL }, -- { V('\'','Y'), 1, "Ý", NULL }, -- { V('\'','a'), 1, "á", NULL }, -- { V('\'','e'), 1, "é", NULL }, -- { V('\'','i'), 1, "í", NULL }, -- { V('\'','o'), 1, "ó", NULL }, -- { V('\'','u'), 1, "ú", NULL }, -- { V('\'','y'), 1, "ý", NULL }, -- { V('!','='), 1, "≠", NULL }, -- { V('%','0'), 1, "‰", NULL }, -- { V('+','-'), 1, "±", NULL }, -- { V(',','C'), 1, "Ç", NULL }, -- { V(',','c'), 1, "ç", NULL }, -- { V('-','>'), 1, "→", NULL }, -- { V('-','D'), 1, "Ð", NULL }, -- { V('.','i'), 1, "ı", NULL }, -- { V('/','L'), 1, "Ł", NULL }, -- { V('/','O'), 1, "Ø", NULL }, -- { V('/','l'), 1, "ł", NULL }, -- { V('/','o'), 1, "ø", NULL }, -- { V('1','2'), 1, "½", NULL }, -- { V('1','4'), 1, "¼", NULL }, -- { V('3','4'), 1, "¾", NULL }, -- { V(':','A'), 1, "Ä", NULL }, -- { V(':','E'), 1, "Ë", NULL }, -- { V(':','I'), 1, "Ï", NULL }, -- { V(':','O'), 1, "Ö", NULL }, -- { V(':','U'), 1, "Ü", NULL }, -- { V(':','a'), 1, "ä", NULL }, -- { V(':','e'), 1, "ë", NULL }, -- { V(':','i'), 1, "ï", NULL }, -- { V(':','o'), 1, "ö", NULL }, -- { V(':','u'), 1, "ü", NULL }, -- { V(':','y'), 1, "ÿ", NULL }, -- { V('<','-'), 1, "←", NULL }, -- { V('<','='), 1, "≤", NULL }, -- { V('<','>'), 1, "↔", NULL }, -- { V('=','='), 1, "≡", NULL }, -- { V('=','~'), 1, "≅", NULL }, -- { V('>','='), 1, "≥", NULL }, -- { V('A','E'), 1, "Æ", NULL }, -- { V('A','h'), 1, "&alepfsym;", NULL }, -- { V('C','R'), 1, "␍", NULL }, -- { V('C','s'), 1, "¤", NULL }, -- { V('D','o'), 1, "$", NULL }, -- { V('E','u'), 1, "€", NULL }, -- { V('F','c'), 1, "»", NULL }, -- { V('F','i'), 3, "ffi", NULL }, -- { V('F','l'), 3, "ffl", NULL }, -- { V('F','o'), 1, "«", NULL }, -- { V('O','E'), 1, "Œ", NULL }, -- { V('P','o'), 1, "£", NULL }, -- { V('S','1'), 1, "¹", NULL }, -- { V('S','2'), 1, "²", NULL }, -- { V('S','3'), 1, "³", NULL }, -- { V('S','d'), 1, "ð", NULL }, -- { V('T','P'), 1, "Þ", NULL }, -- { V('T','p'), 1, "þ", NULL }, -- { V('Y','e'), 1, "¥", NULL }, -- { V('^','A'), 1, "Â", NULL }, -- { V('^','E'), 1, "Ê", NULL }, -- { V('^','I'), 1, "Î", NULL }, -- { V('^','O'), 1, "Ô", NULL }, -- { V('^','U'), 1, "Û", NULL }, -- { V('^','a'), 1, "â", NULL }, -- { V('^','e'), 1, "ê", NULL }, -- { V('^','i'), 1, "î", NULL }, -- { V('^','o'), 1, "ô", NULL }, -- { V('^','u'), 1, "û", NULL }, -- { V('`','A'), 1, "À", NULL }, -- { V('`','E'), 1, "È", NULL }, -- { V('`','I'), 1, "Ì", NULL }, -- { V('`','O'), 1, "Ò", NULL }, -- { V('`','U'), 1, "Ù", NULL }, -- { V('`','a'), 1, "à", NULL }, -- { V('`','e'), 1, "è", NULL }, -- { V('`','i'), 1, "ì", NULL }, -- { V('`','o'), 1, "ò", NULL }, -- { V('`','u'), 1, "ù", NULL }, -- { V('a','a'), 1, "´", NULL }, -- { V('a','e'), 1, "æ", NULL }, -- { V('a','p'), 1, "≈", NULL }, -- { V('a','q'), 1, "'", NULL }, -- { V('a','t'), 1, "@", NULL }, -- { V('a','~'), 1, "~", NULL }, -- { V('b','a'), 1, "|", NULL }, -- { V('b','b'), 1, "|", NULL }, -- { V('b','r'), 1, "|", NULL }, -- { V('b','r'), 1, "|", NULL }, -- { V('b','u'), 1, "•", NULL }, -- { V('b','v'), 1, "|", NULL }, -- { V('c','*'), 1, "⊗", NULL }, -- { V('c','+'), 1, "⊕", NULL }, -- { V('c','i'), 1, "○", NULL }, -- { V('c','o'), 1, "©", NULL }, -- { V('c','q'), 1, "'", NULL }, -- { V('c','t'), 1, "¢", NULL }, -- { V('d','A'), 1, "⇓", NULL }, -- { V('d','a'), 1, "↓", NULL }, -- { V('d','d'), 1, "=", NULL }, -- { V('d','e'), 1, "°", NULL }, -- { V('d','g'), 1, "-", NULL }, -- { V('d','i'), 1, "÷", NULL }, -- { V('d','q'), 1, """, NULL }, -- { V('e','m'), 3, "---", NULL }, /* em dash */ -- { V('e','n'), 1, "-", NULL }, /* en dash */ -- { V('e','q'), 1, "=", NULL }, -- { V('e','s'), 1, "Ø", NULL }, -- { V('e','u'), 1, "€", NULL }, -- { V('f','/'), 1, "⁄", NULL }, -- { V('f','c'), 1, "›", NULL }, -- { V('f','f'), 2, "ff", NULL }, -- { V('f','i'), 2, "fi", NULL }, -- { V('f','l'), 2, "fl", NULL }, -- { V('f','m'), 1, "´", NULL }, -- { V('f','o'), 1, "‹", NULL }, -- { V('g','a'), 1, "`", NULL }, -- { V('h','A'), 1, "⇔", NULL }, -- { V('h','y'), 1, "-", NULL }, -- { V('i','f'), 1, "∞", NULL }, -- { V('i','s'), 8, "Integral", NULL }, /* integral sign */ -- { V('l','A'), 1, "⇐", NULL }, -- { V('l','B'), 1, "[", NULL }, -- { V('l','C'), 1, "{", NULL }, -- { V('l','a'), 1, "<", NULL }, -- { V('l','b'), 1, "[", NULL }, -- { V('l','c'), 2, "|¯", NULL }, -- { V('l','f'), 2, "|_", NULL }, -- { V('l','h'), 1, "☚", NULL }, -- { V('l','k'), 1, "{", NULL }, -- { V('l','q'), 1, "\"", NULL }, -- { V('l','z'), 1, "◊", NULL }, -- { V('m','c'), 1, "µ", NULL }, -- { V('m','i'), 1, "-", NULL }, -- { V('m','u'), 1, "×", NULL }, -- { V('n','o'), 1, "¬", NULL }, -- { V('o','A'), 1, "Å", NULL }, -- { V('o','a'), 1, "å", NULL }, -- { V('o','e'), 1, "œ", NULL }, -- { V('o','q'), 1, "'", NULL }, -- { V('o','r'), 1, "|", NULL }, -- { V('p','d'), 1, "d", NULL }, /* partial derivative */ -- { V('p','l'), 1, "+", NULL }, -- { V('p','s'), 1, "¶", NULL }, -- { V('r','!'), 1, "¡", NULL }, -- { V('r','?'), 1, "¿", NULL }, -- { V('r','A'), 1, "⇒", NULL }, -- { V('r','B'), 1, "]", NULL }, -- { V('r','C'), 1, "}", NULL }, -- { V('r','a'), 1, ">", NULL }, -- { V('r','c'), 2, "¯|", NULL }, -- { V('r','f'), 2, "_|", NULL }, -- { V('r','g'), 1, "®", NULL }, -- { V('r','h'), 1, "☛", NULL }, -- { V('r','k'), 1, "}", NULL }, -- { V('r','n'), 1, "¯", NULL }, -- { V('r','q'), 1, "\"", NULL }, -- { V('r','s'), 1, "\\", NULL }, -- { V('r','u'), 1, "_", NULL }, -- { V('s','c'), 1, "§", NULL }, -- { V('s','h'), 1, "#", NULL }, -- { V('s','l'), 1, "/", NULL }, -- { V('s','q'), 1, "□", NULL }, -- { V('s','s'), 1, "ß", NULL }, -- { V('t','f'), 1, "∴", NULL }, -- { V('t','i'), 1, "~", NULL }, -- { V('t','m'), 1, "™", NULL }, -- { V('t','s'), 1, "s", NULL }, /* should be terminal sigma */ -- { V('u','A'), 1, "⇑", NULL }, -- { V('u','a'), 1, "↑", NULL }, -- { V('u','l'), 1, "_", NULL }, -- { V('~','A'), 1, "Ã", NULL }, -- { V('~','N'), 1, "Ñ", NULL }, -- { V('~','O'), 1, "Õ", NULL }, -- { V('~','a'), 1, "ã", NULL }, -- { V('~','n'), 1, "ñ", NULL }, -- { V('~','o'), 1, "õ", NULL }, -+ { V('*','*'), 1, "∗", NULL }, /* asterisk */ -+ { V('*','A'), 1, "Α", NULL }, /* Alpha */ -+ { V('*','B'), 1, "Β", NULL }, /* Beta */ -+ { V('*','C'), 1, "Ξ", NULL }, /* Xi */ -+ { V('*','D'), 1, "Δ", NULL }, /* Delta */ -+ { V('*','E'), 1, "Ε", NULL }, /* Epsilon */ -+ { V('*','F'), 1, "Φ", NULL }, /* Phi */ -+ { V('*','G'), 1, "Γ", NULL }, /* Gamma */ -+ { V('*','H'), 1, "Θ", NULL }, /* Theta */ -+ { V('*','I'), 1, "Ι", NULL }, /* Iota */ -+ { V('*','K'), 1, "Κ", NULL }, /* Kappa */ -+ { V('*','L'), 1, "Λ", NULL }, /* Lambda */ -+ { V('*','M'), 1, "Μ", NULL }, /* Mu */ -+ { V('*','N'), 1, "Ν", NULL }, /* Nu */ -+ { V('*','O'), 1, "Ο", NULL }, /* Omicron */ -+ { V('*','P'), 1, "Π", NULL }, /* Pi */ -+ { V('*','Q'), 1, "Ψ", NULL }, /* Psi */ -+ { V('*','R'), 1, "Ρ", NULL }, /* Rho */ -+ { V('*','S'), 1, "Σ", NULL }, /* Sigma */ -+ { V('*','T'), 1, "Τ", NULL }, /* Tau */ -+ { V('*','U'), 1, "Υ", NULL }, /* Upsilon */ -+ { V('*','W'), 1, "Ω", NULL }, /* Omega */ -+ { V('*','X'), 1, "Χ", NULL }, /* Chi */ -+ { V('*','Y'), 1, "Η", NULL }, /* Eta */ -+ { V('*','Z'), 1, "Ζ", NULL }, /* Zeta */ -+ { V('*','a'), 1, "α", NULL }, /* alpha */ -+ { V('*','b'), 1, "β", NULL }, /* beta */ -+ { V('*','c'), 1, "ξ", NULL }, /* xi */ -+ { V('*','d'), 1, "δ", NULL }, /* delta */ -+ { V('*','e'), 1, "ε", NULL }, /* epsilon */ -+ { V('*','f'), 1, "φ", NULL }, /* phi */ -+ { V('*','g'), 1, "γ", NULL }, /* gamma */ -+ { V('*','h'), 1, "θ", NULL }, /* theta */ -+ { V('*','i'), 1, "ι", NULL }, /* iota */ -+ { V('*','k'), 1, "κ", NULL }, /* kappa */ -+ { V('*','l'), 1, "λ", NULL }, /* lambda */ -+ { V('*','m'), 1, "μ", NULL }, /* mu */ -+ { V('*','n'), 1, "ν", NULL }, /* nu */ -+ { V('*','o'), 1, "ο", NULL }, /* omicron */ -+ { V('*','p'), 1, "π", NULL }, /* pi */ -+ { V('*','q'), 1, "ψ", NULL }, /* psi */ -+ { V('*','r'), 1, "ρ", NULL }, /* rho */ -+ { V('*','s'), 1, "σ", NULL }, /* sigma */ -+ { V('*','t'), 1, "τ", NULL }, /* tau */ -+ { V('*','u'), 1, "υ", NULL }, /* upsilon */ -+ { V('*','w'), 1, "ω", NULL }, /* omega */ -+ { V('*','x'), 1, "χ", NULL }, /* chi */ -+ { V('*','y'), 1, "η", NULL }, /* eta */ -+ { V('*','z'), 1, "ζ", NULL }, /* zeta */ -+ { V('\'','A'), 1, "Á", NULL }, /* acute A */ -+ { V('\'','E'), 1, "É", NULL }, /* acute E */ -+ { V('\'','I'), 1, "Í", NULL }, /* acute I */ -+ { V('\'','O'), 1, "Ó", NULL }, /* acute O */ -+ { V('\'','U'), 1, "Ú", NULL }, /* acute U */ -+ { V('\'','Y'), 1, "Ý", NULL }, /* Yacute (*) */ -+ { V('\'','a'), 1, "á", NULL }, /* acute a */ -+ { V('\'','e'), 1, "é", NULL }, /* acute e */ -+ { V('\'','i'), 1, "í", NULL }, /* acute i */ -+ { V('\'','o'), 1, "ó", NULL }, /* acute o */ -+ { V('\'','u'), 1, "ú", NULL }, /* acute u */ -+ { V('\'','y'), 1, "ý", NULL }, /* yacute (*) */ -+ { V('!','='), 1, "≠", NULL }, /* not equal */ -+ { V('%','0'), 1, "‰", NULL }, /* per-thousand */ -+ { V('+','-'), 1, "±", NULL }, /* plus-minus */ -+ { V('+','e'), 1, "ϵ", NULL }, /* epsilon variant */ -+ { V('+','f'), 1, "φ", NULL }, /* phi variant */ -+ { V('+','h'), 1, "ϑ", NULL }, /* theta variant */ -+ { V('+','p'), 1, "ϖ", NULL }, /* pi variant */ -+ { V(',','C'), 1, "Ç", NULL }, /* cedilla C */ -+ { V(',','c'), 1, "ç", NULL }, /* cedilla c */ -+ { V('-','+'), 1, "∓", NULL }, /* minus-plus */ -+ { V('-','>'), 1, "→", NULL }, /* right arrow */ -+ { V('-','D'), 1, "Ð", NULL }, /* Eth */ -+ { V('-','h'), 1, "ℏ", NULL }, /* Planck constant over 2π */ -+ { V('.','i'), 1, "ı", NULL }, /* dotless i */ -+ { V('.','j'), 1, "ȷ", NULL }, /* dotless j */ -+ { V('/','L'), 1, "Ł", NULL }, /* stroke L */ -+ { V('/','O'), 1, "Ø", NULL }, /* stroke O */ -+ { V('/','_'), 1, "∠", NULL }, /* angle */ -+ { V('/','l'), 1, "ł", NULL }, /* stroke l */ -+ { V('/','o'), 1, "ø", NULL }, /* stroke o */ -+ { V('1','2'), 1, "½", NULL }, /* 1/2 (*) */ -+ { V('1','4'), 1, "¼", NULL }, /* 1/4 (*) */ -+ { V('3','4'), 1, "¾", NULL }, /* 3/4 (*) */ -+ { V('3','d'), 1, "∴", NULL }, /* therefore */ -+ { V(':','A'), 1, "Ä", NULL }, /* dieresis A */ -+ { V(':','E'), 1, "Ë", NULL }, /* dieresis E */ -+ { V(':','I'), 1, "Ï", NULL }, /* dieresis I */ -+ { V(':','O'), 1, "Ö", NULL }, /* dieresis O */ -+ { V(':','U'), 1, "Ü", NULL }, /* dieresis U */ -+ { V(':','a'), 1, "ä", NULL }, /* dieresis a */ -+ { V(':','e'), 1, "ë", NULL }, /* dieresis e */ -+ { V(':','i'), 1, "ï", NULL }, /* dieresis i */ -+ { V(':','o'), 1, "ö", NULL }, /* dieresis o */ -+ { V(':','u'), 1, "ü", NULL }, /* dieresis u */ -+ { V(':','y'), 1, "ÿ", NULL }, /* dieresis y */ -+ { V('<','-'), 1, "←", NULL }, /* left arrow */ -+ { V('<','<'), 1, "≪", NULL }, /* much less */ -+ { V('<','='), 1, "≤", NULL }, /* less-than-equal */ -+ { V('<','>'), 1, "↔", NULL }, /* left-right arrow */ -+ { V('=','='), 1, "≡", NULL }, /* equivalent */ -+ { V('=','~'), 1, "≅", NULL }, /* approximately equal */ -+ { V('>','='), 1, "≥", NULL }, /* greater-than-equal */ -+ { V('>','>'), 1, "≫", NULL }, /* much greater */ -+ { V('A','E'), 1, "Æ", NULL }, /* AE ligature */ -+ { V('A','N'), 1, "∧", NULL }, /* logical and */ -+ { V('A','h'), 1, "ℵ", NULL }, /* aleph */ -+ { V('B','q'), 1, "„", NULL }, /* right low double-quote */ -+ { V('C','R'), 1, "↵", NULL }, /* carriage return */ -+ { V('C','s'), 1, "¤", NULL }, /* Scandinavian */ -+ { V('D','o'), 1, "$", NULL }, /* dollar */ -+ { V('E','u'), 1, "€", NULL }, /* Euro symbol */ -+ { V('F','c'), 1, "»", NULL }, /* right guillemet */ -+ { V('F','i'), 1, "ffi", NULL }, /* ffi ligature */ -+ { V('F','l'), 1, "ffl", NULL }, /* ffl ligature */ -+ { V('F','n'), 1, "ƒ", NULL }, /* florin */ -+ { V('F','o'), 1, "«", NULL }, /* left guillemet */ -+ { V('I','J'), 1, "IJ", NULL }, /* IJ ligature */ -+ { V('I','m'), 1, "ℑ", NULL }, /* imaginary */ -+ { V('O','E'), 1, "Œ", NULL }, /* OE ligature */ -+ { V('O','K'), 1, "✓", NULL }, /* check mark */ -+ { V('O','R'), 1, "∨", NULL }, /* logical or */ -+ { V('P','o'), 1, "£", NULL }, /* pound */ -+ { V('R','e'), 1, "ℜ", NULL }, /* real */ -+ { V('S','1'), 1, "¹", NULL }, /* sup1 (*) */ -+ { V('S','2'), 1, "²", NULL }, /* sup2 (*) */ -+ { V('S','3'), 1, "³", NULL }, /* sup3 (*) */ -+ { V('S','d'), 1, "ð", NULL }, /* eth */ -+ { V('T','P'), 1, "Þ", NULL }, /* Thorn */ -+ { V('T','p'), 1, "þ", NULL }, /* thorn */ -+ { V('Y','e'), 1, "¥", NULL }, /* yen */ -+ { V('^','A'), 1, "Â", NULL }, /* circumflex A */ -+ { V('^','E'), 1, "Ê", NULL }, /* circumflex E */ -+ { V('^','I'), 1, "Î", NULL }, /* circumflex I */ -+ { V('^','O'), 1, "Ô", NULL }, /* circumflex O */ -+ { V('^','U'), 1, "Û", NULL }, /* circumflex U */ -+ { V('^','a'), 1, "â", NULL }, /* circumflex a */ -+ { V('^','e'), 1, "ê", NULL }, /* circumflex e */ -+ { V('^','i'), 1, "î", NULL }, /* circumflex i */ -+ { V('^','o'), 1, "ô", NULL }, /* circumflex o */ -+ { V('^','u'), 1, "û", NULL }, /* circumflex u */ -+ { V('`','A'), 1, "À", NULL }, /* grave A */ -+ { V('`','E'), 1, "È", NULL }, /* grave E */ -+ { V('`','I'), 1, "Ì", NULL }, /* grave I */ -+ { V('`','O'), 1, "Ò", NULL }, /* grave O */ -+ { V('`','U'), 1, "Ù", NULL }, /* grave U */ -+ { V('`','a'), 1, "à", NULL }, /* grave a */ -+ { V('`','e'), 1, "è", NULL }, /* grave e */ -+ { V('`','i'), 1, "ì", NULL }, /* grave i */ -+ { V('`','o'), 1, "ò", NULL }, /* grave o */ -+ { V('`','u'), 1, "ù", NULL }, /* grave u */ -+ { V('a','"'), 1, "˝", NULL }, /* Hungarian umlaut */ -+ { V('a','-'), 1, "¯", NULL }, /* macron */ -+ { V('a','.'), 1, "˙", NULL }, /* dotted */ -+ { V('a','^'), 1, "^", NULL }, /* circumflex */ -+ { V('a','a'), 1, "´", NULL }, /* acute */ -+ { V('a','b'), 1, "˘", NULL }, /* breve */ -+ { V('a','c'), 1, "¸", NULL }, /* cedilla */ -+ { V('a','d'), 1, "¨", NULL }, /* dieresis */ -+ { V('a','e'), 1, "æ", NULL }, /* ae ligature */ -+ { V('a','h'), 1, "ˇ", NULL }, /* caron */ -+ { V('a','o'), 1, "˚", NULL }, /* ring */ -+ { V('a','p'), 1, "∼", NULL }, /* tilde operator */ -+ { V('a','q'), 1, "'", NULL }, /* apostrophe quote (text) */ -+ { V('a','t'), 1, "@", NULL }, /* at */ -+ { V('a','~'), 1, "~", NULL }, /* tilde */ -+ { V('b','a'), 1, "|", NULL }, /* bar */ -+ { V('b','b'), 1, "¦", NULL }, /* broken bar */ -+ { V('b','r'), 1, "│", NULL }, /* box rule */ -+ { V('b','q'), 1, "‚", NULL }, /* right low single-quote */ -+ { V('b','u'), 1, "•", NULL }, /* bullet */ -+ { V('b','v'), 1, "⎪", NULL }, /* brace extension */ -+ { V('c','*'), 1, "⊗", NULL }, /* circle-multiply */ -+ { V('c','+'), 1, "⊕", NULL }, /* circle-plus */ -+ { V('c','a'), 1, "∩", NULL }, /* intersection */ -+ { V('c','i'), 1, "○", NULL }, /* circle */ -+ { V('c','o'), 1, "©", NULL }, /* copyright */ -+ { V('c','q'), 1, "’", NULL }, /* right single-quote */ -+ { V('c','t'), 1, "¢", NULL }, /* cent */ -+ { V('c','u'), 1, "∪", NULL }, /* union */ -+ { V('d','A'), 1, "⇓", NULL }, /* down double-arrow */ -+ { V('d','a'), 1, "↓", NULL }, /* down arrow */ -+ { V('d','d'), 1, "‡", NULL }, /* double dagger */ -+ { V('d','e'), 1, "°", NULL }, /* degree */ -+ { V('d','g'), 1, "†", NULL }, /* dagger */ -+ { V('d','i'), 1, "÷", NULL }, /* divide */ -+ { V('d','q'), 1, "\"", NULL }, /* double quote (text) */ -+ { V('e','m'), 1, "—", NULL }, /* em-dash */ -+ { V('e','n'), 1, "–", NULL }, /* en-dash */ -+ { V('e','q'), 1, "=", NULL }, /* equal */ -+ { V('e','s'), 1, "∅", NULL }, /* empty set */ -+ { V('e','u'), 1, "€", NULL }, /* Euro symbol */ -+ { V('f','/'), 1, "⁄", NULL }, /* fraction */ -+ { V('f','a'), 1, "∀", NULL }, /* universal quantifier */ -+ { V('f','c'), 1, "›", NULL }, /* right single guillemet */ -+ { V('f','f'), 1, "ff", NULL }, /* ff ligature */ -+ { V('f','i'), 1, "fi", NULL }, /* fi ligature */ -+ { V('f','l'), 1, "fl", NULL }, /* fl ligature */ -+ { V('f','m'), 1, "′", NULL }, /* minute */ -+ { V('f','o'), 1, "‹", NULL }, /* left single guillemet */ -+ { V('g','a'), 1, "`", NULL }, /* grave */ -+ { V('g','r'), 1, "∇", NULL }, /* gradient */ -+ { V('h','A'), 1, "⇔", NULL }, /* left-right double-arrow */ -+ { V('h','a'), 1, "^", NULL }, /* hat (text) */ -+ { V('h','o'), 1, "˛", NULL }, /* ogonek */ -+ { V('h','y'), 1, "‐", NULL }, /* hyphen */ -+ { V('i','b'), 1, "⊆", NULL }, /* reflexive subset */ -+ { V('i','f'), 1, "∞", NULL }, /* infinity */ -+ { V('i','j'), 1, "ij", NULL }, /* ij ligature */ -+ { V('i','p'), 1, "⊇", NULL }, /* reflexive superset */ -+ { V('i','s'), 1, "∫", NULL }, /* integral */ -+ { V('l','A'), 1, "⇐", NULL }, /* left double-arrow */ -+ { V('l','B'), 1, "[", NULL }, /* left bracket */ -+ { V('l','C'), 1, "{", NULL }, /* left brace */ -+ { V('l','a'), 1, "⟨", NULL }, /* left angle */ -+ { V('l','b'), 1, "⎩", NULL }, /* bottom-left hooked brace */ -+ { V('l','c'), 1, "⌈", NULL }, /* left-ceiling */ -+ { V('l','f'), 1, "⌊", NULL }, /* left-floor */ -+ { V('l','h'), 1, "☜", NULL }, /* left hand */ -+ { V('l','k'), 1, "⎨", NULL }, /* mid-left hooked brace */ -+ { V('l','q'), 1, "“", NULL }, /* left double-quote */ -+ { V('l','t'), 1, "⎧", NULL }, /* top-left hooked brace */ -+ { V('l','z'), 1, "◊", NULL }, /* lozenge */ -+ { V('m','c'), 1, "µ", NULL }, /* micro */ -+ { V('m','i'), 1, "−", NULL }, /* minus */ -+ { V('m','o'), 1, "∈", NULL }, /* element */ -+ { V('m','u'), 1, "×", NULL }, /* multiply */ -+ { V('n','b'), 1, "⊄", NULL }, /* not subset */ -+ { V('n','c'), 1, "⊅", NULL }, /* not superset */ -+ { V('n','e'), 1, "≢", NULL }, /* not equivalent */ -+ { V('n','m'), 1, "∉", NULL }, /* not element */ -+ { V('n','o'), 1, "¬", NULL }, /* logical not */ -+ { V('o','A'), 1, "Å", NULL }, /* ring A */ -+ { V('o','a'), 1, "å", NULL }, /* ring a */ -+ { V('o','e'), 1, "œ", NULL }, /* oe ligature */ -+ { V('o','q'), 1, "‘", NULL }, /* left single-quote */ -+ { V('o','r'), 1, "|", NULL }, /* bitwise or */ -+ { V('p','c'), 1, "·", NULL }, /* center-dot */ -+ { V('p','d'), 1, "∂", NULL }, /* partial differential */ -+ { V('p','l'), 1, "+", NULL }, /* plus */ -+ { V('p','p'), 1, "⊥", NULL }, /* perpendicular */ -+ { V('p','s'), 1, "¶", NULL }, /* paragraph */ -+ { V('p','t'), 1, "∝", NULL }, /* proportionate */ -+ { V('r','!'), 1, "¡", NULL }, /* upside-down exclamation */ -+ { V('r','?'), 1, "¿", NULL }, /* upside-down question */ -+ { V('r','A'), 1, "⇒", NULL }, /* right double-arrow */ -+ { V('r','B'), 1, "]", NULL }, /* right bracket */ -+ { V('r','C'), 1, "}", NULL }, /* right brace */ -+ { V('r','a'), 1, "⟩", NULL }, /* right angle */ -+ { V('r','b'), 1, "⎭", NULL }, /* bottom-right hooked brace */ -+ { V('r','c'), 1, "⌉", NULL }, /* right-ceiling */ -+ { V('r','f'), 1, "⌋", NULL }, /* right-floor */ -+ { V('r','g'), 1, "®", NULL }, /* registered */ -+ { V('r','h'), 1, "☞", NULL }, /* right hand */ -+ { V('r','k'), 1, "⎬", NULL }, /* mid-right hooked brace */ -+ { V('r','l'), 1, "‾", NULL }, /* overline */ -+ { V('r','n'), 1, "‾", NULL }, /* overline */ -+ { V('r','q'), 1, "”", NULL }, /* right double-quote */ -+ { V('r','s'), 1, "\\", NULL }, /* backward slash */ -+ { V('r','t'), 1, "⎫", NULL }, /* top-left hooked brace */ -+ { V('r','u'), 1, "_", NULL }, /* (*) */ -+ { V('s','b'), 1, "⊂", NULL }, /* proper subset */ -+ { V('s','c'), 1, "§", NULL }, /* section */ -+ { V('s','d'), 1, "″", NULL }, /* second */ -+ { V('s','h'), 1, "#", NULL }, /* hash (pound) */ -+ { V('s','l'), 1, "/", NULL }, /* forward slash */ -+ { V('s','p'), 1, "⊃", NULL }, /* proper superset */ -+ { V('s','q'), 1, "□", NULL }, /* white square */ -+ { V('s','r'), 1, "√", NULL }, /* square root */ -+ { V('s','s'), 1, "ß", NULL }, /* German eszett */ -+ { V('s','t'), 1, "∋", NULL }, /* such that */ -+ { V('t','e'), 1, "∃", NULL }, /* existential quantifier */ -+ { V('t','f'), 1, "∴", NULL }, /* therefore */ -+ { V('t','i'), 1, "~", NULL }, /* tilde (text) */ -+ { V('t','m'), 1, "™", NULL }, /* trademarked */ -+ { V('t','s'), 1, "ς", NULL }, /* sigma terminal */ -+ { V('u','A'), 1, "⇑", NULL }, /* up double-arrow */ -+ { V('u','a'), 1, "↑", NULL }, /* up arrow */ -+ { V('u','l'), 1, "_", NULL }, /* underscore */ -+ { V('v','A'), 1, "⇕", NULL }, /* up-down double-arrow */ -+ { V('v','a'), 1, "↕", NULL }, /* up-down arrow */ -+ { V('|','='), 1, "≃", NULL }, /* asymptotically equal */ -+ { V('~','='), 1, "≈", NULL }, /* almost equal */ -+ { V('~','A'), 1, "Ã", NULL }, /* tilde A */ -+ { V('~','N'), 1, "Ñ", NULL }, /* tilde N */ -+ { V('~','O'), 1, "Õ", NULL }, /* tilde O */ -+ { V('~','a'), 1, "ã", NULL }, /* tilde a */ -+ { V('~','n'), 1, "ñ", NULL }, /* tilde n */ -+ { V('~','o'), 1, "õ", NULL }, /* tilde o */ -+ { V('~','~'), 1, "≈", NULL }, /* almost equal */ - { 0, 0, NULL, NULL } -- -- - }; - - void stdinit(void) { ---- /dev/null -+++ b/version.h -@@ -0,0 +1 @@ -+#define version "1.6g-7-slitaz" diff -r c7b121a4ffd9 -r d6378d455338 man2html/stuff/patches/man2html-slitaz.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man2html/stuff/patches/man2html-slitaz.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2357 @@ +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,89 @@ ++CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"gunzip"' `pkg-config --cflags --libs glib-2.0` ++# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 ++OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o ++bindir = $(DESTDIR)$(PREFIX)/usr/bin ++mandir = $(DESTDIR)$(PREFIX)/usr/share/man ++vardir = $(DESTDIR)$(PREFIX)/var ++httpdir = $(DESTDIR)$(PREFIX)/home/httpd ++cgidir = $(DESTDIR)$(PREFIX)/var/www ++sharedir = $(DESTDIR)$(PREFIX)/usr/share/man2html ++cgiowner = www ++cgigroup = www ++CC ?= gcc ++ ++all: man2html hman ++ ++man2html: $(OBJECTS) ++ $(CC) -o man2html $(OBJECTS) $(CFLAGS) ++ ++pot: ++ mkdir -p po ++ xgettext -o po/man2html.pot -k_ -kN_ \ ++ --package-name="man2html" \ ++ --from-code="UTF-8" \ ++ cgibase.c man2html.c hman.sh man.sh ++ ++msgmerge: ++ @for l in $(LINGUAS); do \ ++ echo -n "Updating $$l po file."; \ ++ msgmerge -U po/$$l.po po/man2html.pot; \ ++ done; ++ ++msgfmt: ++ @for l in $(LINGUAS); do \ ++ echo "Compiling $$l mo file..."; \ ++ mkdir -p po/mo/$$l/LC_MESSAGES; \ ++ msgfmt -o po/mo/$$l/LC_MESSAGES/man2html.mo po/$$l.po; \ ++ done; ++ ++ ++# man2html: ../src/version.h ++ ++# This installs the man2html utility ++install: man2html ++ mkdir -p $(bindir) ++ install -m 755 man2html $(bindir) ++ mkdir -p $(mandir)/man1 ++ install -m 644 man2html.1 $(mandir)/man1/man2html.1 ++ ++install-scripts: install-man-scripts install-glimpse-stuff install-hman ++ ++# These are the scripts that allow pointing a browser at ++# http://localhost/cgi-bin/man/man2html ++# to work. ++install-man-scripts: ++ mkdir -p $(cgidir) ++ mkdir -p $(sharedir) ++ install -m 755 scripts/cgi-bin/man/* $(cgidir) ++ install -m 644 scripts/cgi-aux/man/* $(sharedir) ++ install -d -o $(cgiowner) -g $(cgigroup) -m 775 $(vardir)/man2html ++# (aux was renamed to cgi-aux since aux causes problems under DOS) ++ ++# If you have installed glimpse, and have compressed man pages, ++# then perhaps you also want these filters. ++install-glimpse-stuff: ++ install -m 644 glimpse_filters $(vardir)/man2html/.glimpse_filters ++ ++# In order not to have to type a long command like ++# netscape http://localhost/cgi-bin/man/man2html?section+topic ++# or ++# lynx lynxcgi:/home/httpd/cgi-bin/man/man2html?section+topic ++# it is convenient to have some shell script as a wrapper. ++# The script hman can be aliased to man. It uses an environment ++# variable MANHTMLPAGER to find out which browser you use, and ++# you can set MANHTMLHOST if the pages are not on localhost. ++hman: hman.sh ++ rm -f hman ++ sed -e 's,%version%,1.6g-7,' hman.sh > hman ++ ++install-hman: hman ++ install -m 555 hman $(bindir)/hman ++ install -m 644 hman.1 $(mandir)/man1/hman.1 ++ ++clean: ++ rm -f core hman man2html $(OBJECTS) *~ ++ ++spotless: clean ++ rm -f Makefile ++ ++$(OBJECTS): defs.h +--- a/abbrev.c ++++ b/abbrev.c +@@ -27,7 +27,7 @@ + "SSO", "System Services Overview", + "TEXT", "Editing Text Files", + "DOCS", "Formatting Documents", +- "TROFF", "Using nroff and troff", ++ "TROFF", "Using nroff and troff", + "INDEX", "Global Index", + "CPG", "C Programmer's Guide", + "CREF", "C Reference Manual", +@@ -46,7 +46,7 @@ + "CGI", "SunCGI Reference Manual", + "CORE", "SunCore Reference Manual", + "4ASSY", "Sun-4 Assembly Language Reference", +- "SARCH", "SPARC Architecture Manual", ++ "SARCH", "SPARC Architecture Manual", + "KR", "The C Programming Language", + 0, 0 }; + +--- a/cgibase.c ++++ b/cgibase.c +@@ -8,6 +8,8 @@ + #include /* tolower() */ + #include /* strlen() */ + #include "defs.h" ++#include ++#include + + /* + * The default is to use cgibase. With relative html style +@@ -21,8 +23,8 @@ + * and uses lynx, and we use lynxcgi:/usr/lib/cgi-bin. + */ + +-static char *man2htmlpath = "/cgi-bin/man/man2html"; /* default */ +-static char *cgibase_format = "http://%s"; /* host.domain:port */ ++static char *man2htmlpath = ""; /* default */ ++static char *cgibase_format = "%s"; /* host.domain:port */ + static char *cgibase_ll_format = "lynxcgi:%s"; /* directory */ + static char *cgibase = ""; /* default */ + +@@ -68,76 +70,46 @@ + relat_html_style = 1; + } + +-/* What shall we say in case of relat_html_style? */ +-static char *signature = "
    \n" +-"This document was created by\n" +-"man2html,\n" +-"using the manual pages.
    \n" +-"%s\n"; +- +-#define TIMEFORMAT "%T GMT, %B %d, %Y" +-#define TIMEBUFSZ 500 +- + void print_sig() + { +- char timebuf[TIMEBUFSZ]; +- struct tm *timetm; +- time_t now; +- +- timebuf[0] = 0; +-#ifdef TIMEFORMAT +- sprintf(timebuf, "Time: "); +- now=time(NULL); +- timetm=gmtime(&now); +- strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm); +- timebuf[TIMEBUFSZ-1] = 0; +-#endif +- printf(signature, cgibase, man2htmlpath, timebuf); ++ printf("
    \n
    \n

    %s

    \n
    \n", ++ _("This document was created by man2html using the manual pages.")); + } + + void + include_file_html(char *g) { +- printf("%s>", g,g); ++ printf("%s>", g,g); + } + + void + man_page_html(char *sec, char *h) { +- if (relat_html_style) { +- if (!h) +- printf("" +- "Return to Main Contents"); +- else +- printf("%s", +- sec, h, sec, h); +- } else { +- if (!h) +- printf("Return to Main Contents", +- cgibase, man2htmlpath); +- else if (!sec) +- printf("%s", +- cgibase, man2htmlpath, sep, h, h); +- else +- printf("%s", +- cgibase, man2htmlpath, sep, sec, h, h); +- } ++ if (!h) ++ printf("%s", ++ _("Return to Main Contents")); ++ else if (!sec) ++ printf("%s", ++ h, h); ++ else ++ printf("%s", ++ sec, h, h); + } + + void + ftp_html(char *f) { +- printf("%s", f, f); ++ printf("%s", f, f); + } + + void + www_html(char *f) { +- printf("%s", f, f); ++ printf("%s", f, f); + } + + void + mailto_html(char *g) { +- printf("%s", g, g); ++ printf("%s", g, g); + } + + void + url_html(char *g) { +- printf("%s", g, g); ++ printf("%s", g, g); + } +--- a/hman.sh ++++ b/hman.sh +@@ -8,99 +8,83 @@ + # Usage examples: + # hman - get start page + # hman man2html - get man page for man2html +-# hman 7 locale - get section 7 man page for locale ++# hman 7 locale - get section 7 man page for locale + # hman 1 - section 1 index of names only + # hman 3 index - section 3 index names+descriptions + # hman -k editor - search all man pages for some string +-# hman -P arena ./twm.man - specify browser; specify man page ++# hman -P arena ./twm.man - specify browser; specify man page + # +-# hman from %version% ++# hman from 1.6g-7 + # + +-if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then +- echo "`basename $0` from %version%" ++. /usr/lib/slitaz/httphelper.sh ++. /lib/libtaz.sh ++ ++# Internationalization ++export TEXTDOMAIN='man2html' ++_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; } ++ ++ ++if [ "$1" == '-v' ] || [ "$1" == '-V' ]; then ++ echo "$(basename $0) v. 1.6g-slitaz" + exit 0 + fi + + # The user has to set MANHTMLPAGER (or he will get httpd-free lynx). + # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ... +-if [ x"$MANHTMLPAGER" = x ] && ! which lynx > /dev/null ; then +- HMAN_BROWSER=sensible-browser +-else +- HMAN_BROWSER=${MANHTMLPAGER-lynxcgi} +-fi ++HMAN_BROWSER="${MANHTMLPAGER:-tazweb}" + +-# + # If the man pages are on a remote host, specify it in MANHTMLHOST. +-HOST=${MANHTMLHOST-localhost} ++HOST=${MANHTMLHOST:-localhost} + + # Perhaps the browser was specified on the command line? +-if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then +- HMAN_BROWSER="$2" +- shift; shift ++if [ "$#" -gt 1 ] && [ "$1" == '-P' ]; then ++ HMAN_BROWSER="$2" ++ shift; shift + fi + + # Perhaps the host was specified on the command line? +-if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then +- HOST="$2" +- shift; shift ++if [ "$#" -gt 1 ] && [ "$1" == '-H' ]; then ++ HOST="$2" ++ shift; shift + fi + +-# Interface to a live (already running) netscape browser. +-nsfunc () { +- if ( /bin/ps xc | grep -q 'netscape$' ) ; then +- if [ -x netscape-remote ] ; then +- exec netscape-remote -remote "openURL($1,new_window)" +- else +- exec netscape -remote "openURL($1,new_window)" +- fi +- else +- netscape $1 & +- fi +-} ++CGI="http://$HOST/man.cgi" + +-urlencode() { +- echo "$@" | perl -pe 'chomp(); s/([^A-Za-z0-9\ \_\-\.\/])/"%" . unpack("H*", $1)/eg; tr/ /+/;' ++enc() { ++ echo "$@" | sed -e 's|+|%2B|g; s| |+|g'; + } + +- +-case "$HMAN_BROWSER" in +- lynxcgi) +- HMAN_BROWSER=lynx +- CG="lynxcgi:/usr/lib/cgi-bin/man" +- ;; +- netscape) +- HMAN_BROWSER=nsfunc +- CG="http://$HOST/cgi-bin/man" +- ;; +- *) +- CG="http://$HOST/cgi-bin/man" +- ;; ++case "$#" in ++ 0) ++ $HMAN_BROWSER "$CGI";; ++ 1) ++ case "$1" in ++ 1|2|3|4|5|6|7|8|l|n) ++ $HMAN_BROWSER "$CGI?$1";; ++ /*) ++ $HMAN_BROWSER "$CGI?$(enc "$1")";; ++ */*) ++ $HMAN_BROWSER "$CGI?$(enc "$(realpath "$PWD/$1")")";; ++ *) ++ $HMAN_BROWSER "$CGI?$(enc "$1")";; ++ esac ++ ;; ++ 2) ++# case "$1" in ++# -k) ++# $HMAN_BROWSER "$CGI?search=$(enc "$2")";; ++# *) ++# if [ "$2" == 'index' ]; then ++# $HMAN_BROWSER "$CGI?whatis=$(enc "$1")" ++# else ++ $HMAN_BROWSER "$CGI?$(enc "$1 $2")" ++# fi ++# ;; ++# esac ++ ;; ++ *) ++ _ 'bad number of args';; + esac +- +- case "$#" in +- 0) $HMAN_BROWSER "$CG/man2html" ;; +- 1) case "$1" in +- 1|2|3|4|5|6|7|8|l|n) +- $HMAN_BROWSER "$CG/mansec?query=$1" ;; +- /*) +- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;; +- */*) +- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$PWD/$1"`" ;; +- *) +- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;; +- esac ;; +- 2) case "$1" in +- -k) +- $HMAN_BROWSER "$CG/mansearch?query=`urlencode "$2"`" ;; +- *) +- if [ "$2" = index ]; then +- $HMAN_BROWSER "$CG/manwhatis?query=`urlencode "$1"`" +- else +- $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1 $2"`" +- fi ;; +- esac ;; +- *) echo "bad number of args" ;; +- esac + + exit 0 +--- /dev/null ++++ b/man.sh +@@ -0,0 +1,292 @@ ++#!/bin/sh ++# man2html cgi script - uses /usr/bin/man2html to format man pages ++# aeb@cwi.nl - 980109 ++# Aleksej Bobylev , 2015-2016 ++ ++. /usr/lib/slitaz/httphelper.sh ++. /lib/libtaz.sh ++ ++# Internationalization. ++[ -e /etc/locale.conf ] && . /etc/locale.conf ++export TEXTDOMAIN='man2html' ++export LANG LC_ALL ++_() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; } ++ ++ ++SECTIONS="$(_ 'User Commands'):$(_ 'System Calls'):$(_ 'C Library Functions'):\ ++$(_ 'Devices and Network Interfaces'):$(_ 'File Formats'):\ ++$(_ 'Games and Demos'):$(_ 'Environments, Tables, and Troff Macros'):\ ++$(_ 'Maintenance Commands'):$(_ 'All available manual pages')" ++ ++query="$(GET query)" ++if [ -z "$query" ]; then ++ set -- $(echo $(GET) | tr '+' ' ') ++else ++ set -- $(echo $(GET query) | tr '+' ' ') ++fi ++ ++ ++if [ $1 == 'css' ]; then ++ # post css file on query ++ header 'Content-Type: text/css' ++ cat /usr/share/doc/slitaz-doc.css ++fi ++ ++if [ $# -eq 1 ]; then ++ case $1 in ++ 1|2|3|4|5|6|7|8|all) ++ if [ "$1" == 'all' ]; then ++ sec_n='9'; sec_folder='man?' ++ else ++ sec_n="$1"; sec_folder="man$1" ++ fi ++ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $sec_n) ++ header ++ cat < ++ ++ ++ $1. $sec_desc ++ ++ ++

    $(_ 'Section %s: %s' $1 "$sec_desc")

    ++
    $(_ 'Manual Pages')
    ++

    ++EOT ++ ++ case $1 in ++ 1) _ "Section 1 of the manual describes user commands and tools, for example, file \ ++manipulation tools, shells, compilers, web browsers, file and image viewers and editors, and so \ ++on.";; ++ 2) _ "Section 2 of the manual describes the Linux system calls. A system call is \ ++an entry point into the Linux kernel.";; ++ 3) _ "Section 3 of the manual describes all library functions excluding the \ ++library functions (system call wrappers) described in Section 2, which implement system calls.";; ++ 4) _ "Section 4 of the manual describes special files (devices).";; ++ 5) _ "Section 5 of the manual describes various file formats, as well as the \ ++corresponding C structures, if any.";; ++ 6) _ "Section 6 of the manual describes all the games and funny little programs \ ++available on the system.";; ++ 7) _ "Section 7 of the manual provides overviews on various topics, and describes \ ++conventions and protocols, character set standards, the standard filesystem layout, and \ ++miscellaneous other things.";; ++ 8) _ "Section 8 of the manual describes commands which either can be or are used \ ++only by the superuser, like system-administration commands, daemons, and hardware-related \ ++commands.";; ++ esac ++ ++ [ "$1" != 'all' ] && echo "intro($1)" ++ echo '

    ' ++ ++ temp="$(mktemp)"; temp2="$(mktemp)" ++ for dir in $(find /usr/share/man -type d -name "$sec_folder"); do ++ ls $dir | sed 's|\.\([0-9]\)\.*[bgx]*z*2*$|:\1|' ++ # fix sorting 'feature': leading '_' always ignored by `sort` ++ done | sed 's|_|zzzzzzzz|g' | sort -fu | sed 's|zzzzzzzz|_|g' | \ ++ awk -F' ' -vtemp="$temp" -vtemp2="$temp2" ' ++ { ++ split($1, man, ":"); ++ ++ letter = tolower(substr(man[1], 1, 1)); ++ if (letter != last_letter) { ++ last_letter = letter; ++ letter_index[++num_letters] = letter; ++ print "

    " toupper(letter) "

    " > temp; ++ } ++ lnk = man[1]; gsub("+", "%2b", lnk); ++ printf "%s(%s) ", lnk, man[2], man[1], man[2] > temp; ++ } ++ END { ++ # Print out alphabetic quick index and other links ++ for (i = 1; i <= num_letters; i++) { ++ print "" toupper(letter_index[i]) "" > temp2; ++ } ++ } ++ ' ++ if [ -s "$temp" ]; then ++ echo '
    '; cat "$temp2"; echo '
    ' ++ cat "$temp" ++ echo '
    '; cat "$temp2"; echo '
    ' ++ fi ++ ++ rm -f "$temp" "$temp2" ++ ++ cat < ++
    $(_ 'Sections')
    ++
      ++EOT ++ for i in $(seq 8); do ++ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i) ++ echo "
    1. $sec_desc
    2. " ++ done ++ cat < ++

      $(_ 'All Sections')

      ++
    ++ ++ ++ ++EOT ++ exit 0 ++ ;; ++ esac ++fi ++ ++# Find the required page - expect to be called with "man2html [sec] page". ++# There may a prefixed "-M manpath" option. ++ ++if [ $# -ge 2 -a "$1" == '-M' ]; then ++ MANPATH="$2" ++ export MANPATH ++ shift; shift ++ MP=' using the given MANPATH' ++else ++ MP='' ++fi ++ ++ ++# If no arguments given, show a start page. ++ ++if [ $# -eq 0 ]; then ++ header ++ cat < ++ ++ ++ ++ $(_ 'Manual Pages - Main Contents') ++ ++ ++ ++

    $(_ 'Manual Pages - Main Contents')

    ++
    $(_ 'Name and Section lookup')
    ++
    ++ ++ ++
    ++

    $(_ "You can enter a program name, possibly preceded by the section, the directories to search \ ++(with -M) or a full name. For example:")

    ++ ++
      ++
    • find
    • ++
    • 1 find
    • ++
    • -M /usr/share/man:/opt/man:/usr/local/share/man find
    • ++
    • /usr/share/man/man1/gperf.1
    • ++
    ++
    ++ ++
    $(_ 'Index of pages')
    ++ ++
      ++EOT ++ for i in $(seq 8); do ++ sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i) ++ echo "
    1. $sec_desc
    2. " ++ done ++ cat < ++

      $(_ 'All Sections')

      ++
    ++ ++ ++ ++ ++EOT ++ exit 0 ++fi ++ ++if [ $# -gt 2 ]; then ++ man2html -E "man2html: bad invocation: too many arguments" ++ exit 0 ++fi ++ ++# A single argument may be an explicitly give path name ++# Otherwise, find it ++ ++if [ $# -eq 1 ]; then ++ arg=${1//%2b/+} ++ case "$arg" in ++ /*) PAGE="$arg";; ++ *.*) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg" -o -name "$arg.gz" -o -name "$arg.bz2" -o -name "$arg.xz" \));; ++ *) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg.*" -o -name "$arg.*.gz" -o -name "$arg.*.bz2" -o -name "$arg.*.xz" \));; ++ esac ++else ++ arg=${2//%2b/+} ++ PAGE="$( ++ for dir in $(find /usr/share/man -type d -name man$1); do ++ find $dir \( -type f -o -type l \) -name "$arg.$1*" ++ done)" ++fi ++ ++if [ -z "$PAGE" ]; then ++ complaint="$(_ 'Cannot find a page')" ++ if [ $# -eq 1 ]; then ++ complaint="$(_ 'Cannot find a page for %s %s' $1 $MP)" ++ else ++ complaint="$(_ 'Cannot find a page for %s in section %s %s') $2 $1 $MP" ++ fi ++ man2html -E "

    $complaint

    " ++ exit 0 ++fi ++ ++if [ "$(echo "$PAGE" | wc -l)" -gt 1 ]; then ++ header ++ cat < ++$(_ 'Multiple pages') ++ ++

    $(_ 'Multiple pages found')

    ++
    ++
      ++EOT ++ echo "$PAGE" | awk -F'/' '{ ++ if ($5 ~ "man") { ++ split($6, man, "."); ++ printf "
    • %s (%s)
    • \n", $0, man[1], man[2]; ++ } else { ++ split($7, man, "."); ++ printf "
    • %s (%s) — %s
    • \n", $0, man[1], man[2], $5; ++ } ++ }' ++ sed 's|^.*$|
    • &
    • |' ++ echo '
    ' ++ exit 0 ++fi ++ ++if [ -r "$PAGE" ]; then ++ tmpman="$(mktemp)" ++ # Unpack man page ++ case "$PAGE" in ++ *.gz) zcat "$PAGE" > "$tmpman";; ++ *.bz2) bzcat "$PAGE" > "$tmpman";; ++ *.xz) xzcat "$PAGE" > "$tmpman";; ++ *) cp "$PAGE" "$tmpman";; ++ esac ++ ++ # Check for link ++ line="$(fgrep -v '.\"' "$tmpman" | head -n1)" ++ case "$line" in ++ .so*) ++ link="$(echo "$line" | cut -d'/' -f2)" ++ header "HTTP/1.1 301 Moved Permanently" \ ++ "Location: ?$link" ++ ;; ++ *) ++ # Convert page to HTML ++ man2html "$tmpman" ++ ;; ++ esac ++ ++ # Clean ++ rm "$tmpman" ++else ++ man2html -E "Strange... Cannot find (or read) $PAGE." ++fi ++exit 0 +--- a/man2html.c ++++ b/man2html.c +@@ -21,14 +21,17 @@ + #include + #include + #include "defs.h" +-#include "../src/version.h" ++#include "version.h" ++#include ++#include ++#define GETTEXT_PACKAGE "man2html" + + /* BSD mandoc Bd/Ed example(?) blocks */ + #define BD_LITERAL 1 + #define BD_INDENT 2 + + #define SIZE(a) (sizeof(a)/sizeof(*a)) +-#define DOCTYPE "\n" ++#define DOCTYPE "\n" + #define CONTENTTYPE "Content-type: text/html; charset=UTF-8\n\n" + + static char NEWLINE[2]="\n"; +@@ -58,28 +61,13 @@ + + static char charb[3]; + +-#ifdef GUNZIP +-/* from src/utils.c */ +-static int +-is_shell_safe(const char *ss, int quoted) { +- char *bad = " ;'\\\"<>|"; +- char *p; + +- if (quoted) +- bad++; /* allow a space inside quotes */ +- for (p = bad; *p; p++) +- if (strchr(ss, *p)) +- return 0; +- return 1; +-} +-#endif +- + /* reads the entire manpage into buffer *buf and returns number of chars read */ + static int + read_manpage_into_buffer(char *path, char **buf) { + int compressed = 0; + FILE * f = NULL; +- char * ext; ++ /* char * ext; */ + int l = 0; + struct stat stbuf; + +@@ -94,26 +82,6 @@ + char * tmp = NULL; + char * command = NULL; + char * openpath = path; +-#ifdef GUNZIP +- +- if (is_shell_safe(openpath, 1)) { +- ext = strrchr(openpath, '.'); +- compressed = (ext && !strcmp(ext, ".gz")); +- +- if (!compressed && stat(openpath, &stbuf)) { +- tmp = (char*) xmalloc(strlen(path) + 4); +- sprintf(tmp, "%s.gz", path); +- if ((compressed = !stat(tmp, &stbuf))) +- openpath = tmp; +- } +- } +- +- if (compressed) { +- command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4); +- sprintf(command, GUNZIP " '%s'", openpath); +- f = popen(command, "r"); +- } else +-#endif + f = fopen(openpath, "r"); + + if (tmp) free(tmp); +@@ -170,7 +138,7 @@ + + h = chardef; + if (h->nr != V('*','*')) { +- printf("chardef corrupted\n"); ++ printf("%s\n", _("chardef corrupted")); + exit(1); + } + +@@ -216,7 +184,7 @@ + ** Add the links to the output. + ** At the moment the following are recognized: + ** +- ** name(*) -> ../man?/name.* ++ ** name(*) -> ?name.* + ** method://string -> method://string + ** www.host.name -> http://www.host.name + ** ftp.host.name -> ftp://ftp.host.name +@@ -453,8 +421,8 @@ + #define DL 1 + #define UL 2 + #define OL 3 +-static char *dl_open[4] = { "", "
    \n", "
      ", "
        " }; +-static char *dl_close[4] = { "", "
    \n", "", "" }; ++static char *dl_open[4] = { "", "
    \n", "
      ", "
        " }; ++static char *dl_close[4] = { "", "
    \n", "", "" }; + + static inline void + dl_begin(void) { +@@ -462,7 +430,7 @@ + out_html(dl_open[DL]); + dl_set[itemdepth]=DL; + } +- out_html("
    "); ++ out_html("
    "); + } + + static inline void +@@ -481,14 +449,14 @@ + itemdepth++; + if (itemdepth < SIZE(dl_set)) + dl_set[itemdepth]=noDL; +- out_html("
    "); ++ out_html("
    "); + } + + static inline void + dl_endlevel(void) { + if (itemdepth) { + dl_end(); +- out_html("
    \n"); ++ out_html("
    \n"); + itemdepth--; + } + } +@@ -538,12 +506,12 @@ + + #define FO0 "" + #define FC0 "" +-#define FO1 "" +-#define FC1 "" +-#define FO2 "" +-#define FC2 "" +-#define FO3 "" +-#define FC3 "" ++#define FO1 "" ++#define FC1 "" ++#define FO2 "" ++#define FC2 "" ++#define FO3 "" ++#define FC3 "" + + char *switchfont[16] = { "" , FC0 FO1, FC0 FO2, FC0 FO3, + FC1 FO0, "" , FC1 FO2, FC1 FO3, +@@ -588,14 +556,16 @@ + i=current_font; + sizebuf[0]=0; + strcat(sizebuf, change_to_font(0)); +- if (current_size) strcat(sizebuf, "
    "); ++ if (current_size) strcat(sizebuf, ""); + current_size=nr; + if (nr) { + int l; +- strcat(sizebuf, "0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr; + sizebuf[l++]=nr+'0'; ++ sizebuf[l++]='p'; ++ sizebuf[l++]='t'; + sizebuf[l++]='"'; + sizebuf[l++]='>'; + sizebuf[l]=0; +@@ -775,7 +745,7 @@ + skip_escape=exskipescape; + intresult=j; + break; +- case 'l': h="
    "; curpos=0; ++ case 'l': h="
    "; curpos=0; + case 'b': + case 'v': + case 'x': +@@ -812,7 +782,7 @@ + case 'c': no_newline_output=1; break; + case '{': newline_for_fun++; h="";break; + case '}': if (newline_for_fun) newline_for_fun--; h="";break; +- case 'p': h="
    \n";curpos=0; break; ++ case 'p': h="
    \n";curpos=0; break; + case 't': h="\t";curpos=(curpos+8)&0xfff8; break; + case '<': h="<";curpos++; break; + case '>': h=">";curpos++; break; +@@ -1021,7 +991,7 @@ + out_html(change_to_size(0)); + if (!fillout) { + fillout=1; +- out_html(""); ++ out_html(""); + } + while (*h && *h!='\n') h++; + if (h[-1]==';') { +@@ -1197,45 +1167,45 @@ + currow=currow->prev; + } + /* produce html output */ +- if (center) out_html("
    "); +- if (box==2) out_html("
    "); +- out_html(""); ++ if (box==2) out_html(""); ++ out_html(""); + curfield=currow->first; + while (curfield) { + if (curfield->align!='S' && curfield->align!='^') { +- out_html("align) { + case 'N': + curfield->space+=4; + case 'R': +- out_html(" ALIGN=right"); ++ out_html(" style=\"text-align: right\""); + break; + case 'C': +- out_html(" ALIGN=center"); ++ out_html(" style=\"text-align: center\""); + default: + break; + } + if (!curfield->valign && curfield->rowspan>1) +- out_html(" VALIGN=center"); ++ out_html(" style=\"vertical-align: center\""); + if (curfield->colspan>1) { + char buf[5]; +- out_html(" COLSPAN="); ++ out_html(" colspan="); + sprintf(buf, "%i", curfield->colspan); + out_html(buf); + } + if (curfield->rowspan>1) { + char buf[5]; +- out_html(" ROWSPAN="); ++ out_html(" rowspan="); + sprintf(buf, "%i", curfield->rowspan); + out_html(buf); + } +@@ -1244,8 +1214,8 @@ + if (curfield->size) out_html(change_to_size(curfield->size)); + if (curfield->font) out_html(change_to_font(curfield->font)); + switch (curfield->align) { +- case '=': out_html("

    "); break; +- case '_': out_html("
    "); break; ++ case '=': out_html("

    "); break; ++ case '_': out_html("
    "); break; + default: + if (curfield->contents) out_html(curfield->contents); + break; +@@ -1255,20 +1225,20 @@ + if (curfield->font) out_html(change_to_font(0)); + if (curfield->size) out_html(change_to_size(0)); + if (j>=maxcol && curfield->align>'@' && curfield->align!='_') +- out_html("
    "); +- out_html(""); ++ out_html("
    "); ++ out_html(""); + } + curfield=curfield->next; + } +- out_html("
    \n"); ++ out_html("\n"); + currow=currow->next; + } +- if (box && !border) out_html("
    "); ++ out_html("
    \n"); + currow=layout; + while (currow) { + j=0; +- out_html("
    "); +- out_html("
    "); +- if (box==2) out_html(""); +- if (center) out_html("
    \n"); ++ if (box && !border) out_html(""); ++ out_html(""); ++ if (box==2) out_html(""); ++ if (center) out_html("\n"); + else out_html("\n"); +- if (!oldfillout) out_html("
    ");
    ++    if (!oldfillout) out_html("
    ");
    +     fillout=oldfillout;
    +     out_html(change_to_size(oldsize));
    +     out_html(change_to_font(oldfont));
    +@@ -1401,7 +1371,7 @@
    + 		case '&': value = (value && value2); break;
    + 		case ':': value = (value || value2); break;
    + 		default: fprintf(stderr,
    +-				 "man2html: Unknown operator %c.\n", oper);
    ++				_("man2html: Unknown operator %c.\n"), oper);
    + 		}
    + 		oper=0;
    + 	    }
    +@@ -1489,42 +1459,42 @@
    + 
    + 
    + char *section_list[] = {
    +-    "1", "User Commands ",
    +-    "1C", "User Commands",
    +-    "1G", "User Commands",
    +-    "1S", "User Commands",
    +-    "1V", "User Commands ",
    +-    "2", "System Calls",
    +-    "2V", "System Calls",
    +-    "3", "C Library Functions",
    +-    "3C", "Compatibility Functions",
    +-    "3F", "Fortran Library Routines",
    +-    "3K", "Kernel VM Library Functions",
    +-    "3L", "Lightweight Processes Library",
    +-    "3M", "Mathematical Library",
    +-    "3N", "Network Functions",
    +-    "3R", "RPC Services Library",
    +-    "3S", "Standard I/O Functions",
    +-    "3V", "C Library Functions",
    +-    "3X", "Miscellaneous Library Functions",
    +-    "4", "Devices and Network Interfaces",
    +-    "4F", "Protocol Families",
    +-    "4I", "Devices and Network Interfaces",
    +-    "4M", "Devices and Network Interfaces",
    +-    "4N", "Devices and Network Interfaces",
    +-    "4P", "Protocols",
    +-    "4S", "Devices and Network Interfaces",
    +-    "4V", "Devices and Network Interfaces",
    +-    "5", "File Formats",
    +-    "5V", "File Formats",
    +-    "6", "Games and Demos",
    +-    "7", "Environments, Tables, and Troff Macros",
    +-    "7V", "Environments, Tables, and Troff Macros",
    +-    "8", "Maintenance Commands",
    +-    "8C", "Maintenance Commands",
    +-    "8S", "Maintenance Commands",
    +-    "8V", "Maintenance Commands",
    +-    "L", "Local Commands",
    ++    "1",  N_("User Commands"),
    ++    "1C", N_("User Commands"),
    ++    "1G", N_("User Commands"),
    ++    "1S", N_("User Commands"),
    ++    "1V", N_("User Commands"),
    ++    "2",  N_("System Calls"),
    ++    "2V", N_("System Calls"),
    ++    "3",  N_("C Library Functions"),
    ++    "3C", N_("Compatibility Functions"),
    ++    "3F", N_("Fortran Library Routines"),
    ++    "3K", N_("Kernel VM Library Functions"),
    ++    "3L", N_("Lightweight Processes Library"),
    ++    "3M", N_("Mathematical Library"),
    ++    "3N", N_("Network Functions"),
    ++    "3R", N_("RPC Services Library"),
    ++    "3S", N_("Standard I/O Functions"),
    ++    "3V", N_("C Library Functions"),
    ++    "3X", N_("Miscellaneous Library Functions"),
    ++    "4",  N_("Devices and Network Interfaces"),
    ++    "4F", N_("Protocol Families"),
    ++    "4I", N_("Devices and Network Interfaces"),
    ++    "4M", N_("Devices and Network Interfaces"),
    ++    "4N", N_("Devices and Network Interfaces"),
    ++    "4P", N_("Protocols"),
    ++    "4S", N_("Devices and Network Interfaces"),
    ++    "4V", N_("Devices and Network Interfaces"),
    ++    "5",  N_("File Formats"),
    ++    "5V", N_("File Formats"),
    ++    "6",  N_("Games and Demos"),
    ++    "7",  N_("Environments, Tables, and Troff Macros"),
    ++    "7V", N_("Environments, Tables, and Troff Macros"),
    ++    "8",  N_("Maintenance Commands"),
    ++    "8C", N_("Maintenance Commands"),
    ++    "8S", N_("Maintenance Commands"),
    ++    "8V", N_("Maintenance Commands"),
    ++    "L",  N_("Local Commands"),
    + /* for Solaris: 
    +     "1", "User Commands",
    +     "1B", "SunOS/BSD Compatibility Package Commands",
    +@@ -1593,7 +1563,7 @@
    +     "9s", "DDI and DKI Data Structures",
    +     "L", "Local Commands",
    + */
    +-    NULL, "Misc. Reference Manual Pages",
    ++    NULL, N_("Misc. Reference Manual Pages"),
    +     NULL, NULL
    + };
    + 
    +@@ -1604,7 +1574,7 @@
    + 
    +     if (!c) return "";
    +     while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
    +-    if (section_list[i+1]) return section_list[i+1];
    ++    if (section_list[i+1]) return _(section_list[i+1]);
    +     else return c;
    + }
    + 
    +@@ -1636,10 +1606,10 @@
    +     if (level != subs) {
    + 	manidx_need(6);
    + 	if (subs) {
    +-	    strcpy(manidx+mip, "\n");
    ++	    strcpy(manidx+mip, "\n");
    + 	    mip += 6;
    + 	} else {
    +-	    strcpy(manidx+mip, "
    \n"); ++ strcpy(manidx+mip, "
    \n"); + mip += 5; + } + } +@@ -1647,7 +1617,7 @@ + + scan_troff(item, 1, &c); + manidx_need(100 + strlen(c)); +- sprintf(manidx+mip, "
    %s
    \n", label, c); ++ sprintf(manidx+mip, "
    %s
    \n", label, c); + if (c) free(c); + while (manidx[mip]) mip++; + } +@@ -1834,8 +1804,8 @@ + } + break; + case V('b','r'): +- if (still_dd) out_html("
    "); +- else out_html("
    \n"); ++ if (still_dd) out_html("
    "); ++ else out_html("
    \n"); + curpos=0; + c=c+j; + if (c[0] == escapesym) { c=scan_escape(c+1); } +@@ -1865,17 +1835,17 @@ + c=skip_till_newline(c); + /* center next i lines */ + if (i>0) { +- out_html("
    \n"); ++ out_html("
    \n"); + while (i && *c) { + char *line=NULL; + c=scan_troff(c,1, &line); +- if (line && strncmp(line, "
    ", 4)) { ++ if (line && strncmp(line, "
    ", 4)) { + out_html(line); +- out_html("
    \n"); ++ out_html("
    \n"); + i--; + } + } +- out_html("
    \n"); ++ out_html("\n"); + curpos=0; + } + break; +@@ -1906,7 +1876,7 @@ + if (!fillout) { + out_html(change_to_font(0)); + out_html(change_to_size('0')); +- out_html("
    \n"); ++ out_html("
    \n"); + } + curpos=0; + fillout=1; +@@ -1981,7 +1951,7 @@ + if (fillout) { + out_html(change_to_font(0)); + out_html(change_to_size('0')); +- out_html("
    \n");
    ++		out_html("
    \n");
    + 	    }
    + 	    curpos=0;
    + 	    fillout=0;
    +@@ -2002,7 +1972,7 @@
    + 	    break;
    + 	case V('s','p'):
    + 	    c=c+j;
    +-	    if (fillout) out_html("

    "); else { ++ if (fillout) out_html("

    "); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2033,30 +2003,15 @@ + *c = 0; + scan_troff(h,1, &name); + if (name[3] == '/') h=name+3; else h=name; +-#if NOCGI +- if (!out_length) { +- char *t,*s; +- t=strrchr(fname, '/'); +- if (!t) t=fname; +- fprintf(stderr, "ln -s %s.html %s.html\n", h, t); +- s=strrchr(t, '.');if (!s) s=t; +- printf(CONTENTTYPE DOCTYPE); +- printf(" Man page of %s\n" +- "\n" +- "See the man page for %s.\n" +- "\n", +- s, h, h); +- } else +-#endif + { + /* this works alright, except for section 3 */ + if ((l = read_manpage_into_buffer(h, &buf)) < 0) { + fprintf(stderr, +- "man2html: unable to open or read file %s\n", h); +- out_html("

    " +- "man2html: unable to open or read file\n"); ++ _("man2html: unable to open or read file %s\n"), h); ++ out_html("
    "); ++ out_html(_("man2html: unable to open or read file\n")); + out_html(h); +- out_html("
    \n"); ++ out_html("
    \n"); + } else { + buf[0]=buf[l]='\n'; + buf[l+1]=buf[l+2]=0; +@@ -2085,7 +2040,7 @@ + #if 0 + dl_down(); + #endif +- out_html("
    \n"); ++ out_html("
    \n"); + c=c+j; + c=scan_expression(c, &j); + for (i=0; i"); ++ out_html("
    "); + curpos = 0; + break; + case V('T','P'): +@@ -2172,7 +2127,7 @@ + /* somewhere a definition ends with '.TP' */ + if (!*c) still_dd=1; else { + c=scan_troff(c,1,NULL); +- out_html("
    "); ++ out_html("
    "); + } + curpos=0; + break; +@@ -2195,20 +2150,20 @@ + fprintf(idxfile,"\n"); + } + #endif +- out_html("' and '<' solves it, but creates + ** some space. A normal space does not work. + */ +- out_html("\">"); ++ out_html("\">"); + break; + case V('P',' '): + case V('P','\n'): + case V('L','P'): + case V('P','P'): + dl_end(); +- if (fillout) out_html("

    \n"); else { ++ if (fillout) out_html("

    \n"); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2272,19 +2227,29 @@ + out_html(change_to_size(0)); + if (!fillout) { + fillout=1; +- out_html("

    "); ++ out_html("
    "); + } + trans_char(c,'"', '\a'); + add_to_index(mode, c); +- out_html(" \n

    "); +- else out_html("\"> \n

    "); ++ ++ if (mode) { ++ out_html("

    "); ++ } else { ++ out_html("

    \n\n
    \n

    "); ++ } ++ + mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0); + c = (mandoc_command ? scan_troff_mandoc : scan_troff)(c,1,NULL); +- if (mode) out_html("

    \n"); +- else out_html("\n"); ++ ++ if (mode) ++ out_html("\n"); ++ else ++ out_html("\n"); ++ + curpos=0; + break; + case V('T','S'): +@@ -2315,7 +2280,7 @@ + int skip=0; + output_possible=1; + printf(CONTENTTYPE DOCTYPE); +- out_html("Man page of "); ++ out_html("<html><head>\n<meta charset=\"UTF-8\">\n<title>"); + scan_troff(wordlist[0], 0, &t); + /* we need to remove all html tags */ + for (s=q=t; *s; s++) { +@@ -2324,11 +2289,14 @@ + else if (!skip) *q++ = *s; + } + *q = '\0'; +- out_html(t); ++ char buff[256]; ++ sprintf(buff, _("Man page of %s"), t); ++ out_html(buff); + free(t); +- out_html("\n\n

    "); ++ out_html("\n\n\n

    "); + scan_troff(wordlist[0], 0, NULL); +- out_html("

    \nSection: "); ++ out_html("

    \n
    \n"); ++ out_html(_("Section: ")); + if (words>4) + scan_troff(wordlist[4], 0, NULL); + else +@@ -2336,14 +2304,17 @@ + out_html(" ("); + scan_troff(wordlist[1], 0, NULL); + if (words>2) { +- out_html(")
    Updated: "); ++ out_html(")
    "); ++ out_html(_("Updated: ")); + scan_troff(wordlist[2], 1, NULL); + } else out_html(")"); +- out_html("
    Index\n"); ++ out_html("
    "); ++ out_html(_("Index")); ++ out_html("\n"); + man_page_html(0,0); /* Return to Main Contents */ + *sl='\n'; +- out_html("
    \n"); +- if (mandoc_command) out_html("
    BSD mandoc
    "); ++ out_html("
    \n"); ++ if (mandoc_command) out_html("
    \nBSD mandoc
    "); + } + c = sl+1; + } else +@@ -2507,7 +2478,7 @@ + dl_newlevel_type(DL); + if (nl) + *nl = t; +- if (fillout) out_html("

    \n"); else { ++ if (fillout) out_html("

    \n"); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2518,7 +2489,7 @@ + case V('E','l'): /* BSD mandoc */ + c=c+j; + dl_endlevel_type(); +- if (fillout) out_html("

    \n"); else { ++ if (fillout) out_html("

    \n"); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2528,7 +2499,7 @@ + case V('I','t'): /* BSD mandoc */ + c=c+j; + if (dl_type(DL)) { +- out_html("

    "); ++ out_html("
    "); + out_html(change_to_font('B')); + if (*c == '\n') { + /* Don't allow embedded comms after a newline */ +@@ -2543,9 +2514,9 @@ + if (inXo) + still_dd = 1; + else +- out_html("
    "); ++ out_html("
    "); + } else if (dl_type(UL) || dl_type(OL)) { +- out_html("
  • "); ++ out_html("
  • "); + c=scan_troff_mandoc(c,1,NULL); + out_html(NEWLINE); + } +@@ -2559,7 +2530,7 @@ + c=c+j; + if (inXo) { + if (still_dd) +- out_html("
    "); ++ out_html("
    "); + inXo = 0; + } + break; +@@ -2594,12 +2565,12 @@ + case V('D','l'): /* BSD mandoc */ + c=c+j; + out_html(NEWLINE); +- out_html("
    "); ++ out_html("
    "); + out_html(change_to_font('L')); + if (*c == '\n') c++; + c=scan_troff_mandoc(c, 1, NULL); + out_html(change_to_font('R')); +- out_html("
    "); ++ out_html("
    "); + if (fillout) curpos++; else curpos=0; + break; + case V('B','d'): /* BSD mandoc */ +@@ -2615,14 +2586,14 @@ + mandoc_bd_options = 0; /* Remember options for terminating Bl */ + if (strstr(c, "-offset indent")) { + mandoc_bd_options |= BD_INDENT; +- out_html("
    \n"); ++ out_html("
    \n"); + } + if (strstr(c, "-literal") || strstr(c, "-unfilled")) { + if (fillout) { + mandoc_bd_options |= BD_LITERAL; + out_html(change_to_font(0)); + out_html(change_to_size('0')); +- out_html("
    \n");
    ++		       out_html("
    \n");
    + 		  }
    + 		  curpos=0;
    + 		  fillout=0;
    +@@ -2637,18 +2608,18 @@
    + 		  if (!fillout) {
    + 		       out_html(change_to_font(0));
    + 		       out_html(change_to_size('0'));
    +-		       out_html("
    \n"); ++ out_html("
    \n"); + } + } + if (mandoc_bd_options & BD_INDENT) +- out_html("
    \n"); ++ out_html("
    \n"); + curpos=0; + fillout=1; + c=skip_till_newline(c); + break; + case V('B','e'): /* BSD mandoc */ + c=c+j; +- if (fillout) out_html("

    "); else { ++ if (fillout) out_html("

    "); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2715,7 +2686,7 @@ + if (fillout) curpos++; else curpos=0; + break; + case V('P','p'): /* BSD mandoc */ +- if (fillout) out_html("

    \n"); else { ++ if (fillout) out_html("

    \n"); else { + out_html(NEWLINE); + NEWLINE[0]='\n'; + } +@@ -2726,9 +2697,9 @@ + trans_char(c,'"','\a'); + c=c+j; + if (*c == '\n') c++; +- out_html("``"); ++ out_html("“"); + c=scan_troff_mandoc(c, 1, NULL); +- out_html("''"); ++ out_html("”"); + out_html(NEWLINE); + if (fillout) curpos++; else curpos=0; + break; +@@ -2800,12 +2771,22 @@ + trans_char(c,'"','\a'); + c=c+j; + if (*c == '\n') c++; +- out_html("`"); ++ out_html("‘"); + c=scan_troff_mandoc(c, 1, NULL); +- out_html("'"); ++ out_html("’"); + out_html(NEWLINE); + if (fillout) curpos++; else curpos=0; + break; ++ case V('A','q'): /* BSD mandoc */ ++ trans_char(c,'"','\a'); ++ c=c+j; ++ if (*c == '\n') c++; ++ out_html("⟨"); ++ c=scan_troff_mandoc(c, 1, NULL); ++ out_html("⟩"); ++ out_html(NEWLINE); ++ if (fillout) curpos++; else curpos=0; ++ break; + case V('A','r'): /* BSD mandoc */ + /* parse one line in italics */ + out_html(change_to_font('I')); +@@ -2855,7 +2836,7 @@ + */ + static int count = 0; /* Don't break on the first Nm */ + if (count) { +- out_html("
    "); ++ out_html("
    "); + } else { + char *end, t=0 /* just for gcc */; + end = strchr(c, '\n'); +@@ -3038,7 +3019,7 @@ + if (h[-1] == '\n' && still_dd && isalnum(*h)) { + /* sometimes a .HP request is not followed by a .br request */ + FLUSHIBP; +- out_html("

    "); ++ out_html("
    "); + curpos=0; + still_dd=0; + } +@@ -3108,12 +3089,12 @@ + curpos++; + } + } else { +- out_html(""); ++ out_html(""); + while (curpos < tabstops[curtab]) { + out_html(" "); + curpos++; + } +- out_html(""); ++ out_html(""); + } + } + } +@@ -3122,7 +3103,7 @@ + if (*h == ' ' && (h[-1] == '\n' || usenbsp)) { + FLUSHIBP; + if (!usenbsp && fillout) { +- out_html("
    "); ++ out_html("
    "); + curpos=0; + } + usenbsp=fillout; +@@ -3196,13 +3177,13 @@ + + switch(status) { + case 403: +- printf("Status: 403 Forbidden\n"); ++ printf("HTTP/1.1 403 Forbidden\n"); + break; + case 404: +- printf("Status: 404 Not Found\n"); ++ printf("HTTP/1.1 404 Not Found\n"); + break; + case 500: +- printf("Status: 500 Internal Server Error\n"); ++ printf("HTTP/1.1 500 Internal Server Error\n"); + break; + case 0: + default: +@@ -3210,12 +3191,13 @@ + } + + printf(CONTENTTYPE DOCTYPE); +- printf("%s\n" +- "\n

    %s

    \n", s, s); ++ printf("\n\n\n%s\n" ++ "\n\n" ++ "\n

    %s

    \n
    \n", s, s); + va_start(p, t); + vfprintf(stdout, t, p); + va_end(p); +- printf("\n"); ++ printf("
    \n\n"); + exit(0); + } + +@@ -3223,8 +3205,8 @@ + xstrdup(const char *s) { + char *p = strdup(s); + if (p == NULL) +- error_page(500, "Out of memory", +- "Sorry, out of memory, aborting...\n"); ++ error_page(500, _("Out of memory"), ++ _("Sorry, out of memory, aborting...\n")); + return p; + } + +@@ -3232,8 +3214,8 @@ + xmalloc(size_t size) { + void *p = malloc(size); + if (p == NULL) +- error_page(500, "Out of memory", +- "Sorry, out of memory, aborting...\n"); ++ error_page(500, _("Out of memory"), ++ _("Sorry, out of memory, aborting...\n")); + return p; + } + +@@ -3241,16 +3223,16 @@ + xrealloc(void *ptr, size_t size) { + void *p = realloc(ptr,size); + if (p == NULL) +- error_page(500, "Out of memory", +- "Sorry, out of memory, aborting...\n"); ++ error_page(500, _("Out of memory"), ++ _("Sorry, out of memory, aborting...\n")); + return p; + } + + static void + usage(void) { +- error_page(500, "man2html: bad invocation", +- "Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n" +- "or: man2html -r [filename]\n"); ++ error_page(500, _("man2html: bad invocation"), ++ _("Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n" ++ "or: man2html -r [filename]\n")); + } + + static void +@@ -3273,7 +3255,7 @@ + } + #if 0 + else /* complain or not - this need not be fatal */ +- error_page("Error", "man2html: could not chdir to %s", s); ++ error_page(_("Error"), _("man2html: could not chdir to %s"), s); + #endif + } + } +@@ -3291,6 +3273,11 @@ + */ + int + main(int argc, char **argv) { ++ setlocale (LC_ALL, ""); ++ bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale"); ++ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); ++ textdomain (GETTEXT_PACKAGE); ++ + int l, c; + char *buf, *filename, *fnam = NULL; + +@@ -3309,7 +3296,7 @@ + case 'D': + goto_dir(optarg, 0, 0); break; + case 'E': +- error_page(0, "Error", "%s", optarg); break; ++ error_page(0, _("Error"), "%s", optarg); break; + case 'h': + set_cgibase("localhost"); break; + case 'H': +@@ -3362,7 +3349,7 @@ + + l = read_manpage_into_buffer(fnam, &buf); + if (l < 0) +- error_page(404, "File not found", "Could not open %s\n", fname); ++ error_page(404, _("File not found"), _("Could not open %s\n"), fname); + + buf[0] = '\n'; + buf[l+1] = '\n'; +@@ -3379,34 +3366,34 @@ + out_html(change_to_size(0)); + if (!fillout) { + fillout=1; +- out_html(""); ++ out_html(""); + } + out_html(NEWLINE); + if (output_possible) { + /*   for mosaic users */ + if (manidx) { +- printf("
    \n 

    Index

    \n
    \n"); ++ printf("
  • \n\n
    \n

    %s

    \n\n
    \n", _("Index")); + manidx[mip]=0; + printf("%s", manidx); +- if (subs) printf("
    \n"); +- printf("\n"); ++ if (subs) printf("\n"); ++ printf("\n"); + } + print_sig(); +- printf("\n\n"); ++ printf("\n\n"); + } else { + if (!filename) + filename = fname; + if (*filename == '/') +- error_page(403, "Invalid Man Page", +- "The requested file %s is not a valid (unformatted) " ++ error_page(403, _("Invalid Man Page"), ++ _("The requested file %s is not a valid (unformatted) " + "man page.\nIf the file is a formatted man page, " + "you could try to load the\n" +- "plain file.\n", ++ "plain file.\n"), + filename, filename); + else +- error_page(403, "Invalid Man Page", +- "The requested file %s is not a valid (unformatted) " +- "man page.", filename); ++ error_page(403, _("Invalid Man Page"), ++ _("The requested file %s is not a valid (unformatted) " ++ "man page."), filename); + } + if (idxfile) + fclose(idxfile); +--- a/scripts/cgi-bin/man/man2html ++++ b/scripts/cgi-bin/man/man2html +@@ -8,11 +8,11 @@ + + # Do we need lynxcgi URLs? For the moment our criterion is + # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. +-AGENT="${HTTP_USER_AGENT-unknown}" ++AGENT="${HTTP_USER_AGENT:-unknown}" + + case "$AGENT" in + Lynx*|lynx*) +- HH="${HTTP_HOST-nohh}" ++ HH="${HTTP_HOST:-nohh}" + SED="s/%lynx //" + ;; + *) +@@ -21,7 +21,7 @@ + ;; + esac + +-SERVER="${SERVER_NAME-localhost}" ++SERVER="${SERVER_NAME:-localhost}" + case "$HH" in + nohh) + LL="-l" +--- a/scripts/cgi-bin/man/mansearch ++++ b/scripts/cgi-bin/man/mansearch +@@ -7,11 +7,11 @@ + + # Do we need lynxcgi URLs? For the moment our criterion is + # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. +-AGENT="${HTTP_USER_AGENT-unknown}" ++AGENT="${HTTP_USER_AGENT:-unknown}" + + case "$AGENT" in + Lynx*|lynx*) +- HH="${HTTP_HOST-nohh}" ++ HH="${HTTP_HOST:-nohh}" + SED="s/%lynx //" + ;; + *) +@@ -20,7 +20,7 @@ + ;; + esac + +-SERVER="${SERVER_NAME-localhost}" ++SERVER="${SERVER_NAME:-localhost}" + case "$HH" in + nohh) + CG="lynxcgi:/usr/lib/cgi-bin/man" +--- a/scripts/cgi-bin/man/mansearchhelp ++++ b/scripts/cgi-bin/man/mansearchhelp +@@ -4,17 +4,17 @@ + + # Do we need lynxcgi URLs? For the moment our criterion is + # 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset. +-AGENT="${HTTP_USER_AGENT-unknown}" ++AGENT="${HTTP_USER_AGENT:-unknown}" + case "$AGENT" in + Lynx*|lynx*) +- HH="${HTTP_HOST-nohh}" ++ HH="${HTTP_HOST:-nohh}" + ;; + *) + HH=nolynx + ;; + esac + +-SERVER="${SERVER_NAME-localhost}" ++SERVER="${SERVER_NAME:-localhost}" + case "$HH" in + nohh) + CG="lynxcgi:/usr/lib/cgi-bin/man" +--- a/strdefs.c ++++ b/strdefs.c +@@ -27,266 +27,333 @@ + { V('.','V'), 1, 0, NULL }, /* the me package tests for this */ + { 0, 0, 0, NULL } }; + ++ ++/* Characters written according to http://mdocml.bsd.lv/man/mandoc_char.7.html */ ++ + static STRDEF standardstring[] = { +- { V('<','='), 2, "<=", NULL }, /* less equal */ +- { V('>','='), 2, ">=;", NULL }, /* greather equal */ +- { V('A','m'), 1, "&", NULL }, /* infinity */ +- { V('B','a'), 1, "|", NULL }, /* vartical bar */ +- { V('G','e'), 2, ">=;", NULL }, /* greather equal */ +- { V('G','t'), 1, ">", NULL }, /* greather than */ +- { V('I','f'), 1, "∞", NULL }, /* infinity */ +- { V('L','e'), 2, "<=", NULL }, /* less equal */ +- { V('L','q'), 1, "“", NULL }, /* left double quote */ +- { V('L','t'), 1, "<", NULL }, /* less than */ +- { V('N','a'), 3, "NaN", NULL }, /* not a number */ +- { V('N','e'), 2, "!=", NULL }, /* not equal */ +- { V('P','i'), 2, "Pi", NULL }, /* pi */ +- { V('P','m'), 1, "±", NULL }, /* plus minus */ +- { V('R',' '), 1, "®", NULL }, +- { V('R','q'), 1, "”", NULL }, /* right double quote */ +- { V('a','a'), 1, "'", NULL }, /* accute accent */ +- { V('g','a'), 1, "`", NULL }, /* grave accent */ +- { V('l','q'), 2, "``", NULL }, +- { V('q',' '), 1, """, NULL }, /* straight double quote */ +- { V('r','q'), 2, "''", NULL }, +- { V('u','a'), 1, "^", NULL }, /* upwards arrow */ ++ { V('<','='), 1, "≤", NULL }, /* less-than-equal */ ++ { V('>','='), 1, "≥", NULL }, /* greater-than-equal */ ++ { V('A','i'), 4, "ANSI", NULL }, /* ANSI standard name */ ++ { V('A','m'), 1, "&", NULL }, /* ampersand */ ++ { V('B','a'), 1, "|", NULL }, /* vertical bar */ ++ { V('G','e'), 1, "≥", NULL }, /* greater-than-equal */ ++ { V('G','t'), 1, ">", NULL }, /* greater-than */ ++ { V('I','f'), 8, "infinity", NULL }, /* infinity */ ++ { V('L','e'), 1, "≤", NULL }, /* less-than-equal */ ++ { V('L','q'), 1, "“", NULL }, /* left-double-quote */ ++ { V('L','t'), 1, "<", NULL }, /* less-than */ ++ { V('N','a'), 3, "NaN", NULL }, /* NaN */ ++ { V('N','e'), 1, "≠", NULL }, /* not equal */ ++ { V('P','i'), 2, "pi", NULL }, /* pi */ ++ { V('P','m'), 1, "±", NULL }, /* plus-minus */ ++ { V('P','x'), 5, "POSIX", NULL }, /* POSIX standard name */ ++ { V('R',' '), 1, "®", NULL }, /* restricted mark */ ++ { V('R','q'), 1, "”", NULL }, /* right-double-quote */ ++ { V('T','m'), 4, "(Tm)", NULL }, /* trade mark */ ++ { V('a','a'), 1, "´", NULL }, /* acute */ ++ { V('g','a'), 1, "`", NULL }, /* grave */ ++ { V('l','p'), 1, "(", NULL }, /* left-parenthesis */ ++ { V('l','q'), 1, "“", NULL }, /* left double-quote */ ++ { V('q',' '), 1, """, NULL }, /* double-quote */ ++ { V('r','p'), 1, ")", NULL }, /* right-parenthesis */ ++ { V('r','q'), 1, "”", NULL }, /* right double-quote */ ++ { V('u','a'), 1, "↑", NULL }, /* up-arrow */ ++ { V('v','a'), 1, "↕", NULL }, /* up-down arrow */ + { 0, 0, NULL, NULL} + }; + + static STRDEF standardchar[] = { +- { V('*','*'), 1, "*", NULL }, /* math star */ +- { V('*','A'), 1, "Α", NULL }, +- { V('*','B'), 1, "Β", NULL }, +- { V('*','C'), 1, "Ξ", NULL }, +- { V('*','D'), 1, "Δ", NULL }, +- { V('*','E'), 1, "Ε", NULL }, +- { V('*','F'), 1, "Φ", NULL }, +- { V('*','G'), 1, "Γ", NULL }, +- { V('*','H'), 1, "Θ", NULL }, +- { V('*','I'), 1, "Ι", NULL }, +- { V('*','K'), 1, "Κ", NULL }, +- { V('*','L'), 1, "Λ", NULL }, +- { V('*','M'), 1, "Μ", NULL }, +- { V('*','N'), 1, "Ν", NULL }, +- { V('*','O'), 1, "Ο", NULL }, +- { V('*','P'), 1, "Π", NULL }, +- { V('*','Q'), 1, "Ψ", NULL }, +- { V('*','R'), 1, "Ρ", NULL }, +- { V('*','S'), 1, "Σ", NULL }, +- { V('*','T'), 1, "Τ", NULL }, +- { V('*','U'), 1, "Υ", NULL }, +- { V('*','W'), 1, "Ω", NULL }, +- { V('*','X'), 1, "Χ", NULL }, +- { V('*','Y'), 1, "Η", NULL }, +- { V('*','Z'), 1, "Ζ", NULL }, +- { V('*','a'), 1, "α", NULL }, +- { V('*','b'), 1, "β", NULL }, +- { V('*','c'), 1, "ξ", NULL }, +- { V('*','d'), 1, "δ", NULL }, +- { V('*','e'), 1, "ε", NULL }, +- { V('*','f'), 1, "φ", NULL }, +- { V('*','g'), 1, "γ", NULL }, +- { V('*','h'), 1, "θ", NULL }, +- { V('*','i'), 1, "ι", NULL }, +- { V('*','k'), 1, "κ", NULL }, +- { V('*','l'), 1, "λ", NULL }, +- { V('*','m'), 1, "μ", NULL }, +- { V('*','n'), 1, "ν", NULL }, +- { V('*','o'), 1, "ο", NULL }, +- { V('*','p'), 1, "π", NULL }, +- { V('*','q'), 1, "ψ", NULL }, +- { V('*','r'), 1, "ρ", NULL }, +- { V('*','s'), 1, "σ", NULL }, +- { V('*','t'), 1, "τ", NULL }, +- { V('*','u'), 1, "υ", NULL }, +- { V('*','w'), 1, "ω", NULL }, +- { V('*','x'), 1, "χ", NULL }, +- { V('*','y'), 1, "η", NULL }, +- { V('*','z'), 1, "ζ", NULL }, +- { V('\'','A'), 1, "Á", NULL }, +- { V('\'','E'), 1, "É", NULL }, +- { V('\'','I'), 1, "Í", NULL }, +- { V('\'','O'), 1, "Ó", NULL }, +- { V('\'','U'), 1, "Ú", NULL }, +- { V('\'','Y'), 1, "Ý", NULL }, +- { V('\'','a'), 1, "á", NULL }, +- { V('\'','e'), 1, "é", NULL }, +- { V('\'','i'), 1, "í", NULL }, +- { V('\'','o'), 1, "ó", NULL }, +- { V('\'','u'), 1, "ú", NULL }, +- { V('\'','y'), 1, "ý", NULL }, +- { V('!','='), 1, "≠", NULL }, +- { V('%','0'), 1, "‰", NULL }, +- { V('+','-'), 1, "±", NULL }, +- { V(',','C'), 1, "Ç", NULL }, +- { V(',','c'), 1, "ç", NULL }, +- { V('-','>'), 1, "→", NULL }, +- { V('-','D'), 1, "Ð", NULL }, +- { V('.','i'), 1, "ı", NULL }, +- { V('/','L'), 1, "Ł", NULL }, +- { V('/','O'), 1, "Ø", NULL }, +- { V('/','l'), 1, "ł", NULL }, +- { V('/','o'), 1, "ø", NULL }, +- { V('1','2'), 1, "½", NULL }, +- { V('1','4'), 1, "¼", NULL }, +- { V('3','4'), 1, "¾", NULL }, +- { V(':','A'), 1, "Ä", NULL }, +- { V(':','E'), 1, "Ë", NULL }, +- { V(':','I'), 1, "Ï", NULL }, +- { V(':','O'), 1, "Ö", NULL }, +- { V(':','U'), 1, "Ü", NULL }, +- { V(':','a'), 1, "ä", NULL }, +- { V(':','e'), 1, "ë", NULL }, +- { V(':','i'), 1, "ï", NULL }, +- { V(':','o'), 1, "ö", NULL }, +- { V(':','u'), 1, "ü", NULL }, +- { V(':','y'), 1, "ÿ", NULL }, +- { V('<','-'), 1, "←", NULL }, +- { V('<','='), 1, "≤", NULL }, +- { V('<','>'), 1, "↔", NULL }, +- { V('=','='), 1, "≡", NULL }, +- { V('=','~'), 1, "≅", NULL }, +- { V('>','='), 1, "≥", NULL }, +- { V('A','E'), 1, "Æ", NULL }, +- { V('A','h'), 1, "&alepfsym;", NULL }, +- { V('C','R'), 1, "␍", NULL }, +- { V('C','s'), 1, "¤", NULL }, +- { V('D','o'), 1, "$", NULL }, +- { V('E','u'), 1, "€", NULL }, +- { V('F','c'), 1, "»", NULL }, +- { V('F','i'), 3, "ffi", NULL }, +- { V('F','l'), 3, "ffl", NULL }, +- { V('F','o'), 1, "«", NULL }, +- { V('O','E'), 1, "Œ", NULL }, +- { V('P','o'), 1, "£", NULL }, +- { V('S','1'), 1, "¹", NULL }, +- { V('S','2'), 1, "²", NULL }, +- { V('S','3'), 1, "³", NULL }, +- { V('S','d'), 1, "ð", NULL }, +- { V('T','P'), 1, "Þ", NULL }, +- { V('T','p'), 1, "þ", NULL }, +- { V('Y','e'), 1, "¥", NULL }, +- { V('^','A'), 1, "Â", NULL }, +- { V('^','E'), 1, "Ê", NULL }, +- { V('^','I'), 1, "Î", NULL }, +- { V('^','O'), 1, "Ô", NULL }, +- { V('^','U'), 1, "Û", NULL }, +- { V('^','a'), 1, "â", NULL }, +- { V('^','e'), 1, "ê", NULL }, +- { V('^','i'), 1, "î", NULL }, +- { V('^','o'), 1, "ô", NULL }, +- { V('^','u'), 1, "û", NULL }, +- { V('`','A'), 1, "À", NULL }, +- { V('`','E'), 1, "È", NULL }, +- { V('`','I'), 1, "Ì", NULL }, +- { V('`','O'), 1, "Ò", NULL }, +- { V('`','U'), 1, "Ù", NULL }, +- { V('`','a'), 1, "à", NULL }, +- { V('`','e'), 1, "è", NULL }, +- { V('`','i'), 1, "ì", NULL }, +- { V('`','o'), 1, "ò", NULL }, +- { V('`','u'), 1, "ù", NULL }, +- { V('a','a'), 1, "´", NULL }, +- { V('a','e'), 1, "æ", NULL }, +- { V('a','p'), 1, "≈", NULL }, +- { V('a','q'), 1, "'", NULL }, +- { V('a','t'), 1, "@", NULL }, +- { V('a','~'), 1, "~", NULL }, +- { V('b','a'), 1, "|", NULL }, +- { V('b','b'), 1, "|", NULL }, +- { V('b','r'), 1, "|", NULL }, +- { V('b','r'), 1, "|", NULL }, +- { V('b','u'), 1, "•", NULL }, +- { V('b','v'), 1, "|", NULL }, +- { V('c','*'), 1, "⊗", NULL }, +- { V('c','+'), 1, "⊕", NULL }, +- { V('c','i'), 1, "○", NULL }, +- { V('c','o'), 1, "©", NULL }, +- { V('c','q'), 1, "'", NULL }, +- { V('c','t'), 1, "¢", NULL }, +- { V('d','A'), 1, "⇓", NULL }, +- { V('d','a'), 1, "↓", NULL }, +- { V('d','d'), 1, "=", NULL }, +- { V('d','e'), 1, "°", NULL }, +- { V('d','g'), 1, "-", NULL }, +- { V('d','i'), 1, "÷", NULL }, +- { V('d','q'), 1, """, NULL }, +- { V('e','m'), 3, "---", NULL }, /* em dash */ +- { V('e','n'), 1, "-", NULL }, /* en dash */ +- { V('e','q'), 1, "=", NULL }, +- { V('e','s'), 1, "Ø", NULL }, +- { V('e','u'), 1, "€", NULL }, +- { V('f','/'), 1, "⁄", NULL }, +- { V('f','c'), 1, "›", NULL }, +- { V('f','f'), 2, "ff", NULL }, +- { V('f','i'), 2, "fi", NULL }, +- { V('f','l'), 2, "fl", NULL }, +- { V('f','m'), 1, "´", NULL }, +- { V('f','o'), 1, "‹", NULL }, +- { V('g','a'), 1, "`", NULL }, +- { V('h','A'), 1, "⇔", NULL }, +- { V('h','y'), 1, "-", NULL }, +- { V('i','f'), 1, "∞", NULL }, +- { V('i','s'), 8, "Integral", NULL }, /* integral sign */ +- { V('l','A'), 1, "⇐", NULL }, +- { V('l','B'), 1, "[", NULL }, +- { V('l','C'), 1, "{", NULL }, +- { V('l','a'), 1, "<", NULL }, +- { V('l','b'), 1, "[", NULL }, +- { V('l','c'), 2, "|¯", NULL }, +- { V('l','f'), 2, "|_", NULL }, +- { V('l','h'), 1, "☚", NULL }, +- { V('l','k'), 1, "{", NULL }, +- { V('l','q'), 1, "\"", NULL }, +- { V('l','z'), 1, "◊", NULL }, +- { V('m','c'), 1, "µ", NULL }, +- { V('m','i'), 1, "-", NULL }, +- { V('m','u'), 1, "×", NULL }, +- { V('n','o'), 1, "¬", NULL }, +- { V('o','A'), 1, "Å", NULL }, +- { V('o','a'), 1, "å", NULL }, +- { V('o','e'), 1, "œ", NULL }, +- { V('o','q'), 1, "'", NULL }, +- { V('o','r'), 1, "|", NULL }, +- { V('p','d'), 1, "d", NULL }, /* partial derivative */ +- { V('p','l'), 1, "+", NULL }, +- { V('p','s'), 1, "¶", NULL }, +- { V('r','!'), 1, "¡", NULL }, +- { V('r','?'), 1, "¿", NULL }, +- { V('r','A'), 1, "⇒", NULL }, +- { V('r','B'), 1, "]", NULL }, +- { V('r','C'), 1, "}", NULL }, +- { V('r','a'), 1, ">", NULL }, +- { V('r','c'), 2, "¯|", NULL }, +- { V('r','f'), 2, "_|", NULL }, +- { V('r','g'), 1, "®", NULL }, +- { V('r','h'), 1, "☛", NULL }, +- { V('r','k'), 1, "}", NULL }, +- { V('r','n'), 1, "¯", NULL }, +- { V('r','q'), 1, "\"", NULL }, +- { V('r','s'), 1, "\\", NULL }, +- { V('r','u'), 1, "_", NULL }, +- { V('s','c'), 1, "§", NULL }, +- { V('s','h'), 1, "#", NULL }, +- { V('s','l'), 1, "/", NULL }, +- { V('s','q'), 1, "□", NULL }, +- { V('s','s'), 1, "ß", NULL }, +- { V('t','f'), 1, "∴", NULL }, +- { V('t','i'), 1, "~", NULL }, +- { V('t','m'), 1, "™", NULL }, +- { V('t','s'), 1, "s", NULL }, /* should be terminal sigma */ +- { V('u','A'), 1, "⇑", NULL }, +- { V('u','a'), 1, "↑", NULL }, +- { V('u','l'), 1, "_", NULL }, +- { V('~','A'), 1, "Ã", NULL }, +- { V('~','N'), 1, "Ñ", NULL }, +- { V('~','O'), 1, "Õ", NULL }, +- { V('~','a'), 1, "ã", NULL }, +- { V('~','n'), 1, "ñ", NULL }, +- { V('~','o'), 1, "õ", NULL }, ++ { V('*','*'), 1, "∗", NULL }, /* asterisk */ ++ { V('*','A'), 1, "Α", NULL }, /* Alpha */ ++ { V('*','B'), 1, "Β", NULL }, /* Beta */ ++ { V('*','C'), 1, "Ξ", NULL }, /* Xi */ ++ { V('*','D'), 1, "Δ", NULL }, /* Delta */ ++ { V('*','E'), 1, "Ε", NULL }, /* Epsilon */ ++ { V('*','F'), 1, "Φ", NULL }, /* Phi */ ++ { V('*','G'), 1, "Γ", NULL }, /* Gamma */ ++ { V('*','H'), 1, "Θ", NULL }, /* Theta */ ++ { V('*','I'), 1, "Ι", NULL }, /* Iota */ ++ { V('*','K'), 1, "Κ", NULL }, /* Kappa */ ++ { V('*','L'), 1, "Λ", NULL }, /* Lambda */ ++ { V('*','M'), 1, "Μ", NULL }, /* Mu */ ++ { V('*','N'), 1, "Ν", NULL }, /* Nu */ ++ { V('*','O'), 1, "Ο", NULL }, /* Omicron */ ++ { V('*','P'), 1, "Π", NULL }, /* Pi */ ++ { V('*','Q'), 1, "Ψ", NULL }, /* Psi */ ++ { V('*','R'), 1, "Ρ", NULL }, /* Rho */ ++ { V('*','S'), 1, "Σ", NULL }, /* Sigma */ ++ { V('*','T'), 1, "Τ", NULL }, /* Tau */ ++ { V('*','U'), 1, "Υ", NULL }, /* Upsilon */ ++ { V('*','W'), 1, "Ω", NULL }, /* Omega */ ++ { V('*','X'), 1, "Χ", NULL }, /* Chi */ ++ { V('*','Y'), 1, "Η", NULL }, /* Eta */ ++ { V('*','Z'), 1, "Ζ", NULL }, /* Zeta */ ++ { V('*','a'), 1, "α", NULL }, /* alpha */ ++ { V('*','b'), 1, "β", NULL }, /* beta */ ++ { V('*','c'), 1, "ξ", NULL }, /* xi */ ++ { V('*','d'), 1, "δ", NULL }, /* delta */ ++ { V('*','e'), 1, "ε", NULL }, /* epsilon */ ++ { V('*','f'), 1, "φ", NULL }, /* phi */ ++ { V('*','g'), 1, "γ", NULL }, /* gamma */ ++ { V('*','h'), 1, "θ", NULL }, /* theta */ ++ { V('*','i'), 1, "ι", NULL }, /* iota */ ++ { V('*','k'), 1, "κ", NULL }, /* kappa */ ++ { V('*','l'), 1, "λ", NULL }, /* lambda */ ++ { V('*','m'), 1, "μ", NULL }, /* mu */ ++ { V('*','n'), 1, "ν", NULL }, /* nu */ ++ { V('*','o'), 1, "ο", NULL }, /* omicron */ ++ { V('*','p'), 1, "π", NULL }, /* pi */ ++ { V('*','q'), 1, "ψ", NULL }, /* psi */ ++ { V('*','r'), 1, "ρ", NULL }, /* rho */ ++ { V('*','s'), 1, "σ", NULL }, /* sigma */ ++ { V('*','t'), 1, "τ", NULL }, /* tau */ ++ { V('*','u'), 1, "υ", NULL }, /* upsilon */ ++ { V('*','w'), 1, "ω", NULL }, /* omega */ ++ { V('*','x'), 1, "χ", NULL }, /* chi */ ++ { V('*','y'), 1, "η", NULL }, /* eta */ ++ { V('*','z'), 1, "ζ", NULL }, /* zeta */ ++ { V('\'','A'), 1, "Á", NULL }, /* acute A */ ++ { V('\'','E'), 1, "É", NULL }, /* acute E */ ++ { V('\'','I'), 1, "Í", NULL }, /* acute I */ ++ { V('\'','O'), 1, "Ó", NULL }, /* acute O */ ++ { V('\'','U'), 1, "Ú", NULL }, /* acute U */ ++ { V('\'','Y'), 1, "Ý", NULL }, /* Yacute (*) */ ++ { V('\'','a'), 1, "á", NULL }, /* acute a */ ++ { V('\'','e'), 1, "é", NULL }, /* acute e */ ++ { V('\'','i'), 1, "í", NULL }, /* acute i */ ++ { V('\'','o'), 1, "ó", NULL }, /* acute o */ ++ { V('\'','u'), 1, "ú", NULL }, /* acute u */ ++ { V('\'','y'), 1, "ý", NULL }, /* yacute (*) */ ++ { V('!','='), 1, "≠", NULL }, /* not equal */ ++ { V('%','0'), 1, "‰", NULL }, /* per-thousand */ ++ { V('+','-'), 1, "±", NULL }, /* plus-minus */ ++ { V('+','e'), 1, "ϵ", NULL }, /* epsilon variant */ ++ { V('+','f'), 1, "φ", NULL }, /* phi variant */ ++ { V('+','h'), 1, "ϑ", NULL }, /* theta variant */ ++ { V('+','p'), 1, "ϖ", NULL }, /* pi variant */ ++ { V(',','C'), 1, "Ç", NULL }, /* cedilla C */ ++ { V(',','c'), 1, "ç", NULL }, /* cedilla c */ ++ { V('-','+'), 1, "∓", NULL }, /* minus-plus */ ++ { V('-','>'), 1, "→", NULL }, /* right arrow */ ++ { V('-','D'), 1, "Ð", NULL }, /* Eth */ ++ { V('-','h'), 1, "ℏ", NULL }, /* Planck constant over 2π */ ++ { V('.','i'), 1, "ı", NULL }, /* dotless i */ ++ { V('.','j'), 1, "ȷ", NULL }, /* dotless j */ ++ { V('/','L'), 1, "Ł", NULL }, /* stroke L */ ++ { V('/','O'), 1, "Ø", NULL }, /* stroke O */ ++ { V('/','_'), 1, "∠", NULL }, /* angle */ ++ { V('/','l'), 1, "ł", NULL }, /* stroke l */ ++ { V('/','o'), 1, "ø", NULL }, /* stroke o */ ++ { V('1','2'), 1, "½", NULL }, /* 1/2 (*) */ ++ { V('1','4'), 1, "¼", NULL }, /* 1/4 (*) */ ++ { V('3','4'), 1, "¾", NULL }, /* 3/4 (*) */ ++ { V('3','d'), 1, "∴", NULL }, /* therefore */ ++ { V(':','A'), 1, "Ä", NULL }, /* dieresis A */ ++ { V(':','E'), 1, "Ë", NULL }, /* dieresis E */ ++ { V(':','I'), 1, "Ï", NULL }, /* dieresis I */ ++ { V(':','O'), 1, "Ö", NULL }, /* dieresis O */ ++ { V(':','U'), 1, "Ü", NULL }, /* dieresis U */ ++ { V(':','a'), 1, "ä", NULL }, /* dieresis a */ ++ { V(':','e'), 1, "ë", NULL }, /* dieresis e */ ++ { V(':','i'), 1, "ï", NULL }, /* dieresis i */ ++ { V(':','o'), 1, "ö", NULL }, /* dieresis o */ ++ { V(':','u'), 1, "ü", NULL }, /* dieresis u */ ++ { V(':','y'), 1, "ÿ", NULL }, /* dieresis y */ ++ { V('<','-'), 1, "←", NULL }, /* left arrow */ ++ { V('<','<'), 1, "≪", NULL }, /* much less */ ++ { V('<','='), 1, "≤", NULL }, /* less-than-equal */ ++ { V('<','>'), 1, "↔", NULL }, /* left-right arrow */ ++ { V('=','='), 1, "≡", NULL }, /* equivalent */ ++ { V('=','~'), 1, "≅", NULL }, /* approximately equal */ ++ { V('>','='), 1, "≥", NULL }, /* greater-than-equal */ ++ { V('>','>'), 1, "≫", NULL }, /* much greater */ ++ { V('A','E'), 1, "Æ", NULL }, /* AE ligature */ ++ { V('A','N'), 1, "∧", NULL }, /* logical and */ ++ { V('A','h'), 1, "ℵ", NULL }, /* aleph */ ++ { V('B','q'), 1, "„", NULL }, /* right low double-quote */ ++ { V('C','R'), 1, "↵", NULL }, /* carriage return */ ++ { V('C','s'), 1, "¤", NULL }, /* Scandinavian */ ++ { V('D','o'), 1, "$", NULL }, /* dollar */ ++ { V('E','u'), 1, "€", NULL }, /* Euro symbol */ ++ { V('F','c'), 1, "»", NULL }, /* right guillemet */ ++ { V('F','i'), 1, "ffi", NULL }, /* ffi ligature */ ++ { V('F','l'), 1, "ffl", NULL }, /* ffl ligature */ ++ { V('F','n'), 1, "ƒ", NULL }, /* florin */ ++ { V('F','o'), 1, "«", NULL }, /* left guillemet */ ++ { V('I','J'), 1, "IJ", NULL }, /* IJ ligature */ ++ { V('I','m'), 1, "ℑ", NULL }, /* imaginary */ ++ { V('O','E'), 1, "Œ", NULL }, /* OE ligature */ ++ { V('O','K'), 1, "✓", NULL }, /* check mark */ ++ { V('O','R'), 1, "∨", NULL }, /* logical or */ ++ { V('P','o'), 1, "£", NULL }, /* pound */ ++ { V('R','e'), 1, "ℜ", NULL }, /* real */ ++ { V('S','1'), 1, "¹", NULL }, /* sup1 (*) */ ++ { V('S','2'), 1, "²", NULL }, /* sup2 (*) */ ++ { V('S','3'), 1, "³", NULL }, /* sup3 (*) */ ++ { V('S','d'), 1, "ð", NULL }, /* eth */ ++ { V('T','P'), 1, "Þ", NULL }, /* Thorn */ ++ { V('T','p'), 1, "þ", NULL }, /* thorn */ ++ { V('Y','e'), 1, "¥", NULL }, /* yen */ ++ { V('^','A'), 1, "Â", NULL }, /* circumflex A */ ++ { V('^','E'), 1, "Ê", NULL }, /* circumflex E */ ++ { V('^','I'), 1, "Î", NULL }, /* circumflex I */ ++ { V('^','O'), 1, "Ô", NULL }, /* circumflex O */ ++ { V('^','U'), 1, "Û", NULL }, /* circumflex U */ ++ { V('^','a'), 1, "â", NULL }, /* circumflex a */ ++ { V('^','e'), 1, "ê", NULL }, /* circumflex e */ ++ { V('^','i'), 1, "î", NULL }, /* circumflex i */ ++ { V('^','o'), 1, "ô", NULL }, /* circumflex o */ ++ { V('^','u'), 1, "û", NULL }, /* circumflex u */ ++ { V('`','A'), 1, "À", NULL }, /* grave A */ ++ { V('`','E'), 1, "È", NULL }, /* grave E */ ++ { V('`','I'), 1, "Ì", NULL }, /* grave I */ ++ { V('`','O'), 1, "Ò", NULL }, /* grave O */ ++ { V('`','U'), 1, "Ù", NULL }, /* grave U */ ++ { V('`','a'), 1, "à", NULL }, /* grave a */ ++ { V('`','e'), 1, "è", NULL }, /* grave e */ ++ { V('`','i'), 1, "ì", NULL }, /* grave i */ ++ { V('`','o'), 1, "ò", NULL }, /* grave o */ ++ { V('`','u'), 1, "ù", NULL }, /* grave u */ ++ { V('a','"'), 1, "˝", NULL }, /* Hungarian umlaut */ ++ { V('a','-'), 1, "¯", NULL }, /* macron */ ++ { V('a','.'), 1, "˙", NULL }, /* dotted */ ++ { V('a','^'), 1, "^", NULL }, /* circumflex */ ++ { V('a','a'), 1, "´", NULL }, /* acute */ ++ { V('a','b'), 1, "˘", NULL }, /* breve */ ++ { V('a','c'), 1, "¸", NULL }, /* cedilla */ ++ { V('a','d'), 1, "¨", NULL }, /* dieresis */ ++ { V('a','e'), 1, "æ", NULL }, /* ae ligature */ ++ { V('a','h'), 1, "ˇ", NULL }, /* caron */ ++ { V('a','o'), 1, "˚", NULL }, /* ring */ ++ { V('a','p'), 1, "∼", NULL }, /* tilde operator */ ++ { V('a','q'), 1, "'", NULL }, /* apostrophe quote (text) */ ++ { V('a','t'), 1, "@", NULL }, /* at */ ++ { V('a','~'), 1, "~", NULL }, /* tilde */ ++ { V('b','a'), 1, "|", NULL }, /* bar */ ++ { V('b','b'), 1, "¦", NULL }, /* broken bar */ ++ { V('b','r'), 1, "│", NULL }, /* box rule */ ++ { V('b','q'), 1, "‚", NULL }, /* right low single-quote */ ++ { V('b','u'), 1, "•", NULL }, /* bullet */ ++ { V('b','v'), 1, "⎪", NULL }, /* brace extension */ ++ { V('c','*'), 1, "⊗", NULL }, /* circle-multiply */ ++ { V('c','+'), 1, "⊕", NULL }, /* circle-plus */ ++ { V('c','a'), 1, "∩", NULL }, /* intersection */ ++ { V('c','i'), 1, "○", NULL }, /* circle */ ++ { V('c','o'), 1, "©", NULL }, /* copyright */ ++ { V('c','q'), 1, "’", NULL }, /* right single-quote */ ++ { V('c','t'), 1, "¢", NULL }, /* cent */ ++ { V('c','u'), 1, "∪", NULL }, /* union */ ++ { V('d','A'), 1, "⇓", NULL }, /* down double-arrow */ ++ { V('d','a'), 1, "↓", NULL }, /* down arrow */ ++ { V('d','d'), 1, "‡", NULL }, /* double dagger */ ++ { V('d','e'), 1, "°", NULL }, /* degree */ ++ { V('d','g'), 1, "†", NULL }, /* dagger */ ++ { V('d','i'), 1, "÷", NULL }, /* divide */ ++ { V('d','q'), 1, "\"", NULL }, /* double quote (text) */ ++ { V('e','m'), 1, "—", NULL }, /* em-dash */ ++ { V('e','n'), 1, "–", NULL }, /* en-dash */ ++ { V('e','q'), 1, "=", NULL }, /* equal */ ++ { V('e','s'), 1, "∅", NULL }, /* empty set */ ++ { V('e','u'), 1, "€", NULL }, /* Euro symbol */ ++ { V('f','/'), 1, "⁄", NULL }, /* fraction */ ++ { V('f','a'), 1, "∀", NULL }, /* universal quantifier */ ++ { V('f','c'), 1, "›", NULL }, /* right single guillemet */ ++ { V('f','f'), 1, "ff", NULL }, /* ff ligature */ ++ { V('f','i'), 1, "fi", NULL }, /* fi ligature */ ++ { V('f','l'), 1, "fl", NULL }, /* fl ligature */ ++ { V('f','m'), 1, "′", NULL }, /* minute */ ++ { V('f','o'), 1, "‹", NULL }, /* left single guillemet */ ++ { V('g','a'), 1, "`", NULL }, /* grave */ ++ { V('g','r'), 1, "∇", NULL }, /* gradient */ ++ { V('h','A'), 1, "⇔", NULL }, /* left-right double-arrow */ ++ { V('h','a'), 1, "^", NULL }, /* hat (text) */ ++ { V('h','o'), 1, "˛", NULL }, /* ogonek */ ++ { V('h','y'), 1, "‐", NULL }, /* hyphen */ ++ { V('i','b'), 1, "⊆", NULL }, /* reflexive subset */ ++ { V('i','f'), 1, "∞", NULL }, /* infinity */ ++ { V('i','j'), 1, "ij", NULL }, /* ij ligature */ ++ { V('i','p'), 1, "⊇", NULL }, /* reflexive superset */ ++ { V('i','s'), 1, "∫", NULL }, /* integral */ ++ { V('l','A'), 1, "⇐", NULL }, /* left double-arrow */ ++ { V('l','B'), 1, "[", NULL }, /* left bracket */ ++ { V('l','C'), 1, "{", NULL }, /* left brace */ ++ { V('l','a'), 1, "⟨", NULL }, /* left angle */ ++ { V('l','b'), 1, "⎩", NULL }, /* bottom-left hooked brace */ ++ { V('l','c'), 1, "⌈", NULL }, /* left-ceiling */ ++ { V('l','f'), 1, "⌊", NULL }, /* left-floor */ ++ { V('l','h'), 1, "☜", NULL }, /* left hand */ ++ { V('l','k'), 1, "⎨", NULL }, /* mid-left hooked brace */ ++ { V('l','q'), 1, "“", NULL }, /* left double-quote */ ++ { V('l','t'), 1, "⎧", NULL }, /* top-left hooked brace */ ++ { V('l','z'), 1, "◊", NULL }, /* lozenge */ ++ { V('m','c'), 1, "µ", NULL }, /* micro */ ++ { V('m','i'), 1, "−", NULL }, /* minus */ ++ { V('m','o'), 1, "∈", NULL }, /* element */ ++ { V('m','u'), 1, "×", NULL }, /* multiply */ ++ { V('n','b'), 1, "⊄", NULL }, /* not subset */ ++ { V('n','c'), 1, "⊅", NULL }, /* not superset */ ++ { V('n','e'), 1, "≢", NULL }, /* not equivalent */ ++ { V('n','m'), 1, "∉", NULL }, /* not element */ ++ { V('n','o'), 1, "¬", NULL }, /* logical not */ ++ { V('o','A'), 1, "Å", NULL }, /* ring A */ ++ { V('o','a'), 1, "å", NULL }, /* ring a */ ++ { V('o','e'), 1, "œ", NULL }, /* oe ligature */ ++ { V('o','q'), 1, "‘", NULL }, /* left single-quote */ ++ { V('o','r'), 1, "|", NULL }, /* bitwise or */ ++ { V('p','c'), 1, "·", NULL }, /* center-dot */ ++ { V('p','d'), 1, "∂", NULL }, /* partial differential */ ++ { V('p','l'), 1, "+", NULL }, /* plus */ ++ { V('p','p'), 1, "⊥", NULL }, /* perpendicular */ ++ { V('p','s'), 1, "¶", NULL }, /* paragraph */ ++ { V('p','t'), 1, "∝", NULL }, /* proportionate */ ++ { V('r','!'), 1, "¡", NULL }, /* upside-down exclamation */ ++ { V('r','?'), 1, "¿", NULL }, /* upside-down question */ ++ { V('r','A'), 1, "⇒", NULL }, /* right double-arrow */ ++ { V('r','B'), 1, "]", NULL }, /* right bracket */ ++ { V('r','C'), 1, "}", NULL }, /* right brace */ ++ { V('r','a'), 1, "⟩", NULL }, /* right angle */ ++ { V('r','b'), 1, "⎭", NULL }, /* bottom-right hooked brace */ ++ { V('r','c'), 1, "⌉", NULL }, /* right-ceiling */ ++ { V('r','f'), 1, "⌋", NULL }, /* right-floor */ ++ { V('r','g'), 1, "®", NULL }, /* registered */ ++ { V('r','h'), 1, "☞", NULL }, /* right hand */ ++ { V('r','k'), 1, "⎬", NULL }, /* mid-right hooked brace */ ++ { V('r','l'), 1, "‾", NULL }, /* overline */ ++ { V('r','n'), 1, "‾", NULL }, /* overline */ ++ { V('r','q'), 1, "”", NULL }, /* right double-quote */ ++ { V('r','s'), 1, "\\", NULL }, /* backward slash */ ++ { V('r','t'), 1, "⎫", NULL }, /* top-left hooked brace */ ++ { V('r','u'), 1, "_", NULL }, /* (*) */ ++ { V('s','b'), 1, "⊂", NULL }, /* proper subset */ ++ { V('s','c'), 1, "§", NULL }, /* section */ ++ { V('s','d'), 1, "″", NULL }, /* second */ ++ { V('s','h'), 1, "#", NULL }, /* hash (pound) */ ++ { V('s','l'), 1, "/", NULL }, /* forward slash */ ++ { V('s','p'), 1, "⊃", NULL }, /* proper superset */ ++ { V('s','q'), 1, "□", NULL }, /* white square */ ++ { V('s','r'), 1, "√", NULL }, /* square root */ ++ { V('s','s'), 1, "ß", NULL }, /* German eszett */ ++ { V('s','t'), 1, "∋", NULL }, /* such that */ ++ { V('t','e'), 1, "∃", NULL }, /* existential quantifier */ ++ { V('t','f'), 1, "∴", NULL }, /* therefore */ ++ { V('t','i'), 1, "~", NULL }, /* tilde (text) */ ++ { V('t','m'), 1, "™", NULL }, /* trademarked */ ++ { V('t','s'), 1, "ς", NULL }, /* sigma terminal */ ++ { V('u','A'), 1, "⇑", NULL }, /* up double-arrow */ ++ { V('u','a'), 1, "↑", NULL }, /* up arrow */ ++ { V('u','l'), 1, "_", NULL }, /* underscore */ ++ { V('v','A'), 1, "⇕", NULL }, /* up-down double-arrow */ ++ { V('v','a'), 1, "↕", NULL }, /* up-down arrow */ ++ { V('|','='), 1, "≃", NULL }, /* asymptotically equal */ ++ { V('~','='), 1, "≈", NULL }, /* almost equal */ ++ { V('~','A'), 1, "Ã", NULL }, /* tilde A */ ++ { V('~','N'), 1, "Ñ", NULL }, /* tilde N */ ++ { V('~','O'), 1, "Õ", NULL }, /* tilde O */ ++ { V('~','a'), 1, "ã", NULL }, /* tilde a */ ++ { V('~','n'), 1, "ñ", NULL }, /* tilde n */ ++ { V('~','o'), 1, "õ", NULL }, /* tilde o */ ++ { V('~','~'), 1, "≈", NULL }, /* almost equal */ + { 0, 0, NULL, NULL } +- +- + }; + + void stdinit(void) { +--- /dev/null ++++ b/version.h +@@ -0,0 +1 @@ ++#define version "1.6g-7-slitaz" diff -r c7b121a4ffd9 -r d6378d455338 man2html/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man2html/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|man2html-slitaz.diff diff -r c7b121a4ffd9 -r d6378d455338 manserver/receipt --- a/manserver/receipt Wed May 09 17:03:28 2018 +0300 +++ b/manserver/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,7 @@ genpkg_rules() { mkdir -p $fs/usr/bin $fs/usr/share/licenses $fs/usr/share/man/man1 $fs/etc/init.d - cd $src; patch -p0 -i $stuff/manserver-1.08-add-xz.patch + install -Dm755 $src/manServer.pl $fs/usr/bin/manServer install -Dm755 $stuff/manserver $fs/usr/bin/manserver install -Dm644 $src/LICENSE $fs/usr/share/licenses/manserver.txt diff -r c7b121a4ffd9 -r d6378d455338 manserver/stuff/manserver-1.08-add-xz.patch --- a/manserver/stuff/manserver-1.08-add-xz.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ ---- manServer.pl.orig -+++ manServer.pl -@@ -175,7 +175,7 @@ - listDir($request); - $processed = 1; - } -- elsif (-f $request || -f "$request.gz" || -f "$request.bz2") -+ elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz") - { - # Only allow fully specified files if they're in our manpath - foreach $md (@manpath) -@@ -270,7 +270,7 @@ - foreach $f (@files) - { - next if ($f eq "." || $f eq ".." || $f !~ m/\./); -- $f =~ s/\.(gz|bz2)$//; -+ $f =~ s/\.(gz|bz2|xz)$//; - # ($name) = ($f =~ m,/([^/]*)$,); - print OUT "$f \n"; - } -@@ -322,6 +322,13 @@ - $srcfile =~ m/^(.*)$/; - $srcfile = $1; # untaint - } -+ elsif (-f "$file.xz") -+ { -+ $zfile = "$file.xz"; -+ $srcfile = "/usr/bin/xzcat $zfile |"; -+ $srcfile =~ m/^(.*)$/; -+ $srcfile = $1; # untaint -+ } - } - print LOG "man2html $file\n"; - $foundNroffTag = 0; -@@ -2823,7 +2830,7 @@ - @multipleMatches = (); - - $file = $_[0]; -- return $file if (-f $file || -f "$file.gz" || -f "$file.bz2"); -+ return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); - - # Search the path for the requested man page, which may be of the form: - # "/usr/man/man1/ls.1", "ls.1" or "ls". -@@ -2837,7 +2844,7 @@ - { - $dir = $md; - $file = "$dir/man$sect/$page.$sect"; -- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); -+ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); - } - } - else -@@ -2855,13 +2862,13 @@ - { - ($s) = ($dir =~ m/man([0-9A-Za-z]+)$/); - $file = "$dir/$page.$s"; -- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); -+ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); - $file = "$dir/$request"; -- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); -+ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); - if ($sect && "$page.$sect" ne $request) - { - $file = "$dir/$page.$sect"; -- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); -+ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); - } - } - if (@multipleMatches == 1) -@@ -2882,7 +2889,7 @@ - { - if ($f =~ m/^$page\./) - { -- $f =~ s/\.(gz|bz2)$//; -+ $f =~ s/\.(gz|bz2|xz)$//; - push(@multipleMatches, "$dir/$f"); - } - } -@@ -2908,7 +2915,7 @@ - { - next if ($f eq "." || $f eq ".." || $f !~ m/\./); - next unless ("$dir/$f" =~ m/perl/); -- $f =~ s/\.(gz|bz2)$//; -+ $f =~ s/\.(gz|bz2|xz)$//; - ($name) = ($f =~ m,(.+)\.[^.]*$,); - $perlPages{$name} = "$dir/$f"; - } diff -r c7b121a4ffd9 -r d6378d455338 manserver/stuff/patches/manserver-1.08-add-xz.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/patches/manserver-1.08-add-xz.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,87 @@ +--- manServer.pl.orig ++++ manServer.pl +@@ -175,7 +175,7 @@ + listDir($request); + $processed = 1; + } +- elsif (-f $request || -f "$request.gz" || -f "$request.bz2") ++ elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz") + { + # Only allow fully specified files if they're in our manpath + foreach $md (@manpath) +@@ -270,7 +270,7 @@ + foreach $f (@files) + { + next if ($f eq "." || $f eq ".." || $f !~ m/\./); +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + # ($name) = ($f =~ m,/([^/]*)$,); + print OUT "$f \n"; + } +@@ -322,6 +322,13 @@ + $srcfile =~ m/^(.*)$/; + $srcfile = $1; # untaint + } ++ elsif (-f "$file.xz") ++ { ++ $zfile = "$file.xz"; ++ $srcfile = "/usr/bin/xzcat $zfile |"; ++ $srcfile =~ m/^(.*)$/; ++ $srcfile = $1; # untaint ++ } + } + print LOG "man2html $file\n"; + $foundNroffTag = 0; +@@ -2823,7 +2830,7 @@ + @multipleMatches = (); + + $file = $_[0]; +- return $file if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + + # Search the path for the requested man page, which may be of the form: + # "/usr/man/man1/ls.1", "ls.1" or "ls". +@@ -2837,7 +2844,7 @@ + { + $dir = $md; + $file = "$dir/man$sect/$page.$sect"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + } + } + else +@@ -2855,13 +2862,13 @@ + { + ($s) = ($dir =~ m/man([0-9A-Za-z]+)$/); + $file = "$dir/$page.$s"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + $file = "$dir/$request"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + if ($sect && "$page.$sect" ne $request) + { + $file = "$dir/$page.$sect"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + } + } + if (@multipleMatches == 1) +@@ -2882,7 +2889,7 @@ + { + if ($f =~ m/^$page\./) + { +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + push(@multipleMatches, "$dir/$f"); + } + } +@@ -2908,7 +2915,7 @@ + { + next if ($f eq "." || $f eq ".." || $f !~ m/\./); + next unless ("$dir/$f" =~ m/perl/); +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + ($name) = ($f =~ m,(.+)\.[^.]*$,); + $perlPages{$name} = "$dir/$f"; + } diff -r c7b121a4ffd9 -r d6378d455338 manserver/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|manserver-1.08-add-xz.patch diff -r c7b121a4ffd9 -r d6378d455338 marlin/receipt --- a/marlin/receipt Wed May 09 17:03:28 2018 +0300 +++ b/marlin/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,8 +21,6 @@ # gee-1.0 is old while gee-0.8 is latest ;) sed -i 's|gee-1.0|gee-0.8|g' $(grep -l gee-1.0 $(find . -type f)) - patch -p1 < $stuff/marlin-0.5.patch - patch -p1 < $stuff/marlin-icons.patch sed -i 's/Gdk.EventKey event = Gdk.EventKey(/Gdk.Event event = new Gdk.Event(Gdk.EventType.KEY_PRESS/' libwidgets/tests/tests-pathbar.vala sed -i 's/event\./&key./' libwidgets/tests/tests-pathbar.vala sed -i 's/event)/event.key)/' libwidgets/tests/tests-pathbar.vala diff -r c7b121a4ffd9 -r d6378d455338 marlin/stuff/marlin-0.5.patch --- a/marlin/stuff/marlin-0.5.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# discussion: https://aur.archlinux.org/packages/marlin-bzr/ -# patch found here: http://pastie.org/5189903 ---- marlin-0.5/src/fm-directory-view.h -+++ marlin-0.5/src/fm-directory-view.h -@@ -42,6 +42,7 @@ - typedef struct FMDirectoryView FMDirectoryView; - typedef struct FMDirectoryViewClass FMDirectoryViewClass; - -+#define FM_DIRECTORY_TYPE_VIEW fm_directory_view_get_type() - #define FM_TYPE_DIRECTORY_VIEW fm_directory_view_get_type() - #define FM_DIRECTORY_VIEW(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_DIRECTORY_VIEW, FMDirectoryView)) - ---- marlin-0.5/src/exo-icon-view.c -+++ marlin-0.5/src/exo-icon-view.c -@@ -4641,8 +4641,15 @@ - item = list ? list->data : NULL; - - /* Give focus to the first cell initially */ -- exo_icon_view_set_cell_data (icon_view, item); -- gtk_cell_area_focus (icon_view->priv->cell_area, direction); -+ if (item == NULL) -+ { -+ return; -+ } -+ else -+ { -+ exo_icon_view_set_cell_data (icon_view, item); -+ gtk_cell_area_focus (icon_view->priv->cell_area, direction); -+ } - } - else - { -@@ -4798,8 +4805,15 @@ - item = list ? list->data : NULL; - - /* Give focus to the first cell initially */ -- exo_icon_view_set_cell_data (icon_view, item); -- gtk_cell_area_focus (icon_view->priv->cell_area, direction); -+ if (item == NULL) -+ { -+ return; -+ } -+ else -+ { -+ exo_icon_view_set_cell_data (icon_view, item); -+ gtk_cell_area_focus (icon_view->priv->cell_area, direction); -+ } - } - else - { diff -r c7b121a4ffd9 -r d6378d455338 marlin/stuff/marlin-icons.patch --- a/marlin/stuff/marlin-icons.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ ---- marlin-0.5/src/View/Chrome/ViewSwicher.vala -+++ marlin-0.5/src/View/Chrome/ViewSwicher.vala -@@ -74,16 +74,16 @@ - - switcher = new ModeButton (); - -- icon = new Image.from_icon_name ("view-list-icons-symbolic", IconSize.MENU); -+ icon = new Image.from_icon_name ("view-list-icons", IconSize.MENU); - icon.set_tooltip_text (_("View as icons")); - switcher.append(icon); -- list = new Image.from_icon_name ("view-list-details-symbolic", IconSize.MENU); -+ list = new Image.from_icon_name ("view-list-details", IconSize.MENU); - list.set_tooltip_text (_("View as list")); - switcher.append(list); -- compact = new Image.from_icon_name ("view-list-compact-symbolic", IconSize.MENU); -+ compact = new Image.from_icon_name ("view-list-compact", IconSize.MENU); - compact.set_tooltip_text (_("View as compact list")); - switcher.append(compact); -- miller = new Image.from_icon_name ("view-list-column-symbolic", IconSize.MENU); -+ miller = new Image.from_icon_name ("view-list-column", IconSize.MENU); - miller.set_tooltip_text(_("View as column")); - switcher.append(miller); - ---- marlin-0.5/src/View/Window.vala -+++ marlin-0.5/src/View/Window.vala -@@ -703,13 +703,13 @@ - { "Redo", Stock.REDO, N_("_Redo"), - "Y", N_("Redo the last action"), - action_redo_callback }, -- { "Up", "go-up-symbolic", N_("Open _Parent"), -+ { "Up", "go-up", N_("Open _Parent"), - "Up", N_("Open the parent folder"), - action_go_up }, -- { "Back", "go-previous-symbolic", N_("_Back"), -+ { "Back", "go-previous", N_("_Back"), - "Left", N_("Go to the previous visited location"), - action_go_back }, -- { "Forward", "go-next-symbolic", N_("_Forward"), -+ { "Forward", "go-next", N_("_Forward"), - "Right", N_("Go to the next visited location"), - action_go_forward }, - { "Reload", Stock.REFRESH, N_("_Reload"), ---- marlin-0.5/src/View/LocationBar.vala -+++ marlin-0.5/src/View/LocationBar.vala -@@ -110,7 +110,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.MUSIC); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-music-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-music", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -119,7 +119,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.PICTURES); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-pictures-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-pictures", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -128,7 +128,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.VIDEOS); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-videos-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-videos", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -137,7 +137,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.DOWNLOAD); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-downloads-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-downloads", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -146,7 +146,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.DOCUMENTS); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-documents-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-documents", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -155,7 +155,7 @@ - dir = Environment.get_user_special_dir(UserDirectory.TEMPLATES); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "folder-templates-symbolic", false, null, null, dir.split("/"), false, null}; -+ IconDirectory icon = {dir, "folder-templates", false, null, null, dir.split("/"), false, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } -@@ -163,7 +163,7 @@ - dir = Environment.get_home_dir(); - if(dir.contains("/")) - { -- IconDirectory icon = {dir, "go-home-symbolic", false, null, null, dir.split("/"), true, null}; -+ IconDirectory icon = {dir, "go-home", false, null, null, dir.split("/"), true, null}; - icon.exploded[0] = "/"; - add_icon(icon); - } ---- marlin-0.5/src/View/Chrome/TopMenu.vala -+++ marlin-0.5/src/View/Chrome/TopMenu.vala -@@ -43,7 +43,7 @@ - compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu"); - toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu"); - -- app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system-symbolic", IconSize.MENU), -+ app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system", IconSize.MENU), - null, _("Menu"), compact_menu); - setup_items(); - show(); ---- marlin-0.5/libwidgets/BreadcrumbsEntry.vala -+++ marlin-0.5/libwidgets/BreadcrumbsEntry.vala -@@ -74,7 +74,7 @@ - - /* Load arrow image */ - try { -- arrow_img = IconTheme.get_default ().load_icon ("go-jump-symbolic", 16, IconLookupFlags.GENERIC_FALLBACK); -+ arrow_img = IconTheme.get_default ().load_icon ("go-jump", 16, IconLookupFlags.GENERIC_FALLBACK); - } catch(Error err) { - stderr.printf ("Unable to load home icon: %s", err.message); - } diff -r c7b121a4ffd9 -r d6378d455338 marlin/stuff/patches/marlin-0.5.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/marlin/stuff/patches/marlin-0.5.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,51 @@ +# discussion: https://aur.archlinux.org/packages/marlin-bzr/ +# patch found here: http://pastie.org/5189903 +--- marlin-0.5/src/fm-directory-view.h ++++ marlin-0.5/src/fm-directory-view.h +@@ -42,6 +42,7 @@ + typedef struct FMDirectoryView FMDirectoryView; + typedef struct FMDirectoryViewClass FMDirectoryViewClass; + ++#define FM_DIRECTORY_TYPE_VIEW fm_directory_view_get_type() + #define FM_TYPE_DIRECTORY_VIEW fm_directory_view_get_type() + #define FM_DIRECTORY_VIEW(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_DIRECTORY_VIEW, FMDirectoryView)) + +--- marlin-0.5/src/exo-icon-view.c ++++ marlin-0.5/src/exo-icon-view.c +@@ -4641,8 +4641,15 @@ + item = list ? list->data : NULL; + + /* Give focus to the first cell initially */ +- exo_icon_view_set_cell_data (icon_view, item); +- gtk_cell_area_focus (icon_view->priv->cell_area, direction); ++ if (item == NULL) ++ { ++ return; ++ } ++ else ++ { ++ exo_icon_view_set_cell_data (icon_view, item); ++ gtk_cell_area_focus (icon_view->priv->cell_area, direction); ++ } + } + else + { +@@ -4798,8 +4805,15 @@ + item = list ? list->data : NULL; + + /* Give focus to the first cell initially */ +- exo_icon_view_set_cell_data (icon_view, item); +- gtk_cell_area_focus (icon_view->priv->cell_area, direction); ++ if (item == NULL) ++ { ++ return; ++ } ++ else ++ { ++ exo_icon_view_set_cell_data (icon_view, item); ++ gtk_cell_area_focus (icon_view->priv->cell_area, direction); ++ } + } + else + { diff -r c7b121a4ffd9 -r d6378d455338 marlin/stuff/patches/marlin-icons.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/marlin/stuff/patches/marlin-icons.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,129 @@ +--- marlin-0.5/src/View/Chrome/ViewSwicher.vala ++++ marlin-0.5/src/View/Chrome/ViewSwicher.vala +@@ -74,16 +74,16 @@ + + switcher = new ModeButton (); + +- icon = new Image.from_icon_name ("view-list-icons-symbolic", IconSize.MENU); ++ icon = new Image.from_icon_name ("view-list-icons", IconSize.MENU); + icon.set_tooltip_text (_("View as icons")); + switcher.append(icon); +- list = new Image.from_icon_name ("view-list-details-symbolic", IconSize.MENU); ++ list = new Image.from_icon_name ("view-list-details", IconSize.MENU); + list.set_tooltip_text (_("View as list")); + switcher.append(list); +- compact = new Image.from_icon_name ("view-list-compact-symbolic", IconSize.MENU); ++ compact = new Image.from_icon_name ("view-list-compact", IconSize.MENU); + compact.set_tooltip_text (_("View as compact list")); + switcher.append(compact); +- miller = new Image.from_icon_name ("view-list-column-symbolic", IconSize.MENU); ++ miller = new Image.from_icon_name ("view-list-column", IconSize.MENU); + miller.set_tooltip_text(_("View as column")); + switcher.append(miller); + +--- marlin-0.5/src/View/Window.vala ++++ marlin-0.5/src/View/Window.vala +@@ -703,13 +703,13 @@ + { "Redo", Stock.REDO, N_("_Redo"), + "Y", N_("Redo the last action"), + action_redo_callback }, +- { "Up", "go-up-symbolic", N_("Open _Parent"), ++ { "Up", "go-up", N_("Open _Parent"), + "Up", N_("Open the parent folder"), + action_go_up }, +- { "Back", "go-previous-symbolic", N_("_Back"), ++ { "Back", "go-previous", N_("_Back"), + "Left", N_("Go to the previous visited location"), + action_go_back }, +- { "Forward", "go-next-symbolic", N_("_Forward"), ++ { "Forward", "go-next", N_("_Forward"), + "Right", N_("Go to the next visited location"), + action_go_forward }, + { "Reload", Stock.REFRESH, N_("_Reload"), +--- marlin-0.5/src/View/LocationBar.vala ++++ marlin-0.5/src/View/LocationBar.vala +@@ -110,7 +110,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.MUSIC); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-music-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-music", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -119,7 +119,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.PICTURES); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-pictures-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-pictures", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -128,7 +128,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.VIDEOS); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-videos-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-videos", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -137,7 +137,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.DOWNLOAD); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-downloads-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-downloads", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -146,7 +146,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.DOCUMENTS); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-documents-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-documents", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -155,7 +155,7 @@ + dir = Environment.get_user_special_dir(UserDirectory.TEMPLATES); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "folder-templates-symbolic", false, null, null, dir.split("/"), false, null}; ++ IconDirectory icon = {dir, "folder-templates", false, null, null, dir.split("/"), false, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +@@ -163,7 +163,7 @@ + dir = Environment.get_home_dir(); + if(dir.contains("/")) + { +- IconDirectory icon = {dir, "go-home-symbolic", false, null, null, dir.split("/"), true, null}; ++ IconDirectory icon = {dir, "go-home", false, null, null, dir.split("/"), true, null}; + icon.exploded[0] = "/"; + add_icon(icon); + } +--- marlin-0.5/src/View/Chrome/TopMenu.vala ++++ marlin-0.5/src/View/Chrome/TopMenu.vala +@@ -43,7 +43,7 @@ + compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu"); + toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu"); + +- app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system-symbolic", IconSize.MENU), ++ app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system", IconSize.MENU), + null, _("Menu"), compact_menu); + setup_items(); + show(); +--- marlin-0.5/libwidgets/BreadcrumbsEntry.vala ++++ marlin-0.5/libwidgets/BreadcrumbsEntry.vala +@@ -74,7 +74,7 @@ + + /* Load arrow image */ + try { +- arrow_img = IconTheme.get_default ().load_icon ("go-jump-symbolic", 16, IconLookupFlags.GENERIC_FALLBACK); ++ arrow_img = IconTheme.get_default ().load_icon ("go-jump", 16, IconLookupFlags.GENERIC_FALLBACK); + } catch(Error err) { + stderr.printf ("Unable to load home icon: %s", err.message); + } diff -r c7b121a4ffd9 -r d6378d455338 marlin/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/marlin/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|marlin-0.5.patch +-p1|marlin-icons.patch diff -r c7b121a4ffd9 -r d6378d455338 memtest/receipt --- a/memtest/receipt Wed May 09 17:03:28 2018 +0300 +++ b/memtest/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,7 +21,7 @@ sed -i -e '/scp memtest.bin/d' -e 's/gcc/gcc-3/' \ -e 's/-fno-stack-protector//' Makefile sed -i 's/0b10/2/' init.c - patch -p1 < $stuff/$SOURCE-$VERSION-array-size.patch + make cp $stuff/*.S $stuff/pack . for i in bootloader unpack ; do diff -r c7b121a4ffd9 -r d6378d455338 memtest/stuff/memtest86+-5.01-array-size.patch --- a/memtest/stuff/memtest86+-5.01-array-size.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- memtest86+-5.01/controller.c~ 2013-08-10 02:01:58.000000000 +0000 -+++ memtest86+-5.01/controller.c 2013-12-12 20:58:12.873555378 +0000 -@@ -292,7 +292,7 @@ - - /* First, locate the PCI bus where the MCH is located */ - -- for(i = 0; i < sizeof(possible_nhm_bus); i++) { -+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); - vid &= 0xFFFF; -@@ -327,7 +327,7 @@ - ctrl.mode = ECC_NONE; - - /* First, locate the PCI bus where the MCH is located */ -- for(i = 0; i < sizeof(possible_nhm_bus); i++) { -+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); - vid &= 0xFFFF; diff -r c7b121a4ffd9 -r d6378d455338 memtest/stuff/patches/memtest86+-5.01-array-size.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memtest/stuff/patches/memtest86+-5.01-array-size.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- memtest86+-5.01/controller.c~ 2013-08-10 02:01:58.000000000 +0000 ++++ memtest86+-5.01/controller.c 2013-12-12 20:58:12.873555378 +0000 +@@ -292,7 +292,7 @@ + + /* First, locate the PCI bus where the MCH is located */ + +- for(i = 0; i < sizeof(possible_nhm_bus); i++) { ++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); + vid &= 0xFFFF; +@@ -327,7 +327,7 @@ + ctrl.mode = ECC_NONE; + + /* First, locate the PCI bus where the MCH is located */ +- for(i = 0; i < sizeof(possible_nhm_bus); i++) { ++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); + vid &= 0xFFFF; diff -r c7b121a4ffd9 -r d6378d455338 memtest/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memtest/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|memtest86+-5.01-array-size.patch diff -r c7b121a4ffd9 -r d6378d455338 mesa12/receipt --- a/mesa12/receipt Wed May 09 17:03:28 2018 +0300 +++ b/mesa12/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,8 +19,6 @@ SPLIT="mesa12 mesa12-dev mesa12-dri mesa12-libegl" compile_rules() { -# patch -p1 -i $stuff/mesa-12.0.patch - # "swr" driver is disabled due to compilation errors GLL_DRV="nouveau,r300,r600,radeonsi,svga,swrast" diff -r c7b121a4ffd9 -r d6378d455338 mesa12/stuff/mesa-12.0.patch --- a/mesa12/stuff/mesa-12.0.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- a/src/gallium/drivers/swr/rasterizer/core/utils.h -+++ b/src/gallium/drivers/swr/rasterizer/core/utils.h -@@ -37,7 +37,7 @@ - #define _MM_INSERT_EPI64 _mm_insert_epi64 - #define _MM_EXTRACT_EPI64 _mm_extract_epi64 - #else --INLINE INT64 _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx) -+INLINE int64_t _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx) - { - OSALIGNLINE(uint32_t) elems[4]; - _mm_store_si128((__m128i*)elems, a); -@@ -55,7 +55,7 @@ - } - } - --INLINE __m128i _MM_INSERT_EPI64(__m128i a, INT64 b, const int32_t ndx) -+INLINE __m128i _MM_INSERT_EPI64(__m128i a, int64_t b, const int32_t ndx) - { - OSALIGNLINE(int64_t) elems[2]; - _mm_store_si128((__m128i*)elems, a); diff -r c7b121a4ffd9 -r d6378d455338 mesa12/stuff/nouveau-fix-header.patch --- a/mesa12/stuff/nouveau-fix-header.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001 -From: Ben Skeggs -Date: Mon, 20 Dec 2010 03:39:36 +0000 -Subject: nouveau: fix includes for latest libdrm - -Signed-off-by: Ben Skeggs ---- -diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h -index ab480ca..747b084 100644 ---- a/src/gallium/drivers/nouveau/nouveau_winsys.h -+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h -@@ -10,7 +10,7 @@ - #include "nouveau/nouveau_grobj.h" - #include "nouveau/nouveau_notifier.h" - #include "nouveau/nouveau_resource.h" --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" - - #ifndef NV04_PFIFO_MAX_PACKET_LEN - #define NV04_PFIFO_MAX_PACKET_LEN 2047 -diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c -index ce48022..a99df76 100644 ---- a/src/gallium/drivers/nv50/nv50_surface.c -+++ b/src/gallium/drivers/nv50/nv50_surface.c -@@ -22,7 +22,7 @@ - - #define __NOUVEAU_PUSH_H__ - #include --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" - #include "nv50_context.h" - #include "nv50_resource.h" - #include "pipe/p_defines.h" -diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c -index e0e65e7..e2fadd3 100644 ---- a/src/gallium/drivers/nvfx/nv04_2d.c -+++ b/src/gallium/drivers/nvfx/nv04_2d.c -@@ -34,11 +34,11 @@ - #include - #include - #include --#include - #include - #include - #include - #include -+#include - #include "nv04_2d.h" - - #include "nouveau/nv_object.xml.h" -diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c -index 597664e..339b317 100644 ---- a/src/gallium/drivers/nvfx/nvfx_vbo.c -+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c -@@ -9,8 +9,7 @@ - #include "nvfx_resource.h" - - #include "nouveau/nouveau_channel.h" -- --#include "nouveau/nouveau_pushbuf.h" -+#include "nouveau/nv04_pushbuf.h" - - static inline unsigned - util_guess_unique_indices_count(unsigned mode, unsigned indices) -diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h -index 8036b18..c5ac128 100644 ---- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h -+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h -@@ -38,7 +38,6 @@ - #include - - #include "nouveau_device.h" --#include "nouveau_pushbuf.h" - #include "nouveau_grobj.h" - #include "nouveau_channel.h" - #include "nouveau_bo.h" -@@ -46,6 +45,7 @@ - #include "nouveau_screen.h" - #include "nouveau_state.h" - #include "nouveau_surface.h" -+#include "nv04_pushbuf.h" - - #define DRIVER_DATE "20091015" - #define DRIVER_AUTHOR "Nouveau" --- -cgit v0.8.3-6-g21f6 diff -r c7b121a4ffd9 -r d6378d455338 mesa12/stuff/patches/mesa-12.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa12/stuff/patches/mesa-12.0.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- a/src/gallium/drivers/swr/rasterizer/core/utils.h ++++ b/src/gallium/drivers/swr/rasterizer/core/utils.h +@@ -37,7 +37,7 @@ + #define _MM_INSERT_EPI64 _mm_insert_epi64 + #define _MM_EXTRACT_EPI64 _mm_extract_epi64 + #else +-INLINE INT64 _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx) ++INLINE int64_t _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx) + { + OSALIGNLINE(uint32_t) elems[4]; + _mm_store_si128((__m128i*)elems, a); +@@ -55,7 +55,7 @@ + } + } + +-INLINE __m128i _MM_INSERT_EPI64(__m128i a, INT64 b, const int32_t ndx) ++INLINE __m128i _MM_INSERT_EPI64(__m128i a, int64_t b, const int32_t ndx) + { + OSALIGNLINE(int64_t) elems[2]; + _mm_store_si128((__m128i*)elems, a); diff -r c7b121a4ffd9 -r d6378d455338 mesa12/stuff/patches/nouveau-fix-header.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa12/stuff/patches/nouveau-fix-header.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,86 @@ +From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Mon, 20 Dec 2010 03:39:36 +0000 +Subject: nouveau: fix includes for latest libdrm + +Signed-off-by: Ben Skeggs +--- +diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h +index ab480ca..747b084 100644 +--- a/src/gallium/drivers/nouveau/nouveau_winsys.h ++++ b/src/gallium/drivers/nouveau/nouveau_winsys.h +@@ -10,7 +10,7 @@ + #include "nouveau/nouveau_grobj.h" + #include "nouveau/nouveau_notifier.h" + #include "nouveau/nouveau_resource.h" +-#include "nouveau/nouveau_pushbuf.h" ++#include "nouveau/nv04_pushbuf.h" + + #ifndef NV04_PFIFO_MAX_PACKET_LEN + #define NV04_PFIFO_MAX_PACKET_LEN 2047 +diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c +index ce48022..a99df76 100644 +--- a/src/gallium/drivers/nv50/nv50_surface.c ++++ b/src/gallium/drivers/nv50/nv50_surface.c +@@ -22,7 +22,7 @@ + + #define __NOUVEAU_PUSH_H__ + #include +-#include "nouveau/nouveau_pushbuf.h" ++#include "nouveau/nv04_pushbuf.h" + #include "nv50_context.h" + #include "nv50_resource.h" + #include "pipe/p_defines.h" +diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c +index e0e65e7..e2fadd3 100644 +--- a/src/gallium/drivers/nvfx/nv04_2d.c ++++ b/src/gallium/drivers/nvfx/nv04_2d.c +@@ -34,11 +34,11 @@ + #include + #include + #include +-#include + #include + #include + #include + #include ++#include + #include "nv04_2d.h" + + #include "nouveau/nv_object.xml.h" +diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c +index 597664e..339b317 100644 +--- a/src/gallium/drivers/nvfx/nvfx_vbo.c ++++ b/src/gallium/drivers/nvfx/nvfx_vbo.c +@@ -9,8 +9,7 @@ + #include "nvfx_resource.h" + + #include "nouveau/nouveau_channel.h" +- +-#include "nouveau/nouveau_pushbuf.h" ++#include "nouveau/nv04_pushbuf.h" + + static inline unsigned + util_guess_unique_indices_count(unsigned mode, unsigned indices) +diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h +index 8036b18..c5ac128 100644 +--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h ++++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h +@@ -38,7 +38,6 @@ + #include + + #include "nouveau_device.h" +-#include "nouveau_pushbuf.h" + #include "nouveau_grobj.h" + #include "nouveau_channel.h" + #include "nouveau_bo.h" +@@ -46,6 +45,7 @@ + #include "nouveau_screen.h" + #include "nouveau_state.h" + #include "nouveau_surface.h" ++#include "nv04_pushbuf.h" + + #define DRIVER_DATE "20091015" + #define DRIVER_AUTHOR "Nouveau" +-- +cgit v0.8.3-6-g21f6 diff -r c7b121a4ffd9 -r d6378d455338 mesa12/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa12/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +#-p1|mesa-12.0.patch diff -r c7b121a4ffd9 -r d6378d455338 microperl/receipt --- a/microperl/receipt Wed May 09 17:03:28 2018 +0300 +++ b/microperl/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,8 +14,6 @@ SIBLINGS="perl" compile_rules() { -# cp Makefile.micro Makefile.micro.orig - patch -p1 -i $stuff/microperl.patch sed -i "s|usr/local|usr|; s|perl5/5.24|perl5/5.24.0|; s|unknown|$HOST_SYSTEM|" \ uconfig.sh diff -r c7b121a4ffd9 -r d6378d455338 microperl/stuff/microperl.patch --- a/microperl/stuff/microperl.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ ---- a/Makefile.micro -+++ b/Makefile.micro -@@ -1,7 +1,7 @@ - LD = $(CC) - CCFLAGS = -c - DEFINES = -DPERL_CORE -DPERL_MICRO -DSTANDARD_C -DPERL_USE_SAFE_PUTENV \ -- -DNO_MATHOMS -+ -DNO_MATHOMS -DUSE_PERLIO - OPTIMIZE = - CFLAGS = $(DEFINES) $(OPTIMIZE) - LDFLAGS = -@@ -14,7 +14,7 @@ - - all: microperl - --O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \ -+O = uav$(_O) ucaretx$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \ - uglobals$(_O) ugv$(_O) uhv$(_O) umro$(_O)\ - umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \ - upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \ -@@ -66,6 +66,9 @@ - - uav$(_O): $(HE) av.c - $(CC) $(CCFLAGS) -o $@ $(CFLAGS) av.c -+ -+ucaretx$(_O): $(HE) caretx.c -+ $(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c - - udeb$(_O): $(HE) deb.c - $(CC) $(CCFLAGS) -o $@ $(CFLAGS) deb.c ---- a/EXTERN.h -+++ b/EXTERN.h -@@ -57,3 +57,7 @@ - #define INIT(x) - - #undef DOINIT -+ -+#define I_LIMITS -+#define I_FCNTL -+#define I_FLOAT diff -r c7b121a4ffd9 -r d6378d455338 microperl/stuff/miniperlmain.patch --- a/microperl/stuff/miniperlmain.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ ---- miniperlmain.c.orig -+++ miniperlmain.c -@@ -117,13 +117,6 @@ - if (!exitstatus) - perl_run(my_perl); - -- /* Unregister our signal handler before destroying my_perl */ -- for (i = 0; PL_sig_name[i]; i++) { -- if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) { -- rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL); -- } -- } -- - exitstatus = perl_destruct(my_perl); - - perl_free(my_perl); diff -r c7b121a4ffd9 -r d6378d455338 microperl/stuff/patches/microperl.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microperl/stuff/patches/microperl.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,40 @@ +--- a/Makefile.micro ++++ b/Makefile.micro +@@ -1,7 +1,7 @@ + LD = $(CC) + CCFLAGS = -c + DEFINES = -DPERL_CORE -DPERL_MICRO -DSTANDARD_C -DPERL_USE_SAFE_PUTENV \ +- -DNO_MATHOMS ++ -DNO_MATHOMS -DUSE_PERLIO + OPTIMIZE = + CFLAGS = $(DEFINES) $(OPTIMIZE) + LDFLAGS = +@@ -14,7 +14,7 @@ + + all: microperl + +-O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \ ++O = uav$(_O) ucaretx$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \ + uglobals$(_O) ugv$(_O) uhv$(_O) umro$(_O)\ + umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \ + upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \ +@@ -66,6 +66,9 @@ + + uav$(_O): $(HE) av.c + $(CC) $(CCFLAGS) -o $@ $(CFLAGS) av.c ++ ++ucaretx$(_O): $(HE) caretx.c ++ $(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c + + udeb$(_O): $(HE) deb.c + $(CC) $(CCFLAGS) -o $@ $(CFLAGS) deb.c +--- a/EXTERN.h ++++ b/EXTERN.h +@@ -57,3 +57,7 @@ + #define INIT(x) + + #undef DOINIT ++ ++#define I_LIMITS ++#define I_FCNTL ++#define I_FLOAT diff -r c7b121a4ffd9 -r d6378d455338 microperl/stuff/patches/miniperlmain.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microperl/stuff/patches/miniperlmain.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,16 @@ +--- miniperlmain.c.orig ++++ miniperlmain.c +@@ -117,13 +117,6 @@ + if (!exitstatus) + perl_run(my_perl); + +- /* Unregister our signal handler before destroying my_perl */ +- for (i = 0; PL_sig_name[i]; i++) { +- if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) { +- rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL); +- } +- } +- + exitstatus = perl_destruct(my_perl); + + perl_free(my_perl); diff -r c7b121a4ffd9 -r d6378d455338 microperl/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microperl/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|microperl.patch diff -r c7b121a4ffd9 -r d6378d455338 moserial/receipt --- a/moserial/receipt Wed May 09 17:03:28 2018 +0300 +++ b/moserial/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,9 +14,6 @@ BUILD_DEPENDS="GConf-dev gnome-doc-utils intltool vala gtk+-dev" compile_rules() { - # removing help - patch -Np3 -i $stuff/glade.patch - ./configure \ --disable-scrollkeeper \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 moserial/stuff/glade.patch --- a/moserial/stuff/glade.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ ---- moserial/source/moserial-2.32.1/data/glade/moserial.glade -+++ moserial.new/source/moserial-2.32.1/data/glade/moserial.glade -@@ -204,26 +204,6 @@ - True - - -- -- -- -- True -- _Contents -- True -- -- -- -- -- gtk-help -- 4 -- 0.5 -- 0.5 -- 0 -- 0 -- -- -- -- - - - -@@ -388,22 +368,7 @@ - - - -- -- -- True -- Help -- Help -- True -- gtk-help -- True -- True -- True -- -- -- False -- True -- -- -+ - - - 0 diff -r c7b121a4ffd9 -r d6378d455338 moserial/stuff/patches/glade.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/moserial/stuff/patches/glade.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,53 @@ +--- moserial/source/moserial-2.32.1/data/glade/moserial.glade ++++ moserial.new/source/moserial-2.32.1/data/glade/moserial.glade +@@ -204,26 +204,6 @@ + True + + +- +- +- +- True +- _Contents +- True +- +- +- +- +- gtk-help +- 4 +- 0.5 +- 0.5 +- 0 +- 0 +- +- +- +- + + + +@@ -388,22 +368,7 @@ + + + +- +- +- True +- Help +- Help +- True +- gtk-help +- True +- True +- True +- +- +- False +- True +- +- ++ + + + 0 diff -r c7b121a4ffd9 -r d6378d455338 moserial/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/moserial/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# removing help +-Np3|glade.patch diff -r c7b121a4ffd9 -r d6378d455338 mplayerplug-in/receipt --- a/mplayerplug-in/receipt Wed May 09 17:03:28 2018 +0300 +++ b/mplayerplug-in/receipt Thu May 10 21:12:00 2018 +0300 @@ -31,15 +31,7 @@ grep -q slitaz-hack include/npplat.h || sed -i \ 's/ne _NPPLAT_H_/ne _NPPLAT_H_\n#include "slitaz-hack.h"/' \ include/npplat.h - while read file; do - [ -f done.$file ] && continue - echo "Apply $file..." - patch -p1 < $stuff/$PACKAGE-$VERSION-$file || return 1 - touch done.$file - done < 1) -@@ -454,7 +454,7 @@ void remove_quotes(char *url) - // in cleanup routines (like destroyCB and shut), when we know that - // the player thread is not running, it is safe to call without locking - --int sendCommand(nsPluginInstance * instance, char *command) -+int sendCommand(nsPluginInstance * instance, const char *command) - { - int retval; - char buffer[1024]; - ---- mplayerplug-in-3.55/Source/plugin-ui.cpp Thu Jun 12 14:18:01 2008 -+++ mplayerplug-in-3.55/Source/plugin-ui.cpp Fri Jun 12 14:25:35 2009 -@@ -283,12 +283,7 @@ - int term, chop; - int PercentRedraw; - -- if (0) { -- printf("Widget: %p\n", w); -- printf("Message: %s\n", message); -- } -- -- if (DEBUG > 1) -+ if (DEBUG > 1) - printf("state = %i, height = %i width = %i\n", instance->state, - instance->movie_height, instance->movie_width); - diff -r c7b121a4ffd9 -r d6378d455338 mplayerplug-in/stuff/mplayerplug-in-3.55-static-iid-accessor.u --- a/mplayerplug-in/stuff/mplayerplug-in-3.55-static-iid-accessor.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ ---- mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h -+++ mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h -@@ -25,7 +25,7 @@ - class NS_NO_VTABLE nsIScriptableWMPPlugin : public nsISupports { - public: - -- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID) -+ NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID) - - /* void play (); */ - NS_IMETHOD Play(void) = 0; -@@ -38,6 +38,8 @@ - - }; - -+NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableWMPPlugin, NS_ISCRIPTABLEWMPPLUGIN_IID) -+ - /* Use this macro when declaring classes that implement this interface. */ - #define NS_DECL_NSISCRIPTABLEWMPPLUGIN \ - NS_IMETHOD Play(void); \ -@@ -120,7 +122,7 @@ - class NS_NO_VTABLE nsIScriptableMplayerPlugin : public nsISupports { - public: - -- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID) -+ NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID) - - /* void Play (); */ - NS_IMETHOD Play(void) = 0; -@@ -249,6 +251,8 @@ - - }; - -+NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableMplayerPlugin, NS_ISCRIPTABLEMPLAYERPLUGIN_IID) -+ - /* Use this macro when declaring classes that implement this interface. */ - #define NS_DECL_NSISCRIPTABLEMPLAYERPLUGIN \ - NS_IMETHOD Play(void); \ diff -r c7b121a4ffd9 -r d6378d455338 mplayerplug-in/stuff/patches/mplayerplug-in-3.55-glibc210.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mplayerplug-in/stuff/patches/mplayerplug-in-3.55-glibc210.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,63 @@ +--- mplayerplug-in-3.55/Source/plugin-list.cpp ++++ mplayerplug-in-3.55/Source/plugin-list.cpp +@@ -132,9 +132,9 @@ void insert_area(Node * parent, char *ta + + void find_area_tags(const char *smilbuffer, Node * parent) + { +- char *startarea; +- char *endvideo; +- char *start; ++ const char *startarea; ++ const char *endvideo; ++ const char *start; + + int tagtime = 0; + char tagtarget[128]; +--- mplayerplug-in-3.55/Source/plugin-setup.h ++++ mplayerplug-in-3.55/Source/plugin-setup.h +@@ -174,7 +174,7 @@ char *getURLHostname(char *url); + char *getURLFilename(const char *url); + int isMms(char *url, int nomediacache); + void mmsToHttp(char *dest, char *src); +-int sendCommand(nsPluginInstance * instance, char *command); ++int sendCommand(nsPluginInstance * instance, const char *command); + int URLcmp(const char *url1, const char *url2); + extern void remove_quotes(char *url); + void killmplayer(nsPluginInstance * instance); +--- mplayerplug-in-3.55/Source/plugin-support.cpp ++++ mplayerplug-in-3.55/Source/plugin-support.cpp +@@ -109,7 +109,7 @@ char *getURLFilename(const char *url) + { + + char *filename; +- char *tmp; ++ const char *tmp; + int len; + + if (DEBUG > 1) +@@ -454,7 +454,7 @@ void remove_quotes(char *url) + // in cleanup routines (like destroyCB and shut), when we know that + // the player thread is not running, it is safe to call without locking + +-int sendCommand(nsPluginInstance * instance, char *command) ++int sendCommand(nsPluginInstance * instance, const char *command) + { + int retval; + char buffer[1024]; + +--- mplayerplug-in-3.55/Source/plugin-ui.cpp Thu Jun 12 14:18:01 2008 ++++ mplayerplug-in-3.55/Source/plugin-ui.cpp Fri Jun 12 14:25:35 2009 +@@ -283,12 +283,7 @@ + int term, chop; + int PercentRedraw; + +- if (0) { +- printf("Widget: %p\n", w); +- printf("Message: %s\n", message); +- } +- +- if (DEBUG > 1) ++ if (DEBUG > 1) + printf("state = %i, height = %i width = %i\n", instance->state, + instance->movie_height, instance->movie_width); + diff -r c7b121a4ffd9 -r d6378d455338 mplayerplug-in/stuff/patches/mplayerplug-in-3.55-static-iid-accessor.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mplayerplug-in/stuff/patches/mplayerplug-in-3.55-static-iid-accessor.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,38 @@ +--- mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h ++++ mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h +@@ -25,7 +25,7 @@ + class NS_NO_VTABLE nsIScriptableWMPPlugin : public nsISupports { + public: + +- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID) ++ NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID) + + /* void play (); */ + NS_IMETHOD Play(void) = 0; +@@ -38,6 +38,8 @@ + + }; + ++NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableWMPPlugin, NS_ISCRIPTABLEWMPPLUGIN_IID) ++ + /* Use this macro when declaring classes that implement this interface. */ + #define NS_DECL_NSISCRIPTABLEWMPPLUGIN \ + NS_IMETHOD Play(void); \ +@@ -120,7 +122,7 @@ + class NS_NO_VTABLE nsIScriptableMplayerPlugin : public nsISupports { + public: + +- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID) ++ NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID) + + /* void Play (); */ + NS_IMETHOD Play(void) = 0; +@@ -249,6 +251,8 @@ + + }; + ++NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableMplayerPlugin, NS_ISCRIPTABLEMPLAYERPLUGIN_IID) ++ + /* Use this macro when declaring classes that implement this interface. */ + #define NS_DECL_NSISCRIPTABLEMPLAYERPLUGIN \ + NS_IMETHOD Play(void); \ diff -r c7b121a4ffd9 -r d6378d455338 mplayerplug-in/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mplayerplug-in/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|mplayerplug-in-3.55-glibc210.u +-p1|mplayerplug-in-3.55-static-iid-accessor.u diff -r c7b121a4ffd9 -r d6378d455338 mtpaint/receipt --- a/mtpaint/receipt Wed May 09 17:03:28 2018 +0300 +++ b/mtpaint/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,7 +15,6 @@ BUILD_DEPENDS="gtk+-dev libpng16-dev lcms-dev zlib-dev gettext" compile_rules() { - patch -p0 < $stuff/mtpaint.patch sed 's/mem_undo_limit,\t32/mem_undo_limit,\t64/' -i $src/src/mainwindow.c case "$ARCH" in diff -r c7b121a4ffd9 -r d6378d455338 mtpaint/stuff/mtpaint.patch --- a/mtpaint/stuff/mtpaint.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ ---- src/spawn.c.orig -+++ src/spawn.c -@@ -411,8 +411,8 @@ - {"View EXIF data (leafpad)", "exif %f | leafpad"}, - {"View filesystem data (xterm)", "xterm -hold -e ls -l %f"}, - {"Edit in Gimp", "gimp %f"}, -- {"View in GQview", "gqview %f"}, -- {"Print image", "kprinter %f"}, -+ {"View in GPicView", "gpicview %f"}, -+ {"Print image", "yad --print --type=IMAGE --print-add-preview --filename=%f"}, - {"Email image", "seamonkey -compose attachment=file://%f"}, - {"Send image to Firefox", "firefox %f"}, - {"Send image to OpenOffice", "soffice %f"}, diff -r c7b121a4ffd9 -r d6378d455338 mtpaint/stuff/patches/mtpaint.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mtpaint/stuff/patches/mtpaint.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,13 @@ +--- src/spawn.c.orig ++++ src/spawn.c +@@ -411,8 +411,8 @@ + {"View EXIF data (leafpad)", "exif %f | leafpad"}, + {"View filesystem data (xterm)", "xterm -hold -e ls -l %f"}, + {"Edit in Gimp", "gimp %f"}, +- {"View in GQview", "gqview %f"}, +- {"Print image", "kprinter %f"}, ++ {"View in GPicView", "gpicview %f"}, ++ {"Print image", "yad --print --type=IMAGE --print-add-preview --filename=%f"}, + {"Email image", "seamonkey -compose attachment=file://%f"}, + {"Send image to Firefox", "firefox %f"}, + {"Send image to OpenOffice", "soffice %f"}, diff -r c7b121a4ffd9 -r d6378d455338 mtpaint/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mtpaint/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|mtpaint.patch diff -r c7b121a4ffd9 -r d6378d455338 mupdf/receipt --- a/mupdf/receipt Wed May 09 17:03:28 2018 +0300 +++ b/mupdf/receipt Thu May 10 21:12:00 2018 +0300 @@ -36,10 +36,6 @@ EOT ln -s /usr/include/freetype2/freetype/ /usr/include/freetype ;; - *) - # apply debian 1.4-1 patch - patch -p1 < $stuff/use_openjpeg_1.5.patch - ;; esac make ${ARCH_ARGS} build=release && make ${ARCH_ARGS} build=release prefix=/usr install diff -r c7b121a4ffd9 -r d6378d455338 mupdf/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mupdf/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# apply debian 1.4-1 patch +-p1|use_openjpeg_1.5.patch diff -r c7b121a4ffd9 -r d6378d455338 mupdf/stuff/patches/use_openjpeg_1.5.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mupdf/stuff/patches/use_openjpeg_1.5.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,149 @@ +commit a7341e98ef48d6041028b7294d1acc13665b04ba +Author: Quoc-Viet Nguyen +Date: Fri Apr 18 23:48:29 2014 +1000 + + Use openjpeg 1.5 rather than 2.0 +--- + source/fitz/load-jpx.c | 104 +++++++++---------------------------------------- + 1 file changed, 18 insertions(+), 86 deletions(-) + +diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c +index dfb89f4..d27b5de 100644 +--- a/source/fitz/load-jpx.c ++++ b/source/fitz/load-jpx.c +@@ -605,41 +605,6 @@ + /* fz_warn("openjpeg info: %s", msg); */ + } + +-static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) +-{ +- stream_block *sb = (stream_block *)p_user_data; +- OPJ_SIZE_T len; +- +- len = sb->size - sb->pos; +- if (len == 0) +- return (OPJ_SIZE_T)-1; /* End of file! */ +- if (len > p_nb_bytes) +- len = p_nb_bytes; +- memcpy(p_buffer, sb->data + sb->pos, len); +- sb->pos += len; +- return len; +-} +- +-static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data) +-{ +- stream_block *sb = (stream_block *)p_user_data; +- +- if (skip > (OPJ_OFF_T)(sb->size - sb->pos)) +- skip = (OPJ_OFF_T)(sb->size - sb->pos); +- sb->pos += skip; +- return sb->pos; +-} +- +-static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data) +-{ +- stream_block *sb = (stream_block *)p_user_data; +- +- if (seek_pos > (OPJ_OFF_T)sb->size) +- return OPJ_FALSE; +- sb->pos = seek_pos; +- return OPJ_TRUE; +-} +- + static int + l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w) + { +@@ -656,10 +621,11 @@ + jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta) + { + fz_pixmap *img; ++ opj_event_mgr_t evtmgr; + opj_dparameters_t params; +- opj_codec_t *codec; ++ opj_dinfo_t *codec; + opj_image_t *jpx; +- opj_stream_t *stream; ++ opj_cio_t *stream; + unsigned char *p; + OPJ_CODEC_FORMAT format; + int a, n, w, h, depth, sgnd; +@@ -677,55 +643,30 @@ + + /* Check for SOC marker -- if found we have a bare J2K stream */ + if (data[0] == 0xFF && data[1] == 0x4F) +- format = OPJ_CODEC_J2K; ++ format = CODEC_J2K; + else +- format = OPJ_CODEC_JP2; ++ format = CODEC_JP2; + ++ memset(&evtmgr, 0, sizeof(evtmgr)); ++ evtmgr.error_handler = fz_opj_error_callback; ++ evtmgr.warning_handler = fz_opj_warning_callback; ++ evtmgr.info_handler = fz_opj_info_callback; ++ + opj_set_default_decoder_parameters(¶ms); + if (fz_colorspace_is_indexed(ctx, defcs)) + params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG; + + codec = opj_create_decompress(format); +- opj_set_info_handler(codec, fz_opj_info_callback, ctx); +- opj_set_warning_handler(codec, fz_opj_warning_callback, ctx); +- opj_set_error_handler(codec, fz_opj_error_callback, ctx); +- if (!opj_setup_decoder(codec, ¶ms)) +- { +- opj_destroy_codec(codec); +- fz_throw(ctx, FZ_ERROR_GENERIC, "j2k decode failed"); +- } ++ opj_set_event_mgr((opj_common_ptr)codec, &evtmgr, ctx); ++ opj_setup_decoder(codec, ¶ms); + +- stream = opj_stream_default_create(OPJ_TRUE); +- sb.data = data; +- sb.pos = 0; +- sb.size = size; ++ stream = opj_cio_open((opj_common_ptr)codec, data, size); + +- opj_stream_set_read_function(stream, fz_opj_stream_read); +- opj_stream_set_skip_function(stream, fz_opj_stream_skip); +- opj_stream_set_seek_function(stream, fz_opj_stream_seek); +- opj_stream_set_user_data(stream, &sb, NULL); +- /* Set the length to avoid an assert */ +- opj_stream_set_user_data_length(stream, size); ++ jpx = opj_decode(codec, stream); + +- if (!opj_read_header(stream, codec, &jpx)) +- { +- opj_stream_destroy(stream); +- opj_destroy_codec(codec); +- fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to read JPX header"); +- } ++ opj_cio_close(stream); ++ opj_destroy_decompress(codec); + +- if (!opj_decode(codec, stream, jpx)) +- { +- opj_stream_destroy(stream); +- opj_destroy_codec(codec); +- opj_image_destroy(jpx); +- fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to decode JPX image"); +- } +- +- opj_stream_destroy(stream); +- opj_destroy_codec(codec); +- +- /* jpx should never be NULL here, but check anyway */ + if (!jpx) + fz_throw(ctx, FZ_ERROR_GENERIC, "opj_decode failed"); + +@@ -733,8 +674,8 @@ + depth = jpx->comps[0].prec; + sgnd = jpx->comps[0].sgnd; + +- if (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; } +- else if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; } ++ if (jpx->color_space == CLRSPC_SRGB && n == 4) { n = 3; a = 1; } ++ else if (jpx->color_space == CLRSPC_SYCC && n == 4) { n = 3; a = 1; } + else if (n == 2) { n = 1; a = 1; } + else if (n > 4) { n = 4; a = 1; } + else { a = 0; } diff -r c7b121a4ffd9 -r d6378d455338 mupdf/stuff/use_openjpeg_1.5.patch --- a/mupdf/stuff/use_openjpeg_1.5.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -commit a7341e98ef48d6041028b7294d1acc13665b04ba -Author: Quoc-Viet Nguyen -Date: Fri Apr 18 23:48:29 2014 +1000 - - Use openjpeg 1.5 rather than 2.0 ---- - source/fitz/load-jpx.c | 104 +++++++++---------------------------------------- - 1 file changed, 18 insertions(+), 86 deletions(-) - -diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c -index dfb89f4..d27b5de 100644 ---- a/source/fitz/load-jpx.c -+++ b/source/fitz/load-jpx.c -@@ -605,41 +605,6 @@ - /* fz_warn("openjpeg info: %s", msg); */ - } - --static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) --{ -- stream_block *sb = (stream_block *)p_user_data; -- OPJ_SIZE_T len; -- -- len = sb->size - sb->pos; -- if (len == 0) -- return (OPJ_SIZE_T)-1; /* End of file! */ -- if (len > p_nb_bytes) -- len = p_nb_bytes; -- memcpy(p_buffer, sb->data + sb->pos, len); -- sb->pos += len; -- return len; --} -- --static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data) --{ -- stream_block *sb = (stream_block *)p_user_data; -- -- if (skip > (OPJ_OFF_T)(sb->size - sb->pos)) -- skip = (OPJ_OFF_T)(sb->size - sb->pos); -- sb->pos += skip; -- return sb->pos; --} -- --static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data) --{ -- stream_block *sb = (stream_block *)p_user_data; -- -- if (seek_pos > (OPJ_OFF_T)sb->size) -- return OPJ_FALSE; -- sb->pos = seek_pos; -- return OPJ_TRUE; --} -- - static int - l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w) - { -@@ -656,10 +621,11 @@ - jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta) - { - fz_pixmap *img; -+ opj_event_mgr_t evtmgr; - opj_dparameters_t params; -- opj_codec_t *codec; -+ opj_dinfo_t *codec; - opj_image_t *jpx; -- opj_stream_t *stream; -+ opj_cio_t *stream; - unsigned char *p; - OPJ_CODEC_FORMAT format; - int a, n, w, h, depth, sgnd; -@@ -677,55 +643,30 @@ - - /* Check for SOC marker -- if found we have a bare J2K stream */ - if (data[0] == 0xFF && data[1] == 0x4F) -- format = OPJ_CODEC_J2K; -+ format = CODEC_J2K; - else -- format = OPJ_CODEC_JP2; -+ format = CODEC_JP2; - -+ memset(&evtmgr, 0, sizeof(evtmgr)); -+ evtmgr.error_handler = fz_opj_error_callback; -+ evtmgr.warning_handler = fz_opj_warning_callback; -+ evtmgr.info_handler = fz_opj_info_callback; -+ - opj_set_default_decoder_parameters(¶ms); - if (fz_colorspace_is_indexed(ctx, defcs)) - params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG; - - codec = opj_create_decompress(format); -- opj_set_info_handler(codec, fz_opj_info_callback, ctx); -- opj_set_warning_handler(codec, fz_opj_warning_callback, ctx); -- opj_set_error_handler(codec, fz_opj_error_callback, ctx); -- if (!opj_setup_decoder(codec, ¶ms)) -- { -- opj_destroy_codec(codec); -- fz_throw(ctx, FZ_ERROR_GENERIC, "j2k decode failed"); -- } -+ opj_set_event_mgr((opj_common_ptr)codec, &evtmgr, ctx); -+ opj_setup_decoder(codec, ¶ms); - -- stream = opj_stream_default_create(OPJ_TRUE); -- sb.data = data; -- sb.pos = 0; -- sb.size = size; -+ stream = opj_cio_open((opj_common_ptr)codec, data, size); - -- opj_stream_set_read_function(stream, fz_opj_stream_read); -- opj_stream_set_skip_function(stream, fz_opj_stream_skip); -- opj_stream_set_seek_function(stream, fz_opj_stream_seek); -- opj_stream_set_user_data(stream, &sb, NULL); -- /* Set the length to avoid an assert */ -- opj_stream_set_user_data_length(stream, size); -+ jpx = opj_decode(codec, stream); - -- if (!opj_read_header(stream, codec, &jpx)) -- { -- opj_stream_destroy(stream); -- opj_destroy_codec(codec); -- fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to read JPX header"); -- } -+ opj_cio_close(stream); -+ opj_destroy_decompress(codec); - -- if (!opj_decode(codec, stream, jpx)) -- { -- opj_stream_destroy(stream); -- opj_destroy_codec(codec); -- opj_image_destroy(jpx); -- fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to decode JPX image"); -- } -- -- opj_stream_destroy(stream); -- opj_destroy_codec(codec); -- -- /* jpx should never be NULL here, but check anyway */ - if (!jpx) - fz_throw(ctx, FZ_ERROR_GENERIC, "opj_decode failed"); - -@@ -733,8 +674,8 @@ - depth = jpx->comps[0].prec; - sgnd = jpx->comps[0].sgnd; - -- if (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; } -- else if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; } -+ if (jpx->color_space == CLRSPC_SRGB && n == 4) { n = 3; a = 1; } -+ else if (jpx->color_space == CLRSPC_SYCC && n == 4) { n = 3; a = 1; } - else if (n == 2) { n = 1; a = 1; } - else if (n > 4) { n = 4; a = 1; } - else { a = 0; } diff -r c7b121a4ffd9 -r d6378d455338 musique/receipt --- a/musique/receipt Wed May 09 17:03:28 2018 +0300 +++ b/musique/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,9 +18,8 @@ # Rules to configure and make the package. compile_rules() { - # put default icons to resources (instead of to hicolor icon theme) + # put default icons to resources (instead of to hicolor icon theme) + patch cp -a $stuff/*.png $src/images - patch -p0 < $stuff/icons.diff mkdir build; cd build qmake PREFIX=/usr ../musique.pro && diff -r c7b121a4ffd9 -r d6378d455338 musique/stuff/icons.diff --- a/musique/stuff/icons.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ ---- resources.qrc -+++ resources.qrc -@@ -8,5 +8,18 @@ - images/item/track.png - style.css - images/sort.png -+ images/audio-volume-high.png -+ images/audio-volume-muted.png -+ images/edit-clear.png -+ images/go-previous.png -+ images/gtk-info.png -+ images/list-add.png -+ images/media-playback-start.png -+ images/media-playback-stop.png -+ images/media-playlist-repeat.png -+ images/media-playlist-shuffle.png -+ images/media-skip-backward.png -+ images/media-skip-forward.png -+ images/view-restore.png - - diff -r c7b121a4ffd9 -r d6378d455338 musique/stuff/patches/icons.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musique/stuff/patches/icons.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,21 @@ +--- resources.qrc ++++ resources.qrc +@@ -8,5 +8,18 @@ + images/item/track.png + style.css + images/sort.png ++ images/audio-volume-high.png ++ images/audio-volume-muted.png ++ images/edit-clear.png ++ images/go-previous.png ++ images/gtk-info.png ++ images/list-add.png ++ images/media-playback-start.png ++ images/media-playback-stop.png ++ images/media-playlist-repeat.png ++ images/media-playlist-shuffle.png ++ images/media-skip-backward.png ++ images/media-skip-forward.png ++ images/view-restore.png + + diff -r c7b121a4ffd9 -r d6378d455338 musique/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musique/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|icons.diff diff -r c7b121a4ffd9 -r d6378d455338 ndoutils/receipt --- a/ndoutils/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ndoutils/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,15 +14,6 @@ BUILD_DEPENDS="mysql-dev" compile_rules() { - while read patch_file; do - if [ ! -f done.$patch_file ]; then - patch -p1 < $stuff/$patch_file || exit 1 - touch done.$patch_file - fi - done < - #include - #include -+#include - - #if defined(HAVE_GNOME_VFS) - #include ---- notecase-1.9.8-ori/src/lib/IniFile.cpp Fri Oct 24 18:54:50 2008 -+++ notecase-1.9.8/src/lib/IniFile.cpp Thu Sep 24 18:50:13 2009 -@@ -9,6 +9,7 @@ - #include "IniFile.h" - #include //find() function - #include -+#include - #include "File64.h" - #include "FilePath.h" - #include "debug.h" diff -r c7b121a4ffd9 -r d6378d455338 notecase/stuff/patches/notecase-1.9.8_gcc4.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notecase/stuff/patches/notecase-1.9.8_gcc4.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- notecase-1.9.8-ori/src/_unx/ExecuteFile.cpp Fri Oct 24 18:54:50 2008 ++++ notecase-1.9.8/src/_unx/ExecuteFile.cpp Thu Sep 24 19:00:03 2009 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #if defined(HAVE_GNOME_VFS) + #include +--- notecase-1.9.8-ori/src/lib/IniFile.cpp Fri Oct 24 18:54:50 2008 ++++ notecase-1.9.8/src/lib/IniFile.cpp Thu Sep 24 18:50:13 2009 +@@ -9,6 +9,7 @@ + #include "IniFile.h" + #include //find() function + #include ++#include + #include "File64.h" + #include "FilePath.h" + #include "debug.h" diff -r c7b121a4ffd9 -r d6378d455338 notecase/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notecase/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|notecase-1.9.8_gcc4.u diff -r c7b121a4ffd9 -r d6378d455338 nvclock/receipt --- a/nvclock/receipt Wed May 09 17:03:28 2018 +0300 +++ b/nvclock/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,6 @@ [ -d $PACKAGE$VERSION ] && mv $PACKAGE$VERSION $PACKAGE-$VERSION sed -i 's|prefix}/man|prefix}/share/man|' Makefile* autoreconf - patch -Np1 -i $stuff/$PACKAGE-$VERSION-install.patch ./configure \ --prefix=/usr \ diff -r c7b121a4ffd9 -r d6378d455338 nvclock/stuff/nvclock-0.8b4-install.patch --- a/nvclock/stuff/nvclock-0.8b4-install.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -upNr nvclock-0.8b4/src/Makefile.in.orig nvclock-0.8b4/src/Makefile.in ---- nvclock-0.8b4/src/Makefile.in.orig Sat Jan 3 12:02:54 2009 -+++ nvclock-0.8b4/src/Makefile.in Thu May 6 08:40:39 2010 -@@ -50,8 +50,8 @@ - install: install-recursive install-app - install-app: - mkdir -p $(bindir) -- $(INSTALL) -c nvclock $(DESTDIR)$(bindir)/nvclock -- $(INSTALL) -c smartdimmer $(DESTDIR)$(bindir)/smartdimmer -+ $(INSTALL) -c nvclock $(bindir)/nvclock -+ $(INSTALL) -c smartdimmer $(bindir)/smartdimmer - - - uninstall: uninstall-recursive uninstall-app diff -r c7b121a4ffd9 -r d6378d455338 nvclock/stuff/patches/nvclock-0.8b4-install.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nvclock/stuff/patches/nvclock-0.8b4-install.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +diff -upNr nvclock-0.8b4/src/Makefile.in.orig nvclock-0.8b4/src/Makefile.in +--- nvclock-0.8b4/src/Makefile.in.orig Sat Jan 3 12:02:54 2009 ++++ nvclock-0.8b4/src/Makefile.in Thu May 6 08:40:39 2010 +@@ -50,8 +50,8 @@ + install: install-recursive install-app + install-app: + mkdir -p $(bindir) +- $(INSTALL) -c nvclock $(DESTDIR)$(bindir)/nvclock +- $(INSTALL) -c smartdimmer $(DESTDIR)$(bindir)/smartdimmer ++ $(INSTALL) -c nvclock $(bindir)/nvclock ++ $(INSTALL) -c smartdimmer $(bindir)/smartdimmer + + + uninstall: uninstall-recursive uninstall-app diff -r c7b121a4ffd9 -r d6378d455338 nvclock/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nvclock/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +nvclock-0.8b4-install.patch diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/receipt --- a/ocsinventory-agent/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ocsinventory-agent/receipt Thu May 10 21:12:00 2018 +0300 @@ -23,12 +23,6 @@ # don't run postinstall script rm -f run-postinst - for p in $stuff/ocsinventory-agent-1.1.2.1.u - do - [ -f done.$(basename $p) ] && continue - patch -p1 -i $p || return 1 - touch done.$(basename $p) - done perl Makefile.PL rm -f run-postinst make && make DESTDIR=$DESTDIR install diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/Drives.pm.u --- a/ocsinventory-agent/stuff/Drives.pm.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ ---- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Fri Mar 6 19:02:57 2009 -+++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Sun Jul 12 22:29:32 2009 -@@ -1,9 +1,11 @@ - package Ocsinventory::Agent::Backend::OS::Linux::Drives; -+# Modified bye Erjo -+# Busybox df applet as no -T -P options. - - use strict; - sub check { - return unless can_run ("df"); -- my $df = `df -TP`; -+ my $df = `df -k`; - return 1 if $df =~ /\w+/; - 0 - } -@@ -19,14 +21,14 @@ - my $volumn; - - -- foreach(`df -TP`) { # TODO retrive error -- if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ -+ foreach(`df -k`) { # TODO retrive error -+ if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ - $free = sprintf("%i",($4/1024)); -- $filesystem = $2; -- $total = sprintf("%i",($3/1024)); -- $type = $1; -- $volumn = $5; -- -+ $filesystem = $1; -+ $total = sprintf("%i",($2/1024)); -+ $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;; -+ $volumn = $6; -+ - # no virtual FS - next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); - next if ($filesystem =~ /^(tmpfs)$/); -@@ -36,8 +38,7 @@ - FILESYSTEM => $filesystem, - TOTAL => $total, - TYPE => $type, -- VOLUMN => -- $volumn -+ VOLUMN => $volumn - }) - } - } diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/manifest.u --- a/ocsinventory-agent/stuff/manifest.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- Ocsinventory-Agent-1.0.1.ori/MANIFEST Sun Mar 22 20:19:28 2009 -+++ Ocsinventory-Agent-1.0.1/MANIFEST Sun Jul 12 22:31:59 2009 -@@ -71,6 +71,7 @@ - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm -+lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Screen.pm diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/ocsinventory-agent-1.1.2.1.u --- a/ocsinventory-agent/stuff/ocsinventory-agent-1.1.2.1.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ ---- Ocsinventory-Agent-1.1.2.1-ori/MANIFEST -+++ Ocsinventory-Agent-1.1.2.1/MANIFEST -@@ -75,6 +75,7 @@ - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/ByHand.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm -+lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Pacman.pm - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm ---- Ocsinventory-Agent-1.1.2.1-ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm -+++ Ocsinventory-Agent-1.1.2.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm -@@ -3,7 +3,7 @@ - use strict; - sub check { - return unless can_run ("df"); -- my $df = `df -TP`; -+ my $df = `df -k`; - return 1 if $df =~ /\w+/; - 0 - } -@@ -58,7 +58,7 @@ - } - } - -- foreach(`df -TP`) { # TODO retrive error -+ foreach(`df -k`) { # TODO retrive error - my $createdate; - my $free; - my $filesystem; -@@ -68,12 +68,12 @@ - my $volumn; - my $serial; - -- if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ -- $free = sprintf("%i",($4/1024)); -- $filesystem = $2; -- $total = sprintf("%i",($3/1024)); -- $type = $5; -- $volumn = $1; -+ if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ -+ $free = sprintf("%i",($4/1024)); -+ $filesystem = $1; -+ $total = sprintf("%i",($2/1024)); -+ $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;; -+ $volumn = $6; - - # no virtual FS - next if ($filesystem =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/patches/Drives.pm.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocsinventory-agent/stuff/patches/Drives.pm.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,47 @@ +--- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Fri Mar 6 19:02:57 2009 ++++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Sun Jul 12 22:29:32 2009 +@@ -1,9 +1,11 @@ + package Ocsinventory::Agent::Backend::OS::Linux::Drives; ++# Modified bye Erjo ++# Busybox df applet as no -T -P options. + + use strict; + sub check { + return unless can_run ("df"); +- my $df = `df -TP`; ++ my $df = `df -k`; + return 1 if $df =~ /\w+/; + 0 + } +@@ -19,14 +21,14 @@ + my $volumn; + + +- foreach(`df -TP`) { # TODO retrive error +- if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ ++ foreach(`df -k`) { # TODO retrive error ++ if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ + $free = sprintf("%i",($4/1024)); +- $filesystem = $2; +- $total = sprintf("%i",($3/1024)); +- $type = $1; +- $volumn = $5; +- ++ $filesystem = $1; ++ $total = sprintf("%i",($2/1024)); ++ $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;; ++ $volumn = $6; ++ + # no virtual FS + next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); + next if ($filesystem =~ /^(tmpfs)$/); +@@ -36,8 +38,7 @@ + FILESYSTEM => $filesystem, + TOTAL => $total, + TYPE => $type, +- VOLUMN => +- $volumn ++ VOLUMN => $volumn + }) + } + } diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/patches/manifest.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocsinventory-agent/stuff/patches/manifest.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- Ocsinventory-Agent-1.0.1.ori/MANIFEST Sun Mar 22 20:19:28 2009 ++++ Ocsinventory-Agent-1.0.1/MANIFEST Sun Jul 12 22:31:59 2009 +@@ -71,6 +71,7 @@ + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm ++lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Screen.pm diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/patches/ocsinventory-agent-1.1.2.1.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocsinventory-agent/stuff/patches/ocsinventory-agent-1.1.2.1.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,49 @@ +--- Ocsinventory-Agent-1.1.2.1-ori/MANIFEST ++++ Ocsinventory-Agent-1.1.2.1/MANIFEST +@@ -75,6 +75,7 @@ + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/ByHand.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm ++lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Pacman.pm + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm +--- Ocsinventory-Agent-1.1.2.1-ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm ++++ Ocsinventory-Agent-1.1.2.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm +@@ -3,7 +3,7 @@ + use strict; + sub check { + return unless can_run ("df"); +- my $df = `df -TP`; ++ my $df = `df -k`; + return 1 if $df =~ /\w+/; + 0 + } +@@ -58,7 +58,7 @@ + } + } + +- foreach(`df -TP`) { # TODO retrive error ++ foreach(`df -k`) { # TODO retrive error + my $createdate; + my $free; + my $filesystem; +@@ -68,12 +68,12 @@ + my $volumn; + my $serial; + +- if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ +- $free = sprintf("%i",($4/1024)); +- $filesystem = $2; +- $total = sprintf("%i",($3/1024)); +- $type = $5; +- $volumn = $1; ++ if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ ++ $free = sprintf("%i",($4/1024)); ++ $filesystem = $1; ++ $total = sprintf("%i",($2/1024)); ++ $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;; ++ $volumn = $6; + + # no virtual FS + next if ($filesystem =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); diff -r c7b121a4ffd9 -r d6378d455338 ocsinventory-agent/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ocsinventory-agent/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|ocsinventory-agent-1.1.2.1.u diff -r c7b121a4ffd9 -r d6378d455338 opencpn/receipt --- a/opencpn/receipt Wed May 09 17:03:28 2018 +0300 +++ b/opencpn/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,8 +17,6 @@ # Binutils 2.22 break many packages build without LDFLAGS set correctly. export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" - busybox patch -p0 -i $stuff/glib.u - ./configure $CONFIGURE_ARGS && fix libtool && make && diff -r c7b121a4ffd9 -r d6378d455338 opencpn/stuff/glib.u --- a/opencpn/stuff/glib.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883 - ---- include/dychart.h -+++ include/dychart.h -@@ -211,7 +211,9 @@ - - #ifdef __WXGTK__ - #ifdef ocpnUSE_GTK_OPTIMIZE -+#define GSocket GlibGSocket - #include -+#undef GSocket - #endif - #endif - diff -r c7b121a4ffd9 -r d6378d455338 opencpn/stuff/patches/glib.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/opencpn/stuff/patches/glib.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883 + +--- include/dychart.h ++++ include/dychart.h +@@ -211,7 +211,9 @@ + + #ifdef __WXGTK__ + #ifdef ocpnUSE_GTK_OPTIMIZE ++#define GSocket GlibGSocket + #include ++#undef GSocket + #endif + #endif + diff -r c7b121a4ffd9 -r d6378d455338 opencpn/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/opencpn/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|glib.u diff -r c7b121a4ffd9 -r d6378d455338 openspades/receipt --- a/openspades/receipt Wed May 09 17:03:28 2018 +0300 +++ b/openspades/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,7 +19,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p1 -i $stuff/$PACKAGE-$VERSION.patch export CXX=/usr/bin/i486-slitaz-linux-g++-49 mkdir build; cd build diff -r c7b121a4ffd9 -r d6378d455338 openspades/stuff/openspades-0.0.12.patch --- a/openspades/stuff/openspades-0.0.12.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ ---- a/Sources/Client/Client_Input.cpp -+++ b/Sources/Client/Client_Input.cpp -@@ -38,6 +38,7 @@ - - #include "NetClient.h" - -+using namespace std; - - SPADES_SETTING(cg_mouseSensitivity, "1"); - SPADES_SETTING(cg_zoomedMouseSensScale, "0.6"); ---- a/Sources/Client/Corpse.cpp -+++ b/Sources/Client/Corpse.cpp -@@ -27,6 +27,8 @@ - #include "../Core/Debug.h" - #include "../Core/Settings.h" - -+using namespace std; -+ - SPADES_SETTING(r_corpseLineCollision, "1"); - - namespace spades { ---- a/Sources/Draw/SWMapRenderer.cpp -+++ b/Sources/Draw/SWMapRenderer.cpp -@@ -31,6 +31,8 @@ - #include "SWUtils.h" - #include - -+using namespace std; -+ - SPADES_SETTING(r_swUndersampling, "0"); - - namespace spades { diff -r c7b121a4ffd9 -r d6378d455338 openspades/stuff/patches/openspades-0.0.12.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openspades/stuff/patches/openspades-0.0.12.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,32 @@ +--- a/Sources/Client/Client_Input.cpp ++++ b/Sources/Client/Client_Input.cpp +@@ -38,6 +38,7 @@ + + #include "NetClient.h" + ++using namespace std; + + SPADES_SETTING(cg_mouseSensitivity, "1"); + SPADES_SETTING(cg_zoomedMouseSensScale, "0.6"); +--- a/Sources/Client/Corpse.cpp ++++ b/Sources/Client/Corpse.cpp +@@ -27,6 +27,8 @@ + #include "../Core/Debug.h" + #include "../Core/Settings.h" + ++using namespace std; ++ + SPADES_SETTING(r_corpseLineCollision, "1"); + + namespace spades { +--- a/Sources/Draw/SWMapRenderer.cpp ++++ b/Sources/Draw/SWMapRenderer.cpp +@@ -31,6 +31,8 @@ + #include "SWUtils.h" + #include + ++using namespace std; ++ + SPADES_SETTING(r_swUndersampling, "0"); + + namespace spades { diff -r c7b121a4ffd9 -r d6378d455338 openspades/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openspades/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|openspades-0.0.12.patch diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/receipt --- a/ovz-web-panel/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ovz-web-panel/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,18 +15,6 @@ # Rules to configure and make the package. compile_rules() { - # Apply patches - while read patch_file; do - if [ -f done.$patch_file ]; then - echo "Skipping $patch_file" - continue - fi - echo "Apply $patch_file" - patch -p1 < $stuff/$patch_file || return 1 - touch done.$patch_file - done < /dev/null || true } diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/stuff/hardware_server.rb.u --- a/ovz-web-panel/stuff/hardware_server.rb.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- ovz-web-panel-ori/app/models/hardware_server.rb Fri Nov 19 18:54:08 2010 -+++ ovz-web-panel/app/models/hardware_server.rb Fri Dec 31 23:59:40 2010 -@@ -174,7 +174,7 @@ - end - - def sync_backups -- backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output'] -+ backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output'] - backups_list = backups_list.split("\n") - # remove totals line - backups_list.shift diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/stuff/owp-1.7.u --- a/ovz-web-panel/stuff/owp-1.7.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ ---- ovz-web-panel-ori/app/models/hardware_server.rb Fri Nov 19 18:54:08 2010 -+++ ovz-web-panel/app/models/hardware_server.rb Fri Dec 31 23:59:40 2010 -@@ -174,7 +174,7 @@ - end - - def sync_backups -- backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output'] -+ backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output'] - backups_list = backups_list.split("\n") - # remove totals line - backups_list.shift ---- ovz-web-panel-ori/script/owp Mon Oct 25 19:09:40 2010 -+++ ovz-web-panel/script/owp Sat Jan 1 01:08:42 2011 -@@ -61,7 +61,7 @@ - - stop() { - echo "Stopping OpenVZ Web Panel server" -- PANEL_APP_PID=`ps auxww | grep ruby | grep script/server | awk '{ print $2 }'` -+ PANEL_APP_PID=`ps | grep ruby | grep script/server | awk '{ print $1 }'` - [ -n "$PANEL_APP_PID" ] && kill -2 $PANEL_APP_PID - [ "$ENVIRONMENT" = "HW-NODE" ] && ruby $INSTALL_DIR/utils/hw-daemon/hw-daemon.rb stop - ruby $INSTALL_DIR/utils/watchdog/watchdog.rb stop diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/stuff/patches/hardware_server.rb.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ovz-web-panel/stuff/patches/hardware_server.rb.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- ovz-web-panel-ori/app/models/hardware_server.rb Fri Nov 19 18:54:08 2010 ++++ ovz-web-panel/app/models/hardware_server.rb Fri Dec 31 23:59:40 2010 +@@ -174,7 +174,7 @@ + end + + def sync_backups +- backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output'] ++ backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output'] + backups_list = backups_list.split("\n") + # remove totals line + backups_list.shift diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/stuff/patches/owp-1.7.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ovz-web-panel/stuff/patches/owp-1.7.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,22 @@ +--- ovz-web-panel-ori/app/models/hardware_server.rb Fri Nov 19 18:54:08 2010 ++++ ovz-web-panel/app/models/hardware_server.rb Fri Dec 31 23:59:40 2010 +@@ -174,7 +174,7 @@ + end + + def sync_backups +- backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output'] ++ backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output'] + backups_list = backups_list.split("\n") + # remove totals line + backups_list.shift +--- ovz-web-panel-ori/script/owp Mon Oct 25 19:09:40 2010 ++++ ovz-web-panel/script/owp Sat Jan 1 01:08:42 2011 +@@ -61,7 +61,7 @@ + + stop() { + echo "Stopping OpenVZ Web Panel server" +- PANEL_APP_PID=`ps auxww | grep ruby | grep script/server | awk '{ print $2 }'` ++ PANEL_APP_PID=`ps | grep ruby | grep script/server | awk '{ print $1 }'` + [ -n "$PANEL_APP_PID" ] && kill -2 $PANEL_APP_PID + [ "$ENVIRONMENT" = "HW-NODE" ] && ruby $INSTALL_DIR/utils/hw-daemon/hw-daemon.rb stop + ruby $INSTALL_DIR/utils/watchdog/watchdog.rb stop diff -r c7b121a4ffd9 -r d6378d455338 ovz-web-panel/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ovz-web-panel/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|owp-1.7.u diff -r c7b121a4ffd9 -r d6378d455338 par2/receipt --- a/par2/receipt Wed May 09 17:03:28 2018 +0300 +++ b/par2/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - #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 && diff -r c7b121a4ffd9 -r d6378d455338 par2/stuff/par2cmdline-0.4-gcc4.patch --- a/par2/stuff/par2cmdline-0.4-gcc4.patch Wed May 09 17:03:28 2018 +0300 +++ /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 diff -r c7b121a4ffd9 -r d6378d455338 par2/stuff/patches/par2cmdline-0.4-gcc4.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/par2/stuff/patches/par2cmdline-0.4-gcc4.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,62 @@ +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 diff -r c7b121a4ffd9 -r d6378d455338 par2/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/par2/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +#http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch +-p1|par2cmdline-0.4-gcc4.patch diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/receipt --- a/pcmanfm-legacy/receipt Wed May 09 17:03:28 2018 +0300 +++ b/pcmanfm-legacy/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,11 +20,6 @@ # Binutils 2.22 break many packages build without LDFLAGS set correctly. export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lXt" - for i in $stuff/*.patch; do - [ -f done.$(basename $i) ] && continue - patch -p0 < $i && touch done.$(basename $i) || return 1 - done - cp $stuff/fr.po $src/po ./configure \ diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/stuff/archiver-tazpkg-support.patch --- a/pcmanfm-legacy/stuff/archiver-tazpkg-support.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ ---- src/ptk/ptk-file-archiver.c Sun May 25 14:59:12 2008 -+++ src/ptk/ptk-file-archiver.c Thu Jun 25 23:28:10 2009 -@@ -10,6 +10,8 @@ - * - */ - -+/* 06-25-2009 Erjo: Add support for tazpkg */ -+ - #include - #include - -@@ -61,6 +63,12 @@ - "tar -xvf", - ".tar", TRUE - }, -+ { -+ "application/x-tazpkg", -+ "tazpkg pack", -+ "tazpkg extract", -+ ".tazpkg", FALSE -+ } - /* - { - "application/x-rar", diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/stuff/patches/archiver-tazpkg-support.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm-legacy/stuff/patches/archiver-tazpkg-support.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,24 @@ +--- src/ptk/ptk-file-archiver.c Sun May 25 14:59:12 2008 ++++ src/ptk/ptk-file-archiver.c Thu Jun 25 23:28:10 2009 +@@ -10,6 +10,8 @@ + * + */ + ++/* 06-25-2009 Erjo: Add support for tazpkg */ ++ + #include + #include + +@@ -61,6 +63,12 @@ + "tar -xvf", + ".tar", TRUE + }, ++ { ++ "application/x-tazpkg", ++ "tazpkg pack", ++ "tazpkg extract", ++ ".tazpkg", FALSE ++ } + /* + { + "application/x-rar", diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm-legacy/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p0|archiver-tazpkg-support.patch +-p0|view.as.detailed.list.click.bug.patch diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/stuff/patches/view.as.detailed.list.click.bug.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmanfm-legacy/stuff/patches/view.as.detailed.list.click.bug.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,25 @@ +--- src/exo/exo-tree-view.c.ORIG ++++ src/exo/exo-tree-view.c +@@ -364,20 +364,11 @@ + tree_view->priv->button_release_activates = (tree_view->priv->single_click && event->type == GDK_BUTTON_PRESS && event->button == 1 + && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0); + } +- +- /* unfortunately GtkTreeView will unselect rows except the clicked one, +- * which makes dragging from a GtkTreeView problematic. That's why we +- * remember the selected paths here and restore them later. +- */ ++ + if (event->type == GDK_BUTTON_PRESS && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0 + && path != NULL && gtk_tree_selection_path_is_selected (selection, path)) + { +- /* if no custom select function is set, we simply use exo_noop_false here, +- * to tell the tree view that it may not alter the selection. +- */ +- if (G_LIKELY (selection->user_func == NULL)) +- gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_false, NULL, NULL); +- else ++ + selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL); + } + diff -r c7b121a4ffd9 -r d6378d455338 pcmanfm-legacy/stuff/view.as.detailed.list.click.bug.patch --- a/pcmanfm-legacy/stuff/view.as.detailed.list.click.bug.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ ---- src/exo/exo-tree-view.c.ORIG -+++ src/exo/exo-tree-view.c -@@ -364,20 +364,11 @@ - tree_view->priv->button_release_activates = (tree_view->priv->single_click && event->type == GDK_BUTTON_PRESS && event->button == 1 - && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0); - } -- -- /* unfortunately GtkTreeView will unselect rows except the clicked one, -- * which makes dragging from a GtkTreeView problematic. That's why we -- * remember the selected paths here and restore them later. -- */ -+ - if (event->type == GDK_BUTTON_PRESS && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0 - && path != NULL && gtk_tree_selection_path_is_selected (selection, path)) - { -- /* if no custom select function is set, we simply use exo_noop_false here, -- * to tell the tree view that it may not alter the selection. -- */ -- if (G_LIKELY (selection->user_func == NULL)) -- gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_false, NULL, NULL); -- else -+ - selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL); - } - diff -r c7b121a4ffd9 -r d6378d455338 php-auth-pam/receipt --- a/php-auth-pam/receipt Wed May 09 17:03:28 2018 +0300 +++ b/php-auth-pam/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,7 +20,6 @@ || make ${PACKAGE}-${VERSION}.orig ${PACKAGE}-${VERSION} cd $src phpize - patch -p1 < $stuff/php-auth-pam-Makefile.global0.4.u || exit 1 sed -i 's/^function_entry/zend_&/;s/pval /zval /' pam_auth.c # php 5.4 ./configure $CONFIGURE_ARGS \ diff -r c7b121a4ffd9 -r d6378d455338 php-auth-pam/stuff/patches/php-auth-pam-Makefile.global0.4.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/php-auth-pam/stuff/patches/php-auth-pam-Makefile.global0.4.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,53 @@ +--- php-auth-pam-0.4-ori/Makefile.global Sat May 8 09:06:20 2010 ++++ php-auth-pam-0.4/Makefile.global Sat May 8 09:07:58 2010 +@@ -24,7 +24,7 @@ + + install-sapi: $(OVERALL_TARGET) + @echo "Installing PHP SAPI module: $(PHP_SAPI)" +- -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) ++ -@$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(bindir) + -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \ + for i in 0.0.0 0.0 0; do \ + if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \ +@@ -37,19 +37,19 @@ + + install-modules: build-modules + @test -d modules && \ +- $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) +- @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" ++ $(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR) ++ @echo "Installing shared extensions: $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)/" + @rm -f modules/*.la >/dev/null 2>&1 +- @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) ++ @$(INSTALL) modules/* $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR) + + install-headers: + -@if test "$(INSTALL_HEADERS)"; then \ + for i in `echo $(INSTALL_HEADERS)`; do \ + i=`$(top_srcdir)/build/shtool path -d $$i`; \ +- paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ ++ paths="$$paths $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i"; \ + done; \ + $(mkinstalldirs) $$paths && \ +- echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ ++ echo "Installing header files: $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/" && \ + for i in `echo $(INSTALL_HEADERS)`; do \ + if test "$(PHP_PECL_EXTENSION)"; then \ + src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \ +@@ -57,12 +57,12 @@ + src=$$i; \ + fi; \ + if test -f "$(top_srcdir)/$$src"; then \ +- $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ ++ $(INSTALL_DATA) $(top_srcdir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ + elif test -f "$(top_builddir)/$$src"; then \ +- $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ ++ $(INSTALL_DATA) $(top_builddir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ + else \ +- (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ +- cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ ++ (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ ++ cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ + fi \ + done; \ + fi diff -r c7b121a4ffd9 -r d6378d455338 php-auth-pam/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/php-auth-pam/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|php-auth-pam-Makefile.global0.4.u diff -r c7b121a4ffd9 -r d6378d455338 php-auth-pam/stuff/php-auth-pam-Makefile.global0.4.u --- a/php-auth-pam/stuff/php-auth-pam-Makefile.global0.4.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ ---- php-auth-pam-0.4-ori/Makefile.global Sat May 8 09:06:20 2010 -+++ php-auth-pam-0.4/Makefile.global Sat May 8 09:07:58 2010 -@@ -24,7 +24,7 @@ - - install-sapi: $(OVERALL_TARGET) - @echo "Installing PHP SAPI module: $(PHP_SAPI)" -- -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) -+ -@$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(bindir) - -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \ - for i in 0.0.0 0.0 0; do \ - if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \ -@@ -37,19 +37,19 @@ - - install-modules: build-modules - @test -d modules && \ -- $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) -- @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" -+ $(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR) -+ @echo "Installing shared extensions: $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)/" - @rm -f modules/*.la >/dev/null 2>&1 -- @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) -+ @$(INSTALL) modules/* $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR) - - install-headers: - -@if test "$(INSTALL_HEADERS)"; then \ - for i in `echo $(INSTALL_HEADERS)`; do \ - i=`$(top_srcdir)/build/shtool path -d $$i`; \ -- paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ -+ paths="$$paths $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i"; \ - done; \ - $(mkinstalldirs) $$paths && \ -- echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ -+ echo "Installing header files: $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/" && \ - for i in `echo $(INSTALL_HEADERS)`; do \ - if test "$(PHP_PECL_EXTENSION)"; then \ - src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \ -@@ -57,12 +57,12 @@ - src=$$i; \ - fi; \ - if test -f "$(top_srcdir)/$$src"; then \ -- $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ -+ $(INSTALL_DATA) $(top_srcdir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ - elif test -f "$(top_builddir)/$$src"; then \ -- $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ -+ $(INSTALL_DATA) $(top_builddir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ - else \ -- (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ -- cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ -+ (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \ -+ cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ - fi \ - done; \ - fi diff -r c7b121a4ffd9 -r d6378d455338 portmidi/receipt --- a/portmidi/receipt Wed May 09 17:03:28 2018 +0300 +++ b/portmidi/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - patch -Np1 -i $stuff/portmidi-217-Makefile.patch - # Prefix Fix sed -i "s_\(/usr\)/local_\1_" \ */CMakeLists.txt \ diff -r c7b121a4ffd9 -r d6378d455338 portmidi/stuff/patches/portmidi-217-Makefile.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/portmidi/stuff/patches/portmidi-217-Makefile.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,77 @@ +diff -Naur portmidi/CMakeLists.txt portmidi_patched/CMakeLists.txt +--- portmidi/CMakeLists.txt 2010-09-20 12:57:48.000000000 -0700 ++++ portmidi_patched/CMakeLists.txt 2010-10-18 11:56:28.000000000 -0700 +@@ -73,5 +73,4 @@ + add_subdirectory(pm_dylib) + + # Cannot figure out how to make an xcode Java application with CMake +-add_subdirectory(pm_java) + +diff -Naur portmidi/pm_common/CMakeLists.txt portmidi_patched/pm_common/CMakeLists.txt +--- portmidi/pm_common/CMakeLists.txt 2010-09-20 12:57:48.000000000 -0700 ++++ portmidi_patched/pm_common/CMakeLists.txt 2010-10-18 11:57:21.000000000 -0700 +@@ -67,14 +67,6 @@ + message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) + else(APPLE) + # LINUX settings... +- include(FindJNI) +- message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) +- message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) +- message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2}) +- message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY}) +- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) +- # libjvm.so is found relative to JAVA_INCLUDE_PATH: +- set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so) + + set(LINUXSRC pmlinuxalsa pmlinux finddefault) + prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) +@@ -99,7 +91,6 @@ + set(PM_NEEDED_LIBS winmm.lib) + endif(WIN32) + endif(UNIX) +-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY}) + + # this completes the list of library sources by adding shared code + list(APPEND LIBSRC pmutil portmidi) +@@ -110,18 +101,10 @@ + target_link_libraries(portmidi-static ${PM_NEEDED_LIBS}) + + # define the jni library +-include_directories(${JAVA_INCLUDE_PATHS}) + +-set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c) +-add_library(pmjni SHARED ${JNISRC}) +-target_link_libraries(pmjni ${JNI_EXTRA_LIBS}) +-set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib") + + # install the libraries (Linux and Mac OS X command line) + if(UNIX) +- INSTALL(TARGETS portmidi-static pmjni +- LIBRARY DESTINATION /usr/local/lib +- ARCHIVE DESTINATION /usr/local/lib) + # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here + # INSTALL(FILES portmidi.h ../porttime/porttime.h + # DESTINATION /usr/local/include) +diff -Naur portmidi/pm_dylib/CMakeLists.txt portmidi_patched/pm_dylib/CMakeLists.txt +--- portmidi/pm_dylib/CMakeLists.txt 2009-11-19 21:41:09.000000000 -0800 ++++ portmidi_patched/pm_dylib/CMakeLists.txt 2010-10-18 11:58:16.000000000 -0700 +@@ -63,7 +63,6 @@ + message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) + else(APPLE) + # LINUX settings... +- include(FindJNI) + # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) + # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) + # note: should use JAVA_JVM_LIB_PATH, but it is not set properly +@@ -75,11 +74,7 @@ + # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH + # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation + # because JAVA_INCLUDE_PATH2 is pretty obscure) +- set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN} +- CACHE STRING "where to find Java SDK include directory") +- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux) + # libjvm.so is found relative to JAVA_INCLUDE_PATH: +- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) + + set(LINUXSRC pmlinuxalsa pmlinux finddefault) + prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) diff -r c7b121a4ffd9 -r d6378d455338 portmidi/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/portmidi/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +portmidi-217-Makefile.patch diff -r c7b121a4ffd9 -r d6378d455338 portmidi/stuff/portmidi-217-Makefile.patch --- a/portmidi/stuff/portmidi-217-Makefile.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -diff -Naur portmidi/CMakeLists.txt portmidi_patched/CMakeLists.txt ---- portmidi/CMakeLists.txt 2010-09-20 12:57:48.000000000 -0700 -+++ portmidi_patched/CMakeLists.txt 2010-10-18 11:56:28.000000000 -0700 -@@ -73,5 +73,4 @@ - add_subdirectory(pm_dylib) - - # Cannot figure out how to make an xcode Java application with CMake --add_subdirectory(pm_java) - -diff -Naur portmidi/pm_common/CMakeLists.txt portmidi_patched/pm_common/CMakeLists.txt ---- portmidi/pm_common/CMakeLists.txt 2010-09-20 12:57:48.000000000 -0700 -+++ portmidi_patched/pm_common/CMakeLists.txt 2010-10-18 11:57:21.000000000 -0700 -@@ -67,14 +67,6 @@ - message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) - else(APPLE) - # LINUX settings... -- include(FindJNI) -- message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) -- message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) -- message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2}) -- message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY}) -- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) -- # libjvm.so is found relative to JAVA_INCLUDE_PATH: -- set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so) - - set(LINUXSRC pmlinuxalsa pmlinux finddefault) - prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) -@@ -99,7 +91,6 @@ - set(PM_NEEDED_LIBS winmm.lib) - endif(WIN32) - endif(UNIX) --set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY}) - - # this completes the list of library sources by adding shared code - list(APPEND LIBSRC pmutil portmidi) -@@ -110,18 +101,10 @@ - target_link_libraries(portmidi-static ${PM_NEEDED_LIBS}) - - # define the jni library --include_directories(${JAVA_INCLUDE_PATHS}) - --set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c) --add_library(pmjni SHARED ${JNISRC}) --target_link_libraries(pmjni ${JNI_EXTRA_LIBS}) --set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib") - - # install the libraries (Linux and Mac OS X command line) - if(UNIX) -- INSTALL(TARGETS portmidi-static pmjni -- LIBRARY DESTINATION /usr/local/lib -- ARCHIVE DESTINATION /usr/local/lib) - # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here - # INSTALL(FILES portmidi.h ../porttime/porttime.h - # DESTINATION /usr/local/include) -diff -Naur portmidi/pm_dylib/CMakeLists.txt portmidi_patched/pm_dylib/CMakeLists.txt ---- portmidi/pm_dylib/CMakeLists.txt 2009-11-19 21:41:09.000000000 -0800 -+++ portmidi_patched/pm_dylib/CMakeLists.txt 2010-10-18 11:58:16.000000000 -0700 -@@ -63,7 +63,6 @@ - message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) - else(APPLE) - # LINUX settings... -- include(FindJNI) - # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) - # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) - # note: should use JAVA_JVM_LIB_PATH, but it is not set properly -@@ -75,11 +74,7 @@ - # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH - # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation - # because JAVA_INCLUDE_PATH2 is pretty obscure) -- set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN} -- CACHE STRING "where to find Java SDK include directory") -- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux) - # libjvm.so is found relative to JAVA_INCLUDE_PATH: -- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) - - set(LINUXSRC pmlinuxalsa pmlinux finddefault) - prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) diff -r c7b121a4ffd9 -r d6378d455338 procps/receipt --- a/procps/receipt Wed May 09 17:03:28 2018 +0300 +++ b/procps/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -Np1 -i $stuff/$PACKAGE-$VERSION+gmake-3.82.patch make && make -j1 install } diff -r c7b121a4ffd9 -r d6378d455338 procps/stuff/patches/procps-3.2.8+gmake-3.82.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/procps/stuff/patches/procps-3.2.8+gmake-3.82.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +Index: procps-3.2.8/Makefile +=================================================================== +--- procps-3.2.8.orig/Makefile ++++ procps-3.2.8/Makefile +@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES) + # want this rule first, use := on ALL, and ALL not filled in yet + all: do_all + +--include */module.mk ++-include proc/module.mk ++-include ps/module.mk + + do_all: $(ALL) + diff -r c7b121a4ffd9 -r d6378d455338 procps/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/procps/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +procps-3.2.8+gmake-3.82.patch diff -r c7b121a4ffd9 -r d6378d455338 procps/stuff/procps-3.2.8+gmake-3.82.patch --- a/procps/stuff/procps-3.2.8+gmake-3.82.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -Index: procps-3.2.8/Makefile -=================================================================== ---- procps-3.2.8.orig/Makefile -+++ procps-3.2.8/Makefile -@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES) - # want this rule first, use := on ALL, and ALL not filled in yet - all: do_all - ---include */module.mk -+-include proc/module.mk -+-include ps/module.mk - - do_all: $(ALL) - diff -r c7b121a4ffd9 -r d6378d455338 python-pygame/receipt --- a/python-pygame/receipt Wed May 09 17:03:28 2018 +0300 +++ b/python-pygame/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ SPLIT="python-pygame-dev" compile_rules() { - patch -Np0 -i $stuff/config.patch sed -i "s|linux/videodev.h|libv4l1-videodev.h|" src/camera.h python config.py -auto && python setup.py install --root=$DESTDIR diff -r c7b121a4ffd9 -r d6378d455338 python-pygame/stuff/config.patch --- a/python-pygame/stuff/config.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -Index: config_unix.py -=================================================================== ---- config_unix.py (revision 2567) -+++ config_unix.py (working copy) -@@ -174,7 +174,7 @@ - - for d in DEPS[1:]: - if not d.found: -- if not confirm(""" -+ if "-auto" not in sys.argv and not confirm(""" - Warning, some of the pygame dependencies were not found. Pygame can still - compile and install, but games that depend on those missing dependencies - will not run. Would you like to continue the configuration?"""): -Index: config_msys.py -=================================================================== ---- config_msys.py (revision 2567) -+++ config_msys.py (working copy) -@@ -283,7 +283,7 @@ - - for d in DEPS[1:]: - if not d.found: -- if not confirm(""" -+ if "-auto" not in sys.argv and not confirm(""" - Warning, some of the pygame dependencies were not found. Pygame can still - compile and install, but games that depend on those missing dependencies - will not run. Would you like to continue the configuration?"""): diff -r c7b121a4ffd9 -r d6378d455338 python-pygame/stuff/patches/config.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-pygame/stuff/patches/config.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,26 @@ +Index: config_unix.py +=================================================================== +--- config_unix.py (revision 2567) ++++ config_unix.py (working copy) +@@ -174,7 +174,7 @@ + + for d in DEPS[1:]: + if not d.found: +- if not confirm(""" ++ if "-auto" not in sys.argv and not confirm(""" + Warning, some of the pygame dependencies were not found. Pygame can still + compile and install, but games that depend on those missing dependencies + will not run. Would you like to continue the configuration?"""): +Index: config_msys.py +=================================================================== +--- config_msys.py (revision 2567) ++++ config_msys.py (working copy) +@@ -283,7 +283,7 @@ + + for d in DEPS[1:]: + if not d.found: +- if not confirm(""" ++ if "-auto" not in sys.argv and not confirm(""" + Warning, some of the pygame dependencies were not found. Pygame can still + compile and install, but games that depend on those missing dependencies + will not run. Would you like to continue the configuration?"""): diff -r c7b121a4ffd9 -r d6378d455338 python-pygame/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-pygame/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-Np0|config.patch diff -r c7b121a4ffd9 -r d6378d455338 python-pyxml/receipt --- a/python-pyxml/receipt Wed May 09 17:03:28 2018 +0300 +++ b/python-pyxml/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,6 @@ # Rules to configure and make the package. compile_rules() { - patch -Np1 -i $stuff/fix-python2.6.patch python setup.py build --with-xslt python setup.py install --root=$DESTDIR } diff -r c7b121a4ffd9 -r d6378d455338 python-pyxml/stuff/fix-python2.6.patch --- a/python-pyxml/stuff/fix-python2.6.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -diff -ur a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py ---- a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2003-03-11 15:01:34.000000000 +0100 -+++ b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2009-05-25 16:32:26.000000000 +0200 -@@ -24,8 +24,8 @@ - self._rel = rel - nt = ParsedNodeTest.ParsedNodeTest('node', '') - ppl = ParsedPredicateList.ParsedPredicateList([]) -- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') -- self._step = ParsedStep.ParsedStep(as, nt, ppl) -+ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') -+ self._step = ParsedStep.ParsedStep(asp, nt, ppl) - return - - def evaluate(self, context): -diff -ur a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py ---- a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2003-03-11 15:01:34.000000000 +0100 -+++ b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2009-05-25 16:27:55.000000000 +0200 -@@ -28,8 +28,8 @@ - self._right = right - nt = ParsedNodeTest.ParsedNodeTest('node','') - ppl = ParsedPredicateList.ParsedPredicateList([]) -- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') -- self._middle = ParsedStep.ParsedStep(as, nt, ppl) -+ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') -+ self._middle = ParsedStep.ParsedStep(asp, nt, ppl) - - def evaluate(self, context): - res = [] diff -r c7b121a4ffd9 -r d6378d455338 python-pyxml/stuff/patches/fix-python2.6.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-pyxml/stuff/patches/fix-python2.6.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,28 @@ +diff -ur a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py +--- a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2003-03-11 15:01:34.000000000 +0100 ++++ b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py 2009-05-25 16:32:26.000000000 +0200 +@@ -24,8 +24,8 @@ + self._rel = rel + nt = ParsedNodeTest.ParsedNodeTest('node', '') + ppl = ParsedPredicateList.ParsedPredicateList([]) +- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') +- self._step = ParsedStep.ParsedStep(as, nt, ppl) ++ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') ++ self._step = ParsedStep.ParsedStep(asp, nt, ppl) + return + + def evaluate(self, context): +diff -ur a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py +--- a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2003-03-11 15:01:34.000000000 +0100 ++++ b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py 2009-05-25 16:27:55.000000000 +0200 +@@ -28,8 +28,8 @@ + self._right = right + nt = ParsedNodeTest.ParsedNodeTest('node','') + ppl = ParsedPredicateList.ParsedPredicateList([]) +- as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') +- self._middle = ParsedStep.ParsedStep(as, nt, ppl) ++ asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self') ++ self._middle = ParsedStep.ParsedStep(asp, nt, ppl) + + def evaluate(self, context): + res = [] diff -r c7b121a4ffd9 -r d6378d455338 python-pyxml/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python-pyxml/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +fix-python2.6.patch diff -r c7b121a4ffd9 -r d6378d455338 qemu-light/receipt --- a/qemu-light/receipt Wed May 09 17:03:28 2018 +0300 +++ b/qemu-light/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,8 +21,6 @@ http://netassist.dl.sourceforge.net/project/edk2/OVMF/$UEFIZIP unzip $SRC/$UEFIZIP OVMF.fd -d $DESTIDR/usr/share/qemu/ia32 - patch -p0 < $stuff/cloop.u - TARGET="i386-softmmu" export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" diff -r c7b121a4ffd9 -r d6378d455338 qemu-light/stuff/cloop.u --- a/qemu-light/stuff/cloop.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,284 +0,0 @@ ---- block/cloop.c -+++ block/cloop.c -@@ -29,11 +29,90 @@ - /* Maximum compressed block size */ - #define MAX_BLOCK_SIZE (64 * 1024 * 1024) - -+typedef struct cloop_tail { -+ uint32_t table_size; -+ uint32_t index_size; -+ uint32_t num_blocks; -+} cloop_tail; -+ -+typedef struct block_info { -+ uint64_t offset; /* 64-bit offsets of compressed block */ -+ uint32_t size; /* 32-bit compressed block size */ -+ uint32_t optidx; /* 32-bit index number */ -+} block_info; -+ -+static inline int build_index(block_info *offsets, unsigned long n) -+{ -+ uint32_t *ofs32 = (uint32_t *) offsets; -+ uint64_t *ofs64 = (uint64_t *) offsets; -+ -+ if (ofs32[0] == 0) { -+ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ -+ while (n--) { -+ offsets[n].offset = be64_to_cpu(offsets[n].offset); -+ offsets[n].size = ntohl(offsets[n].size); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ } -+ } -+ else { /* V2.0 */ -+ uint64_t last = be64_to_cpu(ofs64[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = be64_to_cpu(ofs64[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ } -+ else if (ofs32[1] == 0) { /* V1.0 */ -+ uint64_t last = le64_to_cpu(ofs64[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = le64_to_cpu(ofs64[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ -+ uint64_t last = ntohl(ofs32[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = ntohl(ofs32[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ else { /* V3.0 */ -+ unsigned long i; -+ uint64_t j; -+ -+ for (i = n; i-- > 0; ) { -+ offsets[i].size = ntohl(ofs32[i]); -+ if (offsets[i].size > 2 * MAX_BLOCK_SIZE) -+ return i+1; -+ } -+ for (i = 0, j = 128 + 4 + 4; i < n; i++) { -+ offsets[i].offset = j; -+ if (offsets[i].size & 0x80000000) { -+ unsigned long k = offsets[i].size & 0x7FFFFFFF; -+ offsets[i].offset = offsets[k].offset; -+ offsets[i].size = offsets[k].size; -+ } -+ else j += offsets[i].size; -+ } -+ } -+ return 0; -+} -+ - typedef struct BDRVCloopState { - CoMutex lock; - uint32_t block_size; - uint32_t n_blocks; -- uint64_t *offsets; -+ block_info *offsets; - uint32_t sectors_per_block; - uint32_t current_block; - uint8_t *compressed_block; -@@ -43,17 +117,21 @@ - - static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename) - { -- const char *magic_version_2_0 = "#!/bin/sh\n" -- "#V2.0 Format\n" -+ static const uint8_t magic[] = - "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n"; -- int length = strlen(magic_version_2_0); -- if (length > buf_size) { -- length = buf_size; -+ int i, ret = 0, length = buf_size; -+ uint8_t c; -+ -+ if (length > 127) { -+ length = 127; - } -- if (!memcmp(magic_version_2_0, buf, length)) { -- return 2; -+ for (i = 0; i < length - sizeof(magic) + 1; i++) { -+ if (buf[i] != magic[0]) continue; -+ if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue; -+ ret = 2; -+ break; - } -- return 0; -+ return ret; - } - - static int cloop_open(BlockDriverState *bs, QDict *options, int flags, -@@ -91,79 +169,97 @@ - MAX_BLOCK_SIZE / (1024 * 1024)); - return -EINVAL; - } -- - ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4); - if (ret < 0) { - return ret; - } - s->n_blocks = be32_to_cpu(s->n_blocks); - -- /* read offsets */ -- if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) { -- /* Prevent integer overflow */ -- error_setg(errp, "n_blocks %u must be %zu or less", -- s->n_blocks, -- (UINT32_MAX - 1) / sizeof(uint64_t)); -- return -EINVAL; -- } -- offsets_size = (s->n_blocks + 1) * sizeof(uint64_t); -- if (offsets_size > 512 * 1024 * 1024) { -- /* Prevent ridiculous offsets_size which causes memory allocation to -- * fail or overflows bdrv_pread() size. In practice the 512 MB -- * offsets[] limit supports 16 TB images at 256 KB block size. -- */ -- error_setg(errp, "image requires too many offsets, " -- "try increasing block size"); -- return -EINVAL; -- } -- s->offsets = g_malloc(offsets_size); -+ /* initialize zlib engine */ -+ max_compressed_block_size = s->block_size + s->block_size/1000 + 12 + 4; -+ s->compressed_block = g_malloc(max_compressed_block_size + 1); -+ s->uncompressed_block = g_malloc(s->block_size); - -- ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); -- if (ret < 0) { -+ if (inflateInit(&s->zstream) != Z_OK) { -+ ret = -EINVAL; - goto fail; - } - -- for (i = 0; i < s->n_blocks + 1; i++) { -- uint64_t size; -+ /* read offsets */ -+ if (s->n_blocks + 1 == 0) { -+ cloop_tail tail; -+ int64_t end = bdrv_getlength(bs->file); -+ void *p; -+ uint32_t toclen, len; - -- s->offsets[i] = be64_to_cpu(s->offsets[i]); -- if (i == 0) { -- continue; -+ ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail)); -+ if (ret < 0) { -+ goto fail; - } - -- if (s->offsets[i] < s->offsets[i - 1]) { -- error_setg(errp, "offsets not monotonically increasing at " -- "index %u, image file is corrupt", i); -- ret = -EINVAL; -- goto fail; -+ s->n_blocks = be32_to_cpu(tail.num_blocks); -+ offsets_size = s->n_blocks * sizeof(block_info); -+ if (offsets_size > 512 * 1024 * 1024) { -+ /* Prevent ridiculous offsets_size which causes memory allocation to -+ * fail or overflows bdrv_pread() size. In practice the 512 MB -+ * offsets[] limit supports 16 TB images at 256 KB block size. -+ */ -+ error_setg(errp, "image requires too many offsets, " -+ "try increasing block size"); -+ return -EINVAL; - } -+ len = be32_to_cpu(tail.table_size); -+ toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks; - -- size = s->offsets[i] - s->offsets[i - 1]; -+ s->offsets = g_malloc(offsets_size); -+ p = g_malloc(len); - -- /* Compressed blocks should be smaller than the uncompressed block size -- * but maybe compression performed poorly so the compressed block is -- * actually bigger. Clamp down on unrealistic values to prevent -- * ridiculous s->compressed_block allocation. -- */ -- if (size > 2 * MAX_BLOCK_SIZE) { -- error_setg(errp, "invalid compressed block size at index %u, " -- "image file is corrupt", i); -+ ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len); -+ if (ret < 0) { -+ goto fail; -+ } -+ s->zstream.next_in = p; -+ s->zstream.avail_in = len; -+ s->zstream.next_out = s->offsets; -+ s->zstream.avail_out = toclen; -+ ret = inflateReset(&s->zstream); -+ if (ret != Z_OK) { - ret = -EINVAL; - goto fail; - } -- -- if (size > max_compressed_block_size) { -- max_compressed_block_size = size; -+ ret = inflate(&s->zstream, Z_FINISH); -+ if (ret != Z_STREAM_END || s->zstream.total_out != toclen) { -+ ret = -EINVAL; -+ goto fail; - } -+ g_free(p); - } -+ else { -+ offsets_size = s->n_blocks * sizeof(block_info); -+ if (offsets_size > 512 * 1024 * 1024) { -+ /* Prevent ridiculous offsets_size which causes memory allocation to -+ * fail or overflows bdrv_pread() size. In practice the 512 MB -+ * offsets[] limit supports 16 TB images at 256 KB block size. -+ */ -+ error_setg(errp, "image requires too many offsets, " -+ "try increasing block size"); -+ return -EINVAL; -+ } -+ s->offsets = g_malloc(offsets_size); - -- /* initialize zlib engine */ -- s->compressed_block = g_malloc(max_compressed_block_size + 1); -- s->uncompressed_block = g_malloc(s->block_size); -- if (inflateInit(&s->zstream) != Z_OK) { -+ ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); -+ if (ret < 0) { -+ goto fail; -+ } -+ } -+ ret = build_index(s->offsets, s->n_blocks); -+ if (ret) { -+ error_setg(errp, "invalid compressed block size at index %u, " -+ "image file is corrupt", ret-1); - ret = -EINVAL; - goto fail; - } -+ - s->current_block = s->n_blocks; - - s->sectors_per_block = s->block_size/512; -@@ -184,10 +280,10 @@ - - if (s->current_block != block_num) { - int ret; -- uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num]; -+ uint32_t bytes = s->offsets[block_num].size; - -- ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block, -- bytes); -+ ret = bdrv_pread(bs->file, s->offsets[block_num].offset, -+ s->compressed_block, bytes); - if (ret != bytes) { - return -1; - } diff -r c7b121a4ffd9 -r d6378d455338 qemu-light/stuff/patches/cloop.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qemu-light/stuff/patches/cloop.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,284 @@ +--- block/cloop.c ++++ block/cloop.c +@@ -29,11 +29,90 @@ + /* Maximum compressed block size */ + #define MAX_BLOCK_SIZE (64 * 1024 * 1024) + ++typedef struct cloop_tail { ++ uint32_t table_size; ++ uint32_t index_size; ++ uint32_t num_blocks; ++} cloop_tail; ++ ++typedef struct block_info { ++ uint64_t offset; /* 64-bit offsets of compressed block */ ++ uint32_t size; /* 32-bit compressed block size */ ++ uint32_t optidx; /* 32-bit index number */ ++} block_info; ++ ++static inline int build_index(block_info *offsets, unsigned long n) ++{ ++ uint32_t *ofs32 = (uint32_t *) offsets; ++ uint64_t *ofs64 = (uint64_t *) offsets; ++ ++ if (ofs32[0] == 0) { ++ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ ++ while (n--) { ++ offsets[n].offset = be64_to_cpu(offsets[n].offset); ++ offsets[n].size = ntohl(offsets[n].size); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ } ++ } ++ else { /* V2.0 */ ++ uint64_t last = be64_to_cpu(ofs64[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = be64_to_cpu(ofs64[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ } ++ else if (ofs32[1] == 0) { /* V1.0 */ ++ uint64_t last = le64_to_cpu(ofs64[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = le64_to_cpu(ofs64[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ ++ uint64_t last = ntohl(ofs32[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = ntohl(ofs32[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ else { /* V3.0 */ ++ unsigned long i; ++ uint64_t j; ++ ++ for (i = n; i-- > 0; ) { ++ offsets[i].size = ntohl(ofs32[i]); ++ if (offsets[i].size > 2 * MAX_BLOCK_SIZE) ++ return i+1; ++ } ++ for (i = 0, j = 128 + 4 + 4; i < n; i++) { ++ offsets[i].offset = j; ++ if (offsets[i].size & 0x80000000) { ++ unsigned long k = offsets[i].size & 0x7FFFFFFF; ++ offsets[i].offset = offsets[k].offset; ++ offsets[i].size = offsets[k].size; ++ } ++ else j += offsets[i].size; ++ } ++ } ++ return 0; ++} ++ + typedef struct BDRVCloopState { + CoMutex lock; + uint32_t block_size; + uint32_t n_blocks; +- uint64_t *offsets; ++ block_info *offsets; + uint32_t sectors_per_block; + uint32_t current_block; + uint8_t *compressed_block; +@@ -43,17 +117,21 @@ + + static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename) + { +- const char *magic_version_2_0 = "#!/bin/sh\n" +- "#V2.0 Format\n" ++ static const uint8_t magic[] = + "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n"; +- int length = strlen(magic_version_2_0); +- if (length > buf_size) { +- length = buf_size; ++ int i, ret = 0, length = buf_size; ++ uint8_t c; ++ ++ if (length > 127) { ++ length = 127; + } +- if (!memcmp(magic_version_2_0, buf, length)) { +- return 2; ++ for (i = 0; i < length - sizeof(magic) + 1; i++) { ++ if (buf[i] != magic[0]) continue; ++ if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue; ++ ret = 2; ++ break; + } +- return 0; ++ return ret; + } + + static int cloop_open(BlockDriverState *bs, QDict *options, int flags, +@@ -91,79 +169,97 @@ + MAX_BLOCK_SIZE / (1024 * 1024)); + return -EINVAL; + } +- + ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4); + if (ret < 0) { + return ret; + } + s->n_blocks = be32_to_cpu(s->n_blocks); + +- /* read offsets */ +- if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) { +- /* Prevent integer overflow */ +- error_setg(errp, "n_blocks %u must be %zu or less", +- s->n_blocks, +- (UINT32_MAX - 1) / sizeof(uint64_t)); +- return -EINVAL; +- } +- offsets_size = (s->n_blocks + 1) * sizeof(uint64_t); +- if (offsets_size > 512 * 1024 * 1024) { +- /* Prevent ridiculous offsets_size which causes memory allocation to +- * fail or overflows bdrv_pread() size. In practice the 512 MB +- * offsets[] limit supports 16 TB images at 256 KB block size. +- */ +- error_setg(errp, "image requires too many offsets, " +- "try increasing block size"); +- return -EINVAL; +- } +- s->offsets = g_malloc(offsets_size); ++ /* initialize zlib engine */ ++ max_compressed_block_size = s->block_size + s->block_size/1000 + 12 + 4; ++ s->compressed_block = g_malloc(max_compressed_block_size + 1); ++ s->uncompressed_block = g_malloc(s->block_size); + +- ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); +- if (ret < 0) { ++ if (inflateInit(&s->zstream) != Z_OK) { ++ ret = -EINVAL; + goto fail; + } + +- for (i = 0; i < s->n_blocks + 1; i++) { +- uint64_t size; ++ /* read offsets */ ++ if (s->n_blocks + 1 == 0) { ++ cloop_tail tail; ++ int64_t end = bdrv_getlength(bs->file); ++ void *p; ++ uint32_t toclen, len; + +- s->offsets[i] = be64_to_cpu(s->offsets[i]); +- if (i == 0) { +- continue; ++ ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail)); ++ if (ret < 0) { ++ goto fail; + } + +- if (s->offsets[i] < s->offsets[i - 1]) { +- error_setg(errp, "offsets not monotonically increasing at " +- "index %u, image file is corrupt", i); +- ret = -EINVAL; +- goto fail; ++ s->n_blocks = be32_to_cpu(tail.num_blocks); ++ offsets_size = s->n_blocks * sizeof(block_info); ++ if (offsets_size > 512 * 1024 * 1024) { ++ /* Prevent ridiculous offsets_size which causes memory allocation to ++ * fail or overflows bdrv_pread() size. In practice the 512 MB ++ * offsets[] limit supports 16 TB images at 256 KB block size. ++ */ ++ error_setg(errp, "image requires too many offsets, " ++ "try increasing block size"); ++ return -EINVAL; + } ++ len = be32_to_cpu(tail.table_size); ++ toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks; + +- size = s->offsets[i] - s->offsets[i - 1]; ++ s->offsets = g_malloc(offsets_size); ++ p = g_malloc(len); + +- /* Compressed blocks should be smaller than the uncompressed block size +- * but maybe compression performed poorly so the compressed block is +- * actually bigger. Clamp down on unrealistic values to prevent +- * ridiculous s->compressed_block allocation. +- */ +- if (size > 2 * MAX_BLOCK_SIZE) { +- error_setg(errp, "invalid compressed block size at index %u, " +- "image file is corrupt", i); ++ ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len); ++ if (ret < 0) { ++ goto fail; ++ } ++ s->zstream.next_in = p; ++ s->zstream.avail_in = len; ++ s->zstream.next_out = s->offsets; ++ s->zstream.avail_out = toclen; ++ ret = inflateReset(&s->zstream); ++ if (ret != Z_OK) { + ret = -EINVAL; + goto fail; + } +- +- if (size > max_compressed_block_size) { +- max_compressed_block_size = size; ++ ret = inflate(&s->zstream, Z_FINISH); ++ if (ret != Z_STREAM_END || s->zstream.total_out != toclen) { ++ ret = -EINVAL; ++ goto fail; + } ++ g_free(p); + } ++ else { ++ offsets_size = s->n_blocks * sizeof(block_info); ++ if (offsets_size > 512 * 1024 * 1024) { ++ /* Prevent ridiculous offsets_size which causes memory allocation to ++ * fail or overflows bdrv_pread() size. In practice the 512 MB ++ * offsets[] limit supports 16 TB images at 256 KB block size. ++ */ ++ error_setg(errp, "image requires too many offsets, " ++ "try increasing block size"); ++ return -EINVAL; ++ } ++ s->offsets = g_malloc(offsets_size); + +- /* initialize zlib engine */ +- s->compressed_block = g_malloc(max_compressed_block_size + 1); +- s->uncompressed_block = g_malloc(s->block_size); +- if (inflateInit(&s->zstream) != Z_OK) { ++ ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); ++ if (ret < 0) { ++ goto fail; ++ } ++ } ++ ret = build_index(s->offsets, s->n_blocks); ++ if (ret) { ++ error_setg(errp, "invalid compressed block size at index %u, " ++ "image file is corrupt", ret-1); + ret = -EINVAL; + goto fail; + } ++ + s->current_block = s->n_blocks; + + s->sectors_per_block = s->block_size/512; +@@ -184,10 +280,10 @@ + + if (s->current_block != block_num) { + int ret; +- uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num]; ++ uint32_t bytes = s->offsets[block_num].size; + +- ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block, +- bytes); ++ ret = bdrv_pread(bs->file, s->offsets[block_num].offset, ++ s->compressed_block, bytes); + if (ret != bytes) { + return -1; + } diff -r c7b121a4ffd9 -r d6378d455338 qemu-light/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qemu-light/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|cloop.u diff -r c7b121a4ffd9 -r d6378d455338 qemu/receipt --- a/qemu/receipt Wed May 09 17:03:28 2018 +0300 +++ b/qemu/receipt Thu May 10 21:12:00 2018 +0300 @@ -29,8 +29,6 @@ mkdir -p $install/usr/share/qemu/x64/ unzip $SRC/$UEFIZIP OVMF.fd -d $install/usr/share/qemu/x64/ - patch -p0 < $stuff/cloop.u - TARGET="i386-softmmu, x86_64-softmmu, \ arm-softmmu, ppc-softmmu, mips-softmmu" diff -r c7b121a4ffd9 -r d6378d455338 qemu/stuff/cloop.u --- a/qemu/stuff/cloop.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,284 +0,0 @@ ---- block/cloop.c -+++ block/cloop.c -@@ -29,11 +29,90 @@ - /* Maximum compressed block size */ - #define MAX_BLOCK_SIZE (64 * 1024 * 1024) - -+typedef struct cloop_tail { -+ uint32_t table_size; -+ uint32_t index_size; -+ uint32_t num_blocks; -+} cloop_tail; -+ -+typedef struct block_info { -+ uint64_t offset; /* 64-bit offsets of compressed block */ -+ uint32_t size; /* 32-bit compressed block size */ -+ uint32_t optidx; /* 32-bit index number */ -+} block_info; -+ -+static inline int build_index(block_info *offsets, unsigned long n) -+{ -+ uint32_t *ofs32 = (uint32_t *) offsets; -+ uint64_t *ofs64 = (uint64_t *) offsets; -+ -+ if (ofs32[0] == 0) { -+ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ -+ while (n--) { -+ offsets[n].offset = be64_to_cpu(offsets[n].offset); -+ offsets[n].size = ntohl(offsets[n].size); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ } -+ } -+ else { /* V2.0 */ -+ uint64_t last = be64_to_cpu(ofs64[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = be64_to_cpu(ofs64[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ } -+ else if (ofs32[1] == 0) { /* V1.0 */ -+ uint64_t last = le64_to_cpu(ofs64[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = le64_to_cpu(ofs64[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ -+ uint64_t last = ntohl(ofs32[n - 1]); -+ while (n--) { -+ offsets[n].size = last - -+ (offsets[n].offset = ntohl(ofs32[n])); -+ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) -+ return n+1; -+ last = offsets[n].offset; -+ } -+ } -+ else { /* V3.0 */ -+ unsigned long i; -+ uint64_t j; -+ -+ for (i = n; i-- > 0; ) { -+ offsets[i].size = ntohl(ofs32[i]); -+ if (offsets[i].size > 2 * MAX_BLOCK_SIZE) -+ return i+1; -+ } -+ for (i = 0, j = 128 + 4 + 4; i < n; i++) { -+ offsets[i].offset = j; -+ if (offsets[i].size & 0x80000000) { -+ unsigned long k = offsets[i].size & 0x7FFFFFFF; -+ offsets[i].offset = offsets[k].offset; -+ offsets[i].size = offsets[k].size; -+ } -+ else j += offsets[i].size; -+ } -+ } -+ return 0; -+} -+ - typedef struct BDRVCloopState { - CoMutex lock; - uint32_t block_size; - uint32_t n_blocks; -- uint64_t *offsets; -+ block_info *offsets; - uint32_t sectors_per_block; - uint32_t current_block; - uint8_t *compressed_block; -@@ -43,17 +117,21 @@ - - static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename) - { -- const char *magic_version_2_0 = "#!/bin/sh\n" -- "#V2.0 Format\n" -+ static const uint8_t magic[] = - "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n"; -- int length = strlen(magic_version_2_0); -- if (length > buf_size) { -- length = buf_size; -+ int i, ret = 0, length = buf_size; -+ uint8_t c; -+ -+ if (length > 127) { -+ length = 127; - } -- if (!memcmp(magic_version_2_0, buf, length)) { -- return 2; -+ for (i = 0; i < length - sizeof(magic) + 1; i++) { -+ if (buf[i] != magic[0]) continue; -+ if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue; -+ ret = 2; -+ break; - } -- return 0; -+ return ret; - } - - static int cloop_open(BlockDriverState *bs, QDict *options, int flags, -@@ -91,79 +169,97 @@ - MAX_BLOCK_SIZE / (1024 * 1024)); - return -EINVAL; - } -- - ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4); - if (ret < 0) { - return ret; - } - s->n_blocks = be32_to_cpu(s->n_blocks); - -- /* read offsets */ -- if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) { -- /* Prevent integer overflow */ -- error_setg(errp, "n_blocks %u must be %zu or less", -- s->n_blocks, -- (UINT32_MAX - 1) / sizeof(uint64_t)); -- return -EINVAL; -- } -- offsets_size = (s->n_blocks + 1) * sizeof(uint64_t); -- if (offsets_size > 512 * 1024 * 1024) { -- /* Prevent ridiculous offsets_size which causes memory allocation to -- * fail or overflows bdrv_pread() size. In practice the 512 MB -- * offsets[] limit supports 16 TB images at 256 KB block size. -- */ -- error_setg(errp, "image requires too many offsets, " -- "try increasing block size"); -- return -EINVAL; -- } -- s->offsets = g_malloc(offsets_size); -+ /* initialize zlib engine */ -+ max_compressed_block_size = s->block_size + s->block_size/1000 + 12 + 4; -+ s->compressed_block = g_malloc(max_compressed_block_size + 1); -+ s->uncompressed_block = g_malloc(s->block_size); - -- ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); -- if (ret < 0) { -+ if (inflateInit(&s->zstream) != Z_OK) { -+ ret = -EINVAL; - goto fail; - } - -- for (i = 0; i < s->n_blocks + 1; i++) { -- uint64_t size; -+ /* read offsets */ -+ if (s->n_blocks + 1 == 0) { -+ cloop_tail tail; -+ int64_t end = bdrv_getlength(bs->file); -+ void *p; -+ uint32_t toclen, len; - -- s->offsets[i] = be64_to_cpu(s->offsets[i]); -- if (i == 0) { -- continue; -+ ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail)); -+ if (ret < 0) { -+ goto fail; - } - -- if (s->offsets[i] < s->offsets[i - 1]) { -- error_setg(errp, "offsets not monotonically increasing at " -- "index %u, image file is corrupt", i); -- ret = -EINVAL; -- goto fail; -+ s->n_blocks = be32_to_cpu(tail.num_blocks); -+ offsets_size = s->n_blocks * sizeof(block_info); -+ if (offsets_size > 512 * 1024 * 1024) { -+ /* Prevent ridiculous offsets_size which causes memory allocation to -+ * fail or overflows bdrv_pread() size. In practice the 512 MB -+ * offsets[] limit supports 16 TB images at 256 KB block size. -+ */ -+ error_setg(errp, "image requires too many offsets, " -+ "try increasing block size"); -+ return -EINVAL; - } -+ len = be32_to_cpu(tail.table_size); -+ toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks; - -- size = s->offsets[i] - s->offsets[i - 1]; -+ s->offsets = g_malloc(offsets_size); -+ p = g_malloc(len); - -- /* Compressed blocks should be smaller than the uncompressed block size -- * but maybe compression performed poorly so the compressed block is -- * actually bigger. Clamp down on unrealistic values to prevent -- * ridiculous s->compressed_block allocation. -- */ -- if (size > 2 * MAX_BLOCK_SIZE) { -- error_setg(errp, "invalid compressed block size at index %u, " -- "image file is corrupt", i); -+ ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len); -+ if (ret < 0) { -+ goto fail; -+ } -+ s->zstream.next_in = p; -+ s->zstream.avail_in = len; -+ s->zstream.next_out = s->offsets; -+ s->zstream.avail_out = toclen; -+ ret = inflateReset(&s->zstream); -+ if (ret != Z_OK) { - ret = -EINVAL; - goto fail; - } -- -- if (size > max_compressed_block_size) { -- max_compressed_block_size = size; -+ ret = inflate(&s->zstream, Z_FINISH); -+ if (ret != Z_STREAM_END || s->zstream.total_out != toclen) { -+ ret = -EINVAL; -+ goto fail; - } -+ g_free(p); - } -+ else { -+ offsets_size = s->n_blocks * sizeof(block_info); -+ if (offsets_size > 512 * 1024 * 1024) { -+ /* Prevent ridiculous offsets_size which causes memory allocation to -+ * fail or overflows bdrv_pread() size. In practice the 512 MB -+ * offsets[] limit supports 16 TB images at 256 KB block size. -+ */ -+ error_setg(errp, "image requires too many offsets, " -+ "try increasing block size"); -+ return -EINVAL; -+ } -+ s->offsets = g_malloc(offsets_size); - -- /* initialize zlib engine */ -- s->compressed_block = g_malloc(max_compressed_block_size + 1); -- s->uncompressed_block = g_malloc(s->block_size); -- if (inflateInit(&s->zstream) != Z_OK) { -+ ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); -+ if (ret < 0) { -+ goto fail; -+ } -+ } -+ ret = build_index(s->offsets, s->n_blocks); -+ if (ret) { -+ error_setg(errp, "invalid compressed block size at index %u, " -+ "image file is corrupt", ret-1); - ret = -EINVAL; - goto fail; - } -+ - s->current_block = s->n_blocks; - - s->sectors_per_block = s->block_size/512; -@@ -184,10 +280,10 @@ - - if (s->current_block != block_num) { - int ret; -- uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num]; -+ uint32_t bytes = s->offsets[block_num].size; - -- ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block, -- bytes); -+ ret = bdrv_pread(bs->file, s->offsets[block_num].offset, -+ s->compressed_block, bytes); - if (ret != bytes) { - return -1; - } diff -r c7b121a4ffd9 -r d6378d455338 qemu/stuff/patches/cloop.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qemu/stuff/patches/cloop.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,284 @@ +--- block/cloop.c ++++ block/cloop.c +@@ -29,11 +29,90 @@ + /* Maximum compressed block size */ + #define MAX_BLOCK_SIZE (64 * 1024 * 1024) + ++typedef struct cloop_tail { ++ uint32_t table_size; ++ uint32_t index_size; ++ uint32_t num_blocks; ++} cloop_tail; ++ ++typedef struct block_info { ++ uint64_t offset; /* 64-bit offsets of compressed block */ ++ uint32_t size; /* 32-bit compressed block size */ ++ uint32_t optidx; /* 32-bit index number */ ++} block_info; ++ ++static inline int build_index(block_info *offsets, unsigned long n) ++{ ++ uint32_t *ofs32 = (uint32_t *) offsets; ++ uint64_t *ofs64 = (uint64_t *) offsets; ++ ++ if (ofs32[0] == 0) { ++ if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */ ++ while (n--) { ++ offsets[n].offset = be64_to_cpu(offsets[n].offset); ++ offsets[n].size = ntohl(offsets[n].size); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ } ++ } ++ else { /* V2.0 */ ++ uint64_t last = be64_to_cpu(ofs64[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = be64_to_cpu(ofs64[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ } ++ else if (ofs32[1] == 0) { /* V1.0 */ ++ uint64_t last = le64_to_cpu(ofs64[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = le64_to_cpu(ofs64[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ ++ uint64_t last = ntohl(ofs32[n - 1]); ++ while (n--) { ++ offsets[n].size = last - ++ (offsets[n].offset = ntohl(ofs32[n])); ++ if (offsets[n].size > 2 * MAX_BLOCK_SIZE) ++ return n+1; ++ last = offsets[n].offset; ++ } ++ } ++ else { /* V3.0 */ ++ unsigned long i; ++ uint64_t j; ++ ++ for (i = n; i-- > 0; ) { ++ offsets[i].size = ntohl(ofs32[i]); ++ if (offsets[i].size > 2 * MAX_BLOCK_SIZE) ++ return i+1; ++ } ++ for (i = 0, j = 128 + 4 + 4; i < n; i++) { ++ offsets[i].offset = j; ++ if (offsets[i].size & 0x80000000) { ++ unsigned long k = offsets[i].size & 0x7FFFFFFF; ++ offsets[i].offset = offsets[k].offset; ++ offsets[i].size = offsets[k].size; ++ } ++ else j += offsets[i].size; ++ } ++ } ++ return 0; ++} ++ + typedef struct BDRVCloopState { + CoMutex lock; + uint32_t block_size; + uint32_t n_blocks; +- uint64_t *offsets; ++ block_info *offsets; + uint32_t sectors_per_block; + uint32_t current_block; + uint8_t *compressed_block; +@@ -43,17 +117,21 @@ + + static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename) + { +- const char *magic_version_2_0 = "#!/bin/sh\n" +- "#V2.0 Format\n" ++ static const uint8_t magic[] = + "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n"; +- int length = strlen(magic_version_2_0); +- if (length > buf_size) { +- length = buf_size; ++ int i, ret = 0, length = buf_size; ++ uint8_t c; ++ ++ if (length > 127) { ++ length = 127; + } +- if (!memcmp(magic_version_2_0, buf, length)) { +- return 2; ++ for (i = 0; i < length - sizeof(magic) + 1; i++) { ++ if (buf[i] != magic[0]) continue; ++ if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue; ++ ret = 2; ++ break; + } +- return 0; ++ return ret; + } + + static int cloop_open(BlockDriverState *bs, QDict *options, int flags, +@@ -91,79 +169,97 @@ + MAX_BLOCK_SIZE / (1024 * 1024)); + return -EINVAL; + } +- + ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4); + if (ret < 0) { + return ret; + } + s->n_blocks = be32_to_cpu(s->n_blocks); + +- /* read offsets */ +- if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) { +- /* Prevent integer overflow */ +- error_setg(errp, "n_blocks %u must be %zu or less", +- s->n_blocks, +- (UINT32_MAX - 1) / sizeof(uint64_t)); +- return -EINVAL; +- } +- offsets_size = (s->n_blocks + 1) * sizeof(uint64_t); +- if (offsets_size > 512 * 1024 * 1024) { +- /* Prevent ridiculous offsets_size which causes memory allocation to +- * fail or overflows bdrv_pread() size. In practice the 512 MB +- * offsets[] limit supports 16 TB images at 256 KB block size. +- */ +- error_setg(errp, "image requires too many offsets, " +- "try increasing block size"); +- return -EINVAL; +- } +- s->offsets = g_malloc(offsets_size); ++ /* initialize zlib engine */ ++ max_compressed_block_size = s->block_size + s->block_size/1000 + 12 + 4; ++ s->compressed_block = g_malloc(max_compressed_block_size + 1); ++ s->uncompressed_block = g_malloc(s->block_size); + +- ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); +- if (ret < 0) { ++ if (inflateInit(&s->zstream) != Z_OK) { ++ ret = -EINVAL; + goto fail; + } + +- for (i = 0; i < s->n_blocks + 1; i++) { +- uint64_t size; ++ /* read offsets */ ++ if (s->n_blocks + 1 == 0) { ++ cloop_tail tail; ++ int64_t end = bdrv_getlength(bs->file); ++ void *p; ++ uint32_t toclen, len; + +- s->offsets[i] = be64_to_cpu(s->offsets[i]); +- if (i == 0) { +- continue; ++ ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail)); ++ if (ret < 0) { ++ goto fail; + } + +- if (s->offsets[i] < s->offsets[i - 1]) { +- error_setg(errp, "offsets not monotonically increasing at " +- "index %u, image file is corrupt", i); +- ret = -EINVAL; +- goto fail; ++ s->n_blocks = be32_to_cpu(tail.num_blocks); ++ offsets_size = s->n_blocks * sizeof(block_info); ++ if (offsets_size > 512 * 1024 * 1024) { ++ /* Prevent ridiculous offsets_size which causes memory allocation to ++ * fail or overflows bdrv_pread() size. In practice the 512 MB ++ * offsets[] limit supports 16 TB images at 256 KB block size. ++ */ ++ error_setg(errp, "image requires too many offsets, " ++ "try increasing block size"); ++ return -EINVAL; + } ++ len = be32_to_cpu(tail.table_size); ++ toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks; + +- size = s->offsets[i] - s->offsets[i - 1]; ++ s->offsets = g_malloc(offsets_size); ++ p = g_malloc(len); + +- /* Compressed blocks should be smaller than the uncompressed block size +- * but maybe compression performed poorly so the compressed block is +- * actually bigger. Clamp down on unrealistic values to prevent +- * ridiculous s->compressed_block allocation. +- */ +- if (size > 2 * MAX_BLOCK_SIZE) { +- error_setg(errp, "invalid compressed block size at index %u, " +- "image file is corrupt", i); ++ ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len); ++ if (ret < 0) { ++ goto fail; ++ } ++ s->zstream.next_in = p; ++ s->zstream.avail_in = len; ++ s->zstream.next_out = s->offsets; ++ s->zstream.avail_out = toclen; ++ ret = inflateReset(&s->zstream); ++ if (ret != Z_OK) { + ret = -EINVAL; + goto fail; + } +- +- if (size > max_compressed_block_size) { +- max_compressed_block_size = size; ++ ret = inflate(&s->zstream, Z_FINISH); ++ if (ret != Z_STREAM_END || s->zstream.total_out != toclen) { ++ ret = -EINVAL; ++ goto fail; + } ++ g_free(p); + } ++ else { ++ offsets_size = s->n_blocks * sizeof(block_info); ++ if (offsets_size > 512 * 1024 * 1024) { ++ /* Prevent ridiculous offsets_size which causes memory allocation to ++ * fail or overflows bdrv_pread() size. In practice the 512 MB ++ * offsets[] limit supports 16 TB images at 256 KB block size. ++ */ ++ error_setg(errp, "image requires too many offsets, " ++ "try increasing block size"); ++ return -EINVAL; ++ } ++ s->offsets = g_malloc(offsets_size); + +- /* initialize zlib engine */ +- s->compressed_block = g_malloc(max_compressed_block_size + 1); +- s->uncompressed_block = g_malloc(s->block_size); +- if (inflateInit(&s->zstream) != Z_OK) { ++ ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size); ++ if (ret < 0) { ++ goto fail; ++ } ++ } ++ ret = build_index(s->offsets, s->n_blocks); ++ if (ret) { ++ error_setg(errp, "invalid compressed block size at index %u, " ++ "image file is corrupt", ret-1); + ret = -EINVAL; + goto fail; + } ++ + s->current_block = s->n_blocks; + + s->sectors_per_block = s->block_size/512; +@@ -184,10 +280,10 @@ + + if (s->current_block != block_num) { + int ret; +- uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num]; ++ uint32_t bytes = s->offsets[block_num].size; + +- ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block, +- bytes); ++ ret = bdrv_pread(bs->file, s->offsets[block_num].offset, ++ s->compressed_block, bytes); + if (ret != bytes) { + return -1; + } diff -r c7b121a4ffd9 -r d6378d455338 qemu/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qemu/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|cloop.u diff -r c7b121a4ffd9 -r d6378d455338 qtpanel/receipt --- a/qtpanel/receipt Wed May 09 17:03:28 2018 +0300 +++ b/qtpanel/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,7 @@ # Rules to configure and make the package. compile_rules() { - patch -i $stuff/p.diff --merge #sed -i 's|ddd ddMMM hh:mm||' clockapplet.cpp + #sed -i 's|ddd ddMMM hh:mm||' clockapplet.cpp mkdir b; cd b cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..; make mkdir -p $install/usr/bin diff -r c7b121a4ffd9 -r d6378d455338 qtpanel/stuff/p.diff --- a/qtpanel/stuff/p.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ ---- orig/applicationsmenuapplet.cpp -+++ edit/applicationsmenuapplet.cpp -@@ -96 +96 @@ -- return QSize(m_textItem->boundingRect().size().width() + 16, m_textItem->boundingRect().size().height()); -+ return QSize(m_textItem->boundingRect().size().width() + 8, m_textItem->boundingRect().size().height()); ---- orig/clockapplet.cpp -+++ edit/clockapplet.cpp -@@ -42 +42 @@ -- m_text = dateTimeNow.toString(); -+ m_text = dateTimeNow.toString("ddd ddMMM hh:mm"); -@@ -50 +50 @@ -- return QSize(m_textItem->boundingRect().width() + 16, m_textItem->boundingRect().height() + 16); -+ return QSize(m_textItem->boundingRect().width() + 2, m_textItem->boundingRect().height() + 16); ---- orig/dockapplet.cpp -+++ edit/dockapplet.cpp -@@ -8,0 +9 @@ -+#include -@@ -56 +57 @@ -- QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(36)); -+ QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(25)); -@@ -60,2 +61,2 @@ -- m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(16))); -- m_iconItem->setPos(adjustHardcodedPixelSize(8), m_targetSize.height()/2 - adjustHardcodedPixelSize(8)); -+ m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(22))); -+ m_iconItem->setPos(adjustHardcodedPixelSize(4), m_targetSize.height()/8 + adjustHardcodedPixelSize(2)); -@@ -162 +163 @@ -- return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height() - 1); -+ return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height()); -@@ -244,0 +246,24 @@ -+ } -+ } -+} -+ -+void DockItem::wheelEvent(QGraphicsSceneWheelEvent *event) -+{ -+ int numDegrees = event->delta() / 8; -+ int numSteps = numDegrees / 15; -+ -+ // Ignore accidental scroll events if currently dragging. -+ if(m_dragging) -+ return; -+ -+ if (event->orientation() == Qt::Horizontal) { // Horizontal: switch between tasks -+ // scrollHorizontally(numSteps); -+ } else { // Vertical scroll: (un)roll the hovered task -+ if( numSteps > 0 ) -+ { -+ X11Support::activateWindow(m_clients[0]->handle()); -+ } -+ else -+ { -+ if(m_dockApplet->activeWindow() == m_clients[0]->handle()) -+ X11Support::minimizeWindow(m_clients[0]->handle()); ---- orig/dockapplet.h -+++ edit/dockapplet.h -@@ -7,0 +8 @@ -+#include -@@ -49,0 +51 @@ -+ void wheelEvent(QGraphicsSceneWheelEvent *event); ---- orig/dpisupport.cpp -+++ edit/dpisupport.cpp -@@ -9 +9 @@ -- return size*dpi/96; -+ return size*dpi/125; ---- orig/panelapplication.cpp -+++ edit/panelapplication.cpp -@@ -73,2 +73,2 @@ -- setFontName(settings.value("fontName", "default").toString()); -- setIconThemeName(settings.value("iconThemeName", "default").toString()); -+ setFontName(settings.value("fontName", "Fixed 8").toString()); -+ setIconThemeName(settings.value("iconThemeName", "SliTaz").toString()); diff -r c7b121a4ffd9 -r d6378d455338 qtpanel/stuff/patches/p.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtpanel/stuff/patches/p.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,71 @@ +--- orig/applicationsmenuapplet.cpp ++++ edit/applicationsmenuapplet.cpp +@@ -96 +96 @@ +- return QSize(m_textItem->boundingRect().size().width() + 16, m_textItem->boundingRect().size().height()); ++ return QSize(m_textItem->boundingRect().size().width() + 8, m_textItem->boundingRect().size().height()); +--- orig/clockapplet.cpp ++++ edit/clockapplet.cpp +@@ -42 +42 @@ +- m_text = dateTimeNow.toString(); ++ m_text = dateTimeNow.toString("ddd ddMMM hh:mm"); +@@ -50 +50 @@ +- return QSize(m_textItem->boundingRect().width() + 16, m_textItem->boundingRect().height() + 16); ++ return QSize(m_textItem->boundingRect().width() + 2, m_textItem->boundingRect().height() + 16); +--- orig/dockapplet.cpp ++++ edit/dockapplet.cpp +@@ -8,0 +9 @@ ++#include +@@ -56 +57 @@ +- QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(36)); ++ QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(25)); +@@ -60,2 +61,2 @@ +- m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(16))); +- m_iconItem->setPos(adjustHardcodedPixelSize(8), m_targetSize.height()/2 - adjustHardcodedPixelSize(8)); ++ m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(22))); ++ m_iconItem->setPos(adjustHardcodedPixelSize(4), m_targetSize.height()/8 + adjustHardcodedPixelSize(2)); +@@ -162 +163 @@ +- return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height() - 1); ++ return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height()); +@@ -244,0 +246,24 @@ ++ } ++ } ++} ++ ++void DockItem::wheelEvent(QGraphicsSceneWheelEvent *event) ++{ ++ int numDegrees = event->delta() / 8; ++ int numSteps = numDegrees / 15; ++ ++ // Ignore accidental scroll events if currently dragging. ++ if(m_dragging) ++ return; ++ ++ if (event->orientation() == Qt::Horizontal) { // Horizontal: switch between tasks ++ // scrollHorizontally(numSteps); ++ } else { // Vertical scroll: (un)roll the hovered task ++ if( numSteps > 0 ) ++ { ++ X11Support::activateWindow(m_clients[0]->handle()); ++ } ++ else ++ { ++ if(m_dockApplet->activeWindow() == m_clients[0]->handle()) ++ X11Support::minimizeWindow(m_clients[0]->handle()); +--- orig/dockapplet.h ++++ edit/dockapplet.h +@@ -7,0 +8 @@ ++#include +@@ -49,0 +51 @@ ++ void wheelEvent(QGraphicsSceneWheelEvent *event); +--- orig/dpisupport.cpp ++++ edit/dpisupport.cpp +@@ -9 +9 @@ +- return size*dpi/96; ++ return size*dpi/125; +--- orig/panelapplication.cpp ++++ edit/panelapplication.cpp +@@ -73,2 +73,2 @@ +- setFontName(settings.value("fontName", "default").toString()); +- setIconThemeName(settings.value("iconThemeName", "default").toString()); ++ setFontName(settings.value("fontName", "Fixed 8").toString()); ++ setIconThemeName(settings.value("iconThemeName", "SliTaz").toString()); diff -r c7b121a4ffd9 -r d6378d455338 qtpanel/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtpanel/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +--merge|p.diff diff -r c7b121a4ffd9 -r d6378d455338 rawstudio/receipt --- a/rawstudio/receipt Wed May 09 17:03:28 2018 +0300 +++ b/rawstudio/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,7 +19,7 @@ export CXXFLAGS="-Wno-narrowing" export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lX11" export PKG_CONFIG_PATH="/usr/lib/pkgconfig" - patch -p1 -i $stuff/rawstudio-const.patch + ./configure \ --prefix=/usr \ --infodir=/usr/share/info \ diff -r c7b121a4ffd9 -r d6378d455338 rawstudio/stuff/patches/rawstudio-const.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rawstudio/stuff/patches/rawstudio-const.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,12 @@ +diff -Nur rawstudio-1.2.orig/src/dcraw.cc rawstudio-1.2/src/dcraw.cc +--- rawstudio-1.2.orig/src/dcraw.cc 2009-04-10 00:21:45.000000000 +0300 ++++ rawstudio-1.2/src/dcraw.cc 2009-07-16 00:05:28.169155134 +0300 +@@ -8510,7 +8510,7 @@ + argv[argc] = ""; + for (arg=1; (((opm = argv[arg][0]) - 2) | 2) == '+'; ) { + opt = argv[arg++][1]; +- if ((cp = strchr (sp="nbrkStqmHACg", opt))) ++ if ((cp = (char *)strchr (sp="nbrkStqmHACg", opt))) + for (i=0; i < "114111111422"[cp-sp]-'0'; i++) + if (!isdigit(argv[arg+i][0])) { + dcraw_message (DCRAW_ERROR,_("Non-numeric argument to \"-%c\"\n"), opt); diff -r c7b121a4ffd9 -r d6378d455338 rawstudio/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rawstudio/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|rawstudio-const.patch diff -r c7b121a4ffd9 -r d6378d455338 rawstudio/stuff/rawstudio-const.patch --- a/rawstudio/stuff/rawstudio-const.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -diff -Nur rawstudio-1.2.orig/src/dcraw.cc rawstudio-1.2/src/dcraw.cc ---- rawstudio-1.2.orig/src/dcraw.cc 2009-04-10 00:21:45.000000000 +0300 -+++ rawstudio-1.2/src/dcraw.cc 2009-07-16 00:05:28.169155134 +0300 -@@ -8510,7 +8510,7 @@ - argv[argc] = ""; - for (arg=1; (((opm = argv[arg][0]) - 2) | 2) == '+'; ) { - opt = argv[arg++][1]; -- if ((cp = strchr (sp="nbrkStqmHACg", opt))) -+ if ((cp = (char *)strchr (sp="nbrkStqmHACg", opt))) - for (i=0; i < "114111111422"[cp-sp]-'0'; i++) - if (!isdigit(argv[arg+i][0])) { - dcraw_message (DCRAW_ERROR,_("Non-numeric argument to \"-%c\"\n"), opt); diff -r c7b121a4ffd9 -r d6378d455338 retawq/receipt --- a/retawq/receipt Wed May 09 17:03:28 2018 +0300 +++ b/retawq/receipt Thu May 10 21:12:00 2018 +0300 @@ -22,7 +22,6 @@ arm) opts="" ;; i?86) opts="--enable-i18n" ;; esac - patch -p1 -i $stuff/retawq.patch ./configure \ --enable-local-cgi \ diff -r c7b121a4ffd9 -r d6378d455338 retawq/stuff/patches/retawq.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/retawq/stuff/patches/retawq.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,18 @@ +--- a/configure ++++ b/configure +@@ -1660,13 +1660,13 @@ + initial_path="\$4" + files="\$5" + act="\${ITCHCONFIG_ACT-}" +- ic_makedir="\${MKDIRPROG-mkdir}" ++ ic_makedir="mkdir -p" + ic_program_prefix="$ic_program_prefix" + ic_program_suffix="$ic_program_suffix" + checked_path= + for one_file in \$files + do +- path="\$initial_path" ++ path="\$DESTDIR\$initial_path" + file=\`echo "\$one_file" | sed 's,.*[/],,'\` + case \$magic in + m0) ;; diff -r c7b121a4ffd9 -r d6378d455338 retawq/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/retawq/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|retawq.patch diff -r c7b121a4ffd9 -r d6378d455338 retawq/stuff/retawq.patch --- a/retawq/stuff/retawq.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ ---- a/configure -+++ b/configure -@@ -1660,13 +1660,13 @@ - initial_path="\$4" - files="\$5" - act="\${ITCHCONFIG_ACT-}" -- ic_makedir="\${MKDIRPROG-mkdir}" -+ ic_makedir="mkdir -p" - ic_program_prefix="$ic_program_prefix" - ic_program_suffix="$ic_program_suffix" - checked_path= - for one_file in \$files - do -- path="\$initial_path" -+ path="\$DESTDIR\$initial_path" - file=\`echo "\$one_file" | sed 's,.*[/],,'\` - case \$magic in - m0) ;; diff -r c7b121a4ffd9 -r d6378d455338 rhythmcat2/receipt --- a/rhythmcat2/receipt Wed May 09 17:03:28 2018 +0300 +++ b/rhythmcat2/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ intltool" compile_rules() { - patch -p1 -i $stuff/rhythmcat2.patch cp $stuff/ru.po $src/po ./configure \ diff -r c7b121a4ffd9 -r d6378d455338 rhythmcat2/stuff/patches/rhythmcat2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rhythmcat2/stuff/patches/rhythmcat2.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,57 @@ +--- a/docs/reference/lib/Makefile.in ++++ b/docs/reference/lib/Makefile.in +@@ -713,8 +713,6 @@ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ +- mv -f $${installdir}/$(DOC_MODULE).devhelp \ +- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +--- a/docs/reference/ui/Makefile.in ++++ b/docs/reference/ui/Makefile.in +@@ -724,8 +724,6 @@ + @WITH_GTK_UI_TRUE@ if test -n "$(DOC_MODULE_VERSION)"; then \ + @WITH_GTK_UI_TRUE@ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + @WITH_GTK_UI_TRUE@ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ +-@WITH_GTK_UI_TRUE@ mv -f $${installdir}/$(DOC_MODULE).devhelp \ +-@WITH_GTK_UI_TRUE@ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + @WITH_GTK_UI_TRUE@ fi; \ + @WITH_GTK_UI_TRUE@ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + @WITH_GTK_UI_TRUE@ fi + +--- a/po/LINGUAS ++++ b/po/LINGUAS +@@ -1,3 +1,4 @@ ++ru + zh_CN + zh_HK + zh_TW + +--- a/data/RhythmCat2.desktop ++++ b/data/RhythmCat2.desktop +@@ -8,7 +8,7 @@ + Exec=RhythmCat2 %U + StartupNotify=false + Type=Application +-Name[en_US]=RhythmCat2 Music Player +-Name[zh_CN]=RhythmCat2 音乐播放器 +-Name[zh_TW]=RhythmCat2 音樂播放器 ++Comment[ru]=Музыкальный проигрыватель RhythmCat2 ++Comment[zh_CN]=RhythmCat2 音乐播放器 ++Comment[zh_TW]=RhythmCat2 音樂播放器 + MimeType=application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac; + +--- a/ui/rc-ui-plugin.c ++++ b/ui/rc-ui-plugin.c +@@ -155,7 +155,7 @@ + g_object_set(about_dialog, "program-name", plugin_data->info->name, + "authors", authors, "comments", plugin_data->info->description, + "website", plugin_data->info->homepage, "version", +- plugin_data->info->version, NULL); ++ plugin_data->info->version, "logo", rc_ui_player_get_icon_image(), NULL); + gtk_dialog_run(GTK_DIALOG(about_dialog)); + gtk_widget_destroy(about_dialog); + } diff -r c7b121a4ffd9 -r d6378d455338 rhythmcat2/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rhythmcat2/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|rhythmcat2.patch diff -r c7b121a4ffd9 -r d6378d455338 rhythmcat2/stuff/rhythmcat2.patch --- a/rhythmcat2/stuff/rhythmcat2.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ ---- a/docs/reference/lib/Makefile.in -+++ b/docs/reference/lib/Makefile.in -@@ -713,8 +713,6 @@ - if test -n "$(DOC_MODULE_VERSION)"; then \ - mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ -- mv -f $${installdir}/$(DOC_MODULE).devhelp \ -- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ - fi; \ - $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - fi - ---- a/docs/reference/ui/Makefile.in -+++ b/docs/reference/ui/Makefile.in -@@ -724,8 +724,6 @@ - @WITH_GTK_UI_TRUE@ if test -n "$(DOC_MODULE_VERSION)"; then \ - @WITH_GTK_UI_TRUE@ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - @WITH_GTK_UI_TRUE@ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ --@WITH_GTK_UI_TRUE@ mv -f $${installdir}/$(DOC_MODULE).devhelp \ --@WITH_GTK_UI_TRUE@ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ - @WITH_GTK_UI_TRUE@ fi; \ - @WITH_GTK_UI_TRUE@ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - @WITH_GTK_UI_TRUE@ fi - ---- a/po/LINGUAS -+++ b/po/LINGUAS -@@ -1,3 +1,4 @@ -+ru - zh_CN - zh_HK - zh_TW - ---- a/data/RhythmCat2.desktop -+++ b/data/RhythmCat2.desktop -@@ -8,7 +8,7 @@ - Exec=RhythmCat2 %U - StartupNotify=false - Type=Application --Name[en_US]=RhythmCat2 Music Player --Name[zh_CN]=RhythmCat2 音乐播放器 --Name[zh_TW]=RhythmCat2 音樂播放器 -+Comment[ru]=Музыкальный проигрыватель RhythmCat2 -+Comment[zh_CN]=RhythmCat2 音乐播放器 -+Comment[zh_TW]=RhythmCat2 音樂播放器 - MimeType=application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac; - ---- a/ui/rc-ui-plugin.c -+++ b/ui/rc-ui-plugin.c -@@ -155,7 +155,7 @@ - g_object_set(about_dialog, "program-name", plugin_data->info->name, - "authors", authors, "comments", plugin_data->info->description, - "website", plugin_data->info->homepage, "version", -- plugin_data->info->version, NULL); -+ plugin_data->info->version, "logo", rc_ui_player_get_icon_image(), NULL); - gtk_dialog_run(GTK_DIALOG(about_dialog)); - gtk_widget_destroy(about_dialog); - } diff -r c7b121a4ffd9 -r d6378d455338 rox-filer/receipt --- a/rox-filer/receipt Wed May 09 17:03:28 2018 +0300 +++ b/rox-filer/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,10 +19,6 @@ compile_rules() { export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lm" - echo "patch" - [ -f done.menu.diff ] || - patch $src/ROX-Filer/src/menu.c $stuff/menu.diff - touch done.menu.diff echo "compile" # If missing dep compile will block on a read. echo -e "\t" | $src/ROX-Filer/AppRun --compile diff -r c7b121a4ffd9 -r d6378d455338 rox-filer/stuff/menu.diff --- a/rox-filer/stuff/menu.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ ---- menu.c Sat May 17 16:40:24 2008 -+++ menu2.c Thu Jun 12 01:37:41 2008 -@@ -182,33 +182,10 @@ - #define N_(x) x - - static GtkItemFactoryEntry filer_menu_def[] = { --{N_("Display"), NULL, NULL, 0, ""}, --{">" N_("Icons View"), NULL, view_type, VIEW_TYPE_COLLECTION, NULL}, --{">" N_("Icons, With..."), NULL, NULL, 0, ""}, --{">>" N_("Sizes"), NULL, set_with, DETAILS_SIZE, NULL}, --{">>" N_("Permissions"), NULL, set_with, DETAILS_PERMISSIONS, NULL}, --{">>" N_("Types"), NULL, set_with, DETAILS_TYPE, NULL}, --{">>" N_("Times"), NULL, set_with, DETAILS_TIMES, NULL}, --{">" N_("List View"), NULL, view_type, VIEW_TYPE_DETAILS, "", ROX_STOCK_SHOW_DETAILS}, --{">", NULL, NULL, 0, ""}, --{">" N_("Bigger Icons"), "equal", change_size, 1, "", GTK_STOCK_ZOOM_IN}, --{">" N_("Smaller Icons"), "minus", change_size, -1, "", GTK_STOCK_ZOOM_OUT}, --{">" N_("Automatic"), NULL, change_size_auto, 0, ""}, --{">", NULL, NULL, 0, ""}, --{">" N_("Sort by Name"), NULL, set_sort, SORT_NAME, NULL}, --{">" N_("Sort by Type"), NULL, set_sort, SORT_TYPE, NULL}, --{">" N_("Sort by Date"), NULL, set_sort, SORT_DATE, NULL}, --{">" N_("Sort by Size"), NULL, set_sort, SORT_SIZE, NULL}, --{">" N_("Sort by Owner"), NULL, set_sort, SORT_OWNER, NULL}, --{">" N_("Sort by Group"), NULL, set_sort, SORT_GROUP, NULL}, --{">" N_("Reversed"), NULL, reverse_sort, 0, ""}, --{">", NULL, NULL, 0, ""}, --{">" N_("Show Hidden"), "H", hidden, 0, ""}, --{">" N_("Filter Files..."), NULL, mini_buffer, MINI_FILTER, NULL}, --{">" N_("Filter Directories With Files"), NULL, filter_directories, 0, ""}, --{">" N_("Show Thumbnails"), NULL, show_thumbs, 0, ""}, --{">" N_("Refresh"), NULL, refresh, 0, "", GTK_STOCK_REFRESH}, --{">" N_("Save Current Display Settings..."), NULL, save_settings, 0, NULL}, -+{N_("New"), NULL, NULL, 0, ""}, -+{">" N_("Directory"), NULL, new_directory, 0, NULL}, -+{">" N_("Blank file"), NULL, new_file, 0, "", GTK_STOCK_NEW}, -+{">" N_("Customise Menu..."), NULL, customise_new, 0, NULL}, - {N_("File"), NULL, NULL, 0, ""}, - {">" N_("Copy..."), "C", file_op, FILE_COPY_ITEM, "", GTK_STOCK_COPY}, - {">" N_("Rename..."), NULL, file_op, FILE_RENAME_ITEM, NULL}, -@@ -233,10 +210,6 @@ - {">" N_("Select by Name..."), "period", mini_buffer, MINI_SELECT_BY_NAME, NULL}, - {">" N_("Select If..."), "question", mini_buffer, MINI_SELECT_IF, NULL}, - {N_("Options..."), NULL, menu_show_options, 0, "", GTK_STOCK_PREFERENCES}, --{N_("New"), NULL, NULL, 0, ""}, --{">" N_("Directory"), NULL, new_directory, 0, NULL}, --{">" N_("Blank file"), NULL, new_file, 0, "", GTK_STOCK_NEW}, --{">" N_("Customise Menu..."), NULL, customise_new, 0, NULL}, - {N_("Window"), NULL, NULL, 0, ""}, - {">" N_("Parent, New Window"), NULL, open_parent, 0, "", GTK_STOCK_GO_UP}, - {">" N_("Parent, Same Window"), NULL, open_parent_same, 0, NULL}, -@@ -254,6 +227,33 @@ - {">" N_("Shell Command..."), "exclam", mini_buffer, MINI_SHELL, NULL}, - {">" N_("Terminal Here"), "grave", xterm_here, FALSE, NULL}, - {">" N_("Switch to Terminal"), NULL, xterm_here, TRUE, NULL}, -+{N_("Display"), NULL, NULL, 0, ""}, -+{">" N_("Icons View"), NULL, view_type, VIEW_TYPE_COLLECTION, NULL}, -+{">" N_("Icons, With..."), NULL, NULL, 0, ""}, -+{">>" N_("Sizes"), NULL, set_with, DETAILS_SIZE, NULL}, -+{">>" N_("Permissions"), NULL, set_with, DETAILS_PERMISSIONS, NULL}, -+{">>" N_("Types"), NULL, set_with, DETAILS_TYPE, NULL}, -+{">>" N_("Times"), NULL, set_with, DETAILS_TIMES, NULL}, -+{">" N_("List View"), NULL, view_type, VIEW_TYPE_DETAILS, "", ROX_STOCK_SHOW_DETAILS}, -+{">", NULL, NULL, 0, ""}, -+{">" N_("Bigger Icons"), "equal", change_size, 1, "", GTK_STOCK_ZOOM_IN}, -+{">" N_("Smaller Icons"), "minus", change_size, -1, "", GTK_STOCK_ZOOM_OUT}, -+{">" N_("Automatic"), NULL, change_size_auto, 0, ""}, -+{">", NULL, NULL, 0, ""}, -+{">" N_("Sort by Name"), NULL, set_sort, SORT_NAME, NULL}, -+{">" N_("Sort by Type"), NULL, set_sort, SORT_TYPE, NULL}, -+{">" N_("Sort by Date"), NULL, set_sort, SORT_DATE, NULL}, -+{">" N_("Sort by Size"), NULL, set_sort, SORT_SIZE, NULL}, -+{">" N_("Sort by Owner"), NULL, set_sort, SORT_OWNER, NULL}, -+{">" N_("Sort by Group"), NULL, set_sort, SORT_GROUP, NULL}, -+{">" N_("Reversed"), NULL, reverse_sort, 0, ""}, -+{">", NULL, NULL, 0, ""}, -+{">" N_("Show Hidden"), "H", hidden, 0, ""}, -+{">" N_("Filter Files..."), NULL, mini_buffer, MINI_FILTER, NULL}, -+{">" N_("Filter Directories With Files"), NULL, filter_directories, 0, ""}, -+{">" N_("Show Thumbnails"), NULL, show_thumbs, 0, ""}, -+{">" N_("Refresh"), NULL, refresh, 0, "", GTK_STOCK_REFRESH}, -+{">" N_("Save Current Display Settings..."), NULL, save_settings, 0, NULL}, - {N_("Help"), NULL, NULL, 0, ""}, - {">" N_("About ROX-Filer..."), NULL, menu_rox_help, HELP_ABOUT, NULL}, - {">" N_("Show Help Files"), "F1", menu_rox_help, HELP_DIR, "", GTK_STOCK_HELP}, diff -r c7b121a4ffd9 -r d6378d455338 rox-filer/stuff/patches/menu.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rox-filer/stuff/patches/menu.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,85 @@ +--- a/ROX-Filer/src/menu.c Sat May 17 16:40:24 2008 ++++ b/ROX-Filer/src/menu.c Thu Jun 12 01:37:41 2008 +@@ -182,33 +182,10 @@ + #define N_(x) x + + static GtkItemFactoryEntry filer_menu_def[] = { +-{N_("Display"), NULL, NULL, 0, ""}, +-{">" N_("Icons View"), NULL, view_type, VIEW_TYPE_COLLECTION, NULL}, +-{">" N_("Icons, With..."), NULL, NULL, 0, ""}, +-{">>" N_("Sizes"), NULL, set_with, DETAILS_SIZE, NULL}, +-{">>" N_("Permissions"), NULL, set_with, DETAILS_PERMISSIONS, NULL}, +-{">>" N_("Types"), NULL, set_with, DETAILS_TYPE, NULL}, +-{">>" N_("Times"), NULL, set_with, DETAILS_TIMES, NULL}, +-{">" N_("List View"), NULL, view_type, VIEW_TYPE_DETAILS, "", ROX_STOCK_SHOW_DETAILS}, +-{">", NULL, NULL, 0, ""}, +-{">" N_("Bigger Icons"), "equal", change_size, 1, "", GTK_STOCK_ZOOM_IN}, +-{">" N_("Smaller Icons"), "minus", change_size, -1, "", GTK_STOCK_ZOOM_OUT}, +-{">" N_("Automatic"), NULL, change_size_auto, 0, ""}, +-{">", NULL, NULL, 0, ""}, +-{">" N_("Sort by Name"), NULL, set_sort, SORT_NAME, NULL}, +-{">" N_("Sort by Type"), NULL, set_sort, SORT_TYPE, NULL}, +-{">" N_("Sort by Date"), NULL, set_sort, SORT_DATE, NULL}, +-{">" N_("Sort by Size"), NULL, set_sort, SORT_SIZE, NULL}, +-{">" N_("Sort by Owner"), NULL, set_sort, SORT_OWNER, NULL}, +-{">" N_("Sort by Group"), NULL, set_sort, SORT_GROUP, NULL}, +-{">" N_("Reversed"), NULL, reverse_sort, 0, ""}, +-{">", NULL, NULL, 0, ""}, +-{">" N_("Show Hidden"), "H", hidden, 0, ""}, +-{">" N_("Filter Files..."), NULL, mini_buffer, MINI_FILTER, NULL}, +-{">" N_("Filter Directories With Files"), NULL, filter_directories, 0, ""}, +-{">" N_("Show Thumbnails"), NULL, show_thumbs, 0, ""}, +-{">" N_("Refresh"), NULL, refresh, 0, "", GTK_STOCK_REFRESH}, +-{">" N_("Save Current Display Settings..."), NULL, save_settings, 0, NULL}, ++{N_("New"), NULL, NULL, 0, ""}, ++{">" N_("Directory"), NULL, new_directory, 0, NULL}, ++{">" N_("Blank file"), NULL, new_file, 0, "", GTK_STOCK_NEW}, ++{">" N_("Customise Menu..."), NULL, customise_new, 0, NULL}, + {N_("File"), NULL, NULL, 0, ""}, + {">" N_("Copy..."), "C", file_op, FILE_COPY_ITEM, "", GTK_STOCK_COPY}, + {">" N_("Rename..."), NULL, file_op, FILE_RENAME_ITEM, NULL}, +@@ -233,10 +210,6 @@ + {">" N_("Select by Name..."), "period", mini_buffer, MINI_SELECT_BY_NAME, NULL}, + {">" N_("Select If..."), "question", mini_buffer, MINI_SELECT_IF, NULL}, + {N_("Options..."), NULL, menu_show_options, 0, "", GTK_STOCK_PREFERENCES}, +-{N_("New"), NULL, NULL, 0, ""}, +-{">" N_("Directory"), NULL, new_directory, 0, NULL}, +-{">" N_("Blank file"), NULL, new_file, 0, "", GTK_STOCK_NEW}, +-{">" N_("Customise Menu..."), NULL, customise_new, 0, NULL}, + {N_("Window"), NULL, NULL, 0, ""}, + {">" N_("Parent, New Window"), NULL, open_parent, 0, "", GTK_STOCK_GO_UP}, + {">" N_("Parent, Same Window"), NULL, open_parent_same, 0, NULL}, +@@ -254,6 +227,33 @@ + {">" N_("Shell Command..."), "exclam", mini_buffer, MINI_SHELL, NULL}, + {">" N_("Terminal Here"), "grave", xterm_here, FALSE, NULL}, + {">" N_("Switch to Terminal"), NULL, xterm_here, TRUE, NULL}, ++{N_("Display"), NULL, NULL, 0, ""}, ++{">" N_("Icons View"), NULL, view_type, VIEW_TYPE_COLLECTION, NULL}, ++{">" N_("Icons, With..."), NULL, NULL, 0, ""}, ++{">>" N_("Sizes"), NULL, set_with, DETAILS_SIZE, NULL}, ++{">>" N_("Permissions"), NULL, set_with, DETAILS_PERMISSIONS, NULL}, ++{">>" N_("Types"), NULL, set_with, DETAILS_TYPE, NULL}, ++{">>" N_("Times"), NULL, set_with, DETAILS_TIMES, NULL}, ++{">" N_("List View"), NULL, view_type, VIEW_TYPE_DETAILS, "", ROX_STOCK_SHOW_DETAILS}, ++{">", NULL, NULL, 0, ""}, ++{">" N_("Bigger Icons"), "equal", change_size, 1, "", GTK_STOCK_ZOOM_IN}, ++{">" N_("Smaller Icons"), "minus", change_size, -1, "", GTK_STOCK_ZOOM_OUT}, ++{">" N_("Automatic"), NULL, change_size_auto, 0, ""}, ++{">", NULL, NULL, 0, ""}, ++{">" N_("Sort by Name"), NULL, set_sort, SORT_NAME, NULL}, ++{">" N_("Sort by Type"), NULL, set_sort, SORT_TYPE, NULL}, ++{">" N_("Sort by Date"), NULL, set_sort, SORT_DATE, NULL}, ++{">" N_("Sort by Size"), NULL, set_sort, SORT_SIZE, NULL}, ++{">" N_("Sort by Owner"), NULL, set_sort, SORT_OWNER, NULL}, ++{">" N_("Sort by Group"), NULL, set_sort, SORT_GROUP, NULL}, ++{">" N_("Reversed"), NULL, reverse_sort, 0, ""}, ++{">", NULL, NULL, 0, ""}, ++{">" N_("Show Hidden"), "H", hidden, 0, ""}, ++{">" N_("Filter Files..."), NULL, mini_buffer, MINI_FILTER, NULL}, ++{">" N_("Filter Directories With Files"), NULL, filter_directories, 0, ""}, ++{">" N_("Show Thumbnails"), NULL, show_thumbs, 0, ""}, ++{">" N_("Refresh"), NULL, refresh, 0, "", GTK_STOCK_REFRESH}, ++{">" N_("Save Current Display Settings..."), NULL, save_settings, 0, NULL}, + {N_("Help"), NULL, NULL, 0, ""}, + {">" N_("About ROX-Filer..."), NULL, menu_rox_help, HELP_ABOUT, NULL}, + {">" N_("Show Help Files"), "F1", menu_rox_help, HELP_DIR, "", GTK_STOCK_HELP}, diff -r c7b121a4ffd9 -r d6378d455338 rox-filer/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rox-filer/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +menu.diff diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/receipt --- a/ruby-ncurses/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ruby-ncurses/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,9 +16,6 @@ # Rules to configure and make the package. compile_rules() { - # use fedora patches - patch -i ../../stuff/STR2CSTR-deprecated.patch - patch -i ../../stuff/ruby-ncurses-fix-missing-tz-prototypes.patch ruby extconf.rb make make DESTDIR=$DESTDIR install diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/STR2CSTR-deprecated.patch --- a/ruby-ncurses/stuff/STR2CSTR-deprecated.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,320 +0,0 @@ -diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.p/form_wrap.c ---- ncurses-ruby-1.3.1/form_wrap.c 2011-05-31 01:41:46.000000000 +0200 -+++ ncurses-ruby-1.3.1.p/form_wrap.c 2013-03-14 14:38:21.097682379 +0100 -@@ -625,7 +625,8 @@ - char** list = ALLOC_N(char*, n+1); - int i; - for (i = 0; i < n; i++) { -- list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i)); -+ VALUE tmp = rb_ary_entry(arg3, (long)i); -+ list[i] = StringValuePtr(tmp); - } - list[n] = NULL; - return INT2NUM(set_field_type(field, ftype, -@@ -654,7 +655,7 @@ - if (argc != 2) - rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument"); - return INT2NUM(set_field_type(field, ftype, -- STR2CSTR(arg3))); -+ StringValuePtr(arg3))); - } - else if (ftype == TYPE_IPV4){ - if (argc != 1) -@@ -742,7 +743,7 @@ - */ - static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) { - FIELD* field = get_field(rb_field); -- return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value))); -+ return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value))); - } - static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value) - { return rbncurs_c_set_field_buffer(rb_field, buf, value); } -@@ -1052,7 +1053,7 @@ - { return rbncurs_c_form_request_name(request); } - - static VALUE rbncurs_c_form_request_by_name(VALUE name) { -- return INT2NUM(form_request_by_name(STR2CSTR(name))); -+ return INT2NUM(form_request_by_name(StringValuePtr(name))); - } - static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name) - { return rbncurs_c_form_request_by_name(name); } -diff -Naur ncurses-ruby-1.3.1/menu_wrap.c ncurses-ruby-1.3.1.p/menu_wrap.c ---- ncurses-ruby-1.3.1/menu_wrap.c 2011-05-31 01:41:46.000000000 +0200 -+++ ncurses-ruby-1.3.1.p/menu_wrap.c 2013-03-14 14:39:37.016571464 +0100 -@@ -372,7 +372,7 @@ - * Item creation/destruction functions - mitem_new(3X) man page - */ - static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description) --{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); } -+{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); } - - static VALUE rbncurs_c_free_item(VALUE rb_item) - { -@@ -670,7 +670,7 @@ - - static VALUE rbncurs_c_menu_request_by_name(VALUE name) - { -- return INT2NUM(menu_request_by_name(STR2CSTR(name))); -+ return INT2NUM(menu_request_by_name(StringValuePtr(name))); - } - static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name) - { return rbncurs_c_menu_request_by_name(name); } -@@ -909,7 +909,7 @@ - static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value) - { - MENU *menu = get_menu(rb_menu); -- return INT2NUM(set_menu_mark(menu, STR2CSTR(value))); -+ return INT2NUM(set_menu_mark(menu, StringValuePtr(value))); - } - static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value) - { return rbncurs_c_set_menu_mark(rb_field, value); } -@@ -929,7 +929,7 @@ - static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern) - { - MENU *menu = get_menu(rb_menu); -- return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern))); -+ return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern))); - } - static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern) - { return rbncurs_c_set_menu_pattern(rb_menu, pattern); } -diff -Naur ncurses-ruby-1.3.1/ncurses_wrap.c ncurses-ruby-1.3.1.p/ncurses_wrap.c ---- ncurses-ruby-1.3.1/ncurses_wrap.c 2011-05-31 01:41:46.000000000 +0200 -+++ ncurses-ruby-1.3.1.p/ncurses_wrap.c 2013-03-14 15:09:59.535783327 +0100 -@@ -475,7 +475,7 @@ - static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode) - { - return INT2NUM(define_key((definition != Qnil) -- ? STR2CSTR(definition) -+ ? StringValuePtr(definition) - : (char*)(NULL), - NUM2INT(keycode))); - } -@@ -580,10 +580,10 @@ - return return_value; - } - static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) { -- return INT2NUM(addnstr(STR2CSTR(arg1), NUM2INT(arg2))); -+ return INT2NUM(addnstr(StringValuePtr(arg1), NUM2INT(arg2))); - } - static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) { -- return INT2NUM(addstr(STR2CSTR(arg1))); -+ return INT2NUM(addstr(StringValuePtr(arg1))); - } - static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) { - return INT2NUM(attroff(NUM2ULONG(arg1))); -@@ -1011,10 +1011,10 @@ - return INT2NUM(insertln()); - } - static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) { -- return INT2NUM(insnstr(STR2CSTR(arg1), NUM2INT(arg2))); -+ return INT2NUM(insnstr(StringValuePtr(arg1), NUM2INT(arg2))); - } - static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) { -- return INT2NUM(insstr(STR2CSTR(arg1))); -+ return INT2NUM(insstr(StringValuePtr(arg1))); - } - #ifdef HAVE_INTRFLUSH - static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) { -@@ -1070,10 +1070,10 @@ - return return_value; - } - static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { -- return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); -+ return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); - } - static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { -- return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); -+ return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); - } - #ifdef HAVE_MVCHGAT - static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) { -@@ -1106,10 +1106,10 @@ - return INT2NUM(mvinsch(NUM2INT(arg1), NUM2INT(arg2), NUM2ULONG(arg3))); - } - static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { -- return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); -+ return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); - } - static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { -- return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); -+ return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); - } - #ifdef HAVE_MVVLINE - static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { -@@ -1137,10 +1137,10 @@ - return return_value; - } - static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { -- return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); -+ return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); - } - static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { -- return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); -+ return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); - } - #ifdef HAVE_MVWCHGAT - static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) { -@@ -1171,10 +1171,10 @@ - return INT2NUM(mvwinsch(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), NUM2ULONG(arg4))); - } - static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { -- return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); -+ return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); - } - static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { -- return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); -+ return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); - } - #ifdef HAVE_MVWVLINE - static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { -@@ -1238,7 +1238,7 @@ - } - #ifdef HAVE_PUTP - static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) { -- return INT2NUM(putp(STR2CSTR(arg1))); -+ return INT2NUM(putp(StringValuePtr(arg1))); - } - #endif - #ifdef HAVE_QIFLUSH -@@ -1271,12 +1271,12 @@ - } - #ifdef HAVE_SCR_DUMP - static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) { -- return INT2NUM(scr_dump(STR2CSTR(arg1))); -+ return INT2NUM(scr_dump(StringValuePtr(arg1))); - } - #endif - #ifdef HAVE_SCR_INIT - static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) { -- return INT2NUM(scr_init(STR2CSTR(arg1))); -+ return INT2NUM(scr_init(StringValuePtr(arg1))); - } - #endif - static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) { -@@ -1290,12 +1290,12 @@ - } - #ifdef HAVE_SCR_RESTORE - static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) { -- return INT2NUM(scr_restore(STR2CSTR(arg1))); -+ return INT2NUM(scr_restore(StringValuePtr(arg1))); - } - #endif - #ifdef HAVE_SCR_SET - static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) { -- return INT2NUM(scr_set(STR2CSTR(arg1))); -+ return INT2NUM(scr_set(StringValuePtr(arg1))); - } - #endif - static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) { -@@ -1352,7 +1352,7 @@ - return INT2NUM(slk_restore()); - } - static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { -- return INT2NUM(slk_set(NUM2INT(arg1), STR2CSTR(arg2), NUM2INT(arg3))); -+ return INT2NUM(slk_set(NUM2INT(arg1), StringValuePtr(arg2), NUM2INT(arg3))); - } - static VALUE rbncurs_slk_touch(VALUE dummy) { - return INT2NUM(slk_touch()); -@@ -1383,17 +1383,17 @@ - } - #ifdef HAVE_TIGETFLAG - static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) { -- return INT2NUM(tigetflag(STR2CSTR(arg1))); -+ return INT2NUM(tigetflag(StringValuePtr(arg1))); - } - #endif - #ifdef HAVE_TIGETNUM - static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) { -- return INT2NUM(tigetnum(STR2CSTR(arg1))); -+ return INT2NUM(tigetnum(StringValuePtr(arg1))); - } - #endif - #ifdef HAVE_TIGETSTR - static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) { -- return rb_str_new2(tigetstr(STR2CSTR(arg1))); -+ return rb_str_new2(tigetstr(StringValuePtr(arg1))); - } - #endif - static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) { -@@ -1438,10 +1438,10 @@ - return return_value; - } - static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { -- return INT2NUM(waddnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); -+ return INT2NUM(waddnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); - } - static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) { -- return INT2NUM(waddstr(get_window(arg1), STR2CSTR(arg2))); -+ return INT2NUM(waddstr(get_window(arg1), StringValuePtr(arg2))); - } - static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) { - return INT2NUM(wattron(get_window(arg1), NUM2INT(arg2))); -@@ -1514,10 +1514,10 @@ - return INT2NUM(winsertln(get_window(arg1))); - } - static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { -- return INT2NUM(winsnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); -+ return INT2NUM(winsnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); - } - static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) { -- return INT2NUM(winsstr(get_window(arg1), STR2CSTR(arg2))); -+ return INT2NUM(winsstr(get_window(arg1), StringValuePtr(arg2))); - } - static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { - return INT2NUM(wmove(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3))); -@@ -1619,7 +1619,7 @@ - { return rb_str_new2(unctrl(NUM2ULONG(ch))); } - static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd) - { -- char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type); -+ char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type); - int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0)); - int infd = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0)); - VALUE rb_screen = -@@ -2277,7 +2277,7 @@ - #ifdef HAVE_MCPRINT - static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len) - { -- return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len))); -+ return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len))); - } - #endif - #ifdef HAVE_HAS_KEY -@@ -2378,9 +2378,9 @@ - " and a String"); - return Qnil; - } -+ VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1); - wprintw(get_window(argv[0]), "%s", -- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, -- argv + 1))); -+ StringValuePtr(tmp)); - return Qnil; - } - -@@ -2394,14 +2394,14 @@ - return Qnil; - } - _tracef("%s", -- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); -+ StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); - return Qnil; - } - #endif /* HAVE__TRACEF */ - #ifdef HAVE__TRACEDUMP - static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win) - { -- _tracedump(STR2CSTR(rb_label), get_window(rb_win)); -+ _tracedump(StringValuePtr(rb_label), get_window(rb_win)); - } - #endif /* HAVE__TRACEDUMP */ - #ifdef HAVE__TRACEATTR -@@ -2706,7 +2706,7 @@ - - #ifdef HAVE_LOCALE_H - static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale) --{ return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));} -+{ return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));} - #endif - - static void init_safe_functions(void) diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/Werror-format-security.patch --- a/ruby-ncurses/stuff/Werror-format-security.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.format/form_wrap.c ---- ncurses-ruby-1.3.1/form_wrap.c 2014-02-03 11:31:39.049867878 +0100 -+++ ncurses-ruby-1.3.1.format/form_wrap.c 2014-02-03 11:44:37.001008654 +0100 -@@ -1132,7 +1132,7 @@ - char msg[500]; - snprintf(msg, 500, "The validation functions for this field type need %d additional arguments.",(int)(NUM2INT(argc)-1)); - msg[499]=0; -- rb_raise(rb_eArgError, msg); -+ rb_raise(rb_eArgError, "%s", msg); - } - } - } diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/patches/STR2CSTR-deprecated.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/patches/STR2CSTR-deprecated.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,320 @@ +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.p/form_wrap.c +--- ncurses-ruby-1.3.1/form_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/form_wrap.c 2013-03-14 14:38:21.097682379 +0100 +@@ -625,7 +625,8 @@ + char** list = ALLOC_N(char*, n+1); + int i; + for (i = 0; i < n; i++) { +- list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i)); ++ VALUE tmp = rb_ary_entry(arg3, (long)i); ++ list[i] = StringValuePtr(tmp); + } + list[n] = NULL; + return INT2NUM(set_field_type(field, ftype, +@@ -654,7 +655,7 @@ + if (argc != 2) + rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument"); + return INT2NUM(set_field_type(field, ftype, +- STR2CSTR(arg3))); ++ StringValuePtr(arg3))); + } + else if (ftype == TYPE_IPV4){ + if (argc != 1) +@@ -742,7 +743,7 @@ + */ + static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) { + FIELD* field = get_field(rb_field); +- return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value))); ++ return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value))); + } + static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value) + { return rbncurs_c_set_field_buffer(rb_field, buf, value); } +@@ -1052,7 +1053,7 @@ + { return rbncurs_c_form_request_name(request); } + + static VALUE rbncurs_c_form_request_by_name(VALUE name) { +- return INT2NUM(form_request_by_name(STR2CSTR(name))); ++ return INT2NUM(form_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_form_request_by_name(name); } +diff -Naur ncurses-ruby-1.3.1/menu_wrap.c ncurses-ruby-1.3.1.p/menu_wrap.c +--- ncurses-ruby-1.3.1/menu_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/menu_wrap.c 2013-03-14 14:39:37.016571464 +0100 +@@ -372,7 +372,7 @@ + * Item creation/destruction functions - mitem_new(3X) man page + */ + static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description) +-{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); } ++{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); } + + static VALUE rbncurs_c_free_item(VALUE rb_item) + { +@@ -670,7 +670,7 @@ + + static VALUE rbncurs_c_menu_request_by_name(VALUE name) + { +- return INT2NUM(menu_request_by_name(STR2CSTR(name))); ++ return INT2NUM(menu_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_menu_request_by_name(name); } +@@ -909,7 +909,7 @@ + static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_mark(menu, STR2CSTR(value))); ++ return INT2NUM(set_menu_mark(menu, StringValuePtr(value))); + } + static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value) + { return rbncurs_c_set_menu_mark(rb_field, value); } +@@ -929,7 +929,7 @@ + static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern))); ++ return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern))); + } + static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern) + { return rbncurs_c_set_menu_pattern(rb_menu, pattern); } +diff -Naur ncurses-ruby-1.3.1/ncurses_wrap.c ncurses-ruby-1.3.1.p/ncurses_wrap.c +--- ncurses-ruby-1.3.1/ncurses_wrap.c 2011-05-31 01:41:46.000000000 +0200 ++++ ncurses-ruby-1.3.1.p/ncurses_wrap.c 2013-03-14 15:09:59.535783327 +0100 +@@ -475,7 +475,7 @@ + static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode) + { + return INT2NUM(define_key((definition != Qnil) +- ? STR2CSTR(definition) ++ ? StringValuePtr(definition) + : (char*)(NULL), + NUM2INT(keycode))); + } +@@ -580,10 +580,10 @@ + return return_value; + } + static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(addnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(addnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(addstr(STR2CSTR(arg1))); ++ return INT2NUM(addstr(StringValuePtr(arg1))); + } + static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) { + return INT2NUM(attroff(NUM2ULONG(arg1))); +@@ -1011,10 +1011,10 @@ + return INT2NUM(insertln()); + } + static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(insnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(insnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(insstr(STR2CSTR(arg1))); ++ return INT2NUM(insstr(StringValuePtr(arg1))); + } + #ifdef HAVE_INTRFLUSH + static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1070,10 +1070,10 @@ + return return_value; + } + static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVCHGAT + static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) { +@@ -1106,10 +1106,10 @@ + return INT2NUM(mvinsch(NUM2INT(arg1), NUM2INT(arg2), NUM2ULONG(arg3))); + } + static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVVLINE + static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +@@ -1137,10 +1137,10 @@ + return return_value; + } + static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWCHGAT + static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) { +@@ -1171,10 +1171,10 @@ + return INT2NUM(mvwinsch(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), NUM2ULONG(arg4))); + } + static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWVLINE + static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +@@ -1238,7 +1238,7 @@ + } + #ifdef HAVE_PUTP + static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) { +- return INT2NUM(putp(STR2CSTR(arg1))); ++ return INT2NUM(putp(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_QIFLUSH +@@ -1271,12 +1271,12 @@ + } + #ifdef HAVE_SCR_DUMP + static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_dump(STR2CSTR(arg1))); ++ return INT2NUM(scr_dump(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_INIT + static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_init(STR2CSTR(arg1))); ++ return INT2NUM(scr_init(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) { +@@ -1290,12 +1290,12 @@ + } + #ifdef HAVE_SCR_RESTORE + static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_restore(STR2CSTR(arg1))); ++ return INT2NUM(scr_restore(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_SET + static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_set(STR2CSTR(arg1))); ++ return INT2NUM(scr_set(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1352,7 +1352,7 @@ + return INT2NUM(slk_restore()); + } + static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(slk_set(NUM2INT(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(slk_set(NUM2INT(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_slk_touch(VALUE dummy) { + return INT2NUM(slk_touch()); +@@ -1383,17 +1383,17 @@ + } + #ifdef HAVE_TIGETFLAG + static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetflag(STR2CSTR(arg1))); ++ return INT2NUM(tigetflag(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETNUM + static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetnum(STR2CSTR(arg1))); ++ return INT2NUM(tigetnum(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETSTR + static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) { +- return rb_str_new2(tigetstr(STR2CSTR(arg1))); ++ return rb_str_new2(tigetstr(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) { +@@ -1438,10 +1438,10 @@ + return return_value; + } + static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(waddnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(waddnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(waddstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(waddstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) { + return INT2NUM(wattron(get_window(arg1), NUM2INT(arg2))); +@@ -1514,10 +1514,10 @@ + return INT2NUM(winsertln(get_window(arg1))); + } + static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(winsnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(winsnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(winsstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(winsstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { + return INT2NUM(wmove(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3))); +@@ -1619,7 +1619,7 @@ + { return rb_str_new2(unctrl(NUM2ULONG(ch))); } + static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd) + { +- char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type); ++ char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type); + int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0)); + int infd = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0)); + VALUE rb_screen = +@@ -2277,7 +2277,7 @@ + #ifdef HAVE_MCPRINT + static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len) + { +- return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len))); ++ return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len))); + } + #endif + #ifdef HAVE_HAS_KEY +@@ -2378,9 +2378,9 @@ + " and a String"); + return Qnil; + } ++ VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1); + wprintw(get_window(argv[0]), "%s", +- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, +- argv + 1))); ++ StringValuePtr(tmp)); + return Qnil; + } + +@@ -2394,14 +2394,14 @@ + return Qnil; + } + _tracef("%s", +- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); ++ StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); + return Qnil; + } + #endif /* HAVE__TRACEF */ + #ifdef HAVE__TRACEDUMP + static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win) + { +- _tracedump(STR2CSTR(rb_label), get_window(rb_win)); ++ _tracedump(StringValuePtr(rb_label), get_window(rb_win)); + } + #endif /* HAVE__TRACEDUMP */ + #ifdef HAVE__TRACEATTR +@@ -2706,7 +2706,7 @@ + + #ifdef HAVE_LOCALE_H + static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale) +-{ return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));} ++{ return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));} + #endif + + static void init_safe_functions(void) diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/patches/Werror-format-security.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/patches/Werror-format-security.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,12 @@ +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.format/form_wrap.c +--- ncurses-ruby-1.3.1/form_wrap.c 2014-02-03 11:31:39.049867878 +0100 ++++ ncurses-ruby-1.3.1.format/form_wrap.c 2014-02-03 11:44:37.001008654 +0100 +@@ -1132,7 +1132,7 @@ + char msg[500]; + snprintf(msg, 500, "The validation functions for this field type need %d additional arguments.",(int)(NUM2INT(argc)-1)); + msg[499]=0; +- rb_raise(rb_eArgError, msg); ++ rb_raise(rb_eArgError, "%s", msg); + } + } + } diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/patches/ruby-ncurses-fix-missing-tz-prototypes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/patches/ruby-ncurses-fix-missing-tz-prototypes.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,34 @@ +From d3e59724601b2aabb231f2e12e16ebf00ba79ab1 Mon Sep 17 00:00:00 2001 +From: Caleb Marble +Date: Sun, 2 Mar 2014 13:53:05 -0600 +Subject: [PATCH] modified: ext/ncurses/ncurses_wrap.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes the following compiler error: + +ext/ncurses/ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’: +ext/ncurses/ncurses_wrap.c:807:12: error: variable ‘tz’ has initializer but incomplete type + struct timezone tz = {0,0}; + +Also closes #6 +--- + ncurses_wrap.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ncurses_wrap.h b/ncurses_wrap.h +index 85da4f8..92583c0 100644 +--- a/ncurses_wrap.h ++++ b/ncurses_wrap.h +@@ -84,6 +84,7 @@ int close(int); + #endif + + #include ++#include + + extern VALUE mNcurses; /* module Ncurses */ + extern VALUE cWINDOW; /* class Ncurses::WINDOW */ +-- +1.9.1 + diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby-ncurses/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +# use fedora patches +STR2CSTR-deprecated.patch +ruby-ncurses-fix-missing-tz-prototypes.patch diff -r c7b121a4ffd9 -r d6378d455338 ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch --- a/ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -From d3e59724601b2aabb231f2e12e16ebf00ba79ab1 Mon Sep 17 00:00:00 2001 -From: Caleb Marble -Date: Sun, 2 Mar 2014 13:53:05 -0600 -Subject: [PATCH] modified: ext/ncurses/ncurses_wrap.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes the following compiler error: - -ext/ncurses/ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’: -ext/ncurses/ncurses_wrap.c:807:12: error: variable ‘tz’ has initializer but incomplete type - struct timezone tz = {0,0}; - -Also closes #6 ---- - ncurses_wrap.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/ncurses_wrap.h b/ncurses_wrap.h -index 85da4f8..92583c0 100644 ---- a/ncurses_wrap.h -+++ b/ncurses_wrap.h -@@ -84,6 +84,7 @@ int close(int); - #endif - - #include -+#include - - extern VALUE mNcurses; /* module Ncurses */ - extern VALUE cWINDOW; /* class Ncurses::WINDOW */ --- -1.9.1 - diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/receipt --- a/sane-backends/receipt Wed May 09 17:03:28 2018 +0300 +++ b/sane-backends/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,9 +17,6 @@ compile_rules() { sed -i 's|prefix}/doc|prefix}/share/doc|' configure - patch -Np1 -i $stuff/libv4l-0.8.3.patch - # fix https://bugs.archlinux.org/task/26114 - patch -Np1 -i $stuff/xerox_mfp_fix_usb_devices.patch ./configure $CONFIGURE_ARGS && fix libtool && diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/stuff/libv4l-0.8.3.patch --- a/sane-backends/stuff/libv4l-0.8.3.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -From 26c69b228b29f612faf4b0cc85db969ee7cc4ea6 Mon Sep 17 00:00:00 2001 -From: Nils Philippsen -Date: Mon, 14 Mar 2011 13:35:05 +0100 -Subject: [PATCH] patch: v4l - -Squashed commit of the following: - -commit 23381932c76846191b42a48e505b37cd74711265 -Author: Julien BLACHE -Date: Wed Feb 16 19:37:43 2011 +0100 - - Fix v4l build with libv4l 0.8.3+ - - (cherry picked from commit c5ca46c2d1be78c651afb843cc834cf2b5b24953) - - Conflicts: - - ChangeLog - - Signed-off-by: Nils Philippsen ---- - backend/v4l.c | 3 +-- - backend/v4l.h | 3 ++- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/backend/v4l.c b/backend/v4l.c -index 6510ef0..38595ed 100644 ---- a/backend/v4l.c -+++ b/backend/v4l.c -@@ -84,9 +84,8 @@ - #include "../include/sane/sanei_config.h" - #define V4L_CONFIG_FILE "v4l.conf" - --#include "v4l.h" -- - #include -+#include "v4l.h" - - static const SANE_Device **devlist = NULL; - static int num_devices; -diff --git a/backend/v4l.h b/backend/v4l.h -index 588b96e..6aee586 100644 ---- a/backend/v4l.h -+++ b/backend/v4l.h -@@ -29,6 +29,7 @@ - #ifndef v4l_h - #define v4l_h - -+#ifndef __LINUX_VIDEODEV_H - /* Kernel interface */ - /* Only the stuff we need. For more features, more defines are needed */ - -@@ -165,7 +166,7 @@ struct video_channel - - - /* end of kernel interface */ -- -+#endif /* !__LINUX_VIDEODEV_H */ - - #include <../include/sane/sane.h> - --- -1.7.4 - diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/stuff/patches/libv4l-0.8.3.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sane-backends/stuff/patches/libv4l-0.8.3.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,64 @@ +From 26c69b228b29f612faf4b0cc85db969ee7cc4ea6 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen +Date: Mon, 14 Mar 2011 13:35:05 +0100 +Subject: [PATCH] patch: v4l + +Squashed commit of the following: + +commit 23381932c76846191b42a48e505b37cd74711265 +Author: Julien BLACHE +Date: Wed Feb 16 19:37:43 2011 +0100 + + Fix v4l build with libv4l 0.8.3+ + + (cherry picked from commit c5ca46c2d1be78c651afb843cc834cf2b5b24953) + + Conflicts: + + ChangeLog + + Signed-off-by: Nils Philippsen +--- + backend/v4l.c | 3 +-- + backend/v4l.h | 3 ++- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/backend/v4l.c b/backend/v4l.c +index 6510ef0..38595ed 100644 +--- a/backend/v4l.c ++++ b/backend/v4l.c +@@ -84,9 +84,8 @@ + #include "../include/sane/sanei_config.h" + #define V4L_CONFIG_FILE "v4l.conf" + +-#include "v4l.h" +- + #include ++#include "v4l.h" + + static const SANE_Device **devlist = NULL; + static int num_devices; +diff --git a/backend/v4l.h b/backend/v4l.h +index 588b96e..6aee586 100644 +--- a/backend/v4l.h ++++ b/backend/v4l.h +@@ -29,6 +29,7 @@ + #ifndef v4l_h + #define v4l_h + ++#ifndef __LINUX_VIDEODEV_H + /* Kernel interface */ + /* Only the stuff we need. For more features, more defines are needed */ + +@@ -165,7 +166,7 @@ struct video_channel + + + /* end of kernel interface */ +- ++#endif /* !__LINUX_VIDEODEV_H */ + + #include <../include/sane/sane.h> + +-- +1.7.4 + diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sane-backends/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +libv4l-0.8.3.patch +# fix https://bugs.archlinux.org/task/26114 +xerox_mfp_fix_usb_devices.patch diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/stuff/patches/xerox_mfp_fix_usb_devices.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sane-backends/stuff/patches/xerox_mfp_fix_usb_devices.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,67 @@ +commit 5ea227caeacd504b64eef301e83fa63e0a25b3f7 +Author: Alex Belkin +Date: Tue Mar 8 17:57:19 2011 +0300 + + keep usb device by default (correct for bug introduced by tcp sub-backend + +diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c +index e08b50f..d4672a7 100644 +--- a/backend/xerox_mfp.c ++++ b/backend/xerox_mfp.c +@@ -37,10 +37,10 @@ + static const SANE_Device **devlist = NULL; /* sane_get_devices array */ + static struct device *devices_head = NULL; /* sane_get_devices list */ + +-transport available_transports[] = { ++enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX }; ++transport available_transports[TRANSPORTS_MAX] = { + { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device }, + { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device }, +- { 0 } + }; + + static int resolv_state(int state) +@@ -824,7 +824,13 @@ free_devices (void) + devices_head = NULL; + } + +-/* SANE API ignores return code of this callback */ ++static transport *tr_from_devname(SANE_String_Const devname) ++{ ++ if (strncmp("tcp", devname, 3) == 0) ++ return &available_transports[TRANSPORT_TCP]; ++ return &available_transports[TRANSPORT_USB]; ++} ++ + static SANE_Status + list_one_device (SANE_String_Const devname) + { +@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devname) + return SANE_STATUS_GOOD; + } + +- for (tr = available_transports; tr->ttype; tr++) { +- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) +- break; +- } +- if (!tr->ttype) +- return SANE_STATUS_INVAL; ++ tr = tr_from_devname(devname); + + dev = calloc (1, sizeof (struct device)); + if (dev == NULL) +@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devname) + static SANE_Status + list_conf_devices (UNUSED (SANEI_Config * config), const char *devname) + { +- transport *tr; +- +- for (tr = available_transports; tr->ttype; tr++) { +- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) +- return tr->configure_device(devname, list_one_device); +- } +- return SANE_STATUS_INVAL; ++ return tr_from_devname(devname)->configure_device(devname, list_one_device); + } + + SANE_Status diff -r c7b121a4ffd9 -r d6378d455338 sane-backends/stuff/xerox_mfp_fix_usb_devices.patch --- a/sane-backends/stuff/xerox_mfp_fix_usb_devices.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -commit 5ea227caeacd504b64eef301e83fa63e0a25b3f7 -Author: Alex Belkin -Date: Tue Mar 8 17:57:19 2011 +0300 - - keep usb device by default (correct for bug introduced by tcp sub-backend - -diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c -index e08b50f..d4672a7 100644 ---- a/backend/xerox_mfp.c -+++ b/backend/xerox_mfp.c -@@ -37,10 +37,10 @@ - static const SANE_Device **devlist = NULL; /* sane_get_devices array */ - static struct device *devices_head = NULL; /* sane_get_devices list */ - --transport available_transports[] = { -+enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX }; -+transport available_transports[TRANSPORTS_MAX] = { - { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device }, - { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device }, -- { 0 } - }; - - static int resolv_state(int state) -@@ -824,7 +824,13 @@ free_devices (void) - devices_head = NULL; - } - --/* SANE API ignores return code of this callback */ -+static transport *tr_from_devname(SANE_String_Const devname) -+{ -+ if (strncmp("tcp", devname, 3) == 0) -+ return &available_transports[TRANSPORT_TCP]; -+ return &available_transports[TRANSPORT_USB]; -+} -+ - static SANE_Status - list_one_device (SANE_String_Const devname) - { -@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devname) - return SANE_STATUS_GOOD; - } - -- for (tr = available_transports; tr->ttype; tr++) { -- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) -- break; -- } -- if (!tr->ttype) -- return SANE_STATUS_INVAL; -+ tr = tr_from_devname(devname); - - dev = calloc (1, sizeof (struct device)); - if (dev == NULL) -@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devname) - static SANE_Status - list_conf_devices (UNUSED (SANEI_Config * config), const char *devname) - { -- transport *tr; -- -- for (tr = available_transports; tr->ttype; tr++) { -- if (!strncmp (devname, tr->ttype, strlen(tr->ttype))) -- return tr->configure_device(devname, list_one_device); -- } -- return SANE_STATUS_INVAL; -+ return tr_from_devname(devname)->configure_device(devname, list_one_device); - } - - SANE_Status diff -r c7b121a4ffd9 -r d6378d455338 screenfetch/receipt --- a/screenfetch/receipt Wed May 09 17:03:28 2018 +0300 +++ b/screenfetch/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,8 +16,6 @@ # Rules to configure and make the package. compile_rules() { - # patch for SliTaz (use basic artwork - job for artwork team?) - patch -i ../../stuff/slitaz.patch mkdir -p $install/usr/bin cp screenfetch-dev $install/usr/bin/screenfetch } diff -r c7b121a4ffd9 -r d6378d455338 screenfetch/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screenfetch/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# patch for SliTaz (use basic artwork - job for artwork team?) +slitaz.patch diff -r c7b121a4ffd9 -r d6378d455338 screenfetch/stuff/patches/slitaz.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/screenfetch/stuff/patches/slitaz.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,98 @@ +--- screenfetch-dev.orig 2014-07-09 18:56:48.000000000 +0100 ++++ screenfetch-dev 2014-07-13 13:17:37.000000000 +0100 +@@ -207,8 +207,8 @@ + printf " CrunchBang, Raspbian, elementary OS, Fedora, Frugalware, Fuduntu, Gentoo,\n" + printf " Funtoo, Jiyuu Linux, LinuxDeepin, Kali Linux, Mageia, Mandriva, Manjaro,\n" + printf " Linux Mint, LMDE, openSUSE, Parabola GNU/Linux-libre, Peppermint,\n" +- printf " Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SolusOS,\n" +- printf " TinyCore, Trisquel, Ubuntu and Viperr.\n\n" ++ printf " Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SliTaz,\n" ++ printf " SolusOS, TinyCore, Trisquel, Ubuntu and Viperr.\n\n" + printf "${underline}Other Supported Systems${c0}:\n" + printf " Mac OS X, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD, Android and Cygwin.\n\n" + printf "${underline}Supported Desktop Managers${c0}:\n" +@@ -440,6 +440,8 @@ + distro="Sabayon" + elif [[ "${distro_detect}" == "SolusOS" ]]; then + distro="SolusOS" ++ elif [[ "${distro_detect}" == "SliTaz" ]]; then ++ distro="SliTaz" + elif [[ "${distro_detect}" == "Trisquel" ]]; then + distro="Trisquel" + elif [[ "${distro_detect}" == "Ubuntu" ]]; then +@@ -535,6 +537,7 @@ + elif [ -f /etc/redhat-release ] && grep -q "Red Hat" /etc/redhat-release; then distro="Red Hat Enterprise Linux" + elif [ -f /etc/redhat-release ] && grep -q "CentOS" /etc/redhat-release; then distro="CentOS" + elif [ -f /etc/slackware-version ]; then distro="Slackware" ++ elif [ -f /etc/slitaz-release ]; then distro="SliTaz" + elif [ -f /usr/share/doc/tc/release.txt ]; then distro="TinyCore" + elif [ -f /etc/sabayon-edition ]; then distro="Sabayon"; fi + else +@@ -645,6 +648,7 @@ + gentoo) distro="Gentoo" ;; + funtoo) distro="Funtoo" ;; + slackware) distro="Slackware" ;; ++ slitaz) distro="SliTaz" ;; + frugalware) distro="Frugalware" ;; + peppermint) distro="Peppermint" ;; + solusos) distro="SolusOS" ;; +@@ -729,6 +733,7 @@ + case $distro in + 'Arch Linux'|'Parabola GNU/Linux-libre'|'Chakra'|'Manjaro'|'Antergos'|'KaOS') pkgs=$(pacman -Qq | wc -l) ;; + 'Frugalware') pkgs=$(pacman-g2 -Q | wc -l) ;; ++ 'SliTaz') pkgs=$(tazpkg list | wc -l) ;; + 'Fuduntu'|'Ubuntu'|'Mint'|'SolusOS'|'Debian'|'Raspbian'|'LMDE'|'CrunchBang'|'Peppermint'|'LinuxDeepin'|'Kali Linux'|'Trisquel'|'elementary OS') pkgs=$(dpkg --get-selections | wc -l) ;; + 'Slackware') pkgs=$(ls -1 /var/log/packages | wc -l) ;; + 'Gentoo'|'Sabayon'|'Funtoo') pkgs=$(ls -d /var/db/pkg/*/* | wc -l) ;; +@@ -2967,6 +2972,33 @@ + "${c2} ............... %s") + ;; + ++ "#SliTaz") ++ if [[ "$no_color" != "1" ]]; then ++ c1=$(getColor 'light grey') # Light Grey ++ fi ++ if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi ++ startline="0" ++ fulloutput=( ++"${c1} # # %s" ++"${c1} # ## # %s" ++"${c1} ## ## ### ## %s" ++"${c1} ## ### ### ## %s" ++"${c1} ## ### ## ## %s" ++"${c1} ### #### ##### #### ###%s" ++"${c1} #### ##### ####### ##### ####%s" ++"${c1} ############################ %s" ++"${c1} ###################### %s" ++"${c1} ################################# %s" ++"${c1} ## ################ #### ## %s" ++"${c1} # ### ############ ### ## %s" ++"${c1} # ## ########### ### # %s" ++"${c1} # # ########### # %s" ++"${c1} ######## %s" ++" %s" ++" %s" ++" %s") ++ ;; ++ + + "KaOS") + if [[ "$no_color" != "1" ]]; then +@@ -3086,7 +3118,7 @@ + if [[ "$no_color" != "1" ]]; then + c1=$(getColor 'white') # White + c2=$(getColor 'dark grey') # Light Gray +- c3=$(getColor 'yellow') # Light Yellow ++ c3=$(getColor 'light red') # Light Red + fi + if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi + startline="0" +@@ -3188,7 +3220,7 @@ + "Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux"|"Antergos"|"KaOS") labelcolor=$(getColor 'light blue');; + "Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');; + "Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');; +- "Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');; ++ "Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"SliTaz"|"BackTrack Linux") labelcolor=$(getColor 'light red');; + "CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');; + "Gentoo"|"Parabola GNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');; + "CentOS"|"Ubuntu"|*) labelcolor=$(getColor 'yellow');; diff -r c7b121a4ffd9 -r d6378d455338 screenfetch/stuff/slitaz.patch --- a/screenfetch/stuff/slitaz.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ ---- screenfetch-dev.orig 2014-07-09 18:56:48.000000000 +0100 -+++ screenfetch-dev 2014-07-13 13:17:37.000000000 +0100 -@@ -207,8 +207,8 @@ - printf " CrunchBang, Raspbian, elementary OS, Fedora, Frugalware, Fuduntu, Gentoo,\n" - printf " Funtoo, Jiyuu Linux, LinuxDeepin, Kali Linux, Mageia, Mandriva, Manjaro,\n" - printf " Linux Mint, LMDE, openSUSE, Parabola GNU/Linux-libre, Peppermint,\n" -- printf " Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SolusOS,\n" -- printf " TinyCore, Trisquel, Ubuntu and Viperr.\n\n" -+ printf " Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SliTaz,\n" -+ printf " SolusOS, TinyCore, Trisquel, Ubuntu and Viperr.\n\n" - printf "${underline}Other Supported Systems${c0}:\n" - printf " Mac OS X, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD, Android and Cygwin.\n\n" - printf "${underline}Supported Desktop Managers${c0}:\n" -@@ -440,6 +440,8 @@ - distro="Sabayon" - elif [[ "${distro_detect}" == "SolusOS" ]]; then - distro="SolusOS" -+ elif [[ "${distro_detect}" == "SliTaz" ]]; then -+ distro="SliTaz" - elif [[ "${distro_detect}" == "Trisquel" ]]; then - distro="Trisquel" - elif [[ "${distro_detect}" == "Ubuntu" ]]; then -@@ -535,6 +537,7 @@ - elif [ -f /etc/redhat-release ] && grep -q "Red Hat" /etc/redhat-release; then distro="Red Hat Enterprise Linux" - elif [ -f /etc/redhat-release ] && grep -q "CentOS" /etc/redhat-release; then distro="CentOS" - elif [ -f /etc/slackware-version ]; then distro="Slackware" -+ elif [ -f /etc/slitaz-release ]; then distro="SliTaz" - elif [ -f /usr/share/doc/tc/release.txt ]; then distro="TinyCore" - elif [ -f /etc/sabayon-edition ]; then distro="Sabayon"; fi - else -@@ -645,6 +648,7 @@ - gentoo) distro="Gentoo" ;; - funtoo) distro="Funtoo" ;; - slackware) distro="Slackware" ;; -+ slitaz) distro="SliTaz" ;; - frugalware) distro="Frugalware" ;; - peppermint) distro="Peppermint" ;; - solusos) distro="SolusOS" ;; -@@ -729,6 +733,7 @@ - case $distro in - 'Arch Linux'|'Parabola GNU/Linux-libre'|'Chakra'|'Manjaro'|'Antergos'|'KaOS') pkgs=$(pacman -Qq | wc -l) ;; - 'Frugalware') pkgs=$(pacman-g2 -Q | wc -l) ;; -+ 'SliTaz') pkgs=$(tazpkg list | wc -l) ;; - 'Fuduntu'|'Ubuntu'|'Mint'|'SolusOS'|'Debian'|'Raspbian'|'LMDE'|'CrunchBang'|'Peppermint'|'LinuxDeepin'|'Kali Linux'|'Trisquel'|'elementary OS') pkgs=$(dpkg --get-selections | wc -l) ;; - 'Slackware') pkgs=$(ls -1 /var/log/packages | wc -l) ;; - 'Gentoo'|'Sabayon'|'Funtoo') pkgs=$(ls -d /var/db/pkg/*/* | wc -l) ;; -@@ -2967,6 +2972,33 @@ - "${c2} ............... %s") - ;; - -+ "#SliTaz") -+ if [[ "$no_color" != "1" ]]; then -+ c1=$(getColor 'light grey') # Light Grey -+ fi -+ if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi -+ startline="0" -+ fulloutput=( -+"${c1} # # %s" -+"${c1} # ## # %s" -+"${c1} ## ## ### ## %s" -+"${c1} ## ### ### ## %s" -+"${c1} ## ### ## ## %s" -+"${c1} ### #### ##### #### ###%s" -+"${c1} #### ##### ####### ##### ####%s" -+"${c1} ############################ %s" -+"${c1} ###################### %s" -+"${c1} ################################# %s" -+"${c1} ## ################ #### ## %s" -+"${c1} # ### ############ ### ## %s" -+"${c1} # ## ########### ### # %s" -+"${c1} # # ########### # %s" -+"${c1} ######## %s" -+" %s" -+" %s" -+" %s") -+ ;; -+ - - "KaOS") - if [[ "$no_color" != "1" ]]; then -@@ -3086,7 +3118,7 @@ - if [[ "$no_color" != "1" ]]; then - c1=$(getColor 'white') # White - c2=$(getColor 'dark grey') # Light Gray -- c3=$(getColor 'yellow') # Light Yellow -+ c3=$(getColor 'light red') # Light Red - fi - if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi - startline="0" -@@ -3188,7 +3220,7 @@ - "Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux"|"Antergos"|"KaOS") labelcolor=$(getColor 'light blue');; - "Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');; - "Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');; -- "Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');; -+ "Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"SliTaz"|"BackTrack Linux") labelcolor=$(getColor 'light red');; - "CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');; - "Gentoo"|"Parabola GNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');; - "CentOS"|"Ubuntu"|*) labelcolor=$(getColor 'yellow');; diff -r c7b121a4ffd9 -r d6378d455338 scrot/receipt --- a/scrot/receipt Wed May 09 17:03:28 2018 +0300 +++ b/scrot/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,7 +18,7 @@ compile_rules() { sed -i 's|prefix)/doc|prefix)/share/doc|' * - patch -p1 < $stuff/scrot.patch + ./configure $CONFIGURE_ARGS && make && make DESTDIR=$DESTDIR install diff -r c7b121a4ffd9 -r d6378d455338 scrot/stuff/patches/scrot.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scrot/stuff/patches/scrot.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,440 @@ +# This patch was created manually from patches found here: +# http://scrot.sourcearchive.com/downloads/0.8-12/scrot_0.8-12.debian.tar.gz + +## 01_manpagefix.dpatch by William Vera +## DP: Character cleanup for UTF-8 compatibility. + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -87,7 +87,7 @@ + \\n prints a newline (ignored when used in the filename) + .fi + .SH EXAMPLE +-scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' ++scrot '%Y\-%m\-%d_$wx$h.png' \-e 'mv $f ~/shots/' + .br + This would create a file called something like + 2000-10-30_2560x1024.png and move it to your shots directory. + +## 02_options.c.dpatch by William Vera +## DP: A little fix for wrong words. + +--- scrot-0.8-orig/src/options.c ++++ scrot-0.8/src/options.c +@@ -229,7 +229,7 @@ + " low quality means high compression.\n" + " -m, --multidisp For multiple heads, grab shot from each\n" + " and join them together.\n" +- " -s, --select interactively choose a window or rectnagle\n" ++ " -s, --select interactively choose a window or rectangle\n" + " with the mouse\n" + " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" + " of the original size for the thumbnail to be,\n" +@@ -238,7 +238,7 @@ + " Both the --exec and filename parameters can take format specifiers\n" + " that are expanded by " PACKAGE " when encountered.\n" + " There are two types of format specifier. Characters preceded by a '%%'\n" +- " are interpretted by strftime(2). See man strftime for examples.\n" ++ " are interpreted by strftime(2). See man strftime for examples.\n" + " These options may be used to refer to the current date and time.\n" + " The second kind are internal to " PACKAGE + " and are prefixed by '$'\n" + +## 003_descmanpage.dpatch by William Vera +## DP: Change the description on manpage. + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -1,6 +1,6 @@ + .TH scrot 1 "Oct 26, 2000" + .SH NAME +-scrot - Screen capture using imlib2 ++scrot - capture a screenshot using imlib2 + .SH SYNOPSIS + scrot [options] [file] + .SH DESCRIPTION + +## 04-focused.dpatch by James Cameron +## DP: src/options.c (scrot_parse_option_array): add --focused option. +## DP: src/main.c (scrot_get_geometry, scrot_nice_clip): new functions +## for common code used by both selected and focused screenshot. +## DP: src/main.c (scrot_grab_focused): new function to grab currently +## focused window after specified delay. + +--- scrot-0.8-orig/src/options.h ++++ scrot-0.8/src/options.h +@@ -32,6 +32,7 @@ + int delay; + int countdown; + int select; ++ int focused; + int quality; + int border; + int multidisp; +--- scrot-0.8-orig/src/options.c ++++ scrot-0.8/src/options.c +@@ -44,13 +44,15 @@ + static void + scrot_parse_option_array(int argc, char **argv) + { +- static char stropts[] = "bcd:e:hmq:st:v+:"; ++ static char stropts[] = "bcd:e:hmq:st:uv+:"; + static struct option lopts[] = { + /* actions */ + {"help", 0, 0, 'h'}, /* okay */ + {"version", 0, 0, 'v'}, /* okay */ + {"count", 0, 0, 'c'}, + {"select", 0, 0, 's'}, ++ {"focused", 0, 0, 'u'}, ++ {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ + {"border", 0, 0, 'b'}, + {"multidisp", 0, 0, 'm'}, + /* toggles */ +@@ -95,6 +97,9 @@ + case 's': + opt.select = 1; + break; ++ case 'u': ++ opt.focused = 1; ++ break; + case '+': + opt.debug_level = atoi(optarg); + break; +@@ -231,6 +236,7 @@ + " and join them together.\n" + " -s, --select interactively choose a window or rectangle\n" + " with the mouse\n" ++ " -u, --focused use the currently focused window\n" + " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" + " of the original size for the thumbnail to be,\n" + " or the geometry in percent, e.g. 50x60 or 80x20.\n" +--- scrot-0.8-orig/src/scrot.h ++++ scrot-0.8/src/scrot.h +@@ -72,7 +72,10 @@ + char *filename_im, char *filename_thumb); + void scrot_do_delay(void); + Imlib_Image scrot_sel_and_grab_image(void); ++Imlib_Image scrot_grab_focused(void); + void scrot_sel_area(int *x, int *y, int *w, int *h); ++void scrot_nice_clip(int *rx, int *ry, int *rw, int *rh); ++int scrot_get_geometry(Window target, int *rx, int *ry, int *rw, int *rh); + Window scrot_get_window(Display *display,Window window,int x,int y); + Window scrot_get_client_window(Display * display, Window target); + Window scrot_find_window_by_property(Display * display, const Window window, +--- scrot-0.8-orig/src/main.c ++++ scrot-0.8/src/main.c +@@ -48,7 +48,9 @@ + } + + +- if (opt.select) ++ if (opt.focused) ++ image = scrot_grab_focused(); ++ else if (opt.select) + image = scrot_sel_and_grab_image(); + else { + scrot_do_delay(); +@@ -171,6 +173,22 @@ + } + + Imlib_Image ++scrot_grab_focused(void) ++{ ++ Imlib_Image im = NULL; ++ int rx = 0, ry = 0, rw = 0, rh = 0; ++ Window target = None; ++ int ignored; ++ ++ scrot_do_delay(); ++ XGetInputFocus(disp, &target, &ignored); ++ if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; ++ scrot_nice_clip(&rx, &ry, &rw, &rh); ++ im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); ++ return im; ++} ++ ++Imlib_Image + scrot_sel_and_grab_image(void) + { + Imlib_Image im = NULL; +@@ -313,57 +331,10 @@ + rh = 0 - rh; + } + } else { +- Window child; +- XWindowAttributes attr; +- int stat; +- + /* else it's a window click */ +- /* get geometry of window and use that */ +- /* get windowmanager frame of window */ +- if (target != root) { +- unsigned int d, x; +- int status; +- +- status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); +- if (status != 0) { +- Window rt, *children, parent; +- +- for (;;) { +- /* Find window manager frame. */ +- status = XQueryTree(disp, target, &rt, &parent, &children, &d); +- if (status && (children != None)) +- XFree((char *) children); +- if (!status || (parent == None) || (parent == rt)) +- break; +- target = parent; +- } +- /* Get client window. */ +- if (!opt.border) +- target = scrot_get_client_window(disp, target); +- XRaiseWindow(disp, target); +- } +- } +- stat = XGetWindowAttributes(disp, target, &attr); +- if ((stat == False) || (attr.map_state != IsViewable)) +- return NULL; +- rw = attr.width; +- rh = attr.height; +- XTranslateCoordinates(disp, target, root, 0, 0, &rx, &ry, &child); ++ if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; + } +- +- /* clip rectangle nicely */ +- if (rx < 0) { +- rw += rx; +- rx = 0; +- } +- if (ry < 0) { +- rh += ry; +- ry = 0; +- } +- if ((rx + rw) > scr->width) +- rw = scr->width - rx; +- if ((ry + rh) > scr->height) +- rh = scr->height - ry; ++ scrot_nice_clip(&rx, &ry, &rw, &rh); + + XBell(disp, 0); + im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); +@@ -371,6 +342,72 @@ + return im; + } + ++/* clip rectangle nicely */ ++void ++scrot_nice_clip(int *rx, ++ int *ry, ++ int *rw, ++ int *rh) ++{ ++ if (*rx < 0) { ++ *rw += *rx; ++ *rx = 0; ++ } ++ if (*ry < 0) { ++ *rh += *ry; ++ *ry = 0; ++ } ++ if ((*rx + *rw) > scr->width) ++ *rw = scr->width - *rx; ++ if ((*ry + *rh) > scr->height) ++ *rh = scr->height - *ry; ++} ++ ++/* get geometry of window and use that */ ++int ++scrot_get_geometry(Window target, ++ int *rx, ++ int *ry, ++ int *rw, ++ int *rh) ++{ ++ Window child; ++ XWindowAttributes attr; ++ int stat; ++ ++ /* get windowmanager frame of window */ ++ if (target != root) { ++ unsigned int d, x; ++ int status; ++ ++ status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); ++ if (status != 0) { ++ Window rt, *children, parent; ++ ++ for (;;) { ++ /* Find window manager frame. */ ++ status = XQueryTree(disp, target, &rt, &parent, &children, &d); ++ if (status && (children != None)) ++ XFree((char *) children); ++ if (!status || (parent == None) || (parent == rt)) ++ break; ++ target = parent; ++ } ++ /* Get client window. */ ++ if (!opt.border) ++ target = scrot_get_client_window(disp, target); ++ XRaiseWindow(disp, target); ++ } ++ } ++ stat = XGetWindowAttributes(disp, target, &attr); ++ if ((stat == False) || (attr.map_state != IsViewable)) ++ return 0; ++ *rw = attr.width; ++ *rh = attr.height; ++ XTranslateCoordinates(disp, target, root, 0, 0, rx, ry, &child); ++ return 1; ++} ++ + Window + scrot_get_window(Display * display, + Window window, + +## 05-addfocusedmanpage.dpatch by William Vera +## DP: Add a new option in the man page (focused option). + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -43,6 +43,9 @@ + .B -s, --select + Interactively select a window or rectangle with the mouse. + .TP 5 ++.B -u, --focused ++Use the currently focused window. ++.TP 5 + .B -t, --thumb NUM + generate thumbnail too. NUM is the percentage of the original size for the + thumbnail to be. + +## 06_manpagespace.dpatch by William Vera +## DP: Improve spacing in manual page. + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -58,7 +58,7 @@ + These options may be used to refer to the current date and time. + The second kind are internal to scrot and are prefixed by '$' + The following specifiers are recognised: +-.br ++.PP + .B $f + image path/filename (ignored when used in the filename) + .br + +## 07_fix-formatstring.dpatch by George Danchev +## DP: Prevent arbitrary long file names + +--- scrot-0.8-orig/src/options.c ++++ scrot-0.8/src/options.c +@@ -124,6 +124,12 @@ + if (!opt.output_file) + { + opt.output_file = argv[optind++]; ++ ++ if ( strlen(opt.output_file) > 256 ) { ++ printf("output filename too long.\n"); ++ exit(EXIT_FAILURE); ++ } ++ + if (opt.thumb) + opt.thumb_file = name_thumbnail(opt.output_file); + } + +## fix-beeping.dpatch by Ibragimov Rinat +## DP: Fix missing option for beep prevention. + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -49,6 +49,9 @@ + .B -t, --thumb NUM + generate thumbnail too. NUM is the percentage of the original size for the + thumbnail to be. ++.TP 5 ++.B -z, --silent ++prevent beeping. + .SH SPECIAL STRINGS + Both the + .B --exec +--- scrot-0.8-orig/src/main.c ++++ scrot-0.8/src/main.c +@@ -154,7 +154,7 @@ + { + Imlib_Image im; + +- XBell(disp, 0); ++ if (! opt.silent) XBell(disp, 0); + im = + gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width, + scr->height, 1); +@@ -336,7 +336,7 @@ + } + scrot_nice_clip(&rx, &ry, &rw, &rh); + +- XBell(disp, 0); ++ if (! opt.silent) XBell(disp, 0); + im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); + } + return im; +--- scrot-0.8-orig/src/options.c ++++ scrot-0.8/src/options.c +@@ -44,7 +44,7 @@ + static void + scrot_parse_option_array(int argc, char **argv) + { +- static char stropts[] = "bcd:e:hmq:st:uv+:"; ++ static char stropts[] = "bcd:e:hmq:st:uv+:z"; + static struct option lopts[] = { + /* actions */ + {"help", 0, 0, 'h'}, /* okay */ +@@ -55,6 +55,7 @@ + {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ + {"border", 0, 0, 'b'}, + {"multidisp", 0, 0, 'm'}, ++ {"silent", 0, 0, 'z'}, + /* toggles */ + {"thumb", 1, 0, 't'}, + {"delay", 1, 0, 'd'}, +@@ -109,6 +110,9 @@ + case 't': + options_parse_thumbnail(optarg); + break; ++ case 'z': ++ opt.silent = 1; ++ break; + default: + break; + } +@@ -246,6 +250,7 @@ + " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" + " of the original size for the thumbnail to be,\n" + " or the geometry in percent, e.g. 50x60 or 80x20.\n" ++ " -z, --silent Prevent beeping\n" + "\n" " SPECIAL STRINGS\n" + " Both the --exec and filename parameters can take format specifiers\n" + " that are expanded by " PACKAGE " when encountered.\n" +--- scrot-0.8-orig/src/options.h ++++ scrot-0.8/src/options.h +@@ -35,6 +35,7 @@ + int focused; + int quality; + int border; ++ int silent; + int multidisp; + int thumb; + int thumb_width; + +## 09_fix-minusign.dpatch by William Vera +## DP: Fix a hyphen-used-as-minus-sign in a manpage. + +--- scrot-0.8-orig/scrot.1 ++++ scrot-0.8/scrot.1 +@@ -93,7 +93,7 @@ + \\n prints a newline (ignored when used in the filename) + .fi + .SH EXAMPLE +-scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' ++scrot '%Y-%m-%d_$wx$h.png' \-e 'mv $f ~/shots/' + .br + This would create a file called something like + 2000-10-30_2560x1024.png and move it to your shots directory. diff -r c7b121a4ffd9 -r d6378d455338 scrot/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scrot/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|scrot.patch diff -r c7b121a4ffd9 -r d6378d455338 scrot/stuff/scrot.patch --- a/scrot/stuff/scrot.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,440 +0,0 @@ -# This patch was created manually from patches found here: -# http://scrot.sourcearchive.com/downloads/0.8-12/scrot_0.8-12.debian.tar.gz - -## 01_manpagefix.dpatch by William Vera -## DP: Character cleanup for UTF-8 compatibility. - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -87,7 +87,7 @@ - \\n prints a newline (ignored when used in the filename) - .fi - .SH EXAMPLE --scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' -+scrot '%Y\-%m\-%d_$wx$h.png' \-e 'mv $f ~/shots/' - .br - This would create a file called something like - 2000-10-30_2560x1024.png and move it to your shots directory. - -## 02_options.c.dpatch by William Vera -## DP: A little fix for wrong words. - ---- scrot-0.8-orig/src/options.c -+++ scrot-0.8/src/options.c -@@ -229,7 +229,7 @@ - " low quality means high compression.\n" - " -m, --multidisp For multiple heads, grab shot from each\n" - " and join them together.\n" -- " -s, --select interactively choose a window or rectnagle\n" -+ " -s, --select interactively choose a window or rectangle\n" - " with the mouse\n" - " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" - " of the original size for the thumbnail to be,\n" -@@ -238,7 +238,7 @@ - " Both the --exec and filename parameters can take format specifiers\n" - " that are expanded by " PACKAGE " when encountered.\n" - " There are two types of format specifier. Characters preceded by a '%%'\n" -- " are interpretted by strftime(2). See man strftime for examples.\n" -+ " are interpreted by strftime(2). See man strftime for examples.\n" - " These options may be used to refer to the current date and time.\n" - " The second kind are internal to " PACKAGE - " and are prefixed by '$'\n" - -## 003_descmanpage.dpatch by William Vera -## DP: Change the description on manpage. - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -1,6 +1,6 @@ - .TH scrot 1 "Oct 26, 2000" - .SH NAME --scrot - Screen capture using imlib2 -+scrot - capture a screenshot using imlib2 - .SH SYNOPSIS - scrot [options] [file] - .SH DESCRIPTION - -## 04-focused.dpatch by James Cameron -## DP: src/options.c (scrot_parse_option_array): add --focused option. -## DP: src/main.c (scrot_get_geometry, scrot_nice_clip): new functions -## for common code used by both selected and focused screenshot. -## DP: src/main.c (scrot_grab_focused): new function to grab currently -## focused window after specified delay. - ---- scrot-0.8-orig/src/options.h -+++ scrot-0.8/src/options.h -@@ -32,6 +32,7 @@ - int delay; - int countdown; - int select; -+ int focused; - int quality; - int border; - int multidisp; ---- scrot-0.8-orig/src/options.c -+++ scrot-0.8/src/options.c -@@ -44,13 +44,15 @@ - static void - scrot_parse_option_array(int argc, char **argv) - { -- static char stropts[] = "bcd:e:hmq:st:v+:"; -+ static char stropts[] = "bcd:e:hmq:st:uv+:"; - static struct option lopts[] = { - /* actions */ - {"help", 0, 0, 'h'}, /* okay */ - {"version", 0, 0, 'v'}, /* okay */ - {"count", 0, 0, 'c'}, - {"select", 0, 0, 's'}, -+ {"focused", 0, 0, 'u'}, -+ {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ - {"border", 0, 0, 'b'}, - {"multidisp", 0, 0, 'm'}, - /* toggles */ -@@ -95,6 +97,9 @@ - case 's': - opt.select = 1; - break; -+ case 'u': -+ opt.focused = 1; -+ break; - case '+': - opt.debug_level = atoi(optarg); - break; -@@ -231,6 +236,7 @@ - " and join them together.\n" - " -s, --select interactively choose a window or rectangle\n" - " with the mouse\n" -+ " -u, --focused use the currently focused window\n" - " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" - " of the original size for the thumbnail to be,\n" - " or the geometry in percent, e.g. 50x60 or 80x20.\n" ---- scrot-0.8-orig/src/scrot.h -+++ scrot-0.8/src/scrot.h -@@ -72,7 +72,10 @@ - char *filename_im, char *filename_thumb); - void scrot_do_delay(void); - Imlib_Image scrot_sel_and_grab_image(void); -+Imlib_Image scrot_grab_focused(void); - void scrot_sel_area(int *x, int *y, int *w, int *h); -+void scrot_nice_clip(int *rx, int *ry, int *rw, int *rh); -+int scrot_get_geometry(Window target, int *rx, int *ry, int *rw, int *rh); - Window scrot_get_window(Display *display,Window window,int x,int y); - Window scrot_get_client_window(Display * display, Window target); - Window scrot_find_window_by_property(Display * display, const Window window, ---- scrot-0.8-orig/src/main.c -+++ scrot-0.8/src/main.c -@@ -48,7 +48,9 @@ - } - - -- if (opt.select) -+ if (opt.focused) -+ image = scrot_grab_focused(); -+ else if (opt.select) - image = scrot_sel_and_grab_image(); - else { - scrot_do_delay(); -@@ -171,6 +173,22 @@ - } - - Imlib_Image -+scrot_grab_focused(void) -+{ -+ Imlib_Image im = NULL; -+ int rx = 0, ry = 0, rw = 0, rh = 0; -+ Window target = None; -+ int ignored; -+ -+ scrot_do_delay(); -+ XGetInputFocus(disp, &target, &ignored); -+ if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; -+ scrot_nice_clip(&rx, &ry, &rw, &rh); -+ im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); -+ return im; -+} -+ -+Imlib_Image - scrot_sel_and_grab_image(void) - { - Imlib_Image im = NULL; -@@ -313,57 +331,10 @@ - rh = 0 - rh; - } - } else { -- Window child; -- XWindowAttributes attr; -- int stat; -- - /* else it's a window click */ -- /* get geometry of window and use that */ -- /* get windowmanager frame of window */ -- if (target != root) { -- unsigned int d, x; -- int status; -- -- status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); -- if (status != 0) { -- Window rt, *children, parent; -- -- for (;;) { -- /* Find window manager frame. */ -- status = XQueryTree(disp, target, &rt, &parent, &children, &d); -- if (status && (children != None)) -- XFree((char *) children); -- if (!status || (parent == None) || (parent == rt)) -- break; -- target = parent; -- } -- /* Get client window. */ -- if (!opt.border) -- target = scrot_get_client_window(disp, target); -- XRaiseWindow(disp, target); -- } -- } -- stat = XGetWindowAttributes(disp, target, &attr); -- if ((stat == False) || (attr.map_state != IsViewable)) -- return NULL; -- rw = attr.width; -- rh = attr.height; -- XTranslateCoordinates(disp, target, root, 0, 0, &rx, &ry, &child); -+ if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; - } -- -- /* clip rectangle nicely */ -- if (rx < 0) { -- rw += rx; -- rx = 0; -- } -- if (ry < 0) { -- rh += ry; -- ry = 0; -- } -- if ((rx + rw) > scr->width) -- rw = scr->width - rx; -- if ((ry + rh) > scr->height) -- rh = scr->height - ry; -+ scrot_nice_clip(&rx, &ry, &rw, &rh); - - XBell(disp, 0); - im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); -@@ -371,6 +342,72 @@ - return im; - } - -+/* clip rectangle nicely */ -+void -+scrot_nice_clip(int *rx, -+ int *ry, -+ int *rw, -+ int *rh) -+{ -+ if (*rx < 0) { -+ *rw += *rx; -+ *rx = 0; -+ } -+ if (*ry < 0) { -+ *rh += *ry; -+ *ry = 0; -+ } -+ if ((*rx + *rw) > scr->width) -+ *rw = scr->width - *rx; -+ if ((*ry + *rh) > scr->height) -+ *rh = scr->height - *ry; -+} -+ -+/* get geometry of window and use that */ -+int -+scrot_get_geometry(Window target, -+ int *rx, -+ int *ry, -+ int *rw, -+ int *rh) -+{ -+ Window child; -+ XWindowAttributes attr; -+ int stat; -+ -+ /* get windowmanager frame of window */ -+ if (target != root) { -+ unsigned int d, x; -+ int status; -+ -+ status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); -+ if (status != 0) { -+ Window rt, *children, parent; -+ -+ for (;;) { -+ /* Find window manager frame. */ -+ status = XQueryTree(disp, target, &rt, &parent, &children, &d); -+ if (status && (children != None)) -+ XFree((char *) children); -+ if (!status || (parent == None) || (parent == rt)) -+ break; -+ target = parent; -+ } -+ /* Get client window. */ -+ if (!opt.border) -+ target = scrot_get_client_window(disp, target); -+ XRaiseWindow(disp, target); -+ } -+ } -+ stat = XGetWindowAttributes(disp, target, &attr); -+ if ((stat == False) || (attr.map_state != IsViewable)) -+ return 0; -+ *rw = attr.width; -+ *rh = attr.height; -+ XTranslateCoordinates(disp, target, root, 0, 0, rx, ry, &child); -+ return 1; -+} -+ - Window - scrot_get_window(Display * display, - Window window, - -## 05-addfocusedmanpage.dpatch by William Vera -## DP: Add a new option in the man page (focused option). - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -43,6 +43,9 @@ - .B -s, --select - Interactively select a window or rectangle with the mouse. - .TP 5 -+.B -u, --focused -+Use the currently focused window. -+.TP 5 - .B -t, --thumb NUM - generate thumbnail too. NUM is the percentage of the original size for the - thumbnail to be. - -## 06_manpagespace.dpatch by William Vera -## DP: Improve spacing in manual page. - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -58,7 +58,7 @@ - These options may be used to refer to the current date and time. - The second kind are internal to scrot and are prefixed by '$' - The following specifiers are recognised: --.br -+.PP - .B $f - image path/filename (ignored when used in the filename) - .br - -## 07_fix-formatstring.dpatch by George Danchev -## DP: Prevent arbitrary long file names - ---- scrot-0.8-orig/src/options.c -+++ scrot-0.8/src/options.c -@@ -124,6 +124,12 @@ - if (!opt.output_file) - { - opt.output_file = argv[optind++]; -+ -+ if ( strlen(opt.output_file) > 256 ) { -+ printf("output filename too long.\n"); -+ exit(EXIT_FAILURE); -+ } -+ - if (opt.thumb) - opt.thumb_file = name_thumbnail(opt.output_file); - } - -## fix-beeping.dpatch by Ibragimov Rinat -## DP: Fix missing option for beep prevention. - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -49,6 +49,9 @@ - .B -t, --thumb NUM - generate thumbnail too. NUM is the percentage of the original size for the - thumbnail to be. -+.TP 5 -+.B -z, --silent -+prevent beeping. - .SH SPECIAL STRINGS - Both the - .B --exec ---- scrot-0.8-orig/src/main.c -+++ scrot-0.8/src/main.c -@@ -154,7 +154,7 @@ - { - Imlib_Image im; - -- XBell(disp, 0); -+ if (! opt.silent) XBell(disp, 0); - im = - gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width, - scr->height, 1); -@@ -336,7 +336,7 @@ - } - scrot_nice_clip(&rx, &ry, &rw, &rh); - -- XBell(disp, 0); -+ if (! opt.silent) XBell(disp, 0); - im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); - } - return im; ---- scrot-0.8-orig/src/options.c -+++ scrot-0.8/src/options.c -@@ -44,7 +44,7 @@ - static void - scrot_parse_option_array(int argc, char **argv) - { -- static char stropts[] = "bcd:e:hmq:st:uv+:"; -+ static char stropts[] = "bcd:e:hmq:st:uv+:z"; - static struct option lopts[] = { - /* actions */ - {"help", 0, 0, 'h'}, /* okay */ -@@ -55,6 +55,7 @@ - {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ - {"border", 0, 0, 'b'}, - {"multidisp", 0, 0, 'm'}, -+ {"silent", 0, 0, 'z'}, - /* toggles */ - {"thumb", 1, 0, 't'}, - {"delay", 1, 0, 'd'}, -@@ -109,6 +110,9 @@ - case 't': - options_parse_thumbnail(optarg); - break; -+ case 'z': -+ opt.silent = 1; -+ break; - default: - break; - } -@@ -246,6 +250,7 @@ - " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" - " of the original size for the thumbnail to be,\n" - " or the geometry in percent, e.g. 50x60 or 80x20.\n" -+ " -z, --silent Prevent beeping\n" - "\n" " SPECIAL STRINGS\n" - " Both the --exec and filename parameters can take format specifiers\n" - " that are expanded by " PACKAGE " when encountered.\n" ---- scrot-0.8-orig/src/options.h -+++ scrot-0.8/src/options.h -@@ -35,6 +35,7 @@ - int focused; - int quality; - int border; -+ int silent; - int multidisp; - int thumb; - int thumb_width; - -## 09_fix-minusign.dpatch by William Vera -## DP: Fix a hyphen-used-as-minus-sign in a manpage. - ---- scrot-0.8-orig/scrot.1 -+++ scrot-0.8/scrot.1 -@@ -93,7 +93,7 @@ - \\n prints a newline (ignored when used in the filename) - .fi - .SH EXAMPLE --scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' -+scrot '%Y-%m-%d_$wx$h.png' \-e 'mv $f ~/shots/' - .br - This would create a file called something like - 2000-10-30_2560x1024.png and move it to your shots directory. diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/receipt --- a/seamonkey/receipt Wed May 09 17:03:28 2018 +0300 +++ b/seamonkey/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,10 +21,8 @@ compile_rules() { cp -a $stuff/seamonkey.mozconfig $src/.mozconfig - cd $src sed -i -e 's/USE_INPUT_PARTITION/USE_INPUT_FRAGMENTS/' \ -e 's/0.9.7/1.0.0/' mozilla/configure.in mozilla/configure - #patch -p1 -i $stuff/google-breakpad.u || exit 1 cat >> mozilla/layout/build/Makefile.in << "EOF" ifdef MOZ_ENABLE_CANVAS EXTRA_DSO_LDOPTS += $(XLDFLAGS) -lX11 -lXrender @@ -32,8 +30,6 @@ EOF unset CFLAGS unset CXXFLAGS - patch -Np1 -i $stuff/seamonkey-2.0-lang.patch - patch -Np1 -i $stuff/seamonkey-install-dir.patch export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/seamonkey" ./configure $CONFIGURE_ARGS 2>&1 | grep -v 'cthandlers/calendar/Makefile.in' && make && diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/google-breakpad.u --- a/seamonkey/stuff/google-breakpad.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Mon Jan 4 22:04:19 2010 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Mon Jan 18 16:04:10 2010 -@@ -29,6 +29,7 @@ - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -+#include - #include - #include - #include ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc Mon Jan 4 22:04:19 2010 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc Mon Jan 18 16:02:40 2010 -@@ -29,6 +29,7 @@ - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -+#include - #include - #include - #include ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Mon Jan 4 22:04:19 2010 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Mon Jan 18 16:03:26 2010 -@@ -27,6 +27,7 @@ - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -+#include - #include - #include - #include diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/linux-remove.patch --- a/seamonkey/stuff/linux-remove.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -Index: mozilla/security/coreconf/Linux2.1.mk -=================================================================== -RCS file: mozilla/security/coreconf/Linux2.1.mk -diff -N mozilla/security/coreconf/Linux2.1.mk ---- mozilla/security/coreconf/Linux2.1.mk 11 Jun 2009 00:55:32 -0000 1.7 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,48 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk --ifeq ($(OS_RELEASE),2.1) -- OS_REL_CFLAGS += -DLINUX2_1 -- MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -- ifdef MAPFILE -- MKSHLIB += -Wl,--version-script,$(MAPFILE) -- endif -- PROCESS_MAP_FILE = grep -v ';-' $< | \ -- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ --endif -- -Index: mozilla/security/coreconf/Linux2.2.mk -=================================================================== -RCS file: mozilla/security/coreconf/Linux2.2.mk -diff -N mozilla/security/coreconf/Linux2.2.mk ---- mozilla/security/coreconf/Linux2.2.mk 11 Jun 2009 00:55:32 -0000 1.7 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,48 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk -- --OS_REL_CFLAGS += -DLINUX2_1 --MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -- --ifdef MAPFILE -- MKSHLIB += -Wl,--version-script,$(MAPFILE) --endif --PROCESS_MAP_FILE = grep -v ';-' $< | \ -- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ -- -Index: mozilla/security/coreconf/Linux2.4.mk -=================================================================== -RCS file: mozilla/security/coreconf/Linux2.4.mk -diff -N mozilla/security/coreconf/Linux2.4.mk ---- mozilla/security/coreconf/Linux2.4.mk 21 Jul 2010 16:23:15 -0000 1.10 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,49 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk -- --OS_REL_CFLAGS += -DLINUX2_1 --MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -- --ifdef MAPFILE -- MKSHLIB += -Wl,--version-script,$(MAPFILE) --endif --PROCESS_MAP_FILE = grep -v ';-' $< | \ -- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ -- --DEFINES += -DNO_FORK_CHECK -Index: mozilla/security/coreconf/Linux2.5.mk -=================================================================== -RCS file: mozilla/security/coreconf/Linux2.5.mk -diff -N mozilla/security/coreconf/Linux2.5.mk ---- mozilla/security/coreconf/Linux2.5.mk 11 Jun 2009 00:55:32 -0000 1.6 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,48 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk -- --OS_REL_CFLAGS += -DLINUX2_1 --MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -- --ifdef MAPFILE -- MKSHLIB += -Wl,--version-script,$(MAPFILE) --endif --PROCESS_MAP_FILE = grep -v ';-' $< | \ -- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ -- -Index: mozilla/security/coreconf/Linux2.6.mk -=================================================================== -RCS file: mozilla/security/coreconf/Linux2.6.mk -diff -N mozilla/security/coreconf/Linux2.6.mk ---- mozilla/security/coreconf/Linux2.6.mk 11 Jun 2009 00:55:32 -0000 1.6 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,48 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk -- --OS_REL_CFLAGS += -DLINUX2_1 --MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -- --ifdef MAPFILE -- MKSHLIB += -Wl,--version-script,$(MAPFILE) --endif --PROCESS_MAP_FILE = grep -v ';-' $< | \ -- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ -- -Index: mozilla/security/coreconf/LinuxELF1.2.mk -=================================================================== -RCS file: mozilla/security/coreconf/LinuxELF1.2.mk -diff -N mozilla/security/coreconf/LinuxELF1.2.mk ---- mozilla/security/coreconf/LinuxELF1.2.mk 25 Apr 2004 15:02:17 -0000 1.2 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,38 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk -Index: mozilla/security/coreconf/LinuxELF2.0.mk -=================================================================== -RCS file: mozilla/security/coreconf/LinuxELF2.0.mk -diff -N mozilla/security/coreconf/LinuxELF2.0.mk ---- mozilla/security/coreconf/LinuxELF2.0.mk 25 Apr 2004 15:02:17 -0000 1.2 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,38 +0,0 @@ --# --# ***** BEGIN LICENSE BLOCK ***** --# Version: MPL 1.1/GPL 2.0/LGPL 2.1 --# --# The contents of this file are subject to the Mozilla Public License Version --# 1.1 (the "License"); you may not use this file except in compliance with --# the License. You may obtain a copy of the License at --# http://www.mozilla.org/MPL/ --# --# Software distributed under the License is distributed on an "AS IS" basis, --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License --# for the specific language governing rights and limitations under the --# License. --# --# The Original Code is the Netscape security libraries. --# --# The Initial Developer of the Original Code is --# Netscape Communications Corporation. --# Portions created by the Initial Developer are Copyright (C) 1994-2000 --# the Initial Developer. All Rights Reserved. --# --# Contributor(s): --# --# Alternatively, the contents of this file may be used under the terms of --# either the GNU General Public License Version 2 or later (the "GPL"), or --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), --# in which case the provisions of the GPL or the LGPL are applicable instead --# of those above. If you wish to allow use of your version of this file only --# under the terms of either the GPL or the LGPL, and not to allow others to --# use your version of this file under the terms of the MPL, indicate your --# decision by deleting the provisions above and replace them with the notice --# and other provisions required by the GPL or the LGPL. If you do not delete --# the provisions above, a recipient may use your version of this file under --# the terms of any one of the MPL, the GPL or the LGPL. --# --# ***** END LICENSE BLOCK ***** -- --include $(CORE_DEPTH)/coreconf/Linux.mk diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/linux3.0.patch --- a/seamonkey/stuff/linux3.0.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -Index: mozilla/security/coreconf/Linux.mk -=================================================================== -RCS file: /cvsroot/mozilla/security/coreconf/Linux.mk,v -retrieving revision 1.48 -diff -u -8 -r1.48 Linux.mk ---- mozilla/security/coreconf/Linux.mk 13 Aug 2010 01:31:13 -0000 1.48 -+++ mozilla/security/coreconf/Linux.mk 3 Jul 2011 06:00:38 -0000 -@@ -187,8 +187,20 @@ - ifeq ($(BUILD_SUN_PKG), 1) - ifeq ($(USE_64), 1) - RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib' - else - RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib' - endif - endif - -+OS_REL_CFLAGS += -DLINUX2_1 -+MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) -+ -+ifdef MAPFILE -+ MKSHLIB += -Wl,--version-script,$(MAPFILE) -+endif -+PROCESS_MAP_FILE = grep -v ';-' $< | \ -+ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ -+ -+ifeq ($(OS_RELEASE),2.4) -+DEFINES += -DNO_FORK_CHECK -+endif -Index: mozilla/security/coreconf/config.mk -=================================================================== -RCS file: /cvsroot/mozilla/security/coreconf/config.mk,v -retrieving revision 1.30 -diff -u -8 -r1.30 config.mk ---- mozilla/security/coreconf/config.mk 25 Aug 2009 22:35:11 -0000 1.30 -+++ mozilla/security/coreconf/config.mk 3 Jul 2011 06:00:39 -0000 -@@ -58,17 +58,17 @@ - # (dependent upon tags) # - # # - # We are moving towards just having a $(OS_TARGET).mk file # - # as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files, # - # one for each OS release. # - ####################################################################### - - TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \ -- AIX RISCOS WINNT WIN95 WINCE -+ AIX RISCOS WINNT WIN95 WINCE Linux - - ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET))) - include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk - else - include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk - endif - - ####################################################################### diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/google-breakpad.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/google-breakpad.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,30 @@ +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Mon Jan 4 22:04:19 2010 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Mon Jan 18 16:04:10 2010 +@@ -29,6 +29,7 @@ + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ++#include + #include + #include + #include +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc Mon Jan 4 22:04:19 2010 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc Mon Jan 18 16:02:40 2010 +@@ -29,6 +29,7 @@ + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ++#include + #include + #include + #include +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Mon Jan 4 22:04:19 2010 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Mon Jan 18 16:03:26 2010 +@@ -27,6 +27,7 @@ + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ++#include + #include + #include + #include diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/linux-remove.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/linux-remove.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,366 @@ +Index: mozilla/security/coreconf/Linux2.1.mk +=================================================================== +RCS file: mozilla/security/coreconf/Linux2.1.mk +diff -N mozilla/security/coreconf/Linux2.1.mk +--- mozilla/security/coreconf/Linux2.1.mk 11 Jun 2009 00:55:32 -0000 1.7 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,48 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +-ifeq ($(OS_RELEASE),2.1) +- OS_REL_CFLAGS += -DLINUX2_1 +- MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) +- ifdef MAPFILE +- MKSHLIB += -Wl,--version-script,$(MAPFILE) +- endif +- PROCESS_MAP_FILE = grep -v ';-' $< | \ +- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +-endif +- +Index: mozilla/security/coreconf/Linux2.2.mk +=================================================================== +RCS file: mozilla/security/coreconf/Linux2.2.mk +diff -N mozilla/security/coreconf/Linux2.2.mk +--- mozilla/security/coreconf/Linux2.2.mk 11 Jun 2009 00:55:32 -0000 1.7 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,48 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +- +-OS_REL_CFLAGS += -DLINUX2_1 +-MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) +- +-ifdef MAPFILE +- MKSHLIB += -Wl,--version-script,$(MAPFILE) +-endif +-PROCESS_MAP_FILE = grep -v ';-' $< | \ +- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +- +Index: mozilla/security/coreconf/Linux2.4.mk +=================================================================== +RCS file: mozilla/security/coreconf/Linux2.4.mk +diff -N mozilla/security/coreconf/Linux2.4.mk +--- mozilla/security/coreconf/Linux2.4.mk 21 Jul 2010 16:23:15 -0000 1.10 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,49 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +- +-OS_REL_CFLAGS += -DLINUX2_1 +-MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) +- +-ifdef MAPFILE +- MKSHLIB += -Wl,--version-script,$(MAPFILE) +-endif +-PROCESS_MAP_FILE = grep -v ';-' $< | \ +- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +- +-DEFINES += -DNO_FORK_CHECK +Index: mozilla/security/coreconf/Linux2.5.mk +=================================================================== +RCS file: mozilla/security/coreconf/Linux2.5.mk +diff -N mozilla/security/coreconf/Linux2.5.mk +--- mozilla/security/coreconf/Linux2.5.mk 11 Jun 2009 00:55:32 -0000 1.6 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,48 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +- +-OS_REL_CFLAGS += -DLINUX2_1 +-MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) +- +-ifdef MAPFILE +- MKSHLIB += -Wl,--version-script,$(MAPFILE) +-endif +-PROCESS_MAP_FILE = grep -v ';-' $< | \ +- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +- +Index: mozilla/security/coreconf/Linux2.6.mk +=================================================================== +RCS file: mozilla/security/coreconf/Linux2.6.mk +diff -N mozilla/security/coreconf/Linux2.6.mk +--- mozilla/security/coreconf/Linux2.6.mk 11 Jun 2009 00:55:32 -0000 1.6 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,48 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +- +-OS_REL_CFLAGS += -DLINUX2_1 +-MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) +- +-ifdef MAPFILE +- MKSHLIB += -Wl,--version-script,$(MAPFILE) +-endif +-PROCESS_MAP_FILE = grep -v ';-' $< | \ +- sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +- +Index: mozilla/security/coreconf/LinuxELF1.2.mk +=================================================================== +RCS file: mozilla/security/coreconf/LinuxELF1.2.mk +diff -N mozilla/security/coreconf/LinuxELF1.2.mk +--- mozilla/security/coreconf/LinuxELF1.2.mk 25 Apr 2004 15:02:17 -0000 1.2 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,38 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk +Index: mozilla/security/coreconf/LinuxELF2.0.mk +=================================================================== +RCS file: mozilla/security/coreconf/LinuxELF2.0.mk +diff -N mozilla/security/coreconf/LinuxELF2.0.mk +--- mozilla/security/coreconf/LinuxELF2.0.mk 25 Apr 2004 15:02:17 -0000 1.2 ++++ /dev/null 1 Jan 1970 00:00:00 -0000 +@@ -1,38 +0,0 @@ +-# +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the Netscape security libraries. +-# +-# The Initial Developer of the Original Code is +-# Netscape Communications Corporation. +-# Portions created by the Initial Developer are Copyright (C) 1994-2000 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-include $(CORE_DEPTH)/coreconf/Linux.mk diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/linux3.0.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/linux3.0.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,54 @@ +Index: mozilla/security/coreconf/Linux.mk +=================================================================== +RCS file: /cvsroot/mozilla/security/coreconf/Linux.mk,v +retrieving revision 1.48 +diff -u -8 -r1.48 Linux.mk +--- mozilla/security/coreconf/Linux.mk 13 Aug 2010 01:31:13 -0000 1.48 ++++ mozilla/security/coreconf/Linux.mk 3 Jul 2011 06:00:38 -0000 +@@ -187,8 +187,20 @@ + ifeq ($(BUILD_SUN_PKG), 1) + ifeq ($(USE_64), 1) + RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib' + else + RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib' + endif + endif + ++OS_REL_CFLAGS += -DLINUX2_1 ++MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) ++ ++ifdef MAPFILE ++ MKSHLIB += -Wl,--version-script,$(MAPFILE) ++endif ++PROCESS_MAP_FILE = grep -v ';-' $< | \ ++ sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ ++ ++ifeq ($(OS_RELEASE),2.4) ++DEFINES += -DNO_FORK_CHECK ++endif +Index: mozilla/security/coreconf/config.mk +=================================================================== +RCS file: /cvsroot/mozilla/security/coreconf/config.mk,v +retrieving revision 1.30 +diff -u -8 -r1.30 config.mk +--- mozilla/security/coreconf/config.mk 25 Aug 2009 22:35:11 -0000 1.30 ++++ mozilla/security/coreconf/config.mk 3 Jul 2011 06:00:39 -0000 +@@ -58,17 +58,17 @@ + # (dependent upon tags) # + # # + # We are moving towards just having a $(OS_TARGET).mk file # + # as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files, # + # one for each OS release. # + ####################################################################### + + TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \ +- AIX RISCOS WINNT WIN95 WINCE ++ AIX RISCOS WINNT WIN95 WINCE Linux + + ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET))) + include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk + else + include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk + endif + + ####################################################################### diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/seamonkey-2.0-lang.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/seamonkey-2.0-lang.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- comm-1.9.1/mozilla/modules/libpref/src/init/all.js 2009-10-11 02:12:44.000000000 +0200 ++++ comm-1.9.1/mozilla/modules/libpref/src/init/all.js 2009-09-16 02:56:45.000000000 +0200 +@@ -890,7 +890,7 @@ + pref("intl.charset.detector", "chrome://global/locale/intl.properties"); + pref("intl.charset.default", "chrome://global-platform/locale/intl.properties"); + pref("intl.ellipsis", "chrome://global-platform/locale/intl.properties"); +-pref("intl.locale.matchOS", false); ++pref("intl.locale.matchOS", true); + // fallback charset list for Unicode conversion (converting from Unicode) + // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes) + // for ISO-8859-1 diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/seamonkey-install-dir.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/seamonkey-install-dir.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,42 @@ +diff -Nur comm-beta.orig/config/autoconf.mk.in comm-beta/config/autoconf.mk.in +--- comm-beta.orig/config/autoconf.mk.in 2011-11-06 14:39:51.064983780 +0000 ++++ comm-beta/config/autoconf.mk.in 2011-11-06 14:42:57.216735333 +0000 +@@ -65,8 +65,8 @@ + mandir = @mandir@ + idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) + +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/$(MOZ_APP_NAME) ++sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel + + MOZDEPTH = $(DEPTH)/mozilla + DIST = $(MOZDEPTH)/dist +diff -Nur comm-beta.orig/mozilla/config/autoconf.mk.in comm-beta/mozilla/config/autoconf.mk.in +--- comm-beta.orig/mozilla/config/autoconf.mk.in 2011-11-06 14:39:41.771562967 +0000 ++++ comm-beta/mozilla/config/autoconf.mk.in 2011-11-06 14:44:18.404165515 +0000 +@@ -68,8 +68,8 @@ + mandir = @mandir@ + idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) + +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/$(MOZ_APP_NAME) ++sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel + + DIST = $(DEPTH)/dist + LIBXUL_SDK = @LIBXUL_SDK@ +diff -Nur comm-beta.orig/mozilla/js/src/config/autoconf.mk.in comm-beta/mozilla/js/src/config/autoconf.mk.in +--- comm-beta.orig/mozilla/js/src/config/autoconf.mk.in 2011-11-06 14:39:48.014955070 +0000 ++++ comm-beta/mozilla/js/src/config/autoconf.mk.in 2011-11-06 14:44:32.977635875 +0000 +@@ -61,8 +61,8 @@ + datadir = @datadir@ + mandir = @mandir@ + +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/$(MOZ_APP_NAME) ++sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel + + TOP_DIST = @TOP_DIST@ + ifneq (,$(filter /%,$(TOP_DIST))) diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seamonkey/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +#-p1|google-breakpad.u +seamonkey-2.0-lang.patch +seamonkey-install-dir.patch diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/seamonkey-2.0-lang.patch --- a/seamonkey/stuff/seamonkey-2.0-lang.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- comm-1.9.1/mozilla/modules/libpref/src/init/all.js 2009-10-11 02:12:44.000000000 +0200 -+++ comm-1.9.1/mozilla/modules/libpref/src/init/all.js 2009-09-16 02:56:45.000000000 +0200 -@@ -890,7 +890,7 @@ - pref("intl.charset.detector", "chrome://global/locale/intl.properties"); - pref("intl.charset.default", "chrome://global-platform/locale/intl.properties"); - pref("intl.ellipsis", "chrome://global-platform/locale/intl.properties"); --pref("intl.locale.matchOS", false); -+pref("intl.locale.matchOS", true); - // fallback charset list for Unicode conversion (converting from Unicode) - // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes) - // for ISO-8859-1 diff -r c7b121a4ffd9 -r d6378d455338 seamonkey/stuff/seamonkey-install-dir.patch --- a/seamonkey/stuff/seamonkey-install-dir.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -diff -Nur comm-beta.orig/config/autoconf.mk.in comm-beta/config/autoconf.mk.in ---- comm-beta.orig/config/autoconf.mk.in 2011-11-06 14:39:51.064983780 +0000 -+++ comm-beta/config/autoconf.mk.in 2011-11-06 14:42:57.216735333 +0000 -@@ -65,8 +65,8 @@ - mandir = @mandir@ - idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) - --installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) --sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) -+installdir = $(libdir)/$(MOZ_APP_NAME) -+sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel - - MOZDEPTH = $(DEPTH)/mozilla - DIST = $(MOZDEPTH)/dist -diff -Nur comm-beta.orig/mozilla/config/autoconf.mk.in comm-beta/mozilla/config/autoconf.mk.in ---- comm-beta.orig/mozilla/config/autoconf.mk.in 2011-11-06 14:39:41.771562967 +0000 -+++ comm-beta/mozilla/config/autoconf.mk.in 2011-11-06 14:44:18.404165515 +0000 -@@ -68,8 +68,8 @@ - mandir = @mandir@ - idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) - --installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) --sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) -+installdir = $(libdir)/$(MOZ_APP_NAME) -+sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel - - DIST = $(DEPTH)/dist - LIBXUL_SDK = @LIBXUL_SDK@ -diff -Nur comm-beta.orig/mozilla/js/src/config/autoconf.mk.in comm-beta/mozilla/js/src/config/autoconf.mk.in ---- comm-beta.orig/mozilla/js/src/config/autoconf.mk.in 2011-11-06 14:39:48.014955070 +0000 -+++ comm-beta/mozilla/js/src/config/autoconf.mk.in 2011-11-06 14:44:32.977635875 +0000 -@@ -61,8 +61,8 @@ - datadir = @datadir@ - mandir = @mandir@ - --installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) --sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) -+installdir = $(libdir)/$(MOZ_APP_NAME) -+sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel - - TOP_DIST = @TOP_DIST@ - ifneq (,$(filter /%,$(TOP_DIST))) diff -r c7b121a4ffd9 -r d6378d455338 setserial/receipt --- a/setserial/receipt Wed May 09 17:03:28 2018 +0300 +++ b/setserial/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,10 +15,6 @@ { mkdir -p $DESTDIR/usr/bin - # http://bugs.gentoo.org/309883 - # & remove warnings - patch -p1 < $stuff/setserial-2.17.u || return 1 - ./configure \ --prefix=/usr \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 setserial/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setserial/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +# http://bugs.gentoo.org/309883 +# & remove warnings +-p1|setserial-2.17.u diff -r c7b121a4ffd9 -r d6378d455338 setserial/stuff/patches/setserial-2.17.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setserial/stuff/patches/setserial-2.17.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,24 @@ +--- setserial-2.17-ori/setserial.c.orig 2000-01-27 16:40:52.000000000 +0100 ++++ setserial-2.17/setserial.c 2010-03-25 21:48:21.554872081 +0100 +@@ -24,6 +24,8 @@ + #endif + #include + ++#undef TIOCGHAYESESP ++ + #include "version.h" + + static char version_str[] = "setserial version " SETSERIAL_VERSION ", " + +Common subdirectories: setserial-2.17-ori/Documentation and setserial-2.17/Documentation +Common subdirectories: setserial-2.17-ori/linux and setserial-2.17/linux +--- setserial-2.17-ori/setserial.c Thu Jan 27 16:40:52 2000 ++++ setserial-2.17/setserial.c Thu Jul 22 09:51:23 2010 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_ASM_IOCTLS_H + #include diff -r c7b121a4ffd9 -r d6378d455338 setserial/stuff/setserial-2.17.u --- a/setserial/stuff/setserial-2.17.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ ---- setserial-2.17-ori/setserial.c.orig 2000-01-27 16:40:52.000000000 +0100 -+++ setserial-2.17/setserial.c 2010-03-25 21:48:21.554872081 +0100 -@@ -24,6 +24,8 @@ - #endif - #include - -+#undef TIOCGHAYESESP -+ - #include "version.h" - - static char version_str[] = "setserial version " SETSERIAL_VERSION ", " - -Common subdirectories: setserial-2.17-ori/Documentation and setserial-2.17/Documentation -Common subdirectories: setserial-2.17-ori/linux and setserial-2.17/linux ---- setserial-2.17-ori/setserial.c Thu Jan 27 16:40:52 2000 -+++ setserial-2.17/setserial.c Thu Jul 22 09:51:23 2010 -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #ifdef HAVE_ASM_IOCTLS_H - #include diff -r c7b121a4ffd9 -r d6378d455338 sheerdns/receipt --- a/sheerdns/receipt Wed May 09 17:03:28 2018 +0300 +++ b/sheerdns/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,11 +14,6 @@ compile_rules() { mv $PACKAGE $src 2>/dev/null cd $src - for i in $( cd $stuff ; ls *.u); do - [ -f done.$i ] && continue - patch -p0 < $stuff/$i - touch done.$i - done make || return 1 mkdir -p $install/usr/bin/ $install/var/sheerdns/ diff -r c7b121a4ffd9 -r d6378d455338 sheerdns/stuff/large-subdomains.u --- a/sheerdns/stuff/large-subdomains.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ ---- dir.c -+++ dir.c -@@ -77,16 +77,17 @@ - while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q) - && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA - || qtype == REQ_NS)); -- if (fd == -1) { --/* try lookup "*.example.com" where asking for "nonexistant.example.com": */ -+ for (i = 0; fd == -1; i++) { -+/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */ - char *t; - if (qtype == REQ_SOA || qtype == REQ_NS) /* probably a bad idea to wildcard these, so return */ - return NULL; - q = t = (char *) strdup (s); -- while (*t && *t != '.') -+ for (c = i; *t && *t != '.' || --c >= 0;) - t++; -- if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t) -- || (fd = open (buf, O_RDONLY)) == -1) { -+ t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t) -+ || (fd = open (buf, O_RDONLY)); -+ if (fd == -1 && !*++t ) { - free (q); - return NULL; } - free (q); } - ---- dir.h -+++ dir.h -@@ -11,4 +11,4 @@ - char **directory_lookup (int qtype, unsigned char *s); - time_t get_mtime (int qtype, unsigned char *s); - --#define SHEERDNS_DIR "/var/sheerdns" -+#define SHEERDNS_DIR "/var/sheerdns" diff -r c7b121a4ffd9 -r d6378d455338 sheerdns/stuff/patches/large-subdomains.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sheerdns/stuff/patches/large-subdomains.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,34 @@ +--- dir.c ++++ dir.c +@@ -77,16 +77,17 @@ + while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q) + && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA + || qtype == REQ_NS)); +- if (fd == -1) { +-/* try lookup "*.example.com" where asking for "nonexistant.example.com": */ ++ for (i = 0; fd == -1; i++) { ++/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */ + char *t; + if (qtype == REQ_SOA || qtype == REQ_NS) /* probably a bad idea to wildcard these, so return */ + return NULL; + q = t = (char *) strdup (s); +- while (*t && *t != '.') ++ for (c = i; *t && *t != '.' || --c >= 0;) + t++; +- if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t) +- || (fd = open (buf, O_RDONLY)) == -1) { ++ t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t) ++ || (fd = open (buf, O_RDONLY)); ++ if (fd == -1 && !*++t ) { + free (q); + return NULL; } + free (q); } + +--- dir.h ++++ dir.h +@@ -11,4 +11,4 @@ + char **directory_lookup (int qtype, unsigned char *s); + time_t get_mtime (int qtype, unsigned char *s); + +-#define SHEERDNS_DIR "/var/sheerdns" ++#define SHEERDNS_DIR "/var/sheerdns" diff -r c7b121a4ffd9 -r d6378d455338 sheerdns/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sheerdns/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|large-subdomains.u diff -r c7b121a4ffd9 -r d6378d455338 soundtouch/receipt --- a/soundtouch/receipt Wed May 09 17:03:28 2018 +0300 +++ b/soundtouch/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,7 +17,6 @@ compile_rules() { ./bootstrap sed -i 's|/doc/|/share&|' Makefile* - patch -Np1 -i $stuff/$PACKAGE-1.4.0-mmx-sse-compile-fix.patch ./configure \ --enable-shared \ diff -r c7b121a4ffd9 -r d6378d455338 soundtouch/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/soundtouch/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +soundtouch-1.4.0-mmx-sse-compile-fix.patch diff -r c7b121a4ffd9 -r d6378d455338 soundtouch/stuff/patches/soundtouch-1.4.0-mmx-sse-compile-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/soundtouch/stuff/patches/soundtouch-1.4.0-mmx-sse-compile-fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +diff -up soundtouch/source/SoundTouch/Makefile.in~ soundtouch/source/SoundTouch/Makefile.in +--- soundtouch/source/SoundTouch/Makefile.in~ 2009-02-15 11:21:36.000000000 +0100 ++++ soundtouch/source/SoundTouch/Makefile.in 2009-02-15 11:23:30.000000000 +0100 +@@ -209,7 +209,9 @@ libSoundTouch_la_SOURCES = AAFilter.cpp + # Note by authore: '-msse2' might not work in non-X86 compilations. If someone can + # fix this script to automatically check for CPU architecture, please submit a patch + # to me. +-AM_CXXFLAGS = -O3 -msse2 -fcheck-new -I../../include ++AM_CXXFLAGS = -fcheck-new -I../../include ++mmx_optimized.lo : AM_CXXFLAGS = -mmmx -fcheck-new -I../../include ++sse_optimized.lo : AM_CXXFLAGS = -msse -fcheck-new -I../../include + all: all-am + + .SUFFIXES: diff -r c7b121a4ffd9 -r d6378d455338 soundtouch/stuff/soundtouch-1.4.0-mmx-sse-compile-fix.patch --- a/soundtouch/stuff/soundtouch-1.4.0-mmx-sse-compile-fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -up soundtouch/source/SoundTouch/Makefile.in~ soundtouch/source/SoundTouch/Makefile.in ---- soundtouch/source/SoundTouch/Makefile.in~ 2009-02-15 11:21:36.000000000 +0100 -+++ soundtouch/source/SoundTouch/Makefile.in 2009-02-15 11:23:30.000000000 +0100 -@@ -209,7 +209,9 @@ libSoundTouch_la_SOURCES = AAFilter.cpp - # Note by authore: '-msse2' might not work in non-X86 compilations. If someone can - # fix this script to automatically check for CPU architecture, please submit a patch - # to me. --AM_CXXFLAGS = -O3 -msse2 -fcheck-new -I../../include -+AM_CXXFLAGS = -fcheck-new -I../../include -+mmx_optimized.lo : AM_CXXFLAGS = -mmmx -fcheck-new -I../../include -+sse_optimized.lo : AM_CXXFLAGS = -msse -fcheck-new -I../../include - all: all-am - - .SUFFIXES: diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/receipt --- a/spidermonkey/receipt Wed May 09 17:03:28 2018 +0300 +++ b/spidermonkey/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,10 +21,7 @@ # Fix from Archlinux # http://projects.archlinux.org/svntogit/community.git/tree/spidermonkey/trunk/PKGBUILD - #patch -p0 < $stuff/spidermonkey-Makefile.patch || return 1 sed -i 's|include|include/js|' rules.mk || return 1 - # patch Makefile for threadsafe support with native nspr - patch -p2 -i $stuff/spidermonkey-1.7-threadsafe.patch || return 1 # FS#16673 export CFLAGS="${CFLAGS} -DJS_C_STRINGS_ARE_UTF8" # build - threadsafe diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spidermonkey/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,6 @@ +# Fix from Archlinux +# http://projects.archlinux.org/svntogit/community.git/tree/spidermonkey/trunk/PKGBUILD +#-p0|spidermonkey-Makefile.patch + +# patch Makefile for threadsafe support with native nspr +-p2|spidermonkey-1.7-threadsafe.patch diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/stuff/patches/spidermonkey-1.7-threadsafe.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spidermonkey/stuff/patches/spidermonkey-1.7-threadsafe.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,16 @@ +--- js/src/Makefile.ref.orig 2008-05-28 19:51:32.000000000 -0400 ++++ js/src/Makefile.ref 2008-05-28 19:52:17.000000000 -0400 +@@ -63,11 +63,11 @@ + + ifdef JS_THREADSAFE + DEFINES += -DJS_THREADSAFE +-INCLUDES += -I$(DIST)/include/nspr ++INCLUDES += -I/usr/include/nspr + ifdef USE_MSVC + OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib + else +-OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX) ++OTHER_LIBS += -L/usr/$(LIBDIR)/nspr -lnspr${NSPR_LIBSUFFIX} + endif + endif + diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/stuff/patches/spidermonkey-Makefile.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spidermonkey/stuff/patches/spidermonkey-Makefile.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,22 @@ +*** Makefile.ref.orig 2009-02-16 09:56:29.000000000 -0600 +--- Makefile.ref 2009-02-16 09:58:59.000000000 -0600 +*************** +*** 169,184 **** +--- 169,185 ---- + jstypes.h \ + jsprvtd.h \ + jspubtd.h \ + jsregexp.h \ + jsscan.h \ + jsscope.h \ + jsscript.h \ + jsstr.h \ ++ jsutil.h \ + jsxdrapi.h \ + jsxml.h \ + $(NULL) + + API_HFILES = \ + jsapi.h \ + jsdbgapi.h \ + $(NULL) diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/stuff/spidermonkey-1.7-threadsafe.patch --- a/spidermonkey/stuff/spidermonkey-1.7-threadsafe.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ ---- js/src/Makefile.ref.orig 2008-05-28 19:51:32.000000000 -0400 -+++ js/src/Makefile.ref 2008-05-28 19:52:17.000000000 -0400 -@@ -63,11 +63,11 @@ - - ifdef JS_THREADSAFE - DEFINES += -DJS_THREADSAFE --INCLUDES += -I$(DIST)/include/nspr -+INCLUDES += -I/usr/include/nspr - ifdef USE_MSVC - OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib - else --OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX) -+OTHER_LIBS += -L/usr/$(LIBDIR)/nspr -lnspr${NSPR_LIBSUFFIX} - endif - endif - diff -r c7b121a4ffd9 -r d6378d455338 spidermonkey/stuff/spidermonkey-Makefile.patch --- a/spidermonkey/stuff/spidermonkey-Makefile.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -*** Makefile.ref.orig 2009-02-16 09:56:29.000000000 -0600 ---- Makefile.ref 2009-02-16 09:58:59.000000000 -0600 -*************** -*** 169,184 **** ---- 169,185 ---- - jstypes.h \ - jsprvtd.h \ - jspubtd.h \ - jsregexp.h \ - jsscan.h \ - jsscope.h \ - jsscript.h \ - jsstr.h \ -+ jsutil.h \ - jsxdrapi.h \ - jsxml.h \ - $(NULL) - - API_HFILES = \ - jsapi.h \ - jsdbgapi.h \ - $(NULL) diff -r c7b121a4ffd9 -r d6378d455338 stardict/receipt --- a/stardict/receipt Wed May 09 17:03:28 2018 +0300 +++ b/stardict/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,8 +16,6 @@ compile_rules() { sed -i 's//&\n#include /' stardict-plugins/stardict-wordnet-plugin/scene.hpp - patch -p1 < $stuff/sigc++.patch || return 1 - patch -p1 < $stuff/stardict_gcc43.patch || return 1 ./configure \ --disable-man \ diff -r c7b121a4ffd9 -r d6378d455338 stardict/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stardict/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|sigc++.patch +-p1|stardict_gcc43.patch diff -r c7b121a4ffd9 -r d6378d455338 stardict/stuff/patches/sigc++.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stardict/stuff/patches/sigc++.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,177 @@ +diff -Naur stardict-3.0.1.orig/src/gconf_file.cpp stardict-3.0.1/src/gconf_file.cpp +--- stardict-3.0.1.orig/src/gconf_file.cpp 2007-07-10 08:16:04.000000000 +0100 ++++ stardict-3.0.1/src/gconf_file.cpp 2008-04-11 18:18:43.000000000 +0100 +@@ -22,6 +22,8 @@ + # include "config.h" + #endif + ++#include ++ + #include + + #include "gconf_file.hpp" +diff -Naur stardict-3.0.1.orig/src/inifile.cpp stardict-3.0.1/src/inifile.cpp +--- stardict-3.0.1.orig/src/inifile.cpp 2007-08-01 10:43:00.000000000 +0100 ++++ stardict-3.0.1/src/inifile.cpp 2008-04-11 18:18:43.000000000 +0100 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff -Naur stardict-3.0.1.orig/src/pangoview.cpp stardict-3.0.1/src/pangoview.cpp +--- stardict-3.0.1.orig/src/pangoview.cpp 2007-09-25 08:11:48.000000000 +0100 ++++ stardict-3.0.1/src/pangoview.cpp 2008-04-11 18:18:43.000000000 +0100 +@@ -22,6 +22,8 @@ + # include "config.h" + #endif + ++#include ++ + #include "gtktextviewpango.h" + #include "utils.h" + #include "skin.h"//for SkinCursor definition +diff -Naur stardict-3.0.1.orig/src/prefsdlg.cpp stardict-3.0.1/src/prefsdlg.cpp +--- stardict-3.0.1.orig/src/prefsdlg.cpp 2007-10-30 08:14:07.000000000 +0000 ++++ stardict-3.0.1/src/prefsdlg.cpp 2008-04-11 18:18:43.000000000 +0100 +@@ -21,6 +21,8 @@ + # include "config.h" + #endif + ++#include ++ + #include + #include + +diff -Naur stardict-3.0.1.orig/src/readword.cpp stardict-3.0.1/src/readword.cpp +--- stardict-3.0.1.orig/src/readword.cpp 2007-07-10 08:16:04.000000000 +0100 ++++ stardict-3.0.1/src/readword.cpp 2008-04-11 17:53:43.000000000 +0100 +@@ -3,6 +3,7 @@ + #endif + + #include ++#include + #include + + #include +diff -Naur stardict-3.0.1.orig/src/sigc++/signal.h stardict-3.0.1/src/sigc++/signal.h +--- stardict-3.0.1.orig/src/sigc++/signal.h 2007-07-10 08:16:01.000000000 +0100 ++++ stardict-3.0.1/src/sigc++/signal.h 2008-04-11 17:50:11.000000000 +0100 +@@ -18,7 +18,7 @@ + //Compilers, such as older versions of SUN Forte C++, that do not allow this also often + //do not allow a typedef to have the same name as a class in the typedef's definition. + //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build. +- #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 ++// #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 + #endif + + namespace sigc { +diff -Naur stardict-3.0.1.orig/src/utils.cpp stardict-3.0.1/src/utils.cpp +--- stardict-3.0.1.orig/src/utils.cpp 2007-10-22 03:25:02.000000000 +0100 ++++ stardict-3.0.1/src/utils.cpp 2008-04-11 18:18:43.000000000 +0100 +@@ -22,6 +22,8 @@ + # include "config.h" + #endif + ++#include ++ + #include + #include + #include +diff -Naur stardict-3.0.1.orig/src/x11_iskeyspressed.hpp stardict-3.0.1/src/x11_iskeyspressed.hpp +--- stardict-3.0.1.orig/src/x11_iskeyspressed.hpp 2007-07-10 08:16:04.000000000 +0100 ++++ stardict-3.0.1/src/x11_iskeyspressed.hpp 2008-04-11 17:57:08.000000000 +0100 +@@ -1,6 +1,8 @@ + #ifndef _X11_ISKEYSPRESSED_HPP_ + #define _X11_ISKEYSPRESSED_HPP_ + ++#include ++ + #include + #include + #include + + #ifdef _WIN32 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2007-09-19 09:27:18.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2008-04-11 18:02:55.000000000 +0100 +@@ -1,4 +1,5 @@ + #include "stardict_espeak.h" ++#include + #include + #include + +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2007-09-13 08:51:55.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2008-04-11 17:59:50.000000000 +0100 +@@ -1,4 +1,6 @@ + #include "stardict_html_parsedata.h" ++#include ++#include + #include + + #ifdef _WIN32 + +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2007-09-19 09:29:21.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2008-04-11 18:02:38.000000000 +0100 +@@ -1,4 +1,5 @@ + #include "stardict_spell.h" ++#include + #include + #include + #include + +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2007-10-18 02:36:22.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2008-04-11 18:01:10.000000000 +0100 +@@ -1,4 +1,5 @@ + #include "court_widget.h" ++#include + #include + #include + +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2007-10-15 04:32:04.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2008-04-11 18:00:35.000000000 +0100 +@@ -1,5 +1,6 @@ + #include "stardict_wordnet.h" + #include "court_widget.h" ++#include + #include + + #ifdef _WIN32 + +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp +--- stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2007-08-31 07:41:54.000000000 +0100 ++++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2008-04-11 18:00:12.000000000 +0100 +@@ -1,4 +1,5 @@ + #include "stardict_xdxf_parsedata.h" ++#include + #include + + #ifdef _WIN32 +diff -Naur stardict-3.0.1.orig/tests/t_config_file.cpp stardict-3.0.1/tests/t_config_file.cpp +--- stardict-3.0.1.orig/tests/t_config_file.cpp 2007-07-10 08:16:04.000000000 +0100 ++++ stardict-3.0.1/tests/t_config_file.cpp 2008-04-11 18:04:13.000000000 +0100 +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + + #include "config_file.hpp" +diff -Naur stardict-3.0.1.orig/tests/t_xml.cpp stardict-3.0.1/tests/t_xml.cpp +--- stardict-3.0.1.orig/tests/t_xml.cpp 2007-07-10 08:16:04.000000000 +0100 ++++ stardict-3.0.1/tests/t_xml.cpp 2008-04-11 18:04:58.000000000 +0100 +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + + static void xml_decode(const char *str, std::string& decoded) diff -r c7b121a4ffd9 -r d6378d455338 stardict/stuff/patches/stardict_gcc43.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stardict/stuff/patches/stardict_gcc43.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,357 @@ +--- stardict-3.0.1/src/Makefile.am.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/src/Makefile.am 2008-02-26 19:35:12.000000000 +0900 +@@ -14,6 +14,8 @@ + + bin_PROGRAMS = stardict + ++DEFAULT_INCLUDES = -I$(top_builddir) ++ + INCLUDES = \ + $(STARDICT_CFLAGS) \ + $(LOCAL_SIGCPP_INCLUDE) \ + +--- stardict-3.0.1/src/config_file.hpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/src/config_file.hpp 2008-02-26 19:35:00.000000000 +0900 +@@ -5,7 +5,7 @@ + #include + #include + +-#include "sigc++/sigc++.h" ++#include + + class config_file; + +--- stardict-3.0.1/src/gconf_file.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/src/gconf_file.cpp 2008-02-26 19:37:18.000000000 +0900 +@@ -22,6 +22,7 @@ + # include "config.h" + #endif + ++#include + #include + + #include "gconf_file.hpp" + +--- stardict-3.0.1/src/gtk_iskeyspressed.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/src/gtk_iskeyspressed.cpp 2008-02-26 19:37:35.000000000 +0900 +@@ -97,7 +97,7 @@ + GDK_BUTTON5_MASK = 1 << 12, + */ + +- mask = GdkModifierType(guint(mask) & (1<<13)-1); ++ mask = GdkModifierType(guint(mask) & ((1<<13)-1)); + + mask = + GdkModifierType(guint(mask) & ~(GDK_LOCK_MASK | GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | + +--- stardict-3.0.1/src/inifile.cpp.gcc43 2007-08-01 18:43:00.000000000 +0900 ++++ stardict-3.0.1/src/inifile.cpp 2008-02-26 19:37:51.000000000 +0900 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include "utils.h" + +--- stardict-3.0.1/src/lib/common.cpp.gcc43 2007-09-25 11:27:24.000000000 +0900 ++++ stardict-3.0.1/src/lib/common.cpp 2008-02-26 19:34:01.000000000 +0900 +@@ -24,6 +24,8 @@ + # include "config.h" + #endif + ++#include ++#include + #include "common.hpp" + + static void parse_description(const char *p, long len, std::string &description) + +--- stardict-3.0.1/src/lib/data.cpp.gcc43 2007-09-21 10:09:52.000000000 +0900 ++++ stardict-3.0.1/src/lib/data.cpp 2008-02-26 19:33:38.000000000 +0900 +@@ -26,6 +26,8 @@ + + #include "data.hpp" + #include "getuint32.h" ++#include ++#include + + + DictBase::DictBase() + +--- stardict-3.0.1/src/lib/http_client.cpp.gcc43 2007-09-06 17:29:30.000000000 +0900 ++++ stardict-3.0.1/src/lib/http_client.cpp 2008-02-26 19:34:27.000000000 +0900 +@@ -4,6 +4,7 @@ + + #include "http_client.h" + #include "sockets.hpp" ++#include + + sigc::signal HttpClient::on_error_; + sigc::signal HttpClient::on_response_; + +--- stardict-3.0.1/src/lib/pluginmanager.cpp.gcc43 2007-10-10 12:26:45.000000000 +0900 ++++ stardict-3.0.1/src/lib/pluginmanager.cpp 2008-02-26 19:34:36.000000000 +0900 +@@ -1,6 +1,7 @@ + #include "pluginmanager.h" + #include "file.hpp" + #include ++#include + + StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_): + plugin_filename(filename), module(module_), configure_func(configure_func_) + +--- stardict-3.0.1/src/lib/stardict_client.cpp.gcc43 2007-10-31 17:32:11.000000000 +0900 ++++ stardict-3.0.1/src/lib/stardict_client.cpp 2008-02-26 19:34:16.000000000 +0900 +@@ -25,6 +25,9 @@ + #include + #include + ++#include ++#include ++#include + #include "sockets.hpp" + #include "md5.h" + #include "getuint32.h" + +--- stardict-3.0.1/src/lib/stddict.cpp.gcc43 2007-10-30 18:06:07.000000000 +0900 ++++ stardict-3.0.1/src/lib/stddict.cpp 2008-02-26 19:33:46.000000000 +0900 +@@ -28,6 +28,7 @@ + # include "config.h" + #endif + ++#include + #include + #include + +--- stardict-3.0.1/src/lib/treedict.cpp.gcc43 2007-09-21 10:09:52.000000000 +0900 ++++ stardict-3.0.1/src/lib/treedict.cpp 2008-02-26 19:33:52.000000000 +0900 +@@ -25,6 +25,7 @@ + # include "config.h" + #endif + ++#include + #include "file.hpp" + #include "getuint32.h" + +--- stardict-3.0.1/src/pangoview.cpp.gcc43 2007-09-25 16:11:48.000000000 +0900 ++++ stardict-3.0.1/src/pangoview.cpp 2008-02-26 19:37:02.000000000 +0900 +@@ -22,6 +22,7 @@ + # include "config.h" + #endif + ++#include + #include "gtktextviewpango.h" + #include "utils.h" + #include "skin.h"//for SkinCursor definition + +--- stardict-3.0.1/src/utils.cpp.gcc43 2007-10-22 11:25:02.000000000 +0900 ++++ stardict-3.0.1/src/utils.cpp 2008-02-26 19:36:01.000000000 +0900 +@@ -22,6 +22,7 @@ + # include "config.h" + #endif + ++#include + #include + #include + #include + +--- stardict-3.0.1/src/x11_iskeyspressed.hpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/src/x11_iskeyspressed.hpp 2008-02-27 16:16:17.000000000 +0900 +@@ -5,6 +5,8 @@ + #include + #include + ++#include ++ + #include "iskeyspressed.hpp" + + typedef enum { SYM, CODE, BUTTON } KeyType_t; + +--- stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp.gcc43 2007-09-21 10:09:53.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp 2008-02-26 19:39:34.000000000 +0900 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include + #include + #include + +--- stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp.gcc43 2007-10-10 18:28:29.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp 2008-02-26 19:38:56.000000000 +0900 +@@ -1,5 +1,6 @@ + #include "stardict_dictdotcn.h" + #include ++#include + #include + #include + +--- stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp.gcc43 2007-09-19 17:27:18.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2008-02-26 19:45:43.000000000 +0900 +@@ -1,6 +1,7 @@ + #include "stardict_espeak.h" + #include + #include ++#include + + static const StarDictPluginSystemInfo *plugin_info = NULL; + static std::string voice_engine; + +--- stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp.gcc43 2007-08-31 16:10:41.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp 2008-02-26 19:45:27.000000000 +0900 +@@ -1,6 +1,8 @@ + #include "stardict_gucharmap.h" + #include + #include ++#include ++#include + #include + + static char *build_dictdata(char type, const char *definition) + +--- stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp.gcc43 2007-09-13 16:51:55.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2008-02-26 19:41:11.000000000 +0900 +@@ -1,5 +1,7 @@ + #include "stardict_html_parsedata.h" + #include ++#include ++#include + + #ifdef _WIN32 + #include + +--- stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp.gcc43 2007-09-19 17:30:54.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp 2008-02-26 19:40:22.000000000 +0900 +@@ -1,5 +1,6 @@ + #include "stardict_man.h" + #include ++#include + #include + + static const StarDictPluginSystemInfo *plugin_info = NULL; + +--- stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp.gcc43 2007-10-25 17:16:37.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp 2008-02-26 19:44:06.000000000 +0900 +@@ -1,4 +1,5 @@ + #include "stardict_powerword_parsedata.h" ++#include + #include + + #ifdef _WIN32 + +--- stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp.gcc43 2007-11-02 17:41:26.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp 2008-02-26 19:45:57.000000000 +0900 +@@ -1,6 +1,8 @@ + #include "stardict_qqwry.h" + #include + #include ++#include ++#include + #include + + #ifdef _WIN32 + +--- stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp.gcc43 2007-09-19 17:29:21.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2008-02-26 19:45:13.000000000 +0900 +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + #include + #include + +--- stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp.gcc43 2007-09-19 17:34:36.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp 2008-02-26 19:40:46.000000000 +0900 +@@ -1,5 +1,7 @@ + #include "stardict_update_info.h" + #include ++#include ++#include + + #ifdef _WIN32 + #include + +--- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp.gcc43 2007-07-10 16:16:15.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp 2008-02-26 19:45:00.000000000 +0900 +@@ -1,5 +1,6 @@ + #include "stardict_wiki2xml.h" + #include "WIKI2XML.h" ++#include + #include + + std::string wiki2xml(std::string &str) + +--- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp.gcc43 2007-08-31 15:41:21.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp 2008-02-26 19:44:40.000000000 +0900 +@@ -1,5 +1,6 @@ + #include "stardict_wiki_parsedata.h" + #include "stardict_wiki2xml.h" ++#include + #include + + #ifdef _WIN32 + +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp.gcc43 2007-10-18 10:36:22.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2008-02-26 19:42:25.000000000 +0900 +@@ -1,6 +1,7 @@ + #include "court_widget.h" + #include + #include ++#include + + + wnobj::wnobj(partic_t & p, unsigned int t) : _p(p), _t(t), highlight(false) + +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp.gcc43 2007-10-15 12:32:04.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2008-02-26 19:42:05.000000000 +0900 +@@ -1,6 +1,7 @@ + #include "stardict_wordnet.h" + #include "court_widget.h" + #include ++#include + + #ifdef _WIN32 + #include + +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp.gcc43 2007-10-10 18:39:10.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp 2008-02-26 19:43:21.000000000 +0900 +@@ -1,4 +1,5 @@ + #include "stardict_wordnet_parsedata.h" ++#include + #include + + #ifdef _WIN32 + +--- stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp.gcc43 2007-08-31 15:41:54.000000000 +0900 ++++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2008-02-26 19:41:36.000000000 +0900 +@@ -1,5 +1,6 @@ + #include "stardict_xdxf_parsedata.h" + #include ++#include + + #ifdef _WIN32 + #include + +--- stardict-3.0.1/tests/t_config_file.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/tests/t_config_file.cpp 2008-02-26 19:38:14.000000000 +0900 +@@ -2,6 +2,7 @@ + # include "config.h" + #endif + ++#include + #include + #include + #include + +--- stardict-3.0.1/tests/t_xml.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 ++++ stardict-3.0.1/tests/t_xml.cpp 2008-02-26 19:38:04.000000000 +0900 +@@ -3,6 +3,7 @@ + #endif + + #include ++#include + #include + #include + diff -r c7b121a4ffd9 -r d6378d455338 stardict/stuff/sigc++.patch --- a/stardict/stuff/sigc++.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -diff -Naur stardict-3.0.1.orig/src/gconf_file.cpp stardict-3.0.1/src/gconf_file.cpp ---- stardict-3.0.1.orig/src/gconf_file.cpp 2007-07-10 08:16:04.000000000 +0100 -+++ stardict-3.0.1/src/gconf_file.cpp 2008-04-11 18:18:43.000000000 +0100 -@@ -22,6 +22,8 @@ - # include "config.h" - #endif - -+#include -+ - #include - - #include "gconf_file.hpp" -diff -Naur stardict-3.0.1.orig/src/inifile.cpp stardict-3.0.1/src/inifile.cpp ---- stardict-3.0.1.orig/src/inifile.cpp 2007-08-01 10:43:00.000000000 +0100 -+++ stardict-3.0.1/src/inifile.cpp 2008-04-11 18:18:43.000000000 +0100 -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -Naur stardict-3.0.1.orig/src/pangoview.cpp stardict-3.0.1/src/pangoview.cpp ---- stardict-3.0.1.orig/src/pangoview.cpp 2007-09-25 08:11:48.000000000 +0100 -+++ stardict-3.0.1/src/pangoview.cpp 2008-04-11 18:18:43.000000000 +0100 -@@ -22,6 +22,8 @@ - # include "config.h" - #endif - -+#include -+ - #include "gtktextviewpango.h" - #include "utils.h" - #include "skin.h"//for SkinCursor definition -diff -Naur stardict-3.0.1.orig/src/prefsdlg.cpp stardict-3.0.1/src/prefsdlg.cpp ---- stardict-3.0.1.orig/src/prefsdlg.cpp 2007-10-30 08:14:07.000000000 +0000 -+++ stardict-3.0.1/src/prefsdlg.cpp 2008-04-11 18:18:43.000000000 +0100 -@@ -21,6 +21,8 @@ - # include "config.h" - #endif - -+#include -+ - #include - #include - -diff -Naur stardict-3.0.1.orig/src/readword.cpp stardict-3.0.1/src/readword.cpp ---- stardict-3.0.1.orig/src/readword.cpp 2007-07-10 08:16:04.000000000 +0100 -+++ stardict-3.0.1/src/readword.cpp 2008-04-11 17:53:43.000000000 +0100 -@@ -3,6 +3,7 @@ - #endif - - #include -+#include - #include - - #include -diff -Naur stardict-3.0.1.orig/src/sigc++/signal.h stardict-3.0.1/src/sigc++/signal.h ---- stardict-3.0.1.orig/src/sigc++/signal.h 2007-07-10 08:16:01.000000000 +0100 -+++ stardict-3.0.1/src/sigc++/signal.h 2008-04-11 17:50:11.000000000 +0100 -@@ -18,7 +18,7 @@ - //Compilers, such as older versions of SUN Forte C++, that do not allow this also often - //do not allow a typedef to have the same name as a class in the typedef's definition. - //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build. -- #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 -+// #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 - #endif - - namespace sigc { -diff -Naur stardict-3.0.1.orig/src/utils.cpp stardict-3.0.1/src/utils.cpp ---- stardict-3.0.1.orig/src/utils.cpp 2007-10-22 03:25:02.000000000 +0100 -+++ stardict-3.0.1/src/utils.cpp 2008-04-11 18:18:43.000000000 +0100 -@@ -22,6 +22,8 @@ - # include "config.h" - #endif - -+#include -+ - #include - #include - #include -diff -Naur stardict-3.0.1.orig/src/x11_iskeyspressed.hpp stardict-3.0.1/src/x11_iskeyspressed.hpp ---- stardict-3.0.1.orig/src/x11_iskeyspressed.hpp 2007-07-10 08:16:04.000000000 +0100 -+++ stardict-3.0.1/src/x11_iskeyspressed.hpp 2008-04-11 17:57:08.000000000 +0100 -@@ -1,6 +1,8 @@ - #ifndef _X11_ISKEYSPRESSED_HPP_ - #define _X11_ISKEYSPRESSED_HPP_ - -+#include -+ - #include - #include - #include - - #ifdef _WIN32 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2007-09-19 09:27:18.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2008-04-11 18:02:55.000000000 +0100 -@@ -1,4 +1,5 @@ - #include "stardict_espeak.h" -+#include - #include - #include - -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2007-09-13 08:51:55.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2008-04-11 17:59:50.000000000 +0100 -@@ -1,4 +1,6 @@ - #include "stardict_html_parsedata.h" -+#include -+#include - #include - - #ifdef _WIN32 - -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2007-09-19 09:29:21.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2008-04-11 18:02:38.000000000 +0100 -@@ -1,4 +1,5 @@ - #include "stardict_spell.h" -+#include - #include - #include - #include - -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2007-10-18 02:36:22.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2008-04-11 18:01:10.000000000 +0100 -@@ -1,4 +1,5 @@ - #include "court_widget.h" -+#include - #include - #include - -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2007-10-15 04:32:04.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2008-04-11 18:00:35.000000000 +0100 -@@ -1,5 +1,6 @@ - #include "stardict_wordnet.h" - #include "court_widget.h" -+#include - #include - - #ifdef _WIN32 - -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp ---- stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2007-08-31 07:41:54.000000000 +0100 -+++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2008-04-11 18:00:12.000000000 +0100 -@@ -1,4 +1,5 @@ - #include "stardict_xdxf_parsedata.h" -+#include - #include - - #ifdef _WIN32 -diff -Naur stardict-3.0.1.orig/tests/t_config_file.cpp stardict-3.0.1/tests/t_config_file.cpp ---- stardict-3.0.1.orig/tests/t_config_file.cpp 2007-07-10 08:16:04.000000000 +0100 -+++ stardict-3.0.1/tests/t_config_file.cpp 2008-04-11 18:04:13.000000000 +0100 -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - #include - - #include "config_file.hpp" -diff -Naur stardict-3.0.1.orig/tests/t_xml.cpp stardict-3.0.1/tests/t_xml.cpp ---- stardict-3.0.1.orig/tests/t_xml.cpp 2007-07-10 08:16:04.000000000 +0100 -+++ stardict-3.0.1/tests/t_xml.cpp 2008-04-11 18:04:58.000000000 +0100 -@@ -5,6 +5,7 @@ - #include - #include - #include -+#include - - - static void xml_decode(const char *str, std::string& decoded) diff -r c7b121a4ffd9 -r d6378d455338 stardict/stuff/stardict_gcc43.patch --- a/stardict/stuff/stardict_gcc43.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ ---- stardict-3.0.1/src/Makefile.am.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/src/Makefile.am 2008-02-26 19:35:12.000000000 +0900 -@@ -14,6 +14,8 @@ - - bin_PROGRAMS = stardict - -+DEFAULT_INCLUDES = -I$(top_builddir) -+ - INCLUDES = \ - $(STARDICT_CFLAGS) \ - $(LOCAL_SIGCPP_INCLUDE) \ - ---- stardict-3.0.1/src/config_file.hpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/src/config_file.hpp 2008-02-26 19:35:00.000000000 +0900 -@@ -5,7 +5,7 @@ - #include - #include - --#include "sigc++/sigc++.h" -+#include - - class config_file; - ---- stardict-3.0.1/src/gconf_file.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/src/gconf_file.cpp 2008-02-26 19:37:18.000000000 +0900 -@@ -22,6 +22,7 @@ - # include "config.h" - #endif - -+#include - #include - - #include "gconf_file.hpp" - ---- stardict-3.0.1/src/gtk_iskeyspressed.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/src/gtk_iskeyspressed.cpp 2008-02-26 19:37:35.000000000 +0900 -@@ -97,7 +97,7 @@ - GDK_BUTTON5_MASK = 1 << 12, - */ - -- mask = GdkModifierType(guint(mask) & (1<<13)-1); -+ mask = GdkModifierType(guint(mask) & ((1<<13)-1)); - - mask = - GdkModifierType(guint(mask) & ~(GDK_LOCK_MASK | GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | - ---- stardict-3.0.1/src/inifile.cpp.gcc43 2007-08-01 18:43:00.000000000 +0900 -+++ stardict-3.0.1/src/inifile.cpp 2008-02-26 19:37:51.000000000 +0900 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - #include "utils.h" - ---- stardict-3.0.1/src/lib/common.cpp.gcc43 2007-09-25 11:27:24.000000000 +0900 -+++ stardict-3.0.1/src/lib/common.cpp 2008-02-26 19:34:01.000000000 +0900 -@@ -24,6 +24,8 @@ - # include "config.h" - #endif - -+#include -+#include - #include "common.hpp" - - static void parse_description(const char *p, long len, std::string &description) - ---- stardict-3.0.1/src/lib/data.cpp.gcc43 2007-09-21 10:09:52.000000000 +0900 -+++ stardict-3.0.1/src/lib/data.cpp 2008-02-26 19:33:38.000000000 +0900 -@@ -26,6 +26,8 @@ - - #include "data.hpp" - #include "getuint32.h" -+#include -+#include - - - DictBase::DictBase() - ---- stardict-3.0.1/src/lib/http_client.cpp.gcc43 2007-09-06 17:29:30.000000000 +0900 -+++ stardict-3.0.1/src/lib/http_client.cpp 2008-02-26 19:34:27.000000000 +0900 -@@ -4,6 +4,7 @@ - - #include "http_client.h" - #include "sockets.hpp" -+#include - - sigc::signal HttpClient::on_error_; - sigc::signal HttpClient::on_response_; - ---- stardict-3.0.1/src/lib/pluginmanager.cpp.gcc43 2007-10-10 12:26:45.000000000 +0900 -+++ stardict-3.0.1/src/lib/pluginmanager.cpp 2008-02-26 19:34:36.000000000 +0900 -@@ -1,6 +1,7 @@ - #include "pluginmanager.h" - #include "file.hpp" - #include -+#include - - StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_): - plugin_filename(filename), module(module_), configure_func(configure_func_) - ---- stardict-3.0.1/src/lib/stardict_client.cpp.gcc43 2007-10-31 17:32:11.000000000 +0900 -+++ stardict-3.0.1/src/lib/stardict_client.cpp 2008-02-26 19:34:16.000000000 +0900 -@@ -25,6 +25,9 @@ - #include - #include - -+#include -+#include -+#include - #include "sockets.hpp" - #include "md5.h" - #include "getuint32.h" - ---- stardict-3.0.1/src/lib/stddict.cpp.gcc43 2007-10-30 18:06:07.000000000 +0900 -+++ stardict-3.0.1/src/lib/stddict.cpp 2008-02-26 19:33:46.000000000 +0900 -@@ -28,6 +28,7 @@ - # include "config.h" - #endif - -+#include - #include - #include - ---- stardict-3.0.1/src/lib/treedict.cpp.gcc43 2007-09-21 10:09:52.000000000 +0900 -+++ stardict-3.0.1/src/lib/treedict.cpp 2008-02-26 19:33:52.000000000 +0900 -@@ -25,6 +25,7 @@ - # include "config.h" - #endif - -+#include - #include "file.hpp" - #include "getuint32.h" - ---- stardict-3.0.1/src/pangoview.cpp.gcc43 2007-09-25 16:11:48.000000000 +0900 -+++ stardict-3.0.1/src/pangoview.cpp 2008-02-26 19:37:02.000000000 +0900 -@@ -22,6 +22,7 @@ - # include "config.h" - #endif - -+#include - #include "gtktextviewpango.h" - #include "utils.h" - #include "skin.h"//for SkinCursor definition - ---- stardict-3.0.1/src/utils.cpp.gcc43 2007-10-22 11:25:02.000000000 +0900 -+++ stardict-3.0.1/src/utils.cpp 2008-02-26 19:36:01.000000000 +0900 -@@ -22,6 +22,7 @@ - # include "config.h" - #endif - -+#include - #include - #include - #include - ---- stardict-3.0.1/src/x11_iskeyspressed.hpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/src/x11_iskeyspressed.hpp 2008-02-27 16:16:17.000000000 +0900 -@@ -5,6 +5,8 @@ - #include - #include - -+#include -+ - #include "iskeyspressed.hpp" - - typedef enum { SYM, CODE, BUTTON } KeyType_t; - ---- stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp.gcc43 2007-09-21 10:09:53.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp 2008-02-26 19:39:34.000000000 +0900 -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - #include - #include - #include - ---- stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp.gcc43 2007-10-10 18:28:29.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp 2008-02-26 19:38:56.000000000 +0900 -@@ -1,5 +1,6 @@ - #include "stardict_dictdotcn.h" - #include -+#include - #include - #include - ---- stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp.gcc43 2007-09-19 17:27:18.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp 2008-02-26 19:45:43.000000000 +0900 -@@ -1,6 +1,7 @@ - #include "stardict_espeak.h" - #include - #include -+#include - - static const StarDictPluginSystemInfo *plugin_info = NULL; - static std::string voice_engine; - ---- stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp.gcc43 2007-08-31 16:10:41.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp 2008-02-26 19:45:27.000000000 +0900 -@@ -1,6 +1,8 @@ - #include "stardict_gucharmap.h" - #include - #include -+#include -+#include - #include - - static char *build_dictdata(char type, const char *definition) - ---- stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp.gcc43 2007-09-13 16:51:55.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp 2008-02-26 19:41:11.000000000 +0900 -@@ -1,5 +1,7 @@ - #include "stardict_html_parsedata.h" - #include -+#include -+#include - - #ifdef _WIN32 - #include - ---- stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp.gcc43 2007-09-19 17:30:54.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp 2008-02-26 19:40:22.000000000 +0900 -@@ -1,5 +1,6 @@ - #include "stardict_man.h" - #include -+#include - #include - - static const StarDictPluginSystemInfo *plugin_info = NULL; - ---- stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp.gcc43 2007-10-25 17:16:37.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp 2008-02-26 19:44:06.000000000 +0900 -@@ -1,4 +1,5 @@ - #include "stardict_powerword_parsedata.h" -+#include - #include - - #ifdef _WIN32 - ---- stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp.gcc43 2007-11-02 17:41:26.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp 2008-02-26 19:45:57.000000000 +0900 -@@ -1,6 +1,8 @@ - #include "stardict_qqwry.h" - #include - #include -+#include -+#include - #include - - #ifdef _WIN32 - ---- stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp.gcc43 2007-09-19 17:29:21.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp 2008-02-26 19:45:13.000000000 +0900 -@@ -3,6 +3,7 @@ - #include - #include - #include -+#include - #include - #include - ---- stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp.gcc43 2007-09-19 17:34:36.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp 2008-02-26 19:40:46.000000000 +0900 -@@ -1,5 +1,7 @@ - #include "stardict_update_info.h" - #include -+#include -+#include - - #ifdef _WIN32 - #include - ---- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp.gcc43 2007-07-10 16:16:15.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp 2008-02-26 19:45:00.000000000 +0900 -@@ -1,5 +1,6 @@ - #include "stardict_wiki2xml.h" - #include "WIKI2XML.h" -+#include - #include - - std::string wiki2xml(std::string &str) - ---- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp.gcc43 2007-08-31 15:41:21.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp 2008-02-26 19:44:40.000000000 +0900 -@@ -1,5 +1,6 @@ - #include "stardict_wiki_parsedata.h" - #include "stardict_wiki2xml.h" -+#include - #include - - #ifdef _WIN32 - ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp.gcc43 2007-10-18 10:36:22.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp 2008-02-26 19:42:25.000000000 +0900 -@@ -1,6 +1,7 @@ - #include "court_widget.h" - #include - #include -+#include - - - wnobj::wnobj(partic_t & p, unsigned int t) : _p(p), _t(t), highlight(false) - ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp.gcc43 2007-10-15 12:32:04.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp 2008-02-26 19:42:05.000000000 +0900 -@@ -1,6 +1,7 @@ - #include "stardict_wordnet.h" - #include "court_widget.h" - #include -+#include - - #ifdef _WIN32 - #include - ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp.gcc43 2007-10-10 18:39:10.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp 2008-02-26 19:43:21.000000000 +0900 -@@ -1,4 +1,5 @@ - #include "stardict_wordnet_parsedata.h" -+#include - #include - - #ifdef _WIN32 - ---- stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp.gcc43 2007-08-31 15:41:54.000000000 +0900 -+++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp 2008-02-26 19:41:36.000000000 +0900 -@@ -1,5 +1,6 @@ - #include "stardict_xdxf_parsedata.h" - #include -+#include - - #ifdef _WIN32 - #include - ---- stardict-3.0.1/tests/t_config_file.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/tests/t_config_file.cpp 2008-02-26 19:38:14.000000000 +0900 -@@ -2,6 +2,7 @@ - # include "config.h" - #endif - -+#include - #include - #include - #include - ---- stardict-3.0.1/tests/t_xml.cpp.gcc43 2007-07-10 16:16:04.000000000 +0900 -+++ stardict-3.0.1/tests/t_xml.cpp 2008-02-26 19:38:04.000000000 +0900 -@@ -3,6 +3,7 @@ - #endif - - #include -+#include - #include - #include - diff -r c7b121a4ffd9 -r d6378d455338 sundown/receipt --- a/sundown/receipt Wed May 09 17:03:28 2018 +0300 +++ b/sundown/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,7 +18,6 @@ compile_rules() { #sed -i 's|O3|Os|' $src/Makefile - patch -p1 -i $stuff/sundown.options.patch sed -i 's|-Wl||' Makefile make diff -r c7b121a4ffd9 -r d6378d455338 sundown/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sundown/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|sundown.options.patch diff -r c7b121a4ffd9 -r d6378d455338 sundown/stuff/patches/sundown.options.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sundown/stuff/patches/sundown.options.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +Enable next extensions in the sundown example: + * tables + * fenced_code + * autolink + * strikethrough + * space_headers + * superscript +See `markdown.h` to calculate mkd_extensions value. + +--- a/examples/sundown.c ++++ b/examples/sundown.c +@@ -62,7 +62,7 @@ + ob = bufnew(OUTPUT_UNIT); + + sdhtml_renderer(&callbacks, &options, 0); +- markdown = sd_markdown_new(0, 16, &callbacks, &options); ++ markdown = sd_markdown_new(222, 16, &callbacks, &options); + + sd_markdown_render(ob, ib->data, ib->size, markdown); + sd_markdown_free(markdown); diff -r c7b121a4ffd9 -r d6378d455338 sundown/stuff/sundown.options.patch --- a/sundown/stuff/sundown.options.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -Enable next extensions in the sundown example: - * tables - * fenced_code - * autolink - * strikethrough - * space_headers - * superscript -See `markdown.h` to calculate mkd_extensions value. - ---- a/examples/sundown.c -+++ b/examples/sundown.c -@@ -62,7 +62,7 @@ - ob = bufnew(OUTPUT_UNIT); - - sdhtml_renderer(&callbacks, &options, 0); -- markdown = sd_markdown_new(0, 16, &callbacks, &options); -+ markdown = sd_markdown_new(222, 16, &callbacks, &options); - - sd_markdown_render(ob, ib->data, ib->size, markdown); - sd_markdown_free(markdown); diff -r c7b121a4ffd9 -r d6378d455338 superswitcher/receipt --- a/superswitcher/receipt Wed May 09 17:03:28 2018 +0300 +++ b/superswitcher/receipt Thu May 10 21:12:00 2018 +0300 @@ -19,8 +19,6 @@ { find . -name '*.[ch]*' | xargs sed -i 's|workspace; +- new_workspace_id = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window)); +- new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id); +- + ss_workspace_remove_window (old_workspace, window); ++ ++ wnck_workspace = wnck_window_get_workspace (wnck_window); ++ if (wnck_workspace) { ++ new_workspace_id = wnck_workspace_get_number (wnck_workspace); ++ new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id); ++ ++ ss_workspace_add_window (new_workspace, window); ++ window->workspace = new_workspace; ++ } else { ++ window->workspace = NULL; ++ } ++ +- window->workspace = new_workspace; +- ss_workspace_add_window (new_workspace, window); + window->new_window_index = -1; + gtk_widget_queue_draw (gtk_widget_get_toplevel (window->widget)); + } diff -r c7b121a4ffd9 -r d6378d455338 superswitcher/stuff/superswitcher-0.6-wnck-workspace.patch --- a/superswitcher/stuff/superswitcher-0.6-wnck-workspace.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -It seems like wnck_window_is_skip_pager isn't all we need to check. - ---- superswitcher/src/screen.c -+++ superswitcher/src/screen.c -@@ -505,6 +505,7 @@ - static SSWindow * - add_window_to_screen (SSScreen *screen, WnckWindow *wnck_window) - { -+ WnckWorkspace *wnck_workspace; - SSWindow *window; - SSWorkspace *workspace; - int n; -@@ -513,7 +514,13 @@ - return NULL; - } - -- n = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window)); -+ wnck_workspace = wnck_window_get_workspace (wnck_window); -+ -+ if (wnck_workspace == NULL) { -+ return NULL; -+ } -+ -+ n = wnck_workspace_get_number (wnck_workspace); - workspace = ss_screen_get_nth_workspace (screen, n); - - window = ss_window_new (workspace, wnck_window); ---- superswitcher/src/window.c -+++ superswitcher/src/window.c -@@ -254,6 +254,7 @@ - static void - on_workspace_changed (WnckWindow *wnck_window, gpointer data) - { -+ WnckWorkspace *wnck_workspace; - SSWindow *window; - SSWorkspace *old_workspace; - SSWorkspace *new_workspace; -@@ -261,12 +262,19 @@ - - window = (SSWindow *) data; - old_workspace = window->workspace; -- new_workspace_id = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window)); -- new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id); -- - ss_workspace_remove_window (old_workspace, window); -+ -+ wnck_workspace = wnck_window_get_workspace (wnck_window); -+ if (wnck_workspace) { -+ new_workspace_id = wnck_workspace_get_number (wnck_workspace); -+ new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id); -+ -+ ss_workspace_add_window (new_workspace, window); -+ window->workspace = new_workspace; -+ } else { -+ window->workspace = NULL; -+ } -+ -- window->workspace = new_workspace; -- ss_workspace_add_window (new_workspace, window); - window->new_window_index = -1; - gtk_widget_queue_draw (gtk_widget_get_toplevel (window->widget)); - } diff -r c7b121a4ffd9 -r d6378d455338 syslinux/receipt --- a/syslinux/receipt Wed May 09 17:03:28 2018 +0300 +++ b/syslinux/receipt Thu May 10 21:12:00 2018 +0300 @@ -21,10 +21,6 @@ compile_rules() { rm -f $src/core/isolinux.bin - patch -p 0 < $stuff/extra/loadhigh.u - patch -p 0 < $stuff/extra/iso9660.u - patch -p 0 < $stuff/extra/readconfig.u - patch -p 0 < $stuff/extra/keytab-lilo.u cp -f $stuff/slitaz-next/miniacc.h $src/lzo/src/ # use latest https://raw.githubusercontent.com/upx/upx/master/src/miniacc.h cp $stuff/tools/isohybrid.sh . cp $stuff/extra/md5sum.c com32/modules diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/extra/iso9660.u --- a/syslinux/stuff/extra/iso9660.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ ---- core/fs/iso9660/iso9660.c -+++ core/fs/iso9660/iso9660.c -@@ -89,6 +89,24 @@ - return true; - } - -+#define __ROCKRIDGE -+#ifdef __ROCKRIDGE -+static size_t rockname(const struct iso_dir_entry *de, char **name) -+{ -+ size_t len, delen, n = (de->name_len + 34) & -2; -+ char *data = (char *) de; -+ -+ for (delen = 0; n + 2 < de->length; n += len) { -+ len = data[n + 2]; -+ if (* (short *) (data + n) == 0x4D4E) { /* NM */ -+ *name = data + n + 5; -+ delen = len - 5; -+ } -+ } -+ return delen; -+} -+#endif -+ - /* - * Find a entry in the specified dir with name _dname_. - */ -@@ -132,6 +150,20 @@ - - de_name_len = de->name_len; - de_name = de->name; -+#ifdef __ROCKRIDGE -+ { -+ char *name; -+ size_t len = rockname(de, &name); -+ -+ if (len) { -+ name[len] = 0; -+ if (!strcmp(name, dname)) { -+ dprintf("Found rockridge.\n"); -+ return de; -+ } -+ } -+ } -+#endif - if (iso_compare_name(de_name, de_name_len, dname)) { - dprintf("Found.\n"); - return de; -@@ -217,11 +249,22 @@ - dirent->d_ino = 0; /* Inode number is invalid to ISO fs */ - dirent->d_off = file->offset; - dirent->d_type = get_inode_mode(de->flags); -- dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + -- iso_convert_name(dirent->d_name, de->name, de->name_len); -+ iso_convert_name(dirent->d_name, de->name, de->name_len); - -+#ifdef __ROCKRIDGE -+ { -+ char *name; -+ size_t len = rockname(de, &name); -+ -+ if (len) { -+ strcpy(dirent->d_name, name); -+ dirent->d_name[len] = 0; -+ } -+ } -+#endif -+ dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + strlen(dirent->d_name); - file->offset += de->length; /* Update for next reading */ -- -+ - return 0; - } - diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/extra/keytab-lilo.u --- a/syslinux/stuff/extra/keytab-lilo.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -kbd 2.0.3 support ---- utils/keytab-lilo -+++ utils/keytab-lilo -@@ -48,9 +48,9 @@ - $empty = 1; - while () { - chop; -- if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { -+ if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { - die "active at beginning of map" if defined $current; -- $current = $pfx.":".$2; -+ $current = $pfx.":".$3; - next; - } - undef $current if /^};\s*$/; diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/extra/loadhigh.u --- a/syslinux/stuff/extra/loadhigh.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,557 +0,0 @@ ---- core/fs/loadhigh.c -+++ core/fs/loadhigh.c -@@ -36,6 +36,11 @@ - #include - #include "core.h" - #include "fs.h" -+#define LZLOAD ".c32 modules can be compressed with lz4 or lzma" -+#ifdef LZLOAD -+#include "../unlz4.c" -+#include "../unlzma.c" -+#endif - - #define MAX_CHUNK (1 << 20) /* 1 MB */ - -@@ -51,6 +56,9 @@ - uint32_t sector_mask; - size_t pad; - uint32_t retflags = 0; -+#ifdef LZLOAD -+ char *unpacked = (char *) regs->edi.l; -+#endif - - bytes = regs->eax.l; - zero_mask = regs->edx.w[0]; -@@ -101,6 +109,27 @@ - break; - } - } -+ -+#ifdef LZLOAD -+ switch (* (short *) unpacked) { -+ char *packed; -+ size_t packedsz, unpackedsz; -+ case 0x005D: -+ packedsz = buf - unpacked; -+ unpackedsz = * (unsigned long *) (unpacked + 5); -+ if (unpackedsz > 1000000) break; /* no size? */ -+ packed = unpacked + unpackedsz - packedsz + 1024; -+ if (packed < unpacked + 1024) packed = unpacked + 1024; -+ memmove(packed, unpacked, packedsz); -+ unlzma(packed, unpacked, packed + packedsz /* heap */); -+ buf = packed; -+ break; -+ case 0x2204: -+ case 0x2102: -+ buf = (char *) unlz4((unsigned char *) unpacked, (unsigned char *) buf); -+ break; -+ } -+#endif - - pad = (size_t)buf & zero_mask; - if (pad) ---- /dev/null -+++ core/unlzma.c -@@ -0,0 +1,385 @@ -+typedef unsigned char uint8_t; -+typedef unsigned short uint16_t; -+typedef unsigned uint32_t; -+typedef unsigned long long uint64_t; -+typedef unsigned size_t; -+#define SWAP_LE32(x) (x) -+#define SWAP_LE64(x) (x) -+/* vi: set sw=4 ts=4: */ -+/* -+ * Small lzma deflate implementation. -+ * Copyright (C) 2006 Aurelien Jacobs -+ * -+ * Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/) -+ * Copyright (C) 1999-2005 Igor Pavlov -+ * -+ * Licensed under GPLv2 or later, see file LICENSE in this source tree. -+ */ -+ -+#include -+ -+#define PACKED __attribute__ ((packed)) -+#define ALWAYS_INLINE inline -+#define speed_inline -+#define size_inline ALWAYS_INLINE -+ -+ -+typedef struct { -+ uint8_t *ptr; -+ -+ uint32_t code; -+ uint32_t range; -+ uint32_t bound; -+} rc_t; -+ -+#define RC_TOP_BITS 24 -+#define RC_MOVE_BITS 5 -+#define RC_MODEL_TOTAL_BITS 11 -+ -+/* Called twice, but one callsite is in speed_inline'd rc_is_bit_1() */ -+static void rc_do_normalize(rc_t *rc) -+{ -+ rc->range <<= 8; -+ rc->code = (rc->code << 8) | *rc->ptr++; -+} -+ -+static ALWAYS_INLINE void rc_normalize(rc_t *rc) -+{ -+ if (rc->range < (1 << RC_TOP_BITS)) { -+ rc_do_normalize(rc); -+ } -+} -+ -+/* Called once */ -+static void rc_init(rc_t *rc) /*, int buffer_size) */ -+{ -+ int i; -+ -+ rc->range = 0; -+ for (i = 0; i < 5; i++) { -+ rc_do_normalize(rc); -+ } -+ rc->range = 0xffffffff; -+} -+ -+/* rc_is_bit_1 is called 9 times */ -+static speed_inline int rc_is_bit_1(rc_t *rc, uint16_t *p) -+{ -+ rc_normalize(rc); -+ rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS); -+ if (rc->code < rc->bound) { -+ rc->range = rc->bound; -+ *p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS; -+ return 0; -+ } -+ rc->range -= rc->bound; -+ rc->code -= rc->bound; -+ *p -= *p >> RC_MOVE_BITS; -+ return 1; -+} -+ -+/* Called 4 times in unlzma loop */ -+static ALWAYS_INLINE int rc_get_bit(rc_t *rc, uint16_t *p, int *symbol) -+{ -+ int ret = rc_is_bit_1(rc, p); -+ *symbol = *symbol * 2 + ret; -+ return ret; -+} -+ -+/* Called once */ -+static ALWAYS_INLINE int rc_direct_bit(rc_t *rc) -+{ -+ rc_normalize(rc); -+ rc->range >>= 1; -+ if (rc->code >= rc->range) { -+ rc->code -= rc->range; -+ return 1; -+ } -+ return 0; -+} -+ -+/* Called twice */ -+static speed_inline void -+rc_bit_tree_decode(rc_t *rc, uint16_t *p, int num_levels, int *symbol) -+{ -+ int i = num_levels; -+ -+ *symbol = 1; -+ while (i--) -+ rc_get_bit(rc, p + *symbol, symbol); -+ *symbol -= 1 << num_levels; -+} -+ -+ -+typedef struct { -+ uint8_t pos; -+ uint32_t dict_size; -+ uint64_t dst_size; -+} PACKED lzma_header_t; -+ -+ -+/* #defines will force compiler to compute/optimize each one with each usage. -+ * Have heart and use enum instead. */ -+enum { -+ LZMA_BASE_SIZE = 1846, -+ LZMA_LIT_SIZE = 768, -+ -+ LZMA_NUM_POS_BITS_MAX = 4, -+ -+ LZMA_LEN_NUM_LOW_BITS = 3, -+ LZMA_LEN_NUM_MID_BITS = 3, -+ LZMA_LEN_NUM_HIGH_BITS = 8, -+ -+ LZMA_LEN_CHOICE = 0, -+ LZMA_LEN_CHOICE_2 = (LZMA_LEN_CHOICE + 1), -+ LZMA_LEN_LOW = (LZMA_LEN_CHOICE_2 + 1), -+ LZMA_LEN_MID = (LZMA_LEN_LOW \ -+ + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))), -+ LZMA_LEN_HIGH = (LZMA_LEN_MID \ -+ + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))), -+ LZMA_NUM_LEN_PROBS = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)), -+ -+ LZMA_NUM_STATES = 12, -+ LZMA_NUM_LIT_STATES = 7, -+ -+ LZMA_START_POS_MODEL_INDEX = 4, -+ LZMA_END_POS_MODEL_INDEX = 14, -+ LZMA_NUM_FULL_DISTANCES = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)), -+ -+ LZMA_NUM_POS_SLOT_BITS = 6, -+ LZMA_NUM_LEN_TO_POS_STATES = 4, -+ -+ LZMA_NUM_ALIGN_BITS = 4, -+ -+ LZMA_MATCH_MIN_LEN = 2, -+ -+ LZMA_IS_MATCH = 0, -+ LZMA_IS_REP = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)), -+ LZMA_IS_REP_G0 = (LZMA_IS_REP + LZMA_NUM_STATES), -+ LZMA_IS_REP_G1 = (LZMA_IS_REP_G0 + LZMA_NUM_STATES), -+ LZMA_IS_REP_G2 = (LZMA_IS_REP_G1 + LZMA_NUM_STATES), -+ LZMA_IS_REP_0_LONG = (LZMA_IS_REP_G2 + LZMA_NUM_STATES), -+ LZMA_POS_SLOT = (LZMA_IS_REP_0_LONG \ -+ + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)), -+ LZMA_SPEC_POS = (LZMA_POS_SLOT \ -+ + (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)), -+ LZMA_ALIGN = (LZMA_SPEC_POS \ -+ + LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX), -+ LZMA_LEN_CODER = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)), -+ LZMA_REP_LEN_CODER = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS), -+ LZMA_LITERAL = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS), -+}; -+ -+ -+void unlzma(char *from, char *to, char *heap) -+{ -+ lzma_header_t header; -+ int lc, pb, lp; -+ uint32_t pos_state_mask; -+ uint32_t literal_pos_mask; -+ uint16_t *p; -+ rc_t *rc = (rc_t *) heap; -+ int i; -+ uint8_t *buffer = (void *) to; -+ uint8_t previous_byte = 0; -+ size_t buffer_pos = 0; -+ int len = 0; -+ int state = 0; -+ uint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1; -+ -+ memcpy(&header, from, sizeof(header)); -+ from += sizeof(header); -+ heap += sizeof(*rc); -+ rc->ptr = (void *) from; -+ -+ i = header.pos / 9; -+ lc = header.pos % 9; -+ pb = i / 5; -+ lp = i % 5; -+ pos_state_mask = (1 << pb) - 1; -+ literal_pos_mask = (1 << lp) - 1; -+ -+ /* Example values from linux-3.3.4.tar.lzma: -+ * dict_size: 64M, dst_size: 2^64-1 -+ */ -+ header.dict_size = SWAP_LE32(header.dict_size); -+ header.dst_size = SWAP_LE64(header.dst_size); -+ -+ //if (header.dict_size == 0) -+ // header.dict_size++; -+ -+ rc_init(rc); -+ -+ { -+ int num_probs; -+ -+ num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)); -+ //p = xmalloc(num_probs * sizeof(*p)); -+ p = (void *) heap; -+ num_probs += LZMA_LITERAL - LZMA_BASE_SIZE; -+ for (i = 0; i < num_probs; i++) -+ p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1; -+ } -+ -+ -+ while (buffer_pos < header.dst_size) { -+ int pos_state = buffer_pos & pos_state_mask; -+ uint16_t *prob = p + LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state; -+ -+ if (!rc_is_bit_1(rc, prob)) { -+ static const char next_state[LZMA_NUM_STATES] = -+ { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 }; -+ int mi = 1; -+ -+ prob = (p + LZMA_LITERAL -+ + (LZMA_LIT_SIZE * (((buffer_pos & literal_pos_mask) << lc) -+ + (previous_byte >> (8 - lc)) -+ ) -+ ) -+ ); -+ -+ if (state >= LZMA_NUM_LIT_STATES) { -+ int match_byte; -+ uint32_t pos = buffer_pos - rep0; -+ -+ while (pos >= header.dict_size) -+ pos += header.dict_size; -+ match_byte = buffer[pos]; -+ do { -+ int bit; -+ -+ match_byte <<= 1; -+ bit = match_byte & 0x100; -+ bit ^= (rc_get_bit(rc, prob + 0x100 + bit + mi, &mi) << 8); /* 0x100 or 0 */ -+ if (bit) -+ break; -+ } while (mi < 0x100); -+ } -+ while (mi < 0x100) { -+ rc_get_bit(rc, prob + mi, &mi); -+ } -+ -+ state = next_state[state]; -+ -+ previous_byte = (uint8_t) mi; -+ len = 1; -+ goto one_byte2; -+ } else { -+ int num_bits; -+ int offset; -+ uint16_t *prob2; -+#define prob_len prob2 -+ -+ prob2 = p + LZMA_IS_REP + state; -+ if (!rc_is_bit_1(rc, prob2)) { -+ rep3 = rep2; -+ rep2 = rep1; -+ rep1 = rep0; -+ state = state < LZMA_NUM_LIT_STATES ? 0 : 3; -+ prob2 = p + LZMA_LEN_CODER; -+ } else { -+ prob2 += LZMA_IS_REP_G0 - LZMA_IS_REP; -+ if (!rc_is_bit_1(rc, prob2)) { -+ prob2 = (p + LZMA_IS_REP_0_LONG -+ + (state << LZMA_NUM_POS_BITS_MAX) -+ + pos_state -+ ); -+ if (!rc_is_bit_1(rc, prob2)) { -+ state = state < LZMA_NUM_LIT_STATES ? 9 : 11; -+ len = 1; -+ goto string; -+ } -+ } else { -+ uint32_t distance; -+ -+ prob2 += LZMA_IS_REP_G1 - LZMA_IS_REP_G0; -+ distance = rep1; -+ if (rc_is_bit_1(rc, prob2)) { -+ prob2 += LZMA_IS_REP_G2 - LZMA_IS_REP_G1; -+ distance = rep2; -+ if (rc_is_bit_1(rc, prob2)) { -+ distance = rep3; -+ rep3 = rep2; -+ } -+ rep2 = rep1; -+ } -+ rep1 = rep0; -+ rep0 = distance; -+ } -+ state = state < LZMA_NUM_LIT_STATES ? 8 : 11; -+ prob2 = p + LZMA_REP_LEN_CODER; -+ } -+ -+ prob_len = prob2 + LZMA_LEN_CHOICE; -+ num_bits = LZMA_LEN_NUM_LOW_BITS; -+ if (!rc_is_bit_1(rc, prob_len)) { -+ prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE -+ + (pos_state << LZMA_LEN_NUM_LOW_BITS); -+ offset = 0; -+ } else { -+ prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE; -+ if (!rc_is_bit_1(rc, prob_len)) { -+ prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2 -+ + (pos_state << LZMA_LEN_NUM_MID_BITS); -+ offset = 1 << LZMA_LEN_NUM_LOW_BITS; -+ num_bits += LZMA_LEN_NUM_MID_BITS - LZMA_LEN_NUM_LOW_BITS; -+ } else { -+ prob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2; -+ offset = ((1 << LZMA_LEN_NUM_LOW_BITS) -+ + (1 << LZMA_LEN_NUM_MID_BITS)); -+ num_bits += LZMA_LEN_NUM_HIGH_BITS - LZMA_LEN_NUM_LOW_BITS; -+ } -+ } -+ rc_bit_tree_decode(rc, prob_len, num_bits, &len); -+ len += offset; -+ -+ if (state < 4) { -+ int pos_slot; -+ uint16_t *prob3; -+ -+ state += LZMA_NUM_LIT_STATES; -+ prob3 = p + LZMA_POS_SLOT + -+ ((len < LZMA_NUM_LEN_TO_POS_STATES ? len : -+ LZMA_NUM_LEN_TO_POS_STATES - 1) -+ << LZMA_NUM_POS_SLOT_BITS); -+ rc_bit_tree_decode(rc, prob3, -+ LZMA_NUM_POS_SLOT_BITS, &pos_slot); -+ rep0 = pos_slot; -+ if (pos_slot >= LZMA_START_POS_MODEL_INDEX) { -+ int i2, mi2, num_bits2 = (pos_slot >> 1) - 1; -+ rep0 = 2 | (pos_slot & 1); -+ if (pos_slot < LZMA_END_POS_MODEL_INDEX) { -+ rep0 <<= num_bits2; -+ prob3 = p + LZMA_SPEC_POS + rep0 - pos_slot - 1; -+ } else { -+ for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--) -+ rep0 = (rep0 << 1) | rc_direct_bit(rc); -+ rep0 <<= LZMA_NUM_ALIGN_BITS; -+ prob3 = p + LZMA_ALIGN; -+ } -+ i2 = 1; -+ mi2 = 1; -+ while (num_bits2--) { -+ if (rc_get_bit(rc, prob3 + mi2, &mi2)) -+ rep0 |= i2; -+ i2 <<= 1; -+ } -+ } -+ if (++rep0 == 0) -+ break; -+ } -+ -+ len += LZMA_MATCH_MIN_LEN; -+ string: -+ do { -+ uint32_t pos = buffer_pos - rep0; -+ while (pos >= header.dict_size) -+ pos += header.dict_size; -+ previous_byte = buffer[pos]; -+ one_byte2: -+ buffer[buffer_pos++] = previous_byte; -+ len--; -+ } while (len != 0 && buffer_pos < header.dst_size); -+ } -+ } -+} ---- /dev/null -+++ core/unlz4.c -@@ -0,0 +1,114 @@ -+/* -+ * Copyright (C) 2015, pascal.bellard@slitaz.org -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ */ -+ -+#include -+ -+#define LZ4_MAGIC 0x184D2204 /* Spec 1.5.0 */ -+#define LZ4_LEGACY 0x184C2102 -+#define LZ4_SKIP(n) ((((n) - 0x184D2A50) >> 4) == 0) -+ -+static unsigned lz4cnt(unsigned char **p, unsigned n) -+{ -+ int i; -+ -+ if (n == 0xF) do { -+ i = *(*p)++; -+ n += i; -+ } while (i == 0xFF); -+ return n; -+} -+ -+unsigned char *unlz4(unsigned char *from, unsigned char *end) -+{ -+ unsigned char *p, *end_chunk, *to, flags, mask; -+ long magic; -+ unsigned i, n, size; -+ -+ for (p = from, flags = size = 0; p < end;) { -+ while (1) { -+ magic = * (long *) p; -+ p += sizeof(long); -+ if (magic == LZ4_LEGACY) continue; -+ if (magic != LZ4_MAGIC) break; -+ flags = *p; -+ if (flags & 8) { -+ size = * (unsigned *) (p + 2); -+ goto sizefound; -+ } -+ p += 3; /* skip FLG BD HC */ -+ } -+ if (LZ4_SKIP(magic)) { -+ p += 4 + * (long *) p; -+ continue; -+ } -+ mask = 4; /* Content checksum */ -+ if (magic) { -+ if (magic > 0) -+ for (end_chunk = p + magic; p < end_chunk;) { -+ unsigned char token = *p++; -+ -+ n = lz4cnt(&p, token >> 4); -+ size += n; -+ p += n; -+ if (p >= end_chunk) break; -+ p += sizeof(unsigned short); -+ size += 4 + lz4cnt(&p, token & 0xF); -+ } -+ else { -+ magic &= 0x7FffFFff; -+ p += magic; -+ size += magic; -+ } -+ mask = 0x10; /* Block checksum */ -+ } -+ if (flags & mask) p += 4; /* skip block checksum */ -+ } -+sizefound: -+ size += 16 - (p - from); -+ memmove(from + size, from, p - from); -+ for (to = from, p = from += size, end += size, flags = 0; p < end;) { -+ while (1) { -+ magic = * (long *) p; -+ p += sizeof(long); -+ if (magic == LZ4_LEGACY) continue; -+ if (magic != LZ4_MAGIC) break; -+ flags = *p; -+ if (flags & 8) p += 8; /* skip size */ -+ p += 3; /* skip FLG BD HC */ -+ } -+ if (LZ4_SKIP(magic)) { -+ p += 4 + * (long *) p; -+ continue; -+ } -+ mask = 4; /* Content checksum */ -+ if (magic) { -+ if (magic > 0) -+ for (end_chunk = p + magic; p < end_chunk;) { -+ unsigned char *dico; -+ unsigned char token = *p++; -+ -+ n = lz4cnt(&p, token >> 4); -+ for (i = 0; i < n; i++) -+ *to++ = *p++; -+ if (p >= end_chunk) break; -+ dico = to - (* (unsigned short *) p); -+ p += sizeof(unsigned short); -+ n = 4 + lz4cnt(&p, token & 0xF); -+ for (i = 0; i < n; i++) -+ *to++ = *dico++; -+ } -+ else for (end_chunk = p + (magic & 0x7FffFFff); -+ p < end_chunk;) { -+ *to++ = *p++; -+ } -+ mask = 0x10; /* Block checksum */ -+ } -+ if (flags & mask) p += 4; /* Skip checksum */ -+ } -+ return to; -+} diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/extra/readconfig.u --- a/syslinux/stuff/extra/readconfig.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ ---- com32/menu/readconfig.c -+++ com32/menu/readconfig.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #include "menu.h" - -@@ -874,6 +875,31 @@ - } - } else if (looking_at(p, "start")) { - start_menu = m; -+ } else if ((ep = looking_at(p, "startifnoarg"))) { -+ const union syslinux_derivative_info *sdi; -+ int custom = 0; -+ size_t size; -+ int slot; -+ sdi = syslinux_derivative_info(); -+ if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) { -+ struct disk_info diskinfo; -+ char *custom_buffer; -+ int got_config; -+ -+ disk_get_params(sdi->iso.drive_number, &diskinfo); -+ custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1); -+ got_config = (*(unsigned long *) (custom_buffer + 80)) -+ * 2048 / diskinfo.bps; -+ free(custom_buffer); -+ custom_buffer = disk_read_sectors(&diskinfo, got_config, 1); -+ if (!memcmp(custom_buffer,"#!boot ",7)) { -+ custom++; -+ } -+ free(custom_buffer); -+ } -+ slot = strtoul(ep, &ep, 0); -+ if (!custom && !syslinux_getadv(slot, &size)) -+ start_menu = m; - } else if (looking_at(p, "help")) { - if (ld.label) { - ld.action = MA_HELP; diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/patches/iso9660.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/patches/iso9660.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,74 @@ +--- core/fs/iso9660/iso9660.c ++++ core/fs/iso9660/iso9660.c +@@ -89,6 +89,24 @@ + return true; + } + ++#define __ROCKRIDGE ++#ifdef __ROCKRIDGE ++static size_t rockname(const struct iso_dir_entry *de, char **name) ++{ ++ size_t len, delen, n = (de->name_len + 34) & -2; ++ char *data = (char *) de; ++ ++ for (delen = 0; n + 2 < de->length; n += len) { ++ len = data[n + 2]; ++ if (* (short *) (data + n) == 0x4D4E) { /* NM */ ++ *name = data + n + 5; ++ delen = len - 5; ++ } ++ } ++ return delen; ++} ++#endif ++ + /* + * Find a entry in the specified dir with name _dname_. + */ +@@ -132,6 +150,20 @@ + + de_name_len = de->name_len; + de_name = de->name; ++#ifdef __ROCKRIDGE ++ { ++ char *name; ++ size_t len = rockname(de, &name); ++ ++ if (len) { ++ name[len] = 0; ++ if (!strcmp(name, dname)) { ++ dprintf("Found rockridge.\n"); ++ return de; ++ } ++ } ++ } ++#endif + if (iso_compare_name(de_name, de_name_len, dname)) { + dprintf("Found.\n"); + return de; +@@ -217,11 +249,22 @@ + dirent->d_ino = 0; /* Inode number is invalid to ISO fs */ + dirent->d_off = file->offset; + dirent->d_type = get_inode_mode(de->flags); +- dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + +- iso_convert_name(dirent->d_name, de->name, de->name_len); ++ iso_convert_name(dirent->d_name, de->name, de->name_len); + ++#ifdef __ROCKRIDGE ++ { ++ char *name; ++ size_t len = rockname(de, &name); ++ ++ if (len) { ++ strcpy(dirent->d_name, name); ++ dirent->d_name[len] = 0; ++ } ++ } ++#endif ++ dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + strlen(dirent->d_name); + file->offset += de->length; /* Update for next reading */ +- ++ + return 0; + } + diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/patches/keytab-lilo.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/patches/keytab-lilo.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,15 @@ +kbd 2.0.3 support +--- utils/keytab-lilo ++++ utils/keytab-lilo +@@ -48,9 +48,9 @@ + $empty = 1; + while () { + chop; +- if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { ++ if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) { + die "active at beginning of map" if defined $current; +- $current = $pfx.":".$2; ++ $current = $pfx.":".$3; + next; + } + undef $current if /^};\s*$/; diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/patches/loadhigh.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/patches/loadhigh.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,557 @@ +--- core/fs/loadhigh.c ++++ core/fs/loadhigh.c +@@ -36,6 +36,11 @@ + #include + #include "core.h" + #include "fs.h" ++#define LZLOAD ".c32 modules can be compressed with lz4 or lzma" ++#ifdef LZLOAD ++#include "../unlz4.c" ++#include "../unlzma.c" ++#endif + + #define MAX_CHUNK (1 << 20) /* 1 MB */ + +@@ -51,6 +56,9 @@ + uint32_t sector_mask; + size_t pad; + uint32_t retflags = 0; ++#ifdef LZLOAD ++ char *unpacked = (char *) regs->edi.l; ++#endif + + bytes = regs->eax.l; + zero_mask = regs->edx.w[0]; +@@ -101,6 +109,27 @@ + break; + } + } ++ ++#ifdef LZLOAD ++ switch (* (short *) unpacked) { ++ char *packed; ++ size_t packedsz, unpackedsz; ++ case 0x005D: ++ packedsz = buf - unpacked; ++ unpackedsz = * (unsigned long *) (unpacked + 5); ++ if (unpackedsz > 1000000) break; /* no size? */ ++ packed = unpacked + unpackedsz - packedsz + 1024; ++ if (packed < unpacked + 1024) packed = unpacked + 1024; ++ memmove(packed, unpacked, packedsz); ++ unlzma(packed, unpacked, packed + packedsz /* heap */); ++ buf = packed; ++ break; ++ case 0x2204: ++ case 0x2102: ++ buf = (char *) unlz4((unsigned char *) unpacked, (unsigned char *) buf); ++ break; ++ } ++#endif + + pad = (size_t)buf & zero_mask; + if (pad) +--- /dev/null ++++ core/unlzma.c +@@ -0,0 +1,385 @@ ++typedef unsigned char uint8_t; ++typedef unsigned short uint16_t; ++typedef unsigned uint32_t; ++typedef unsigned long long uint64_t; ++typedef unsigned size_t; ++#define SWAP_LE32(x) (x) ++#define SWAP_LE64(x) (x) ++/* vi: set sw=4 ts=4: */ ++/* ++ * Small lzma deflate implementation. ++ * Copyright (C) 2006 Aurelien Jacobs ++ * ++ * Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/) ++ * Copyright (C) 1999-2005 Igor Pavlov ++ * ++ * Licensed under GPLv2 or later, see file LICENSE in this source tree. ++ */ ++ ++#include ++ ++#define PACKED __attribute__ ((packed)) ++#define ALWAYS_INLINE inline ++#define speed_inline ++#define size_inline ALWAYS_INLINE ++ ++ ++typedef struct { ++ uint8_t *ptr; ++ ++ uint32_t code; ++ uint32_t range; ++ uint32_t bound; ++} rc_t; ++ ++#define RC_TOP_BITS 24 ++#define RC_MOVE_BITS 5 ++#define RC_MODEL_TOTAL_BITS 11 ++ ++/* Called twice, but one callsite is in speed_inline'd rc_is_bit_1() */ ++static void rc_do_normalize(rc_t *rc) ++{ ++ rc->range <<= 8; ++ rc->code = (rc->code << 8) | *rc->ptr++; ++} ++ ++static ALWAYS_INLINE void rc_normalize(rc_t *rc) ++{ ++ if (rc->range < (1 << RC_TOP_BITS)) { ++ rc_do_normalize(rc); ++ } ++} ++ ++/* Called once */ ++static void rc_init(rc_t *rc) /*, int buffer_size) */ ++{ ++ int i; ++ ++ rc->range = 0; ++ for (i = 0; i < 5; i++) { ++ rc_do_normalize(rc); ++ } ++ rc->range = 0xffffffff; ++} ++ ++/* rc_is_bit_1 is called 9 times */ ++static speed_inline int rc_is_bit_1(rc_t *rc, uint16_t *p) ++{ ++ rc_normalize(rc); ++ rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS); ++ if (rc->code < rc->bound) { ++ rc->range = rc->bound; ++ *p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS; ++ return 0; ++ } ++ rc->range -= rc->bound; ++ rc->code -= rc->bound; ++ *p -= *p >> RC_MOVE_BITS; ++ return 1; ++} ++ ++/* Called 4 times in unlzma loop */ ++static ALWAYS_INLINE int rc_get_bit(rc_t *rc, uint16_t *p, int *symbol) ++{ ++ int ret = rc_is_bit_1(rc, p); ++ *symbol = *symbol * 2 + ret; ++ return ret; ++} ++ ++/* Called once */ ++static ALWAYS_INLINE int rc_direct_bit(rc_t *rc) ++{ ++ rc_normalize(rc); ++ rc->range >>= 1; ++ if (rc->code >= rc->range) { ++ rc->code -= rc->range; ++ return 1; ++ } ++ return 0; ++} ++ ++/* Called twice */ ++static speed_inline void ++rc_bit_tree_decode(rc_t *rc, uint16_t *p, int num_levels, int *symbol) ++{ ++ int i = num_levels; ++ ++ *symbol = 1; ++ while (i--) ++ rc_get_bit(rc, p + *symbol, symbol); ++ *symbol -= 1 << num_levels; ++} ++ ++ ++typedef struct { ++ uint8_t pos; ++ uint32_t dict_size; ++ uint64_t dst_size; ++} PACKED lzma_header_t; ++ ++ ++/* #defines will force compiler to compute/optimize each one with each usage. ++ * Have heart and use enum instead. */ ++enum { ++ LZMA_BASE_SIZE = 1846, ++ LZMA_LIT_SIZE = 768, ++ ++ LZMA_NUM_POS_BITS_MAX = 4, ++ ++ LZMA_LEN_NUM_LOW_BITS = 3, ++ LZMA_LEN_NUM_MID_BITS = 3, ++ LZMA_LEN_NUM_HIGH_BITS = 8, ++ ++ LZMA_LEN_CHOICE = 0, ++ LZMA_LEN_CHOICE_2 = (LZMA_LEN_CHOICE + 1), ++ LZMA_LEN_LOW = (LZMA_LEN_CHOICE_2 + 1), ++ LZMA_LEN_MID = (LZMA_LEN_LOW \ ++ + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))), ++ LZMA_LEN_HIGH = (LZMA_LEN_MID \ ++ + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))), ++ LZMA_NUM_LEN_PROBS = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)), ++ ++ LZMA_NUM_STATES = 12, ++ LZMA_NUM_LIT_STATES = 7, ++ ++ LZMA_START_POS_MODEL_INDEX = 4, ++ LZMA_END_POS_MODEL_INDEX = 14, ++ LZMA_NUM_FULL_DISTANCES = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)), ++ ++ LZMA_NUM_POS_SLOT_BITS = 6, ++ LZMA_NUM_LEN_TO_POS_STATES = 4, ++ ++ LZMA_NUM_ALIGN_BITS = 4, ++ ++ LZMA_MATCH_MIN_LEN = 2, ++ ++ LZMA_IS_MATCH = 0, ++ LZMA_IS_REP = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)), ++ LZMA_IS_REP_G0 = (LZMA_IS_REP + LZMA_NUM_STATES), ++ LZMA_IS_REP_G1 = (LZMA_IS_REP_G0 + LZMA_NUM_STATES), ++ LZMA_IS_REP_G2 = (LZMA_IS_REP_G1 + LZMA_NUM_STATES), ++ LZMA_IS_REP_0_LONG = (LZMA_IS_REP_G2 + LZMA_NUM_STATES), ++ LZMA_POS_SLOT = (LZMA_IS_REP_0_LONG \ ++ + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)), ++ LZMA_SPEC_POS = (LZMA_POS_SLOT \ ++ + (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)), ++ LZMA_ALIGN = (LZMA_SPEC_POS \ ++ + LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX), ++ LZMA_LEN_CODER = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)), ++ LZMA_REP_LEN_CODER = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS), ++ LZMA_LITERAL = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS), ++}; ++ ++ ++void unlzma(char *from, char *to, char *heap) ++{ ++ lzma_header_t header; ++ int lc, pb, lp; ++ uint32_t pos_state_mask; ++ uint32_t literal_pos_mask; ++ uint16_t *p; ++ rc_t *rc = (rc_t *) heap; ++ int i; ++ uint8_t *buffer = (void *) to; ++ uint8_t previous_byte = 0; ++ size_t buffer_pos = 0; ++ int len = 0; ++ int state = 0; ++ uint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1; ++ ++ memcpy(&header, from, sizeof(header)); ++ from += sizeof(header); ++ heap += sizeof(*rc); ++ rc->ptr = (void *) from; ++ ++ i = header.pos / 9; ++ lc = header.pos % 9; ++ pb = i / 5; ++ lp = i % 5; ++ pos_state_mask = (1 << pb) - 1; ++ literal_pos_mask = (1 << lp) - 1; ++ ++ /* Example values from linux-3.3.4.tar.lzma: ++ * dict_size: 64M, dst_size: 2^64-1 ++ */ ++ header.dict_size = SWAP_LE32(header.dict_size); ++ header.dst_size = SWAP_LE64(header.dst_size); ++ ++ //if (header.dict_size == 0) ++ // header.dict_size++; ++ ++ rc_init(rc); ++ ++ { ++ int num_probs; ++ ++ num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)); ++ //p = xmalloc(num_probs * sizeof(*p)); ++ p = (void *) heap; ++ num_probs += LZMA_LITERAL - LZMA_BASE_SIZE; ++ for (i = 0; i < num_probs; i++) ++ p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1; ++ } ++ ++ ++ while (buffer_pos < header.dst_size) { ++ int pos_state = buffer_pos & pos_state_mask; ++ uint16_t *prob = p + LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state; ++ ++ if (!rc_is_bit_1(rc, prob)) { ++ static const char next_state[LZMA_NUM_STATES] = ++ { 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 }; ++ int mi = 1; ++ ++ prob = (p + LZMA_LITERAL ++ + (LZMA_LIT_SIZE * (((buffer_pos & literal_pos_mask) << lc) ++ + (previous_byte >> (8 - lc)) ++ ) ++ ) ++ ); ++ ++ if (state >= LZMA_NUM_LIT_STATES) { ++ int match_byte; ++ uint32_t pos = buffer_pos - rep0; ++ ++ while (pos >= header.dict_size) ++ pos += header.dict_size; ++ match_byte = buffer[pos]; ++ do { ++ int bit; ++ ++ match_byte <<= 1; ++ bit = match_byte & 0x100; ++ bit ^= (rc_get_bit(rc, prob + 0x100 + bit + mi, &mi) << 8); /* 0x100 or 0 */ ++ if (bit) ++ break; ++ } while (mi < 0x100); ++ } ++ while (mi < 0x100) { ++ rc_get_bit(rc, prob + mi, &mi); ++ } ++ ++ state = next_state[state]; ++ ++ previous_byte = (uint8_t) mi; ++ len = 1; ++ goto one_byte2; ++ } else { ++ int num_bits; ++ int offset; ++ uint16_t *prob2; ++#define prob_len prob2 ++ ++ prob2 = p + LZMA_IS_REP + state; ++ if (!rc_is_bit_1(rc, prob2)) { ++ rep3 = rep2; ++ rep2 = rep1; ++ rep1 = rep0; ++ state = state < LZMA_NUM_LIT_STATES ? 0 : 3; ++ prob2 = p + LZMA_LEN_CODER; ++ } else { ++ prob2 += LZMA_IS_REP_G0 - LZMA_IS_REP; ++ if (!rc_is_bit_1(rc, prob2)) { ++ prob2 = (p + LZMA_IS_REP_0_LONG ++ + (state << LZMA_NUM_POS_BITS_MAX) ++ + pos_state ++ ); ++ if (!rc_is_bit_1(rc, prob2)) { ++ state = state < LZMA_NUM_LIT_STATES ? 9 : 11; ++ len = 1; ++ goto string; ++ } ++ } else { ++ uint32_t distance; ++ ++ prob2 += LZMA_IS_REP_G1 - LZMA_IS_REP_G0; ++ distance = rep1; ++ if (rc_is_bit_1(rc, prob2)) { ++ prob2 += LZMA_IS_REP_G2 - LZMA_IS_REP_G1; ++ distance = rep2; ++ if (rc_is_bit_1(rc, prob2)) { ++ distance = rep3; ++ rep3 = rep2; ++ } ++ rep2 = rep1; ++ } ++ rep1 = rep0; ++ rep0 = distance; ++ } ++ state = state < LZMA_NUM_LIT_STATES ? 8 : 11; ++ prob2 = p + LZMA_REP_LEN_CODER; ++ } ++ ++ prob_len = prob2 + LZMA_LEN_CHOICE; ++ num_bits = LZMA_LEN_NUM_LOW_BITS; ++ if (!rc_is_bit_1(rc, prob_len)) { ++ prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE ++ + (pos_state << LZMA_LEN_NUM_LOW_BITS); ++ offset = 0; ++ } else { ++ prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE; ++ if (!rc_is_bit_1(rc, prob_len)) { ++ prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2 ++ + (pos_state << LZMA_LEN_NUM_MID_BITS); ++ offset = 1 << LZMA_LEN_NUM_LOW_BITS; ++ num_bits += LZMA_LEN_NUM_MID_BITS - LZMA_LEN_NUM_LOW_BITS; ++ } else { ++ prob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2; ++ offset = ((1 << LZMA_LEN_NUM_LOW_BITS) ++ + (1 << LZMA_LEN_NUM_MID_BITS)); ++ num_bits += LZMA_LEN_NUM_HIGH_BITS - LZMA_LEN_NUM_LOW_BITS; ++ } ++ } ++ rc_bit_tree_decode(rc, prob_len, num_bits, &len); ++ len += offset; ++ ++ if (state < 4) { ++ int pos_slot; ++ uint16_t *prob3; ++ ++ state += LZMA_NUM_LIT_STATES; ++ prob3 = p + LZMA_POS_SLOT + ++ ((len < LZMA_NUM_LEN_TO_POS_STATES ? len : ++ LZMA_NUM_LEN_TO_POS_STATES - 1) ++ << LZMA_NUM_POS_SLOT_BITS); ++ rc_bit_tree_decode(rc, prob3, ++ LZMA_NUM_POS_SLOT_BITS, &pos_slot); ++ rep0 = pos_slot; ++ if (pos_slot >= LZMA_START_POS_MODEL_INDEX) { ++ int i2, mi2, num_bits2 = (pos_slot >> 1) - 1; ++ rep0 = 2 | (pos_slot & 1); ++ if (pos_slot < LZMA_END_POS_MODEL_INDEX) { ++ rep0 <<= num_bits2; ++ prob3 = p + LZMA_SPEC_POS + rep0 - pos_slot - 1; ++ } else { ++ for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--) ++ rep0 = (rep0 << 1) | rc_direct_bit(rc); ++ rep0 <<= LZMA_NUM_ALIGN_BITS; ++ prob3 = p + LZMA_ALIGN; ++ } ++ i2 = 1; ++ mi2 = 1; ++ while (num_bits2--) { ++ if (rc_get_bit(rc, prob3 + mi2, &mi2)) ++ rep0 |= i2; ++ i2 <<= 1; ++ } ++ } ++ if (++rep0 == 0) ++ break; ++ } ++ ++ len += LZMA_MATCH_MIN_LEN; ++ string: ++ do { ++ uint32_t pos = buffer_pos - rep0; ++ while (pos >= header.dict_size) ++ pos += header.dict_size; ++ previous_byte = buffer[pos]; ++ one_byte2: ++ buffer[buffer_pos++] = previous_byte; ++ len--; ++ } while (len != 0 && buffer_pos < header.dst_size); ++ } ++ } ++} +--- /dev/null ++++ core/unlz4.c +@@ -0,0 +1,114 @@ ++/* ++ * Copyright (C) 2015, pascal.bellard@slitaz.org ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++ ++#define LZ4_MAGIC 0x184D2204 /* Spec 1.5.0 */ ++#define LZ4_LEGACY 0x184C2102 ++#define LZ4_SKIP(n) ((((n) - 0x184D2A50) >> 4) == 0) ++ ++static unsigned lz4cnt(unsigned char **p, unsigned n) ++{ ++ int i; ++ ++ if (n == 0xF) do { ++ i = *(*p)++; ++ n += i; ++ } while (i == 0xFF); ++ return n; ++} ++ ++unsigned char *unlz4(unsigned char *from, unsigned char *end) ++{ ++ unsigned char *p, *end_chunk, *to, flags, mask; ++ long magic; ++ unsigned i, n, size; ++ ++ for (p = from, flags = size = 0; p < end;) { ++ while (1) { ++ magic = * (long *) p; ++ p += sizeof(long); ++ if (magic == LZ4_LEGACY) continue; ++ if (magic != LZ4_MAGIC) break; ++ flags = *p; ++ if (flags & 8) { ++ size = * (unsigned *) (p + 2); ++ goto sizefound; ++ } ++ p += 3; /* skip FLG BD HC */ ++ } ++ if (LZ4_SKIP(magic)) { ++ p += 4 + * (long *) p; ++ continue; ++ } ++ mask = 4; /* Content checksum */ ++ if (magic) { ++ if (magic > 0) ++ for (end_chunk = p + magic; p < end_chunk;) { ++ unsigned char token = *p++; ++ ++ n = lz4cnt(&p, token >> 4); ++ size += n; ++ p += n; ++ if (p >= end_chunk) break; ++ p += sizeof(unsigned short); ++ size += 4 + lz4cnt(&p, token & 0xF); ++ } ++ else { ++ magic &= 0x7FffFFff; ++ p += magic; ++ size += magic; ++ } ++ mask = 0x10; /* Block checksum */ ++ } ++ if (flags & mask) p += 4; /* skip block checksum */ ++ } ++sizefound: ++ size += 16 - (p - from); ++ memmove(from + size, from, p - from); ++ for (to = from, p = from += size, end += size, flags = 0; p < end;) { ++ while (1) { ++ magic = * (long *) p; ++ p += sizeof(long); ++ if (magic == LZ4_LEGACY) continue; ++ if (magic != LZ4_MAGIC) break; ++ flags = *p; ++ if (flags & 8) p += 8; /* skip size */ ++ p += 3; /* skip FLG BD HC */ ++ } ++ if (LZ4_SKIP(magic)) { ++ p += 4 + * (long *) p; ++ continue; ++ } ++ mask = 4; /* Content checksum */ ++ if (magic) { ++ if (magic > 0) ++ for (end_chunk = p + magic; p < end_chunk;) { ++ unsigned char *dico; ++ unsigned char token = *p++; ++ ++ n = lz4cnt(&p, token >> 4); ++ for (i = 0; i < n; i++) ++ *to++ = *p++; ++ if (p >= end_chunk) break; ++ dico = to - (* (unsigned short *) p); ++ p += sizeof(unsigned short); ++ n = 4 + lz4cnt(&p, token & 0xF); ++ for (i = 0; i < n; i++) ++ *to++ = *dico++; ++ } ++ else for (end_chunk = p + (magic & 0x7FffFFff); ++ p < end_chunk;) { ++ *to++ = *p++; ++ } ++ mask = 0x10; /* Block checksum */ ++ } ++ if (flags & mask) p += 4; /* Skip checksum */ ++ } ++ return to; ++} diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/patches/readconfig.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/patches/readconfig.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,42 @@ +--- com32/menu/readconfig.c ++++ com32/menu/readconfig.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "menu.h" + +@@ -874,6 +875,31 @@ + } + } else if (looking_at(p, "start")) { + start_menu = m; ++ } else if ((ep = looking_at(p, "startifnoarg"))) { ++ const union syslinux_derivative_info *sdi; ++ int custom = 0; ++ size_t size; ++ int slot; ++ sdi = syslinux_derivative_info(); ++ if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) { ++ struct disk_info diskinfo; ++ char *custom_buffer; ++ int got_config; ++ ++ disk_get_params(sdi->iso.drive_number, &diskinfo); ++ custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1); ++ got_config = (*(unsigned long *) (custom_buffer + 80)) ++ * 2048 / diskinfo.bps; ++ free(custom_buffer); ++ custom_buffer = disk_read_sectors(&diskinfo, got_config, 1); ++ if (!memcmp(custom_buffer,"#!boot ",7)) { ++ custom++; ++ } ++ free(custom_buffer); ++ } ++ slot = strtoul(ep, &ep, 0); ++ if (!custom && !syslinux_getadv(slot, &size)) ++ start_menu = m; + } else if (looking_at(p, "help")) { + if (ld.label) { + ld.action = MA_HELP; diff -r c7b121a4ffd9 -r d6378d455338 syslinux/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,4 @@ +-p0|loadhigh.u +-p0|iso9660.u +-p0|readconfig.u +-p0|keytab-lilo.u diff -r c7b121a4ffd9 -r d6378d455338 thttpd/receipt --- a/thttpd/receipt Wed May 09 17:03:28 2018 +0300 +++ b/thttpd/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,8 +15,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - patch -p1 -i $stuff/htpassword.c.u || exit 1 ./configure \ --prefix=/usr \ --infodir=/usr/share/info \ diff -r c7b121a4ffd9 -r d6378d455338 thttpd/stuff/htpassword.c.u --- a/thttpd/stuff/htpassword.c.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- thttpd-2.25b-ori/extras/htpasswd.c Wed Dec 19 01:08:08 2001 -+++ thttpd-2.25b/extras/htpasswd.c Sun Feb 28 23:02:36 2010 -@@ -49,7 +49,7 @@ - while((line[y++] = line[x++])); - } - --static int getline(char *s, int n, FILE *f) { -+static int xgetline(char *s, int n, FILE *f) { - register int i=0; - - while(1) { -@@ -189,7 +189,7 @@ - strcpy(user,argv[2]); - - found = 0; -- while(!(getline(line,MAX_STRING_LEN,f))) { -+ while(!(xgetline(line,MAX_STRING_LEN,f))) { - if(found || (line[0] == '#') || (!line[0])) { - putline(tfp,line); - continue; diff -r c7b121a4ffd9 -r d6378d455338 thttpd/stuff/patches/htpassword.c.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thttpd/stuff/patches/htpassword.c.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,20 @@ +--- thttpd-2.25b-ori/extras/htpasswd.c Wed Dec 19 01:08:08 2001 ++++ thttpd-2.25b/extras/htpasswd.c Sun Feb 28 23:02:36 2010 +@@ -49,7 +49,7 @@ + while((line[y++] = line[x++])); + } + +-static int getline(char *s, int n, FILE *f) { ++static int xgetline(char *s, int n, FILE *f) { + register int i=0; + + while(1) { +@@ -189,7 +189,7 @@ + strcpy(user,argv[2]); + + found = 0; +- while(!(getline(line,MAX_STRING_LEN,f))) { ++ while(!(xgetline(line,MAX_STRING_LEN,f))) { + if(found || (line[0] == '#') || (!line[0])) { + putline(tfp,line); + continue; diff -r c7b121a4ffd9 -r d6378d455338 thttpd/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thttpd/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|htpassword.c.u diff -r c7b121a4ffd9 -r d6378d455338 tinyproxy/receipt --- a/tinyproxy/receipt Wed May 09 17:03:28 2018 +0300 +++ b/tinyproxy/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,8 +12,6 @@ WGET_URL="https://banu.com/pub/$PACKAGE/${VERSION%.*}/$TARBALL" compile_rules() { - patch -Np1 -i $stuff/no-docs-and-tests.diff - ./configure \ --sysconfdir=/etc/tinyproxy \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 tinyproxy/stuff/no-docs-and-tests.diff --- a/tinyproxy/stuff/no-docs-and-tests.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -diff --git a/Makefile.am b/Makefile.am -index 7de41f2..9d1f99b 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -2,9 +2,7 @@ SUBDIRS = \ - src \ - data \ - etc \ -- docs \ - m4macros \ -- tests - - # tools want this on a single line - ACLOCAL_AMFLAGS = -I m4macros -diff --git a/Makefile.in b/Makefile.in -index d0ec918..5be49d4 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -221,9 +221,7 @@ SUBDIRS = \ - src \ - data \ - etc \ -- docs \ - m4macros \ -- tests - - - # tools want this on a single line -diff --git a/configure b/configure -index 01d6883..facfadd 100755 ---- a/configure -+++ b/configure -@@ -6810,65 +6810,8 @@ - fi - - -- -- -- -- -- --# Check for asciidoc --# Extract the first word of "a2x", so it can be a program name with args. --set dummy a2x; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_A2X+set}" = set; then : -- $as_echo_n "(cached) " >&6 --else -- case $A2X in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_A2X="$A2X" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_path_A2X="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no" -- ;; --esac --fi --A2X=$ac_cv_path_A2X --if test -n "$A2X"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5 --$as_echo "$A2X" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- -- if test "x$A2X" != "xno"; then -- HAVE_A2X_TRUE= -- HAVE_A2X_FALSE='#' --else - HAVE_A2X_TRUE='#' - HAVE_A2X_FALSE= --fi -- --if test x"$A2X" = x"no"; then -- as_fn_error $? "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5 --fi -- - ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile" - - diff -r c7b121a4ffd9 -r d6378d455338 tinyproxy/stuff/patches/no-docs-and-tests.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tinyproxy/stuff/patches/no-docs-and-tests.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,98 @@ +diff --git a/Makefile.am b/Makefile.am +index 7de41f2..9d1f99b 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,9 +2,7 @@ SUBDIRS = \ + src \ + data \ + etc \ +- docs \ + m4macros \ +- tests + + # tools want this on a single line + ACLOCAL_AMFLAGS = -I m4macros +diff --git a/Makefile.in b/Makefile.in +index d0ec918..5be49d4 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -221,9 +221,7 @@ SUBDIRS = \ + src \ + data \ + etc \ +- docs \ + m4macros \ +- tests + + + # tools want this on a single line +diff --git a/configure b/configure +index 01d6883..facfadd 100755 +--- a/configure ++++ b/configure +@@ -6810,65 +6810,8 @@ + fi + + +- +- +- +- +- +-# Check for asciidoc +-# Extract the first word of "a2x", so it can be a program name with args. +-set dummy a2x; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_A2X+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $A2X in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_A2X="$A2X" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_A2X="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no" +- ;; +-esac +-fi +-A2X=$ac_cv_path_A2X +-if test -n "$A2X"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5 +-$as_echo "$A2X" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +- if test "x$A2X" != "xno"; then +- HAVE_A2X_TRUE= +- HAVE_A2X_FALSE='#' +-else + HAVE_A2X_TRUE='#' + HAVE_A2X_FALSE= +-fi +- +-if test x"$A2X" = x"no"; then +- as_fn_error $? "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5 +-fi +- + ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile" + + diff -r c7b121a4ffd9 -r d6378d455338 tinyproxy/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tinyproxy/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +no-docs-and-tests.diff diff -r c7b121a4ffd9 -r d6378d455338 tpp/receipt --- a/tpp/receipt Wed May 09 17:03:28 2018 +0300 +++ b/tpp/receipt Thu May 10 21:12:00 2018 +0300 @@ -12,10 +12,6 @@ WGET_URL="http://www.ngolde.de/download/$TARBALL" compile_rules() { - # use debian patches and fixes - patch -i $stuff/ruby19.patch - patch -i $stuff/optional-x.patch - cd examples for tppfile in *.tpp; do iconv -f ISO-8859-1 -t UTF-8 -o $tppfile.new $tppfile && diff -r c7b121a4ffd9 -r d6378d455338 tpp/stuff/optional-x.patch --- a/tpp/stuff/optional-x.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -Description: Don't execute commands with --exec by default -Author: Axel Beckert -Debian-Bug: 706644 - -Index: tpp/tpp.rb -=================================================================== ---- tpp.orig/tpp.rb 2013-06-12 22:13:55.000000000 +0200 -+++ tpp/tpp.rb 2013-06-12 22:15:08.000000000 +0200 -@@ -725,9 +725,13 @@ - end - - def do_exec(cmdline) -- rc = Kernel.system(cmdline) -- if not rc then -- # @todo: add error message -+ if $execok then -+ rc = Kernel.system(cmdline) -+ if not rc then -+ # @todo: add error message -+ end -+ else -+ @screen.addstr("--exec disabled by default for security reasons. Use option -x to enable it.") - end - end - -@@ -1683,6 +1687,7 @@ - $stderr.puts "\t -t \tset filetype as output format" - $stderr.puts "\t -o \twrite output to file " - $stderr.puts "\t -s \twait seconds between slides (with -t autoplay)" -+ $stderr.puts "\t -x\t\tallow parsing of --exec in input files" - $stderr.puts "\t --version\tprint the version" - $stderr.puts "\t --help\t\tprint this help" - $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt" -@@ -1699,6 +1704,7 @@ - output = nil - type = "ncurses" - time = 1 -+$execok = nil - - skip_next = false - -@@ -1720,6 +1726,8 @@ - elsif ARGV[i] == "-s" then - time = ARGV[i+1].to_i - skip_next = true -+ elsif ARGV[i] == "-x" then -+ $execok = 1 - elsif input == nil then - input = ARGV[i] - end - diff -r c7b121a4ffd9 -r d6378d455338 tpp/stuff/patches/optional-x.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/stuff/patches/optional-x.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,51 @@ +Description: Don't execute commands with --exec by default +Author: Axel Beckert +Debian-Bug: 706644 + +Index: tpp/tpp.rb +=================================================================== +--- tpp.orig/tpp.rb 2013-06-12 22:13:55.000000000 +0200 ++++ tpp/tpp.rb 2013-06-12 22:15:08.000000000 +0200 +@@ -725,9 +725,13 @@ + end + + def do_exec(cmdline) +- rc = Kernel.system(cmdline) +- if not rc then +- # @todo: add error message ++ if $execok then ++ rc = Kernel.system(cmdline) ++ if not rc then ++ # @todo: add error message ++ end ++ else ++ @screen.addstr("--exec disabled by default for security reasons. Use option -x to enable it.") + end + end + +@@ -1683,6 +1687,7 @@ + $stderr.puts "\t -t \tset filetype as output format" + $stderr.puts "\t -o \twrite output to file " + $stderr.puts "\t -s \twait seconds between slides (with -t autoplay)" ++ $stderr.puts "\t -x\t\tallow parsing of --exec in input files" + $stderr.puts "\t --version\tprint the version" + $stderr.puts "\t --help\t\tprint this help" + $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt" +@@ -1699,6 +1704,7 @@ + output = nil + type = "ncurses" + time = 1 ++$execok = nil + + skip_next = false + +@@ -1720,6 +1726,8 @@ + elsif ARGV[i] == "-s" then + time = ARGV[i+1].to_i + skip_next = true ++ elsif ARGV[i] == "-x" then ++ $execok = 1 + elsif input == nil then + input = ARGV[i] + end + diff -r c7b121a4ffd9 -r d6378d455338 tpp/stuff/patches/ruby19.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/stuff/patches/ruby19.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,294 @@ +Description: make key events work on ruby 1.9 +Author: Chad Fowler +Debian-Bug: 671530 + +Index: tpp/tpp.rb +=================================================================== +--- tpp.orig/tpp.rb 2013-06-12 18:13:40.000000000 +0200 ++++ tpp/tpp.rb 2013-06-12 21:05:55.000000000 +0200 +@@ -44,7 +44,7 @@ + "blue" => 5, + "cyan" => 6, + "magenta" => 7, +- "black" => 8, ++ "black" => 8, + "default" =>-1} + colors[color] + end +@@ -95,7 +95,7 @@ + end # class FileParser + + +-# Represents a page (aka `slide') in TPP. A page consists of a title and one or ++# Represents a page (aka `slide') in TPP. A page consists of a title and one or + # more lines. + class Page + +@@ -145,8 +145,8 @@ + + + +-# Implements a generic visualizer from which all other visualizers need to be +-# derived. If Ruby supported abstract methods, all the do_* methods would be ++# Implements a generic visualizer from which all other visualizers need to be ++# derived. If Ruby supported abstract methods, all the do_* methods would be + # abstract. + class TppVisualizer + +@@ -154,8 +154,8 @@ + # nothing + end + +- # Splits a line into several lines, where each of the result lines is at most +- # _width_ characters long, caring about word boundaries, and returns an array ++ # Splits a line into several lines, where each of the result lines is at most ++ # _width_ characters long, caring about word boundaries, and returns an array + # of strings. + def split_lines(text,width) + lines = [] +@@ -190,13 +190,13 @@ + $stderr.puts "Error: TppVisualizer#do_footer has been called directly." + Kernel.exit(1) + end +- ++ + def do_header(header_text) + $stderr.puts "Error: TppVisualizer#do_header has been called directly." + Kernel.exit(1) + end + +- ++ + def do_refresh + $stderr.puts "Error: TppVisualizer#do_refresh has been called directly." + Kernel.exit(1) +@@ -316,7 +316,7 @@ + $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly." + Kernel.exit(1) + end +- ++ + def do_beginslideright + $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly." + Kernel.exit(1) +@@ -377,7 +377,7 @@ + Kernel.exit(1) + end + +- # Receives a _line_, parses it if necessary, and dispatches it ++ # Receives a _line_, parses it if necessary, and dispatches it + # to the correct method which then does the correct processing. + # It returns whether the controller shall wait for input. + def visualize(line,eop) +@@ -446,10 +446,10 @@ + do_huge(figlet_text) + when /^--footer / + @footer_txt = line.sub(/^--footer /,"") +- do_footer(@footer_txt) ++ do_footer(@footer_txt) + when /^--header / + @header_txt = line.sub(/^--header /,"") +- do_header(@header_txt) ++ do_header(@header_txt) + when /^--title / + title = line.sub(/^--title /,"") + do_title(title) +@@ -547,7 +547,7 @@ + @withborder = true + draw_border + end +- ++ + def do_command_prompt() + message = "Press any key to continue :)" + cursor_pos = 0 +@@ -614,11 +614,11 @@ + (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'") + 1.upto(@termheight-3) do |y| + @screen.move(y,0) +- @screen.addstr("|") ++ @screen.addstr("|") + end + 1.upto(@termheight-3) do |y| + @screen.move(y,@termwidth-1) +- @screen.addstr("|") ++ @screen.addstr("|") + end + end + +@@ -700,7 +700,7 @@ + end + + def show_help_page +- help_text = [ "tpp help", ++ help_text = [ "tpp help", + "", + "space bar ............................... display next entry within page", + "space bar, cursor-down, cursor-right .... display next page", +@@ -775,7 +775,7 @@ + @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2) + @screen.addstr(footer_txt) + end +- ++ + def do_header(header_txt) + @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2) + @screen.addstr(header_txt) +@@ -918,7 +918,7 @@ + time_to_sleep = 1.to_f / 20 + Kernel.sleep(time_to_sleep) + xcount -= 1 +- end ++ end + when "right" + (@termwidth - @indent).times do |pos| + @screen.move(@cur_line,@termwidth - pos - 1) +@@ -991,7 +991,7 @@ + @screen.move(line,col*15 + 2) + if current_page == i then + @screen.printw("%2d %s <=",i+1,pages[i].title[0..80]) +- else ++ else + @screen.printw("%2d %s",i+1,pages[i].title[0..80]) + end + line += 1 +@@ -1092,7 +1092,7 @@ + + def do_footer(footer_text) + end +- ++ + def do_header(header_text) + end + +@@ -1166,7 +1166,7 @@ + + def do_revon + end +- ++ + def do_command_prompt + end + def do_revoff +@@ -1183,7 +1183,7 @@ + + def do_endslide + end +- ++ + def do_beginslideright + end + +@@ -1349,7 +1349,7 @@ + + end + +-# Implements an interactive controller which feeds the visualizer until it is ++# Implements an interactive controller which feeds the visualizer until it is + # told to stop, and then reads a key press and executes the appropiate action. + class InteractiveController < TppController + +@@ -1396,17 +1396,17 @@ + loop do + ch = @vis.get_key + case ch +- when 'q'[0], 'Q'[0] # 'Q'uit ++ when ?q.ord, ?Q.ord # 'Q'uit + return +- when 'r'[0], 'R'[0] # 'R'edraw slide ++ when ?r.ord, ?R.ord # 'R'edraw slide + changed_page = true # @todo: actually implement redraw +- when 'e'[0], 'E'[0] ++ when ?e.ord, ?E.ord + @cur_page = @pages.size - 1 + break +- when 's'[0], 'S'[0] ++ when ?s.ord, ?S.ord + @cur_page = 0 + break +- when 'j'[0], 'J'[0] # 'J'ump to slide ++ when ?j.ord, ?J.ord # 'J'ump to slide + screen = @vis.store_screen + p = @vis.read_newpage(@pages,@cur_page) + if p >= 0 and p < @pages.size +@@ -1417,28 +1417,28 @@ + @vis.restore_screen(screen) + end + break +- when 'l'[0], 'L'[0] # re'l'oad current file ++ when ?l.ord, ?L.ord # re'l'oad current file + @reload_file = true + return +- when 'c'[0], 'C'[0] # command prompt ++ when ?c.ord, ?C.ord # command prompt + screen = @vis.store_screen + @vis.do_command_prompt + @vis.clear + @vis.restore_screen(screen) +- when '?'[0], 'h'[0] ++ when ??.ord, ?h.ord + screen = @vis.store_screen + @vis.show_help_page + ch = @vis.get_key + @vis.clear + @vis.restore_screen(screen) +- when :keyright, :keydown, ' '[0] ++ when :keyright, :keydown, ' '.ord + if @cur_page + 1 < @pages.size and eop then + @cur_page += 1 + @pages[@cur_page].reset_eop + @vis.new_page + end + break +- when 'b'[0], 'B'[0], :keyleft, :keyup ++ when ?b.ord, ?B.ord, :keyleft, :keyup + if @cur_page > 0 then + @cur_page -= 1 + @pages[@cur_page].reset_eop +@@ -1455,7 +1455,7 @@ + end + + +-# Implements a visualizer which converts TPP source to a nicely formatted text ++# Implements a visualizer which converts TPP source to a nicely formatted text + # file which can e.g. be used as handout. + class TextVisualizer < TppVisualizer + +@@ -1475,7 +1475,7 @@ + + def do_footer(footer_text) + end +- ++ + def do_header(header_text) + end + +@@ -1539,7 +1539,7 @@ + + def do_revon + end +- ++ + def do_command_prompt + end + def do_revoff +@@ -1556,7 +1556,7 @@ + + def do_endslide + end +- ++ + def do_beginslideright + end + +@@ -1650,8 +1650,8 @@ + + end + +-# Implements a non-interactive controller to control non-interactive +-# visualizers (i.e. those that are used for converting TPP source code into ++# Implements a non-interactive controller to control non-interactive ++# visualizers (i.e. those that are used for converting TPP source code into + # another format) + class ConversionController < TppController + diff -r c7b121a4ffd9 -r d6378d455338 tpp/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpp/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +# use debian patches and fixes +ruby19.patch +optional-x.patch diff -r c7b121a4ffd9 -r d6378d455338 tpp/stuff/ruby19.patch --- a/tpp/stuff/ruby19.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ -Description: make key events work on ruby 1.9 -Author: Chad Fowler -Debian-Bug: 671530 - -Index: tpp/tpp.rb -=================================================================== ---- tpp.orig/tpp.rb 2013-06-12 18:13:40.000000000 +0200 -+++ tpp/tpp.rb 2013-06-12 21:05:55.000000000 +0200 -@@ -44,7 +44,7 @@ - "blue" => 5, - "cyan" => 6, - "magenta" => 7, -- "black" => 8, -+ "black" => 8, - "default" =>-1} - colors[color] - end -@@ -95,7 +95,7 @@ - end # class FileParser - - --# Represents a page (aka `slide') in TPP. A page consists of a title and one or -+# Represents a page (aka `slide') in TPP. A page consists of a title and one or - # more lines. - class Page - -@@ -145,8 +145,8 @@ - - - --# Implements a generic visualizer from which all other visualizers need to be --# derived. If Ruby supported abstract methods, all the do_* methods would be -+# Implements a generic visualizer from which all other visualizers need to be -+# derived. If Ruby supported abstract methods, all the do_* methods would be - # abstract. - class TppVisualizer - -@@ -154,8 +154,8 @@ - # nothing - end - -- # Splits a line into several lines, where each of the result lines is at most -- # _width_ characters long, caring about word boundaries, and returns an array -+ # Splits a line into several lines, where each of the result lines is at most -+ # _width_ characters long, caring about word boundaries, and returns an array - # of strings. - def split_lines(text,width) - lines = [] -@@ -190,13 +190,13 @@ - $stderr.puts "Error: TppVisualizer#do_footer has been called directly." - Kernel.exit(1) - end -- -+ - def do_header(header_text) - $stderr.puts "Error: TppVisualizer#do_header has been called directly." - Kernel.exit(1) - end - -- -+ - def do_refresh - $stderr.puts "Error: TppVisualizer#do_refresh has been called directly." - Kernel.exit(1) -@@ -316,7 +316,7 @@ - $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly." - Kernel.exit(1) - end -- -+ - def do_beginslideright - $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly." - Kernel.exit(1) -@@ -377,7 +377,7 @@ - Kernel.exit(1) - end - -- # Receives a _line_, parses it if necessary, and dispatches it -+ # Receives a _line_, parses it if necessary, and dispatches it - # to the correct method which then does the correct processing. - # It returns whether the controller shall wait for input. - def visualize(line,eop) -@@ -446,10 +446,10 @@ - do_huge(figlet_text) - when /^--footer / - @footer_txt = line.sub(/^--footer /,"") -- do_footer(@footer_txt) -+ do_footer(@footer_txt) - when /^--header / - @header_txt = line.sub(/^--header /,"") -- do_header(@header_txt) -+ do_header(@header_txt) - when /^--title / - title = line.sub(/^--title /,"") - do_title(title) -@@ -547,7 +547,7 @@ - @withborder = true - draw_border - end -- -+ - def do_command_prompt() - message = "Press any key to continue :)" - cursor_pos = 0 -@@ -614,11 +614,11 @@ - (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'") - 1.upto(@termheight-3) do |y| - @screen.move(y,0) -- @screen.addstr("|") -+ @screen.addstr("|") - end - 1.upto(@termheight-3) do |y| - @screen.move(y,@termwidth-1) -- @screen.addstr("|") -+ @screen.addstr("|") - end - end - -@@ -700,7 +700,7 @@ - end - - def show_help_page -- help_text = [ "tpp help", -+ help_text = [ "tpp help", - "", - "space bar ............................... display next entry within page", - "space bar, cursor-down, cursor-right .... display next page", -@@ -775,7 +775,7 @@ - @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2) - @screen.addstr(footer_txt) - end -- -+ - def do_header(header_txt) - @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2) - @screen.addstr(header_txt) -@@ -918,7 +918,7 @@ - time_to_sleep = 1.to_f / 20 - Kernel.sleep(time_to_sleep) - xcount -= 1 -- end -+ end - when "right" - (@termwidth - @indent).times do |pos| - @screen.move(@cur_line,@termwidth - pos - 1) -@@ -991,7 +991,7 @@ - @screen.move(line,col*15 + 2) - if current_page == i then - @screen.printw("%2d %s <=",i+1,pages[i].title[0..80]) -- else -+ else - @screen.printw("%2d %s",i+1,pages[i].title[0..80]) - end - line += 1 -@@ -1092,7 +1092,7 @@ - - def do_footer(footer_text) - end -- -+ - def do_header(header_text) - end - -@@ -1166,7 +1166,7 @@ - - def do_revon - end -- -+ - def do_command_prompt - end - def do_revoff -@@ -1183,7 +1183,7 @@ - - def do_endslide - end -- -+ - def do_beginslideright - end - -@@ -1349,7 +1349,7 @@ - - end - --# Implements an interactive controller which feeds the visualizer until it is -+# Implements an interactive controller which feeds the visualizer until it is - # told to stop, and then reads a key press and executes the appropiate action. - class InteractiveController < TppController - -@@ -1396,17 +1396,17 @@ - loop do - ch = @vis.get_key - case ch -- when 'q'[0], 'Q'[0] # 'Q'uit -+ when ?q.ord, ?Q.ord # 'Q'uit - return -- when 'r'[0], 'R'[0] # 'R'edraw slide -+ when ?r.ord, ?R.ord # 'R'edraw slide - changed_page = true # @todo: actually implement redraw -- when 'e'[0], 'E'[0] -+ when ?e.ord, ?E.ord - @cur_page = @pages.size - 1 - break -- when 's'[0], 'S'[0] -+ when ?s.ord, ?S.ord - @cur_page = 0 - break -- when 'j'[0], 'J'[0] # 'J'ump to slide -+ when ?j.ord, ?J.ord # 'J'ump to slide - screen = @vis.store_screen - p = @vis.read_newpage(@pages,@cur_page) - if p >= 0 and p < @pages.size -@@ -1417,28 +1417,28 @@ - @vis.restore_screen(screen) - end - break -- when 'l'[0], 'L'[0] # re'l'oad current file -+ when ?l.ord, ?L.ord # re'l'oad current file - @reload_file = true - return -- when 'c'[0], 'C'[0] # command prompt -+ when ?c.ord, ?C.ord # command prompt - screen = @vis.store_screen - @vis.do_command_prompt - @vis.clear - @vis.restore_screen(screen) -- when '?'[0], 'h'[0] -+ when ??.ord, ?h.ord - screen = @vis.store_screen - @vis.show_help_page - ch = @vis.get_key - @vis.clear - @vis.restore_screen(screen) -- when :keyright, :keydown, ' '[0] -+ when :keyright, :keydown, ' '.ord - if @cur_page + 1 < @pages.size and eop then - @cur_page += 1 - @pages[@cur_page].reset_eop - @vis.new_page - end - break -- when 'b'[0], 'B'[0], :keyleft, :keyup -+ when ?b.ord, ?B.ord, :keyleft, :keyup - if @cur_page > 0 then - @cur_page -= 1 - @pages[@cur_page].reset_eop -@@ -1455,7 +1455,7 @@ - end - - --# Implements a visualizer which converts TPP source to a nicely formatted text -+# Implements a visualizer which converts TPP source to a nicely formatted text - # file which can e.g. be used as handout. - class TextVisualizer < TppVisualizer - -@@ -1475,7 +1475,7 @@ - - def do_footer(footer_text) - end -- -+ - def do_header(header_text) - end - -@@ -1539,7 +1539,7 @@ - - def do_revon - end -- -+ - def do_command_prompt - end - def do_revoff -@@ -1556,7 +1556,7 @@ - - def do_endslide - end -- -+ - def do_beginslideright - end - -@@ -1650,8 +1650,8 @@ - - end - --# Implements a non-interactive controller to control non-interactive --# visualizers (i.e. those that are used for converting TPP source code into -+# Implements a non-interactive controller to control non-interactive -+# visualizers (i.e. those that are used for converting TPP source code into - # another format) - class ConversionController < TppController - diff -r c7b121a4ffd9 -r d6378d455338 tuxmath/receipt --- a/tuxmath/receipt Wed May 09 17:03:28 2018 +0300 +++ b/tuxmath/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,7 +20,6 @@ # Rules to configure and make the package. compile_rules() { - #patch -p1 -i $stuff/SDL_extras.c.patch ./configure LIBS="-lt4k_common" \ --prefix=/usr \ $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 tuxmath/stuff/SDL_extras.c.patch --- a/tuxmath/stuff/SDL_extras.c.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ ---- tuxmath_w_fonts-1.7.2/src/SDL_extras.c.old Mon Mar 9 10:44:42 2009 -+++ tuxmath_w_fonts-1.7.2/src/SDL_extras.c Sat Jun 6 18:55:22 2009 -@@ -987,6 +987,7 @@ - /* font in memory once loaded until cleanup. */ - static TTF_Font* get_font(int size) - { -+ static char prev_font_name[FONT_NAME_LENGTH]; - if (size < 0) - { - fprintf(stderr, "Error - requested font size %d is negative\n", size); -@@ -1001,7 +1002,7 @@ - } - - /* If the font has changed, we need to wipe out the old ones: */ -- if (0 != strncmp(prev_font_name, Opts_FontName(),sizeof(prev_font_name))) -+ if (0 != strncmp(prev_font_name, Opts_FontName(), FONT_NAME_LENGTH)) - { - free_font_list(); - strncpy(prev_font_name, Opts_FontName(), sizeof(prev_font_name)); diff -r c7b121a4ffd9 -r d6378d455338 tuxmath/stuff/patches/SDL_extras.c.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tuxmath/stuff/patches/SDL_extras.c.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,19 @@ +--- tuxmath_w_fonts-1.7.2/src/SDL_extras.c.old Mon Mar 9 10:44:42 2009 ++++ tuxmath_w_fonts-1.7.2/src/SDL_extras.c Sat Jun 6 18:55:22 2009 +@@ -987,6 +987,7 @@ + /* font in memory once loaded until cleanup. */ + static TTF_Font* get_font(int size) + { ++ static char prev_font_name[FONT_NAME_LENGTH]; + if (size < 0) + { + fprintf(stderr, "Error - requested font size %d is negative\n", size); +@@ -1001,7 +1002,7 @@ + } + + /* If the font has changed, we need to wipe out the old ones: */ +- if (0 != strncmp(prev_font_name, Opts_FontName(),sizeof(prev_font_name))) ++ if (0 != strncmp(prev_font_name, Opts_FontName(), FONT_NAME_LENGTH)) + { + free_font_list(); + strncpy(prev_font_name, Opts_FontName(), sizeof(prev_font_name)); diff -r c7b121a4ffd9 -r d6378d455338 tuxmath/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tuxmath/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +#-p1|SDL_extras.c.patch diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/receipt --- a/visualboyadvance/receipt Wed May 09 17:03:28 2018 +0300 +++ b/visualboyadvance/receipt Thu May 10 21:12:00 2018 +0300 @@ -20,9 +20,6 @@ sed -i 's/int i = 0; i < 16; i++/int ii = 0; ii < 16; ii++/' \ src/sdl/debugger.cpp sed -i 's/void \*,void \*/gzFile, void */' src/Util.cpp - for i in $stuff/$VERSION-*.patch; do - patch -Np0 < $i - done ./configure \ --disable-profiling \ diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-deprecatedsigc++.patch --- a/visualboyadvance/stuff/1.7.2-deprecatedsigc++.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,692 +0,0 @@ ---- src/gtk/sigccompat.h.old 2008-05-02 10:46:45.000000000 +0200 -+++ src/gtk/sigccompat.h 2008-05-02 10:47:08.000000000 +0200 -@@ -20,7 +20,7 @@ - #ifndef __VBA_SIGCCOMPAT_H__ - #define __VBA_SIGCCOMPAT_H__ - --#undef LIBSIGC_DISABLE_DEPRECATED -+#define LIBSIGC_DISABLE_DEPRECATED - #include - #include - -@@ -28,9 +28,679 @@ - #include - #include - --namespace SigC -+ -+// From sigc++/bind.h -+namespace SigC { -+ -+template -+inline ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type> -+bind(const T_functor& _A_functor, T_bound1 _A_b1) -+{ return ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type> -+ (_A_functor, _A_b1); -+} -+ -+template -+inline ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type> -+bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2) -+{ return ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type> -+ (_A_functor, _A_b1, _A_b2); -+} -+ -+template -+inline ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type> -+bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2,T_bound3 _A_b3) -+{ return ::sigc::bind_functor<-1, T_functor, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type, -+ typename ::sigc::unwrap_reference::type> -+ (_A_functor, _A_b1, _A_b2, _A_b3); -+} -+ -+} -+ -+// From sigc++/connection.h -+namespace SigC { -+ -+/** Convinience class for safe disconnection. -+ * Iterators must not be used beyond the lifetime of the list -+ * they work on. A connection object can be created from a -+ * slot list iterator and may safely be used to disconnect -+ * the referred slot at any time (disconnect()). If the slot -+ * has already been destroyed, disconnect() does nothing. empty() or -+ * operator bool() can be used to test whether the connection is -+ * still active. The connection can be blocked (block(), unblock()). -+ * -+ * This is possible because the connection object gets notified -+ * when the referred slot dies (notify()). -+ * -+ * @deprecated Use sigc::connection instead. -+ * @ingroup compat -+ */ -+typedef ::sigc::connection Connection; -+ -+} -+ -+// From sigc++/slot.h -+namespace SigC { -+ -+// SlotN -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot0 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot0 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot0() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot0(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot0(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot0& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot1 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot1 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot1() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot1(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot1(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot1& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot2 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot2 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot2() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot2(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot2(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot2& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot3 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * - @e T_arg3 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot3 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot3() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot3(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot3(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot3& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot4 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * - @e T_arg3 Argument type used in the definition of operator()(). -+ * - @e T_arg4 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot4 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot4() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot4(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot4(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot4& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot5 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * - @e T_arg3 Argument type used in the definition of operator()(). -+ * - @e T_arg4 Argument type used in the definition of operator()(). -+ * - @e T_arg5 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot5 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot5() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot5(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot5(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot5& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot6 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * - @e T_arg3 Argument type used in the definition of operator()(). -+ * - @e T_arg4 Argument type used in the definition of operator()(). -+ * - @e T_arg5 Argument type used in the definition of operator()(). -+ * - @e T_arg6 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot6 -+ : public ::sigc::slot -+{ -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot6() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot6(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot6(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot6& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+/** Converts an arbitrary functor to a unified type which is opaque. -+ * Slot7 itself is a functor or to be more precise a closure. It contains -+ * a single, arbitrary functor (or closure) that is executed in operator()(). -+ * -+ * The template arguments determine the function signature of operator()(): -+ * - @e T_return The return type of operator()(). -+ * - @e T_arg1 Argument type used in the definition of operator()(). -+ * - @e T_arg2 Argument type used in the definition of operator()(). -+ * - @e T_arg3 Argument type used in the definition of operator()(). -+ * - @e T_arg4 Argument type used in the definition of operator()(). -+ * - @e T_arg5 Argument type used in the definition of operator()(). -+ * - @e T_arg6 Argument type used in the definition of operator()(). -+ * - @e T_arg7 Argument type used in the definition of operator()(). -+ * -+ * To use simply assign the slot to the desired functor. If the functor -+ * is not compatible with the parameter list defined with the template -+ * arguments compiler errors are triggered. When called the slot -+ * will invoke the functor with minimal copies. -+ * block() and unblock() can be used to block the functor's invocation -+ * from operator()() temporarily. -+ * -+ * @par Example: -+ * @code -+ * #include -+ * void foo(int) {} -+ * SigC::Slot1 s = SigC::slot(&foo); -+ * s(19); -+ * @endcode -+ * -+ * @deprecated Use the unnumbered template sigc::slot instead. -+ * @ingroup compat -+ */ -+template -+class Slot7 -+ : public ::sigc::slot - { -+public: -+ typedef ::sigc::slot parent_type; -+ -+ /// Constructs an empty slot. -+ Slot7() {} -+ -+ /** Constructs a slot from an arbitrary functor. -+ * @param _A_func The desired functor the new slot should be assigned to. -+ */ -+ template -+ Slot7(const T_functor& _A_func) -+ : ::sigc::slot(_A_func) {} -+ -+ /** Constructs a slot, copying an existing one. -+ * @param src The existing slot to copy. -+ */ -+ Slot7(const parent_type& src) -+ : parent_type(src) {} -+ -+ /** Overrides this slot making a copy from another slot. -+ * @param src The slot from which to make a copy. -+ * @return @p this. -+ */ -+ Slot7& operator=(const parent_type& src) -+ { parent_type::operator=(src); return *this; } -+}; -+ -+ -+ -+#ifndef DOXYGEN_SHOULD_SKIP_THIS -+/* gcc 3.2 reports a strange conflict between SigC::slot() and sigc::slot<> -+ * when "using namespace SigC" and later using a slot(obj,func) overload -+ * without the prefix "SigC::". Probably a compiler bug. I will investigate. -+ * -+ * This ugly hack avoids the error: -+ */ -+// #define slot(...) make_slot(__VA_ARGS__) /* only works for gcc */ -+#endif - -+ -+// slot() -+/** Creates a functor of type SigC::Slot0 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot0 -+slot(T_return (*_A_func)()) -+{ return Slot0(_A_func); } -+ -+/** Creates a functor of type SigC::Slot1 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot1 -+slot(T_return (*_A_func)(T_arg1)) -+{ return Slot1(_A_func); } -+ -+/** Creates a functor of type SigC::Slot2 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot2 -+slot(T_return (*_A_func)(T_arg1,T_arg2)) -+{ return Slot2(_A_func); } -+ -+/** Creates a functor of type SigC::Slot3 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot3 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3)) -+{ return Slot3(_A_func); } -+ -+/** Creates a functor of type SigC::Slot4 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot4 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4)) -+{ return Slot4(_A_func); } -+ -+/** Creates a functor of type SigC::Slot5 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot5 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5)) -+{ return Slot5(_A_func); } -+ -+/** Creates a functor of type SigC::Slot6 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot6 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6)) -+{ return Slot6(_A_func); } -+ -+/** Creates a functor of type SigC::Slot7 that wraps an existing non-member function. -+ * -+ * @param _A_func Pointer to function that should be wrapped. -+ * @return Functor that executes _A_func on invokation. -+ * -+ * @deprecated Use sigc::ptr_fun() instead. -+ * @ingroup compat -+ */ -+template -+inline Slot7 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7)) -+{ return Slot7(_A_func); } -+ -+ -+ -+} -+ -+// From sigc++/object.h -+namespace SigC { -+ -+// Object -+typedef ::sigc::trackable Object; -+ -+} -+ -+namespace SigC -+{ - template - inline Slot0 - slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() ) diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-gcc34.patch --- a/visualboyadvance/stuff/1.7.2-gcc34.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -diff -ur src/gtk/joypadconfig.h src/gtk/joypadconfig.h ---- src/gtk/joypadconfig.h 2004-05-10 16:43:21.000000000 +0200 -+++ src/gtk/joypadconfig.h 2004-08-12 22:30:20.838039064 +0200 -@@ -22,8 +22,8 @@ - - #include - --#include - #include -+#include - - #ifndef GTKMM20 - # include "sigccompat.h" -diff -ur src/gtk/main.cpp src/gtk/main.cpp ---- src/gtk/main.cpp 2004-05-21 18:02:35.000000000 +0200 -+++ src/gtk/main.cpp 2004-08-12 22:39:08.633801912 +0200 -@@ -22,10 +22,10 @@ - - #include - --#include - #include - #include - #include -+#include - - #include "images/vba-wm-pixbufs.h" - -diff -ur src/gtk/window.h src/gtk/window.h ---- src/gtk/window.h 2004-05-21 15:25:41.000000000 +0200 -+++ src/gtk/window.h 2004-08-12 22:30:58.650290728 +0200 -@@ -23,8 +23,8 @@ - #include - #include - --#include - #include -+#include - - #ifndef GTKMM20 - # include "sigccompat.h" diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-gcc41.patch --- a/visualboyadvance/stuff/1.7.2-gcc41.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -diff -ru src/prof/prof.cpp src/prof/prof.cpp ---- src/prof/prof.cpp 2004-05-14 00:31:58.000000000 +1000 -+++ src/prof/prof.cpp 2006-06-03 13:49:41.000000000 +1000 -@@ -266,7 +266,7 @@ - for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { - if(profWrite8(fd, GMON_TAG_CG_ARC) || - profWrite32(fd, (u32)frompc) || -- profWrite32(fd, (u32)tos[toindex].selfpc) || -+ profWrite32(fd, (u32)(intptr_t)tos[toindex].selfpc) || - profWrite32(fd, tos[toindex].count)) { - systemMessage(0, "mcount: arc"); - fclose(fd); -diff -ru src/sdl/debugger.cpp src/sdl/debugger.cpp ---- src/sdl/debugger.cpp 2004-05-14 00:13:14.000000000 +1000 -+++ src/sdl/debugger.cpp 2006-06-03 13:49:57.000000000 +1000 -@@ -950,9 +950,9 @@ - { - u32 address = 0; - if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff]) -- address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]); -+ address = 0x2000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&workRAM[0]); - else -- address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]); -+ address = 0x3000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&internalRAM[0]); - - if(size == 2) - printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-glibc.patch --- a/visualboyadvance/stuff/1.7.2-glibc.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ ---- src/GBA.cpp -+++ src/GBA.cpp -@@ -1130,7 +1130,7 @@ - bool CPUIsZipFile(const char * file) - { - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".zip") == 0) -@@ -1145,7 +1145,7 @@ - { - cpuIsMultiBoot = false; - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".gba") == 0) -@@ -1169,7 +1169,7 @@ - bool CPUIsGBABios(const char * file) - { - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".gba") == 0) -@@ -1189,7 +1189,7 @@ - bool CPUIsELF(const char *file) - { - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".elf") == 0) ---- src/Util.cpp -+++ src/Util.cpp -@@ -478,7 +478,7 @@ - { - cpuIsMultiBoot = false; - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".gba") == 0) -@@ -502,7 +502,7 @@ - bool utilIsGBImage(const char * file) - { - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".gb") == 0) -@@ -522,7 +522,7 @@ - bool utilIsZipFile(const char *file) - { - if(strlen(file) > 4) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".zip") == 0) -@@ -552,7 +552,7 @@ - bool utilIsGzipFile(const char *file) - { - if(strlen(file) > 3) { -- char * p = strrchr(file,'.'); -+ const char * p = strrchr(file,'.'); - - if(p != NULL) { - if(_stricmp(p, ".gz") == 0) diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-homedir.patch --- a/visualboyadvance/stuff/1.7.2-homedir.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- src/sdl/SDL.cpp.orig 2004-08-15 02:43:28.232750688 -0400 -+++ src/sdl/SDL.cpp 2004-08-15 02:44:01.557684528 -0400 -@@ -887,7 +887,7 @@ - - if(home != NULL) { - fprintf(stderr, "Searching home directory: %s\n", home); -- sprintf(path, "%s%c%s", home, FILE_SEP, name); -+ sprintf(path, "%s%c.%s%c%s", home, FILE_SEP, EXE_NAME, FILE_SEP, name); - f = fopen(path, "r"); - if(f != NULL) - return f; diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/1.7.2-uninit.patch --- a/visualboyadvance/stuff/1.7.2-uninit.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -diff -ru src/gtk/window.cpp src/gtk/window.cpp ---- src/gtk/window.cpp 2004-05-14 00:31:58.000000000 +1000 -+++ src/gtk/window.cpp 2007-03-17 14:57:22.000000000 -0500 -@@ -91,7 +91,8 @@ - m_iFilterIBMin (FirstFilterIB), - m_iFilterIBMax (LastFilterIB), - m_iJoypadMin (1), -- m_iJoypadMax (4) -+ m_iJoypadMax (4), -+ m_poKeymap (NULL) - { - m_poXml = _poXml; - m_poFileOpenDialog = NULL; diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-deprecatedsigc++.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-deprecatedsigc++.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,692 @@ +--- src/gtk/sigccompat.h.old 2008-05-02 10:46:45.000000000 +0200 ++++ src/gtk/sigccompat.h 2008-05-02 10:47:08.000000000 +0200 +@@ -20,7 +20,7 @@ + #ifndef __VBA_SIGCCOMPAT_H__ + #define __VBA_SIGCCOMPAT_H__ + +-#undef LIBSIGC_DISABLE_DEPRECATED ++#define LIBSIGC_DISABLE_DEPRECATED + #include + #include + +@@ -28,9 +28,679 @@ + #include + #include + +-namespace SigC ++ ++// From sigc++/bind.h ++namespace SigC { ++ ++template ++inline ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type> ++bind(const T_functor& _A_functor, T_bound1 _A_b1) ++{ return ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type> ++ (_A_functor, _A_b1); ++} ++ ++template ++inline ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type> ++bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2) ++{ return ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type> ++ (_A_functor, _A_b1, _A_b2); ++} ++ ++template ++inline ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type> ++bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2,T_bound3 _A_b3) ++{ return ::sigc::bind_functor<-1, T_functor, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type, ++ typename ::sigc::unwrap_reference::type> ++ (_A_functor, _A_b1, _A_b2, _A_b3); ++} ++ ++} ++ ++// From sigc++/connection.h ++namespace SigC { ++ ++/** Convinience class for safe disconnection. ++ * Iterators must not be used beyond the lifetime of the list ++ * they work on. A connection object can be created from a ++ * slot list iterator and may safely be used to disconnect ++ * the referred slot at any time (disconnect()). If the slot ++ * has already been destroyed, disconnect() does nothing. empty() or ++ * operator bool() can be used to test whether the connection is ++ * still active. The connection can be blocked (block(), unblock()). ++ * ++ * This is possible because the connection object gets notified ++ * when the referred slot dies (notify()). ++ * ++ * @deprecated Use sigc::connection instead. ++ * @ingroup compat ++ */ ++typedef ::sigc::connection Connection; ++ ++} ++ ++// From sigc++/slot.h ++namespace SigC { ++ ++// SlotN ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot0 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot0 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot0() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot0(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot0(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot0& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot1 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot1 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot1() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot1(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot1(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot1& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot2 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot2 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot2() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot2(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot2(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot2& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot3 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * - @e T_arg3 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot3 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot3() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot3(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot3(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot3& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot4 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * - @e T_arg3 Argument type used in the definition of operator()(). ++ * - @e T_arg4 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot4 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot4() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot4(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot4(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot4& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot5 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * - @e T_arg3 Argument type used in the definition of operator()(). ++ * - @e T_arg4 Argument type used in the definition of operator()(). ++ * - @e T_arg5 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot5 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot5() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot5(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot5(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot5& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot6 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * - @e T_arg3 Argument type used in the definition of operator()(). ++ * - @e T_arg4 Argument type used in the definition of operator()(). ++ * - @e T_arg5 Argument type used in the definition of operator()(). ++ * - @e T_arg6 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot6 ++ : public ::sigc::slot ++{ ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot6() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot6(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot6(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot6& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++/** Converts an arbitrary functor to a unified type which is opaque. ++ * Slot7 itself is a functor or to be more precise a closure. It contains ++ * a single, arbitrary functor (or closure) that is executed in operator()(). ++ * ++ * The template arguments determine the function signature of operator()(): ++ * - @e T_return The return type of operator()(). ++ * - @e T_arg1 Argument type used in the definition of operator()(). ++ * - @e T_arg2 Argument type used in the definition of operator()(). ++ * - @e T_arg3 Argument type used in the definition of operator()(). ++ * - @e T_arg4 Argument type used in the definition of operator()(). ++ * - @e T_arg5 Argument type used in the definition of operator()(). ++ * - @e T_arg6 Argument type used in the definition of operator()(). ++ * - @e T_arg7 Argument type used in the definition of operator()(). ++ * ++ * To use simply assign the slot to the desired functor. If the functor ++ * is not compatible with the parameter list defined with the template ++ * arguments compiler errors are triggered. When called the slot ++ * will invoke the functor with minimal copies. ++ * block() and unblock() can be used to block the functor's invocation ++ * from operator()() temporarily. ++ * ++ * @par Example: ++ * @code ++ * #include ++ * void foo(int) {} ++ * SigC::Slot1 s = SigC::slot(&foo); ++ * s(19); ++ * @endcode ++ * ++ * @deprecated Use the unnumbered template sigc::slot instead. ++ * @ingroup compat ++ */ ++template ++class Slot7 ++ : public ::sigc::slot + { ++public: ++ typedef ::sigc::slot parent_type; ++ ++ /// Constructs an empty slot. ++ Slot7() {} ++ ++ /** Constructs a slot from an arbitrary functor. ++ * @param _A_func The desired functor the new slot should be assigned to. ++ */ ++ template ++ Slot7(const T_functor& _A_func) ++ : ::sigc::slot(_A_func) {} ++ ++ /** Constructs a slot, copying an existing one. ++ * @param src The existing slot to copy. ++ */ ++ Slot7(const parent_type& src) ++ : parent_type(src) {} ++ ++ /** Overrides this slot making a copy from another slot. ++ * @param src The slot from which to make a copy. ++ * @return @p this. ++ */ ++ Slot7& operator=(const parent_type& src) ++ { parent_type::operator=(src); return *this; } ++}; ++ ++ ++ ++#ifndef DOXYGEN_SHOULD_SKIP_THIS ++/* gcc 3.2 reports a strange conflict between SigC::slot() and sigc::slot<> ++ * when "using namespace SigC" and later using a slot(obj,func) overload ++ * without the prefix "SigC::". Probably a compiler bug. I will investigate. ++ * ++ * This ugly hack avoids the error: ++ */ ++// #define slot(...) make_slot(__VA_ARGS__) /* only works for gcc */ ++#endif + ++ ++// slot() ++/** Creates a functor of type SigC::Slot0 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot0 ++slot(T_return (*_A_func)()) ++{ return Slot0(_A_func); } ++ ++/** Creates a functor of type SigC::Slot1 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot1 ++slot(T_return (*_A_func)(T_arg1)) ++{ return Slot1(_A_func); } ++ ++/** Creates a functor of type SigC::Slot2 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot2 ++slot(T_return (*_A_func)(T_arg1,T_arg2)) ++{ return Slot2(_A_func); } ++ ++/** Creates a functor of type SigC::Slot3 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot3 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3)) ++{ return Slot3(_A_func); } ++ ++/** Creates a functor of type SigC::Slot4 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot4 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4)) ++{ return Slot4(_A_func); } ++ ++/** Creates a functor of type SigC::Slot5 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot5 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5)) ++{ return Slot5(_A_func); } ++ ++/** Creates a functor of type SigC::Slot6 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot6 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6)) ++{ return Slot6(_A_func); } ++ ++/** Creates a functor of type SigC::Slot7 that wraps an existing non-member function. ++ * ++ * @param _A_func Pointer to function that should be wrapped. ++ * @return Functor that executes _A_func on invokation. ++ * ++ * @deprecated Use sigc::ptr_fun() instead. ++ * @ingroup compat ++ */ ++template ++inline Slot7 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7)) ++{ return Slot7(_A_func); } ++ ++ ++ ++} ++ ++// From sigc++/object.h ++namespace SigC { ++ ++// Object ++typedef ::sigc::trackable Object; ++ ++} ++ ++namespace SigC ++{ + template + inline Slot0 + slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() ) diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-gcc34.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-gcc34.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,41 @@ +diff -ur src/gtk/joypadconfig.h src/gtk/joypadconfig.h +--- src/gtk/joypadconfig.h 2004-05-10 16:43:21.000000000 +0200 ++++ src/gtk/joypadconfig.h 2004-08-12 22:30:20.838039064 +0200 +@@ -22,8 +22,8 @@ + + #include + +-#include + #include ++#include + + #ifndef GTKMM20 + # include "sigccompat.h" +diff -ur src/gtk/main.cpp src/gtk/main.cpp +--- src/gtk/main.cpp 2004-05-21 18:02:35.000000000 +0200 ++++ src/gtk/main.cpp 2004-08-12 22:39:08.633801912 +0200 +@@ -22,10 +22,10 @@ + + #include + +-#include + #include + #include + #include ++#include + + #include "images/vba-wm-pixbufs.h" + +diff -ur src/gtk/window.h src/gtk/window.h +--- src/gtk/window.h 2004-05-21 15:25:41.000000000 +0200 ++++ src/gtk/window.h 2004-08-12 22:30:58.650290728 +0200 +@@ -23,8 +23,8 @@ + #include + #include + +-#include + #include ++#include + + #ifndef GTKMM20 + # include "sigccompat.h" diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-gcc41.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-gcc41.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,27 @@ +diff -ru src/prof/prof.cpp src/prof/prof.cpp +--- src/prof/prof.cpp 2004-05-14 00:31:58.000000000 +1000 ++++ src/prof/prof.cpp 2006-06-03 13:49:41.000000000 +1000 +@@ -266,7 +266,7 @@ + for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { + if(profWrite8(fd, GMON_TAG_CG_ARC) || + profWrite32(fd, (u32)frompc) || +- profWrite32(fd, (u32)tos[toindex].selfpc) || ++ profWrite32(fd, (u32)(intptr_t)tos[toindex].selfpc) || + profWrite32(fd, tos[toindex].count)) { + systemMessage(0, "mcount: arc"); + fclose(fd); +diff -ru src/sdl/debugger.cpp src/sdl/debugger.cpp +--- src/sdl/debugger.cpp 2004-05-14 00:13:14.000000000 +1000 ++++ src/sdl/debugger.cpp 2006-06-03 13:49:57.000000000 +1000 +@@ -950,9 +950,9 @@ + { + u32 address = 0; + if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff]) +- address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]); ++ address = 0x2000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&workRAM[0]); + else +- address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]); ++ address = 0x3000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&internalRAM[0]); + + if(size == 2) + printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-glibc.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-glibc.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,76 @@ +--- src/GBA.cpp ++++ src/GBA.cpp +@@ -1130,7 +1130,7 @@ + bool CPUIsZipFile(const char * file) + { + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".zip") == 0) +@@ -1145,7 +1145,7 @@ + { + cpuIsMultiBoot = false; + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".gba") == 0) +@@ -1169,7 +1169,7 @@ + bool CPUIsGBABios(const char * file) + { + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".gba") == 0) +@@ -1189,7 +1189,7 @@ + bool CPUIsELF(const char *file) + { + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".elf") == 0) +--- src/Util.cpp ++++ src/Util.cpp +@@ -478,7 +478,7 @@ + { + cpuIsMultiBoot = false; + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".gba") == 0) +@@ -502,7 +502,7 @@ + bool utilIsGBImage(const char * file) + { + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".gb") == 0) +@@ -522,7 +522,7 @@ + bool utilIsZipFile(const char *file) + { + if(strlen(file) > 4) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".zip") == 0) +@@ -552,7 +552,7 @@ + bool utilIsGzipFile(const char *file) + { + if(strlen(file) > 3) { +- char * p = strrchr(file,'.'); ++ const char * p = strrchr(file,'.'); + + if(p != NULL) { + if(_stricmp(p, ".gz") == 0) diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-homedir.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-homedir.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,11 @@ +--- src/sdl/SDL.cpp.orig 2004-08-15 02:43:28.232750688 -0400 ++++ src/sdl/SDL.cpp 2004-08-15 02:44:01.557684528 -0400 +@@ -887,7 +887,7 @@ + + if(home != NULL) { + fprintf(stderr, "Searching home directory: %s\n", home); +- sprintf(path, "%s%c%s", home, FILE_SEP, name); ++ sprintf(path, "%s%c.%s%c%s", home, FILE_SEP, EXE_NAME, FILE_SEP, name); + f = fopen(path, "r"); + if(f != NULL) + return f; diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/1.7.2-uninit.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/1.7.2-uninit.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,13 @@ +diff -ru src/gtk/window.cpp src/gtk/window.cpp +--- src/gtk/window.cpp 2004-05-14 00:31:58.000000000 +1000 ++++ src/gtk/window.cpp 2007-03-17 14:57:22.000000000 -0500 +@@ -91,7 +91,8 @@ + m_iFilterIBMin (FirstFilterIB), + m_iFilterIBMax (LastFilterIB), + m_iJoypadMin (1), +- m_iJoypadMax (4) ++ m_iJoypadMax (4), ++ m_poKeymap (NULL) + { + m_poXml = _poXml; + m_poFileOpenDialog = NULL; diff -r c7b121a4ffd9 -r d6378d455338 visualboyadvance/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/visualboyadvance/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,6 @@ +-Np0|1.7.2-deprecatedsigc++.patch +-Np0|1.7.2-gcc34.patch +-Np0|1.7.2-gcc41.patch +-Np0|1.7.2-glibc.patch +-Np0|1.7.2-homedir.patch +-Np0|1.7.2-uninit.patch diff -r c7b121a4ffd9 -r d6378d455338 volumeicon/receipt --- a/volumeicon/receipt Wed May 09 17:03:28 2018 +0300 +++ b/volumeicon/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,7 +16,6 @@ # Rules to configure and make the package. compile_rules() { - patch -p0 < $stuff/alsa_backend.patch ./configure --enable-notify $CONFIGURE_ARGS && make && make install } diff -r c7b121a4ffd9 -r d6378d455338 volumeicon/stuff/alsa_backend.patch --- a/volumeicon/stuff/alsa_backend.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ ---- src/alsa_backend.new.c -+++ src/alsa_backend.c -@@ -22,10 +22,7 @@ - //############################################################################## - - #include --#include --#include --#include --#include -+#include - - #include "alsa_backend.h" - diff -r c7b121a4ffd9 -r d6378d455338 volumeicon/stuff/patches/alsa_backend.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/volumeicon/stuff/patches/alsa_backend.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +--- src/alsa_backend.new.c ++++ src/alsa_backend.c +@@ -22,10 +22,7 @@ + //############################################################################## + + #include +-#include +-#include +-#include +-#include ++#include + + #include "alsa_backend.h" + diff -r c7b121a4ffd9 -r d6378d455338 volumeicon/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/volumeicon/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|alsa_backend.patch diff -r c7b121a4ffd9 -r d6378d455338 vzctl/receipt --- a/vzctl/receipt Wed May 09 17:03:28 2018 +0300 +++ b/vzctl/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,19 +14,6 @@ BUILD_DEPENDS="sed" compile_rules() { - # Apply patches - while read patch_file; do - if [ -f done.$patch_file ]; then - echo "Skipping $patch_file" - continue - fi - echo "Apply $patch_file" - patch -p1 < $stuff/$patch_file || return 1 - touch done.$patch_file - done < + + /* to include vsscanf() */ +-#define __USE_ISOC99 ++#ifndef __USE_ISOC99 ++ #define __USE_ISOC99 ++#endif ++ + #include + + #include diff -r c7b121a4ffd9 -r d6378d455338 vzquota/stuff/vzquota-3.0.12.u --- a/vzquota/stuff/vzquota-3.0.12.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ ---- vzquota-3.0.12-ori/src/Makefile Thu Mar 6 20:28:38 2008 -+++ vzquota-3.0.12/src/Makefile Fri Dec 31 10:33:49 2010 -@@ -18,7 +18,7 @@ - INSTALL = install - PREFIX = /usr - SBINDIR = ${PREFIX}/sbin --VARDIR = /var -+VARDIR = /var/lib - MANDIR = ${PREFIX}/share/man - - #DEBUG = -D_DEBUG -g3 -ggdb3 -p -pg ---- vzquota-3.0.12-ori/src/vzdqload.c Thu Mar 6 20:28:38 2008 -+++ vzquota-3.0.12/src/vzdqload.c Fri Dec 31 10:33:39 2010 -@@ -20,7 +20,10 @@ - #include - - /* to include vsscanf() */ --#define __USE_ISOC99 -+#ifndef __USE_ISOC99 -+ #define __USE_ISOC99 -+#endif -+ - #include - - #include diff -r c7b121a4ffd9 -r d6378d455338 w3m/receipt --- a/w3m/receipt Wed May 09 17:03:28 2018 +0300 +++ b/w3m/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,14 +18,6 @@ compile_rules() { export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" - for i in $stuff/*.patch - do - if [ -f done.$(basename $i) ]; then - continue - else - patch -p0 < $i && touch done.$(basename $i) || return 1 - fi - done ./configure $CONFIGURE_ARGS && make && make install } diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/file_handle.patch --- a/w3m/stuff/file_handle.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -diff -Naur old/istream.c new/istream.c ---- istream.c 2011-01-04 20:22:22.000000000 +1100 -+++ istream.c 2012-07-04 21:50:51.529661517 +1000 -@@ -22,8 +22,8 @@ - static void basic_close(int *handle); - static int basic_read(int *handle, char *buf, int len); - --static void file_close(struct file_handle *handle); --static int file_read(struct file_handle *handle, char *buf, int len); -+static void file_close(struct file_handle_rofl *handle); -+static int file_read(struct file_handle_rofl *handle, char *buf, int len); - - static int str_read(Str handle, char *buf, int len); - -@@ -114,7 +114,7 @@ - stream = New(union input_stream); - init_base_stream(&stream->base, STREAM_BUF_SIZE); - stream->file.type = IST_FILE; -- stream->file.handle = New(struct file_handle); -+ stream->file.handle = New(struct file_handle_rofl); - stream->file.handle->f = f; - if (closep) - stream->file.handle->close = closep; -@@ -658,13 +658,13 @@ - } - - static void --file_close(struct file_handle *handle) -+file_close(struct file_handle_rofl *handle) - { - handle->close(handle->f); - } - - static int --file_read(struct file_handle *handle, char *buf, int len) -+file_read(struct file_handle_rofl *handle, char *buf, int len) - { - return fread(buf, 1, len, handle->f); - } -diff -Naur old/istream.h new/istream.h ---- istream.h 2003-10-21 02:41:56.000000000 +1000 -+++ istream.h 2012-07-04 21:50:51.529661517 +1000 -@@ -20,7 +20,7 @@ - - typedef struct stream_buffer *StreamBuffer; - --struct file_handle { -+struct file_handle_rofl { - FILE *f; - void (*close) (); - }; -@@ -53,7 +53,7 @@ - - struct file_stream { - struct stream_buffer stream; -- struct file_handle *handle; -+ struct file_handle_rofl *handle; - char type; - char iseos; - int (*read) (); diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/https.patch --- a/w3m/stuff/https.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -Fedora patch; see https://bugzilla.redhat.com/show_bug.cgi?id=707994 - ---- url.c 2011-01-04 14:52:24.000000000 +0530 -+++ url.c 2011-09-02 18:25:43.305652690 +0530 -@@ -82,11 +82,11 @@ - {"ftp", SCM_FTP}, - {"local", SCM_LOCAL}, - {"file", SCM_LOCAL}, -- /* {"exec", SCM_EXEC}, */ -+ {"exec", SCM_EXEC}, - {"nntp", SCM_NNTP}, -- /* {"nntp", SCM_NNTP_GROUP}, */ -+ {"nntp", SCM_NNTP_GROUP}, - {"news", SCM_NEWS}, -- /* {"news", SCM_NEWS_GROUP}, */ -+ {"news", SCM_NEWS_GROUP}, - {"data", SCM_DATA}, - #ifndef USE_W3MMAILER - {"mailto", SCM_MAILTO}, diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/patches/file_handle.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/w3m/stuff/patches/file_handle.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,60 @@ +diff -Naur old/istream.c new/istream.c +--- istream.c 2011-01-04 20:22:22.000000000 +1100 ++++ istream.c 2012-07-04 21:50:51.529661517 +1000 +@@ -22,8 +22,8 @@ + static void basic_close(int *handle); + static int basic_read(int *handle, char *buf, int len); + +-static void file_close(struct file_handle *handle); +-static int file_read(struct file_handle *handle, char *buf, int len); ++static void file_close(struct file_handle_rofl *handle); ++static int file_read(struct file_handle_rofl *handle, char *buf, int len); + + static int str_read(Str handle, char *buf, int len); + +@@ -114,7 +114,7 @@ + stream = New(union input_stream); + init_base_stream(&stream->base, STREAM_BUF_SIZE); + stream->file.type = IST_FILE; +- stream->file.handle = New(struct file_handle); ++ stream->file.handle = New(struct file_handle_rofl); + stream->file.handle->f = f; + if (closep) + stream->file.handle->close = closep; +@@ -658,13 +658,13 @@ + } + + static void +-file_close(struct file_handle *handle) ++file_close(struct file_handle_rofl *handle) + { + handle->close(handle->f); + } + + static int +-file_read(struct file_handle *handle, char *buf, int len) ++file_read(struct file_handle_rofl *handle, char *buf, int len) + { + return fread(buf, 1, len, handle->f); + } +diff -Naur old/istream.h new/istream.h +--- istream.h 2003-10-21 02:41:56.000000000 +1000 ++++ istream.h 2012-07-04 21:50:51.529661517 +1000 +@@ -20,7 +20,7 @@ + + typedef struct stream_buffer *StreamBuffer; + +-struct file_handle { ++struct file_handle_rofl { + FILE *f; + void (*close) (); + }; +@@ -53,7 +53,7 @@ + + struct file_stream { + struct stream_buffer stream; +- struct file_handle *handle; ++ struct file_handle_rofl *handle; + char type; + char iseos; + int (*read) (); diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/patches/https.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/w3m/stuff/patches/https.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,19 @@ +Fedora patch; see https://bugzilla.redhat.com/show_bug.cgi?id=707994 + +--- url.c 2011-01-04 14:52:24.000000000 +0530 ++++ url.c 2011-09-02 18:25:43.305652690 +0530 +@@ -82,11 +82,11 @@ + {"ftp", SCM_FTP}, + {"local", SCM_LOCAL}, + {"file", SCM_LOCAL}, +- /* {"exec", SCM_EXEC}, */ ++ {"exec", SCM_EXEC}, + {"nntp", SCM_NNTP}, +- /* {"nntp", SCM_NNTP_GROUP}, */ ++ {"nntp", SCM_NNTP_GROUP}, + {"news", SCM_NEWS}, +- /* {"news", SCM_NEWS_GROUP}, */ ++ {"news", SCM_NEWS_GROUP}, + {"data", SCM_DATA}, + #ifndef USE_W3MMAILER + {"mailto", SCM_MAILTO}, diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/w3m/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +-p0|file_handle.patch +-p0|https.patch +-p0|w3m-0.5.2-gc72.patch diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/patches/w3m-0.5.2-gc72.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/w3m/stuff/patches/w3m-0.5.2-gc72.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,27 @@ +diff -Naurb w3m-0.5.2.orig/main.c w3m-0.5.2/main.c +--- main.c 2007-05-31 10:19:50.000000000 +0900 ++++ main.c 2009-11-09 08:20:02.184953443 +0900 +@@ -312,7 +312,11 @@ + lock = 0; + } + } ++#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2 ++ else if (orig_GC_warn_proc = GC_get_warn_proc()) ++#else + else if (orig_GC_warn_proc) ++#endif + orig_GC_warn_proc(msg, arg); + else + fprintf(stderr, msg, (unsigned long)arg); +@@ -842,7 +846,11 @@ + mySignal(SIGPIPE, SigPipe); + #endif + ++#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2 ++ GC_set_warn_proc(wrap_GC_warn_proc); ++#else + orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); ++#endif + err_msg = Strnew(); + if (load_argc == 0) { + /* no URL specified */ diff -r c7b121a4ffd9 -r d6378d455338 w3m/stuff/w3m-0.5.2-gc72.patch --- a/w3m/stuff/w3m-0.5.2-gc72.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -diff -Naurb w3m-0.5.2.orig/main.c w3m-0.5.2/main.c ---- main.c 2007-05-31 10:19:50.000000000 +0900 -+++ main.c 2009-11-09 08:20:02.184953443 +0900 -@@ -312,7 +312,11 @@ - lock = 0; - } - } -+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2 -+ else if (orig_GC_warn_proc = GC_get_warn_proc()) -+#else - else if (orig_GC_warn_proc) -+#endif - orig_GC_warn_proc(msg, arg); - else - fprintf(stderr, msg, (unsigned long)arg); -@@ -842,7 +846,11 @@ - mySignal(SIGPIPE, SigPipe); - #endif - -+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2 -+ GC_set_warn_proc(wrap_GC_warn_proc); -+#else - orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); -+#endif - err_msg = Strnew(); - if (load_argc == 0) { - /* no URL specified */ diff -r c7b121a4ffd9 -r d6378d455338 wbar/receipt --- a/wbar/receipt Wed May 09 17:03:28 2018 +0300 +++ b/wbar/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,7 +14,6 @@ BUILD_DEPENDS="imlib2-dev xorg-libX11-dev" compile_rules() { - patch -p0 < $stuff/gcc43_fixes.diff || return 1 sed -i 's|^LDFLAGS.*|& -lX11|' Makefile make || return 1 diff -r c7b121a4ffd9 -r d6378d455338 wbar/stuff/gcc43_fixes.diff --- a/wbar/stuff/gcc43_fixes.diff Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -diff -Naur wbar-1.3.3.orig/IconLoader.cc wbar-1.3.3/IconLoader.cc ---- IconLoader.cc 2006-12-29 01:54:29.000000000 +0000 -+++ IconLoader.cc 2008-08-06 15:35:58.000000000 +0000 -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - }; - - #include "IconLoader.h" -diff -Naur wbar-1.3.3.orig/Main.cc wbar-1.3.3/Main.cc ---- Main.cc 2007-08-06 12:28:11.000000000 +0000 -+++ Main.cc 2008-08-06 15:35:00.000000000 +0000 -@@ -4,6 +4,8 @@ - #include - #include - #include -+#include -+#include - - #include "XWin.h" - #include "ImgWrap.h" -diff -Naur wbar-1.3.3.orig/SuperBar.cc wbar-1.3.3/SuperBar.cc ---- SuperBar.cc 2007-08-04 00:24:34.000000000 +0000 -+++ SuperBar.cc 2008-08-06 15:51:14.000000000 +0000 -@@ -1,5 +1,6 @@ - #include "SuperBar.h" - #include "SuperIcon.h" -+#include - - using namespace std; - diff -r c7b121a4ffd9 -r d6378d455338 wbar/stuff/patches/gcc43_fixes.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wbar/stuff/patches/gcc43_fixes.diff Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,33 @@ +diff -Naur wbar-1.3.3.orig/IconLoader.cc wbar-1.3.3/IconLoader.cc +--- IconLoader.cc 2006-12-29 01:54:29.000000000 +0000 ++++ IconLoader.cc 2008-08-06 15:35:58.000000000 +0000 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + }; + + #include "IconLoader.h" +diff -Naur wbar-1.3.3.orig/Main.cc wbar-1.3.3/Main.cc +--- Main.cc 2007-08-06 12:28:11.000000000 +0000 ++++ Main.cc 2008-08-06 15:35:00.000000000 +0000 +@@ -4,6 +4,8 @@ + #include + #include + #include ++#include ++#include + + #include "XWin.h" + #include "ImgWrap.h" +diff -Naur wbar-1.3.3.orig/SuperBar.cc wbar-1.3.3/SuperBar.cc +--- SuperBar.cc 2007-08-04 00:24:34.000000000 +0000 ++++ SuperBar.cc 2008-08-06 15:51:14.000000000 +0000 +@@ -1,5 +1,6 @@ + #include "SuperBar.h" + #include "SuperIcon.h" ++#include + + using namespace std; + diff -r c7b121a4ffd9 -r d6378d455338 wbar/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wbar/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|gcc43_fixes.diff diff -r c7b121a4ffd9 -r d6378d455338 wicd/receipt --- a/wicd/receipt Wed May 09 17:03:28 2018 +0300 +++ b/wicd/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,10 +17,6 @@ # Rules to configure and make the package. compile_rules() { - # Fix problem with new urwid FS#33378 LP#1075399 - patch -Np0 -i $stuff/831_830.patch - patch -Np0 -i $stuff/835_834.patch - patch -Np0 -i $stuff/dbus_string_fix.patch python setup.py configure #HACK for https://bugs.launchpad.net/wicd/+bug/928589 mkdir -p translations/ast/LC_MESSAGES diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/831_830.patch --- a/wicd/stuff/831_830.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -=== modified file 'curses/curses_misc.py' ---- curses/curses_misc.py 2012-05-06 15:16:15 +0000 -+++ curses/curses_misc.py 2012-11-15 09:26:21 +0000 -@@ -349,7 +349,10 @@ - # We need this to pick our keypresses - self.use_enter = use_enter - -- self.focus = focus -+ if urwid.VERSION < (1, 1, 0): -+ self.focus = focus -+ else: -+ self.focus_position = focus - - self.callback = callback - self.user_args = user_args -@@ -362,7 +365,11 @@ - self.list = list - - def set_focus(self,index): -- self.focus = index -+ if urwid.VERSION < (1, 1, 0): -+ self.focus = index -+ else: -+ self.focus_position = index -+ - # API changed between urwid 0.9.8.4 and 0.9.9 - try: - self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW)) -@@ -376,16 +383,21 @@ - def build_combobox(self,parent,ui,row): - str,trash = self.label.get_text() - -- self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]), -+ if urwid.VERSION < (1, 1, 0): -+ index = self.focus -+ else: -+ index = self.focus_position -+ -+ self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]), - attrs=self.attrs,focus_attr=self.focus_attr) - if str != '': - w = urwid.Columns([('fixed',len(str),self.label),self.cbox], - dividechars=1) -- self.overlay = self.ComboSpace(self.list,parent,ui,self.focus, -+ self.overlay = self.ComboSpace(self.list,parent,ui,index, - pos=(len(str)+1,row)) - else: - w = urwid.Columns([self.cbox]) -- self.overlay = self.ComboSpace(self.list,parent,ui,self.focus, -+ self.overlay = self.ComboSpace(self.list,parent,ui,index, - pos=(0,row)) - - self._w = w -@@ -419,7 +431,10 @@ - if self.overlay: - return self.overlay._listbox.get_focus() - else: -- return None,self.focus -+ if urwid.VERSION < (1, 1, 0): -+ return None, self.focus -+ else: -+ return None, self.focus_position - - def get_sensitive(self): - return self.cbox.get_sensitive() - diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/835_834.patch --- a/wicd/stuff/835_834.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -=== modified file 'curses/curses_misc.py' ---- curses/curses_misc.py 2012-11-15 09:26:21 +0000 -+++ curses/curses_misc.py 2012-11-16 09:22:47 +0000 -@@ -352,7 +352,7 @@ - if urwid.VERSION < (1, 1, 0): - self.focus = focus - else: -- self.focus_position = focus -+ self._w.focus_position = focus - - self.callback = callback - self.user_args = user_args -@@ -368,7 +368,10 @@ - if urwid.VERSION < (1, 1, 0): - self.focus = index - else: -- self.focus_position = index -+ try: -+ self._w.focus_position = index -+ except IndexError: -+ pass - - # API changed between urwid 0.9.8.4 and 0.9.9 - try: -@@ -386,7 +389,7 @@ - if urwid.VERSION < (1, 1, 0): - index = self.focus - else: -- index = self.focus_position -+ index = self._w.focus_position - - self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]), - attrs=self.attrs,focus_attr=self.focus_attr) -@@ -434,7 +437,7 @@ - if urwid.VERSION < (1, 1, 0): - return None, self.focus - else: -- return None, self.focus_position -+ return None, self._w.focus_position - - def get_sensitive(self): - return self.cbox.get_sensitive() - diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/dbus_string_fix.patch --- a/wicd/stuff/dbus_string_fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -=== modified file 'wicd/misc.py' ---- wicd/misc.py 2012-04-30 19:20:47 +0000 -+++ wicd/misc.py 2012-05-03 16:01:49 +0000 -@@ -430,7 +430,10 @@ - """ Sanitize property names to be used in config-files. """ - allowed = string.ascii_letters + '_' + string.digits - table = string.maketrans(allowed, ' ' * len(allowed)) -- return s.translate(None, table) -+ -+ # s is a dbus.String -- since we don't allow unicode property keys, -+ # make it simple. -+ return str(s).translate(None, table) - - def sanitize_escaped(s): - """ Sanitize double-escaped unicode strings. """ diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/patches/831_830.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wicd/stuff/patches/831_830.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,66 @@ +=== modified file 'curses/curses_misc.py' +--- curses/curses_misc.py 2012-05-06 15:16:15 +0000 ++++ curses/curses_misc.py 2012-11-15 09:26:21 +0000 +@@ -349,7 +349,10 @@ + # We need this to pick our keypresses + self.use_enter = use_enter + +- self.focus = focus ++ if urwid.VERSION < (1, 1, 0): ++ self.focus = focus ++ else: ++ self.focus_position = focus + + self.callback = callback + self.user_args = user_args +@@ -362,7 +365,11 @@ + self.list = list + + def set_focus(self,index): +- self.focus = index ++ if urwid.VERSION < (1, 1, 0): ++ self.focus = index ++ else: ++ self.focus_position = index ++ + # API changed between urwid 0.9.8.4 and 0.9.9 + try: + self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW)) +@@ -376,16 +383,21 @@ + def build_combobox(self,parent,ui,row): + str,trash = self.label.get_text() + +- self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]), ++ if urwid.VERSION < (1, 1, 0): ++ index = self.focus ++ else: ++ index = self.focus_position ++ ++ self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]), + attrs=self.attrs,focus_attr=self.focus_attr) + if str != '': + w = urwid.Columns([('fixed',len(str),self.label),self.cbox], + dividechars=1) +- self.overlay = self.ComboSpace(self.list,parent,ui,self.focus, ++ self.overlay = self.ComboSpace(self.list,parent,ui,index, + pos=(len(str)+1,row)) + else: + w = urwid.Columns([self.cbox]) +- self.overlay = self.ComboSpace(self.list,parent,ui,self.focus, ++ self.overlay = self.ComboSpace(self.list,parent,ui,index, + pos=(0,row)) + + self._w = w +@@ -419,7 +431,10 @@ + if self.overlay: + return self.overlay._listbox.get_focus() + else: +- return None,self.focus ++ if urwid.VERSION < (1, 1, 0): ++ return None, self.focus ++ else: ++ return None, self.focus_position + + def get_sensitive(self): + return self.cbox.get_sensitive() + diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/patches/835_834.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wicd/stuff/patches/835_834.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,43 @@ +=== modified file 'curses/curses_misc.py' +--- curses/curses_misc.py 2012-11-15 09:26:21 +0000 ++++ curses/curses_misc.py 2012-11-16 09:22:47 +0000 +@@ -352,7 +352,7 @@ + if urwid.VERSION < (1, 1, 0): + self.focus = focus + else: +- self.focus_position = focus ++ self._w.focus_position = focus + + self.callback = callback + self.user_args = user_args +@@ -368,7 +368,10 @@ + if urwid.VERSION < (1, 1, 0): + self.focus = index + else: +- self.focus_position = index ++ try: ++ self._w.focus_position = index ++ except IndexError: ++ pass + + # API changed between urwid 0.9.8.4 and 0.9.9 + try: +@@ -386,7 +389,7 @@ + if urwid.VERSION < (1, 1, 0): + index = self.focus + else: +- index = self.focus_position ++ index = self._w.focus_position + + self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]), + attrs=self.attrs,focus_attr=self.focus_attr) +@@ -434,7 +437,7 @@ + if urwid.VERSION < (1, 1, 0): + return None, self.focus + else: +- return None, self.focus_position ++ return None, self._w.focus_position + + def get_sensitive(self): + return self.cbox.get_sensitive() + diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/patches/dbus_string_fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wicd/stuff/patches/dbus_string_fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,15 @@ +=== modified file 'wicd/misc.py' +--- wicd/misc.py 2012-04-30 19:20:47 +0000 ++++ wicd/misc.py 2012-05-03 16:01:49 +0000 +@@ -430,7 +430,10 @@ + """ Sanitize property names to be used in config-files. """ + allowed = string.ascii_letters + '_' + string.digits + table = string.maketrans(allowed, ' ' * len(allowed)) +- return s.translate(None, table) ++ ++ # s is a dbus.String -- since we don't allow unicode property keys, ++ # make it simple. ++ return str(s).translate(None, table) + + def sanitize_escaped(s): + """ Sanitize double-escaped unicode strings. """ diff -r c7b121a4ffd9 -r d6378d455338 wicd/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wicd/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,4 @@ +# Fix problem with new urwid FS#33378 LP#1075399 +-Np0|831_830.patch +-Np0|835_834.patch +-Np0|dbus_string_fix.patch diff -r c7b121a4ffd9 -r d6378d455338 wxWidgets/stuff/gsockgtk.patch --- a/wxWidgets/stuff/gsockgtk.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ ---- src/gtk/gsockgtk.cpp Fri Mar 6 13:11:40 2009 -+++ src/gtk/gsockgtk.cpp Thu Sep 17 12:10:10 2009 -@@ -15,8 +15,13 @@ - #include - #include - -+// newer versions of glib define its own GSocket but we unfortunately use this -+// name in our own (semi-)public header and so can't change it -- rename glib -+// one instead -+#define GSocket GlibGSocket - #include - #include -+#undef GSocket - - #include "wx/gsocket.h" - #include "wx/unix/gsockunx.h" diff -r c7b121a4ffd9 -r d6378d455338 wxpython/receipt --- a/wxpython/receipt Wed May 09 17:03:28 2018 +0300 +++ b/wxpython/receipt Thu May 10 21:12:00 2018 +0300 @@ -31,7 +31,6 @@ $CONFIGURE_ARGS && make $MAKEFLAGS cd $src/wxPython - patch -Np2 -i $stuff/wxpython-cairo.patch python setup.py WXPORT=gtk2 UNICODE=1 build python setup.py WXPORT=gtk2 UNICODE=1 install --root=$DESTDIR } diff -r c7b121a4ffd9 -r d6378d455338 wxpython/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wxpython/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +wxpython-cairo.patch diff -r c7b121a4ffd9 -r d6378d455338 wxpython/stuff/patches/wxpython-cairo.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wxpython/stuff/patches/wxpython-cairo.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,51 @@ +--- a/wxPython/wx/lib/wxcairo.py 2011/08/25 18:50:02 68894 ++++ b/wxPython/wx/lib/wxcairo.py 2011/09/22 00:30:25 69181 +@@ -401,6 +401,48 @@ + ctypes.py_object)), + ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))] + ++ # This structure is known good with pycairo 1.10.0. The keep adding stuff ++ # to the middle of the structure instead of only adding to the end! ++ elif cairo.version_info < (1,11): ++ _fields_ = [ ++ ('Context_Type', ctypes.py_object), ++ ('Context_FromContext', ctypes.PYFUNCTYPE(ctypes.py_object, ++ ctypes.c_void_p, ++ ctypes.py_object, ++ ctypes.py_object)), ++ ('FontFace_Type', ctypes.py_object), ++ ('ToyFontFace_Type', ctypes.py_object), #** new in 1.8.4 ++ ('FontFace_FromFontFace', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), ++ ('FontOptions_Type', ctypes.py_object), ++ ('FontOptions_FromFontOptions', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), ++ ('Matrix_Type', ctypes.py_object), ++ ('Matrix_FromMatrix', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), ++ ('Path_Type', ctypes.py_object), ++ ('Path_FromPath', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), ++ ('Pattern_Type', ctypes.py_object), ++ ('SolidPattern_Type', ctypes.py_object), ++ ('SurfacePattern_Type', ctypes.py_object), ++ ('Gradient_Type', ctypes.py_object), ++ ('LinearGradient_Type', ctypes.py_object), ++ ('RadialGradient_Type', ctypes.py_object), ++ ('Pattern_FromPattern', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p, ++ ctypes.py_object)), #** changed in 1.8.4 ++ ('ScaledFont_Type', ctypes.py_object), ++ ('ScaledFont_FromScaledFont', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), ++ ('Surface_Type', ctypes.py_object), ++ ('ImageSurface_Type', ctypes.py_object), ++ ('PDFSurface_Type', ctypes.py_object), ++ ('PSSurface_Type', ctypes.py_object), ++ ('SVGSurface_Type', ctypes.py_object), ++ ('Win32Surface_Type', ctypes.py_object), ++ ('Win32PrintingSurface_Type', ctypes.py_object), ++ ('XCBSurface_Type', ctypes.py_object), ++ ('XlibSurface_Type', ctypes.py_object), ++ ('Surface_FromSurface', ctypes.PYFUNCTYPE(ctypes.py_object, ++ ctypes.c_void_p, ++ ctypes.py_object)), ++ ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))] ++ + + def _loadPycairoAPI(): + global pycairoAPI diff -r c7b121a4ffd9 -r d6378d455338 wxpython/stuff/wxpython-cairo.patch --- a/wxpython/stuff/wxpython-cairo.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ ---- wxPython/trunk/wx/lib/wxcairo.py 2011/08/25 18:50:02 68894 -+++ wxPython/trunk/wx/lib/wxcairo.py 2011/09/22 00:30:25 69181 -@@ -401,6 +401,48 @@ - ctypes.py_object)), - ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))] - -+ # This structure is known good with pycairo 1.10.0. The keep adding stuff -+ # to the middle of the structure instead of only adding to the end! -+ elif cairo.version_info < (1,11): -+ _fields_ = [ -+ ('Context_Type', ctypes.py_object), -+ ('Context_FromContext', ctypes.PYFUNCTYPE(ctypes.py_object, -+ ctypes.c_void_p, -+ ctypes.py_object, -+ ctypes.py_object)), -+ ('FontFace_Type', ctypes.py_object), -+ ('ToyFontFace_Type', ctypes.py_object), #** new in 1.8.4 -+ ('FontFace_FromFontFace', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), -+ ('FontOptions_Type', ctypes.py_object), -+ ('FontOptions_FromFontOptions', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), -+ ('Matrix_Type', ctypes.py_object), -+ ('Matrix_FromMatrix', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), -+ ('Path_Type', ctypes.py_object), -+ ('Path_FromPath', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), -+ ('Pattern_Type', ctypes.py_object), -+ ('SolidPattern_Type', ctypes.py_object), -+ ('SurfacePattern_Type', ctypes.py_object), -+ ('Gradient_Type', ctypes.py_object), -+ ('LinearGradient_Type', ctypes.py_object), -+ ('RadialGradient_Type', ctypes.py_object), -+ ('Pattern_FromPattern', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p, -+ ctypes.py_object)), #** changed in 1.8.4 -+ ('ScaledFont_Type', ctypes.py_object), -+ ('ScaledFont_FromScaledFont', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), -+ ('Surface_Type', ctypes.py_object), -+ ('ImageSurface_Type', ctypes.py_object), -+ ('PDFSurface_Type', ctypes.py_object), -+ ('PSSurface_Type', ctypes.py_object), -+ ('SVGSurface_Type', ctypes.py_object), -+ ('Win32Surface_Type', ctypes.py_object), -+ ('Win32PrintingSurface_Type', ctypes.py_object), -+ ('XCBSurface_Type', ctypes.py_object), -+ ('XlibSurface_Type', ctypes.py_object), -+ ('Surface_FromSurface', ctypes.PYFUNCTYPE(ctypes.py_object, -+ ctypes.c_void_p, -+ ctypes.py_object)), -+ ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))] -+ - - def _loadPycairoAPI(): - global pycairoAPI diff -r c7b121a4ffd9 -r d6378d455338 xarchive/receipt --- a/xarchive/receipt Wed May 09 17:03:28 2018 +0300 +++ b/xarchive/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,12 +18,6 @@ # Rules to configure and make the package.ls sr compile_rules() { - cd $src - # patch tar-wrap for busybox tar option - [ -f done.slitaz-xarchive-wrappers-0.2.8-6.patch ] || \ - patch -p1 -i $stuff/slitaz-xarchive-wrappers-0.2.8-6.patch - touch done.slitaz-xarchive-wrappers-0.2.8-6.patch - ./configure --prefix=/usr --infodir=/usr/share/info \ --mandir=/usr/share/man $CONFIGURE_ARGS && diff -r c7b121a4ffd9 -r d6378d455338 xarchive/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarchive/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +# patch tar-wrap for busybox tar option +-p1|slitaz-xarchive-wrappers-0.2.8-6.patch diff -r c7b121a4ffd9 -r d6378d455338 xarchive/stuff/patches/slitaz-xarchive-wrappers-0.2.8-6.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarchive/stuff/patches/slitaz-xarchive-wrappers-0.2.8-6.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,693 @@ +--- xarchive-0.2.8-6.old/config.log Thu Jan 1 01:00:00 1970 ++++ xarchive-0.2.8-6/config.log Sat Mar 22 12:58:40 2008 +@@ -0,0 +1,479 @@ ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++ ++It was created by XArchive configure 0.2.8-6, which was ++generated by GNU Autoconf 2.59. Invocation command line was ++ ++ $ ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu ++ ++## --------- ## ++## Platform. ## ++## --------- ## ++ ++hostname = beastie ++uname -m = i686 ++uname -r = 2.6.24.2-slitaz ++uname -s = Linux ++uname -v = #1 SMP Mon Mar 10 16:36:10 CET 2008 ++ ++/usr/bin/uname -p = unknown ++/bin/uname -X = unknown ++ ++/bin/arch = unknown ++/usr/bin/arch -k = unknown ++/usr/convex/getsysinfo = unknown ++hostinfo = unknown ++/bin/machine = unknown ++/usr/bin/oslevel = unknown ++/bin/universe = unknown ++ ++PATH: /usr/sbin ++PATH: /usr/bin ++PATH: /sbin ++PATH: /bin ++PATH: /usr/games ++ ++ ++## ----------- ## ++## Core tests. ## ++## ----------- ## ++ ++configure:1378: checking for a BSD-compatible install ++configure:1433: result: /usr/bin/install -c ++configure:1444: checking whether build environment is sane ++configure:1487: result: yes ++configure:1520: checking for gawk ++configure:1549: result: no ++configure:1520: checking for mawk ++configure:1549: result: no ++configure:1520: checking for nawk ++configure:1549: result: no ++configure:1520: checking for awk ++configure:1536: found /usr/bin/awk ++configure:1546: result: awk ++configure:1556: checking whether make sets $(MAKE) ++configure:1576: result: yes ++configure:1734: checking build system type ++configure:1752: result: i486-pc-linux-gnu ++configure:1770: checking for i486-pc-linux-gnu-gcc ++configure:1786: found /usr/bin/i486-pc-linux-gnu-gcc ++configure:1796: result: i486-pc-linux-gnu-gcc ++configure:2078: checking for C compiler version ++configure:2081: i486-pc-linux-gnu-gcc --version &5 ++i486-pc-linux-gnu-gcc (GCC) 4.2.2 ++Copyright (C) 2007 Free Software Foundation, Inc. ++This is free software; see the source for copying conditions. There is NO ++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ ++configure:2084: $? = 0 ++configure:2086: i486-pc-linux-gnu-gcc -v &5 ++Using built-in specs. ++Target: i486-pc-linux-gnu ++Configured with: ../gcc-4.2.2/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu ++Thread model: posix ++gcc version 4.2.2 ++configure:2089: $? = 0 ++configure:2091: i486-pc-linux-gnu-gcc -V &5 ++i486-pc-linux-gnu-gcc: '-V' option must have argument ++configure:2094: $? = 1 ++configure:2117: checking for C compiler default output file name ++configure:2120: i486-pc-linux-gnu-gcc conftest.c >&5 ++configure:2123: $? = 0 ++configure:2169: result: a.out ++configure:2174: checking whether the C compiler works ++configure:2180: ./a.out ++configure:2183: $? = 0 ++configure:2200: result: yes ++configure:2207: checking whether we are cross compiling ++configure:2209: result: no ++configure:2212: checking for suffix of executables ++configure:2214: i486-pc-linux-gnu-gcc -o conftest conftest.c >&5 ++configure:2217: $? = 0 ++configure:2242: result: ++configure:2248: checking for suffix of object files ++configure:2269: i486-pc-linux-gnu-gcc -c conftest.c >&5 ++configure:2272: $? = 0 ++configure:2294: result: o ++configure:2298: checking whether we are using the GNU C compiler ++configure:2322: i486-pc-linux-gnu-gcc -c conftest.c >&5 ++configure:2328: $? = 0 ++configure:2331: test -z || test ! -s conftest.err ++configure:2334: $? = 0 ++configure:2337: test -s conftest.o ++configure:2340: $? = 0 ++configure:2353: result: yes ++configure:2359: checking whether i486-pc-linux-gnu-gcc accepts -g ++configure:2380: i486-pc-linux-gnu-gcc -c -g conftest.c >&5 ++configure:2386: $? = 0 ++configure:2389: test -z || test ! -s conftest.err ++configure:2392: $? = 0 ++configure:2395: test -s conftest.o ++configure:2398: $? = 0 ++configure:2409: result: yes ++configure:2426: checking for i486-pc-linux-gnu-gcc option to accept ANSI C ++configure:2496: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:2502: $? = 0 ++configure:2505: test -z || test ! -s conftest.err ++configure:2508: $? = 0 ++configure:2511: test -s conftest.o ++configure:2514: $? = 0 ++configure:2532: result: none needed ++configure:2550: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' ++configure:2556: $? = 1 ++configure: failed program was: ++| #ifndef __cplusplus ++| choke me ++| #endif ++configure:2705: checking for style of include used by make ++configure:2733: result: GNU ++configure:2761: checking dependency style of i486-pc-linux-gnu-gcc ++configure:2823: result: gcc3 ++configure:2830: checking for bash ++configure:2848: found /bin/bash ++configure:2860: result: /bin/bash ++configure:2875: checking for i486-pc-linux-gnu-pkg-config ++configure:2908: result: no ++configure:2917: checking for pkg-config ++configure:2935: found /usr/bin/pkg-config ++configure:2947: result: /usr/bin/pkg-config ++configure:2962: checking pkg-config is at least version 0.9.0 ++configure:2965: result: yes ++configure:2976: checking for GTK_CFLAGS ++configure:2993: result: -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ++configure:2995: checking for GTK_LIBS ++configure:3012: result: -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ++configure:3043: checking for dirent.h that defines DIR ++configure:3067: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3073: $? = 0 ++configure:3076: test -z || test ! -s conftest.err ++configure:3079: $? = 0 ++configure:3082: test -s conftest.o ++configure:3085: $? = 0 ++configure:3096: result: yes ++configure:3109: checking for library containing opendir ++configure:3139: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 ++configure:3145: $? = 0 ++configure:3148: test -z || test ! -s conftest.err ++configure:3151: $? = 0 ++configure:3154: test -s conftest ++configure:3157: $? = 0 ++configure:3226: result: none required ++configure:3365: checking how to run the C preprocessor ++configure:3400: i486-pc-linux-gnu-gcc -E conftest.c ++configure:3406: $? = 0 ++configure:3438: i486-pc-linux-gnu-gcc -E conftest.c ++conftest.c:13:28: error: ac_nonexistent.h: No such file or directory ++configure:3444: $? = 1 ++configure: failed program was: ++| /* confdefs.h. */ ++| ++| #define PACKAGE_NAME "XArchive" ++| #define PACKAGE_TARNAME "xarchive" ++| #define PACKAGE_VERSION "0.2.8-6" ++| #define PACKAGE_STRING "XArchive 0.2.8-6" ++| #define PACKAGE_BUGREPORT "Lee Bigelow " ++| #define PACKAGE "xarchive" ++| #define VERSION "0.2.8-6" ++| #define _GNU_SOURCE 1 ++| #define HAVE_DIRENT_H 1 ++| /* end confdefs.h. */ ++| #include ++configure:3483: result: i486-pc-linux-gnu-gcc -E ++configure:3507: i486-pc-linux-gnu-gcc -E conftest.c ++configure:3513: $? = 0 ++configure:3545: i486-pc-linux-gnu-gcc -E conftest.c ++conftest.c:13:28: error: ac_nonexistent.h: No such file or directory ++configure:3551: $? = 1 ++configure: failed program was: ++| /* confdefs.h. */ ++| ++| #define PACKAGE_NAME "XArchive" ++| #define PACKAGE_TARNAME "xarchive" ++| #define PACKAGE_VERSION "0.2.8-6" ++| #define PACKAGE_STRING "XArchive 0.2.8-6" ++| #define PACKAGE_BUGREPORT "Lee Bigelow " ++| #define PACKAGE "xarchive" ++| #define VERSION "0.2.8-6" ++| #define _GNU_SOURCE 1 ++| #define HAVE_DIRENT_H 1 ++| /* end confdefs.h. */ ++| #include ++configure:3595: checking for egrep ++configure:3605: result: grep -E ++configure:3610: checking for ANSI C header files ++configure:3635: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3641: $? = 0 ++configure:3644: test -z || test ! -s conftest.err ++configure:3647: $? = 0 ++configure:3650: test -s conftest.o ++configure:3653: $? = 0 ++configure:3742: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 ++conftest.c: In function 'main': ++conftest.c:30: warning: incompatible implicit declaration of built-in function 'exit' ++configure:3745: $? = 0 ++configure:3747: ./conftest ++configure:3750: $? = 0 ++configure:3765: result: yes ++configure:3789: checking for sys/types.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for sys/stat.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for stdlib.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for string.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for memory.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for strings.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for inttypes.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for stdint.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3789: checking for unistd.h ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:3811: $? = 0 ++configure:3814: test -z || test ! -s conftest.err ++configure:3817: $? = 0 ++configure:3820: test -s conftest.o ++configure:3823: $? = 0 ++configure:3834: result: yes ++configure:3853: checking for stdlib.h ++configure:3858: result: yes ++configure:3853: checking for string.h ++configure:3858: result: yes ++configure:3853: checking for unistd.h ++configure:3858: result: yes ++configure:3999: checking for an ANSI C-conforming const ++configure:4066: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 ++configure:4072: $? = 0 ++configure:4075: test -z || test ! -s conftest.err ++configure:4078: $? = 0 ++configure:4081: test -s conftest.o ++configure:4084: $? = 0 ++configure:4095: result: yes ++configure:4109: checking for working alloca.h ++configure:4130: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 ++ ++## ---------------- ## ++## Cache variables. ## ++## ---------------- ## ++ ++ac_cv_build=i486-pc-linux-gnu ++ac_cv_build_alias=i486-pc-linux-gnu ++ac_cv_c_compiler_gnu=yes ++ac_cv_c_const=yes ++ac_cv_env_CC_set= ++ac_cv_env_CC_value= ++ac_cv_env_CFLAGS_set= ++ac_cv_env_CFLAGS_value= ++ac_cv_env_CPPFLAGS_set= ++ac_cv_env_CPPFLAGS_value= ++ac_cv_env_CPP_set= ++ac_cv_env_CPP_value= ++ac_cv_env_GTK_CFLAGS_set= ++ac_cv_env_GTK_CFLAGS_value= ++ac_cv_env_GTK_LIBS_set= ++ac_cv_env_GTK_LIBS_value= ++ac_cv_env_LDFLAGS_set= ++ac_cv_env_LDFLAGS_value= ++ac_cv_env_PKG_CONFIG_set= ++ac_cv_env_PKG_CONFIG_value= ++ac_cv_env_build_alias_set=set ++ac_cv_env_build_alias_value=i486-pc-linux-gnu ++ac_cv_env_host_alias_set=set ++ac_cv_env_host_alias_value=i486-pc-linux-gnu ++ac_cv_env_target_alias_set= ++ac_cv_env_target_alias_value= ++ac_cv_exeext= ++ac_cv_header_dirent_dirent_h=yes ++ac_cv_header_inttypes_h=yes ++ac_cv_header_memory_h=yes ++ac_cv_header_stdc=yes ++ac_cv_header_stdint_h=yes ++ac_cv_header_stdlib_h=yes ++ac_cv_header_string_h=yes ++ac_cv_header_strings_h=yes ++ac_cv_header_sys_stat_h=yes ++ac_cv_header_sys_types_h=yes ++ac_cv_header_unistd_h=yes ++ac_cv_objext=o ++ac_cv_path_BASH_PROG=/bin/bash ++ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config ++ac_cv_path_install='/usr/bin/install -c' ++ac_cv_prog_AWK=awk ++ac_cv_prog_CC=i486-pc-linux-gnu-gcc ++ac_cv_prog_CPP='i486-pc-linux-gnu-gcc -E' ++ac_cv_prog_cc_g=yes ++ac_cv_prog_cc_stdc= ++ac_cv_prog_egrep='grep -E' ++ac_cv_prog_make_make_set=yes ++ac_cv_search_opendir='none required' ++am_cv_CC_dependencies_compiler_type=gcc3 ++pkg_cv_GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' ++pkg_cv_GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' ++ ++## ----------------- ## ++## Output variables. ## ++## ----------------- ## ++ ++ACLOCAL='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run aclocal-1.6' ++ALLOCA='' ++AMDEPBACKSLASH='\' ++AMDEP_FALSE='#' ++AMDEP_TRUE='' ++AMTAR='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run tar' ++AUTOCONF='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoconf' ++AUTOHEADER='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoheader' ++AUTOMAKE='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run automake-1.6' ++AWK='awk' ++BASH_PROG='/bin/bash' ++BASH_PROG='/bin/bash' ++CC='i486-pc-linux-gnu-gcc' ++CCDEPMODE='depmode=gcc3' ++CFLAGS='-g -O2' ++CONFIGURE_CFLAGS='' ++CONFIGURE_LDFLAGS='' ++CPP='i486-pc-linux-gnu-gcc -E' ++CPPFLAGS='' ++DEFS='' ++DEPDIR='.deps' ++ECHO_C='' ++ECHO_N='-n' ++ECHO_T='' ++EGREP='grep -E' ++EXEEXT='' ++GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' ++GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' ++GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' ++GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' ++INSTALL_DATA='${INSTALL} -m 644' ++INSTALL_PROGRAM='${INSTALL}' ++INSTALL_SCRIPT='${INSTALL}' ++INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' ++LDFLAGS='' ++LIBOBJS='' ++LIBS='' ++LTLIBOBJS='' ++MAKEINFO='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run makeinfo' ++OBJEXT='o' ++PACKAGE='xarchive' ++PACKAGE_BUGREPORT='Lee Bigelow ' ++PACKAGE_NAME='XArchive' ++PACKAGE_STRING='XArchive 0.2.8-6' ++PACKAGE_TARNAME='xarchive' ++PACKAGE_VERSION='0.2.8-6' ++PATH_SEPARATOR=':' ++PKG_CONFIG='/usr/bin/pkg-config' ++SET_MAKE='' ++SHELL='/bin/bash' ++STRIP='' ++VERSION='0.2.8-6' ++ac_ct_CC='' ++ac_ct_STRIP='' ++ac_pt_PKG_CONFIG='/usr/bin/pkg-config' ++am__include='include' ++am__quote='' ++bindir='${exec_prefix}/bin' ++build='i486-pc-linux-gnu' ++build_alias='i486-pc-linux-gnu' ++build_cpu='i486' ++build_os='linux-gnu' ++build_os='linux-gnu' ++build_vendor='pc' ++datadir='${prefix}/share' ++exec_prefix='NONE' ++host_alias='i486-pc-linux-gnu' ++includedir='${prefix}/include' ++infodir='/usr/share/info' ++install_sh='/home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/install-sh' ++libdir='${exec_prefix}/lib' ++libexecdir='${exec_prefix}/libexec' ++localstatedir='${prefix}/var' ++mandir='/usr/share/man' ++oldincludedir='/usr/include' ++prefix='/usr' ++program_transform_name='s,x,x,' ++sbindir='${exec_prefix}/sbin' ++sharedstatedir='${prefix}/com' ++sysconfdir='${prefix}/etc' ++target_alias='' ++ ++## ----------- ## ++## confdefs.h. ## ++## ----------- ## ++ ++#define HAVE_DIRENT_H 1 ++#define HAVE_INTTYPES_H 1 ++#define HAVE_MEMORY_H 1 ++#define HAVE_STDINT_H 1 ++#define HAVE_STDLIB_H 1 ++#define HAVE_STDLIB_H 1 ++#define HAVE_STRINGS_H 1 ++#define HAVE_STRING_H 1 ++#define HAVE_STRING_H 1 ++#define HAVE_SYS_STAT_H 1 ++#define HAVE_SYS_TYPES_H 1 ++#define HAVE_UNISTD_H 1 ++#define HAVE_UNISTD_H 1 ++#define PACKAGE "xarchive" ++#define PACKAGE_BUGREPORT "Lee Bigelow " ++#define PACKAGE_NAME "XArchive" ++#define PACKAGE_STRING "XArchive 0.2.8-6" ++#define PACKAGE_TARNAME "xarchive" ++#define PACKAGE_VERSION "0.2.8-6" ++#define STDC_HEADERS 1 ++#define VERSION "0.2.8-6" ++#define _GNU_SOURCE 1 ++ ++configure: caught signal 2 ++configure: exit 1 +--- xarchive-0.2.8-6.old/wrappers/7za.src Tue Nov 15 12:59:51 2005 ++++ xarchive-0.2.8-6/wrappers/7za.src Sat Mar 22 13:01:15 2008 +@@ -51,9 +51,9 @@ + # the shifting will leave the files passed as + # all the remaining args: "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # Command line options for prog functions + NEW_OPTS="a -ms=off" +--- xarchive-0.2.8-6.old/wrappers/ace.src Sat Jan 14 04:49:36 2006 ++++ xarchive-0.2.8-6/wrappers/ace.src Sat Mar 22 13:01:15 2008 +@@ -48,9 +48,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # Command line options for prog functions + # disable comments when opening +--- xarchive-0.2.8-6.old/wrappers/arj.src Tue Nov 15 12:59:56 2005 ++++ xarchive-0.2.8-6/wrappers/arj.src Sat Mar 22 13:01:15 2008 +@@ -52,9 +52,9 @@ + # the shifting will leave the files passed as + # all the remaining args: "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # Command line options for prog functions + NEW_OPTS="a" +--- xarchive-0.2.8-6.old/wrappers/deb.src Tue Nov 8 17:49:13 2005 ++++ xarchive-0.2.8-6/wrappers/deb.src Sat Mar 22 13:01:15 2008 +@@ -40,9 +40,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + + # Command line options for prog functions +--- xarchive-0.2.8-6.old/wrappers/rar.src Mon Nov 14 21:41:21 2005 ++++ xarchive-0.2.8-6/wrappers/rar.src Sat Mar 22 13:01:15 2008 +@@ -53,9 +53,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # Command line options for prog functions + # disable comments when opening +--- xarchive-0.2.8-6.old/wrappers/rpm-bsd.src Tue Nov 8 17:49:13 2005 ++++ xarchive-0.2.8-6/wrappers/rpm-bsd.src Sat Mar 22 13:01:16 2008 +@@ -42,9 +42,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # the option switches + case "$opt" in +--- xarchive-0.2.8-6.old/wrappers/rpm-gnu.src Tue Nov 8 17:49:13 2005 ++++ xarchive-0.2.8-6/wrappers/rpm-gnu.src Sat Mar 22 13:01:16 2008 +@@ -41,9 +41,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # the option switches + case "$opt" in +--- xarchive-0.2.8-6.old/wrappers/tar-bsd.src Tue Nov 8 20:51:54 2005 ++++ xarchive-0.2.8-6/wrappers/tar-bsd.src Sat Mar 22 13:01:16 2008 +@@ -43,9 +43,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # set up compression variables for our compression functions. + # translate archive name to lower case for pattern matching. +--- xarchive-0.2.8-6.old/wrappers/tar-gnu.src Tue Nov 8 20:50:59 2005 ++++ xarchive-0.2.8-6/wrappers/tar-gnu.src Sat Mar 22 13:16:15 2008 +@@ -42,9 +42,9 @@ + # the shifting will leave the files passed as + # all the remaining args "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # set up compression variables for our compression functions. + # translate archive name to lower case for pattern matching. +@@ -54,14 +54,14 @@ + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then + DECOMPRESS="gzip -dc" + COMPRESS="gzip -c" +- TAR_COMPRESS_OPT="--use-compress-prog=gzip" ++ TAR_COMPRESS_OPT="z" + fi + done + for ext in $BZIP2_EXTS; do + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then + DECOMPRESS="bzip2 -dc" + COMPRESS="bzip2 -c" +- TAR_COMPRESS_OPT="--use-compress-prog=bzip2" ++ TAR_COMPRESS_OPT="j" + fi + done + for ext in $COMPRESS_EXTS; do +@@ -76,8 +76,8 @@ + # open and extract can use tar's cmd line option + # add, new, and remove need to decompress the tar first + # do their thing, than recompress the tar. +-OPEN_OPTS="$TAR_COMPRESS_OPT -tvf" +-EXTRACT_OPTS="$TAR_COMPRESS_OPT -xf" ++OPEN_OPTS="-tv${TAR_COMPRESS_OPT}f" ++EXTRACT_OPTS="-x${TAR_COMPRESS_OPT}f" + ADD_OPTS="-rf" + NEW_OPTS="-cf" + REMOVE_OPTS="--delete -f" +@@ -206,11 +206,12 @@ + ;; + + -r) # remove: from archive passed files +- decompress_func +- $TAR_PROG $REMOVE_OPTS "$archive" "$@" +- wrapper_status=$? +- compress_func +- exit $wrapper_status ++ #decompress_func ++ #$TAR_PROG $REMOVE_OPTS "$archive" "$@" ++ #wrapper_status=$? ++ #compress_func ++ #exit $wrapper_status ++ exit $E_UNSUPPORTED + ;; + + -e) # extract: from archive passed files +--- xarchive-0.2.8-6.old/wrappers/zip.src Tue Nov 15 13:02:08 2005 ++++ xarchive-0.2.8-6/wrappers/zip.src Sat Mar 22 13:01:16 2008 +@@ -51,9 +51,9 @@ + # the shifting will leave the files passed as + # all the remaining args: "$@" + opt="$1" +-shift 1 ++test -z $1 || shift 1 + archive="$1" +-shift 1 ++test -z $1 || shift 1 + + # Command line options for prog functions + +--- xarchive-0.2.8-6/xarchive.desktop.src ++++ xarchive-0.2.8-6/xarchive.desktop.src +@@ -12,7 +12,7 @@ + Comment[en_GB]=Create, modify and browse an archive + GenericName=Archive Manager + +-Categories=Gtk;Application;System;Utility; ++Categories=Gtk;Utility; + Exec=xarchive %F + Icon=/path/to/icons/xarchive.xpm + StartupNotify=true + +--- xarchive-0.2.8-6/src/main.c ++++ xarchive-0.2.8-6/src/main.c +@@ -178,6 +178,10 @@ + { + ext = (gchar *) g_ptr_array_index(wrapent->ext_array, e); + g_string_append_printf(info_text,"%s ", ext); ++ if (e % 10 == 9) ++ { ++ g_string_append_printf(info_text,"\n "); ++ } + } + g_string_append_c(info_text, '\n'); + } diff -r c7b121a4ffd9 -r d6378d455338 xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch --- a/xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,693 +0,0 @@ ---- xarchive-0.2.8-6.old/config.log Thu Jan 1 01:00:00 1970 -+++ xarchive-0.2.8-6/config.log Sat Mar 22 12:58:40 2008 -@@ -0,0 +1,479 @@ -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+ -+It was created by XArchive configure 0.2.8-6, which was -+generated by GNU Autoconf 2.59. Invocation command line was -+ -+ $ ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu -+ -+## --------- ## -+## Platform. ## -+## --------- ## -+ -+hostname = beastie -+uname -m = i686 -+uname -r = 2.6.24.2-slitaz -+uname -s = Linux -+uname -v = #1 SMP Mon Mar 10 16:36:10 CET 2008 -+ -+/usr/bin/uname -p = unknown -+/bin/uname -X = unknown -+ -+/bin/arch = unknown -+/usr/bin/arch -k = unknown -+/usr/convex/getsysinfo = unknown -+hostinfo = unknown -+/bin/machine = unknown -+/usr/bin/oslevel = unknown -+/bin/universe = unknown -+ -+PATH: /usr/sbin -+PATH: /usr/bin -+PATH: /sbin -+PATH: /bin -+PATH: /usr/games -+ -+ -+## ----------- ## -+## Core tests. ## -+## ----------- ## -+ -+configure:1378: checking for a BSD-compatible install -+configure:1433: result: /usr/bin/install -c -+configure:1444: checking whether build environment is sane -+configure:1487: result: yes -+configure:1520: checking for gawk -+configure:1549: result: no -+configure:1520: checking for mawk -+configure:1549: result: no -+configure:1520: checking for nawk -+configure:1549: result: no -+configure:1520: checking for awk -+configure:1536: found /usr/bin/awk -+configure:1546: result: awk -+configure:1556: checking whether make sets $(MAKE) -+configure:1576: result: yes -+configure:1734: checking build system type -+configure:1752: result: i486-pc-linux-gnu -+configure:1770: checking for i486-pc-linux-gnu-gcc -+configure:1786: found /usr/bin/i486-pc-linux-gnu-gcc -+configure:1796: result: i486-pc-linux-gnu-gcc -+configure:2078: checking for C compiler version -+configure:2081: i486-pc-linux-gnu-gcc --version &5 -+i486-pc-linux-gnu-gcc (GCC) 4.2.2 -+Copyright (C) 2007 Free Software Foundation, Inc. -+This is free software; see the source for copying conditions. There is NO -+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -+ -+configure:2084: $? = 0 -+configure:2086: i486-pc-linux-gnu-gcc -v &5 -+Using built-in specs. -+Target: i486-pc-linux-gnu -+Configured with: ../gcc-4.2.2/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu -+Thread model: posix -+gcc version 4.2.2 -+configure:2089: $? = 0 -+configure:2091: i486-pc-linux-gnu-gcc -V &5 -+i486-pc-linux-gnu-gcc: '-V' option must have argument -+configure:2094: $? = 1 -+configure:2117: checking for C compiler default output file name -+configure:2120: i486-pc-linux-gnu-gcc conftest.c >&5 -+configure:2123: $? = 0 -+configure:2169: result: a.out -+configure:2174: checking whether the C compiler works -+configure:2180: ./a.out -+configure:2183: $? = 0 -+configure:2200: result: yes -+configure:2207: checking whether we are cross compiling -+configure:2209: result: no -+configure:2212: checking for suffix of executables -+configure:2214: i486-pc-linux-gnu-gcc -o conftest conftest.c >&5 -+configure:2217: $? = 0 -+configure:2242: result: -+configure:2248: checking for suffix of object files -+configure:2269: i486-pc-linux-gnu-gcc -c conftest.c >&5 -+configure:2272: $? = 0 -+configure:2294: result: o -+configure:2298: checking whether we are using the GNU C compiler -+configure:2322: i486-pc-linux-gnu-gcc -c conftest.c >&5 -+configure:2328: $? = 0 -+configure:2331: test -z || test ! -s conftest.err -+configure:2334: $? = 0 -+configure:2337: test -s conftest.o -+configure:2340: $? = 0 -+configure:2353: result: yes -+configure:2359: checking whether i486-pc-linux-gnu-gcc accepts -g -+configure:2380: i486-pc-linux-gnu-gcc -c -g conftest.c >&5 -+configure:2386: $? = 0 -+configure:2389: test -z || test ! -s conftest.err -+configure:2392: $? = 0 -+configure:2395: test -s conftest.o -+configure:2398: $? = 0 -+configure:2409: result: yes -+configure:2426: checking for i486-pc-linux-gnu-gcc option to accept ANSI C -+configure:2496: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:2502: $? = 0 -+configure:2505: test -z || test ! -s conftest.err -+configure:2508: $? = 0 -+configure:2511: test -s conftest.o -+configure:2514: $? = 0 -+configure:2532: result: none needed -+configure:2550: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' -+configure:2556: $? = 1 -+configure: failed program was: -+| #ifndef __cplusplus -+| choke me -+| #endif -+configure:2705: checking for style of include used by make -+configure:2733: result: GNU -+configure:2761: checking dependency style of i486-pc-linux-gnu-gcc -+configure:2823: result: gcc3 -+configure:2830: checking for bash -+configure:2848: found /bin/bash -+configure:2860: result: /bin/bash -+configure:2875: checking for i486-pc-linux-gnu-pkg-config -+configure:2908: result: no -+configure:2917: checking for pkg-config -+configure:2935: found /usr/bin/pkg-config -+configure:2947: result: /usr/bin/pkg-config -+configure:2962: checking pkg-config is at least version 0.9.0 -+configure:2965: result: yes -+configure:2976: checking for GTK_CFLAGS -+configure:2993: result: -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -+configure:2995: checking for GTK_LIBS -+configure:3012: result: -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -+configure:3043: checking for dirent.h that defines DIR -+configure:3067: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3073: $? = 0 -+configure:3076: test -z || test ! -s conftest.err -+configure:3079: $? = 0 -+configure:3082: test -s conftest.o -+configure:3085: $? = 0 -+configure:3096: result: yes -+configure:3109: checking for library containing opendir -+configure:3139: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 -+configure:3145: $? = 0 -+configure:3148: test -z || test ! -s conftest.err -+configure:3151: $? = 0 -+configure:3154: test -s conftest -+configure:3157: $? = 0 -+configure:3226: result: none required -+configure:3365: checking how to run the C preprocessor -+configure:3400: i486-pc-linux-gnu-gcc -E conftest.c -+configure:3406: $? = 0 -+configure:3438: i486-pc-linux-gnu-gcc -E conftest.c -+conftest.c:13:28: error: ac_nonexistent.h: No such file or directory -+configure:3444: $? = 1 -+configure: failed program was: -+| /* confdefs.h. */ -+| -+| #define PACKAGE_NAME "XArchive" -+| #define PACKAGE_TARNAME "xarchive" -+| #define PACKAGE_VERSION "0.2.8-6" -+| #define PACKAGE_STRING "XArchive 0.2.8-6" -+| #define PACKAGE_BUGREPORT "Lee Bigelow " -+| #define PACKAGE "xarchive" -+| #define VERSION "0.2.8-6" -+| #define _GNU_SOURCE 1 -+| #define HAVE_DIRENT_H 1 -+| /* end confdefs.h. */ -+| #include -+configure:3483: result: i486-pc-linux-gnu-gcc -E -+configure:3507: i486-pc-linux-gnu-gcc -E conftest.c -+configure:3513: $? = 0 -+configure:3545: i486-pc-linux-gnu-gcc -E conftest.c -+conftest.c:13:28: error: ac_nonexistent.h: No such file or directory -+configure:3551: $? = 1 -+configure: failed program was: -+| /* confdefs.h. */ -+| -+| #define PACKAGE_NAME "XArchive" -+| #define PACKAGE_TARNAME "xarchive" -+| #define PACKAGE_VERSION "0.2.8-6" -+| #define PACKAGE_STRING "XArchive 0.2.8-6" -+| #define PACKAGE_BUGREPORT "Lee Bigelow " -+| #define PACKAGE "xarchive" -+| #define VERSION "0.2.8-6" -+| #define _GNU_SOURCE 1 -+| #define HAVE_DIRENT_H 1 -+| /* end confdefs.h. */ -+| #include -+configure:3595: checking for egrep -+configure:3605: result: grep -E -+configure:3610: checking for ANSI C header files -+configure:3635: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3641: $? = 0 -+configure:3644: test -z || test ! -s conftest.err -+configure:3647: $? = 0 -+configure:3650: test -s conftest.o -+configure:3653: $? = 0 -+configure:3742: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 -+conftest.c: In function 'main': -+conftest.c:30: warning: incompatible implicit declaration of built-in function 'exit' -+configure:3745: $? = 0 -+configure:3747: ./conftest -+configure:3750: $? = 0 -+configure:3765: result: yes -+configure:3789: checking for sys/types.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for sys/stat.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for stdlib.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for string.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for memory.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for strings.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for inttypes.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for stdint.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3789: checking for unistd.h -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:3811: $? = 0 -+configure:3814: test -z || test ! -s conftest.err -+configure:3817: $? = 0 -+configure:3820: test -s conftest.o -+configure:3823: $? = 0 -+configure:3834: result: yes -+configure:3853: checking for stdlib.h -+configure:3858: result: yes -+configure:3853: checking for string.h -+configure:3858: result: yes -+configure:3853: checking for unistd.h -+configure:3858: result: yes -+configure:3999: checking for an ANSI C-conforming const -+configure:4066: i486-pc-linux-gnu-gcc -c -g -O2 conftest.c >&5 -+configure:4072: $? = 0 -+configure:4075: test -z || test ! -s conftest.err -+configure:4078: $? = 0 -+configure:4081: test -s conftest.o -+configure:4084: $? = 0 -+configure:4095: result: yes -+configure:4109: checking for working alloca.h -+configure:4130: i486-pc-linux-gnu-gcc -o conftest -g -O2 conftest.c >&5 -+ -+## ---------------- ## -+## Cache variables. ## -+## ---------------- ## -+ -+ac_cv_build=i486-pc-linux-gnu -+ac_cv_build_alias=i486-pc-linux-gnu -+ac_cv_c_compiler_gnu=yes -+ac_cv_c_const=yes -+ac_cv_env_CC_set= -+ac_cv_env_CC_value= -+ac_cv_env_CFLAGS_set= -+ac_cv_env_CFLAGS_value= -+ac_cv_env_CPPFLAGS_set= -+ac_cv_env_CPPFLAGS_value= -+ac_cv_env_CPP_set= -+ac_cv_env_CPP_value= -+ac_cv_env_GTK_CFLAGS_set= -+ac_cv_env_GTK_CFLAGS_value= -+ac_cv_env_GTK_LIBS_set= -+ac_cv_env_GTK_LIBS_value= -+ac_cv_env_LDFLAGS_set= -+ac_cv_env_LDFLAGS_value= -+ac_cv_env_PKG_CONFIG_set= -+ac_cv_env_PKG_CONFIG_value= -+ac_cv_env_build_alias_set=set -+ac_cv_env_build_alias_value=i486-pc-linux-gnu -+ac_cv_env_host_alias_set=set -+ac_cv_env_host_alias_value=i486-pc-linux-gnu -+ac_cv_env_target_alias_set= -+ac_cv_env_target_alias_value= -+ac_cv_exeext= -+ac_cv_header_dirent_dirent_h=yes -+ac_cv_header_inttypes_h=yes -+ac_cv_header_memory_h=yes -+ac_cv_header_stdc=yes -+ac_cv_header_stdint_h=yes -+ac_cv_header_stdlib_h=yes -+ac_cv_header_string_h=yes -+ac_cv_header_strings_h=yes -+ac_cv_header_sys_stat_h=yes -+ac_cv_header_sys_types_h=yes -+ac_cv_header_unistd_h=yes -+ac_cv_objext=o -+ac_cv_path_BASH_PROG=/bin/bash -+ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config -+ac_cv_path_install='/usr/bin/install -c' -+ac_cv_prog_AWK=awk -+ac_cv_prog_CC=i486-pc-linux-gnu-gcc -+ac_cv_prog_CPP='i486-pc-linux-gnu-gcc -E' -+ac_cv_prog_cc_g=yes -+ac_cv_prog_cc_stdc= -+ac_cv_prog_egrep='grep -E' -+ac_cv_prog_make_make_set=yes -+ac_cv_search_opendir='none required' -+am_cv_CC_dependencies_compiler_type=gcc3 -+pkg_cv_GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' -+pkg_cv_GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' -+ -+## ----------------- ## -+## Output variables. ## -+## ----------------- ## -+ -+ACLOCAL='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run aclocal-1.6' -+ALLOCA='' -+AMDEPBACKSLASH='\' -+AMDEP_FALSE='#' -+AMDEP_TRUE='' -+AMTAR='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run tar' -+AUTOCONF='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoconf' -+AUTOHEADER='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoheader' -+AUTOMAKE='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run automake-1.6' -+AWK='awk' -+BASH_PROG='/bin/bash' -+BASH_PROG='/bin/bash' -+CC='i486-pc-linux-gnu-gcc' -+CCDEPMODE='depmode=gcc3' -+CFLAGS='-g -O2' -+CONFIGURE_CFLAGS='' -+CONFIGURE_LDFLAGS='' -+CPP='i486-pc-linux-gnu-gcc -E' -+CPPFLAGS='' -+DEFS='' -+DEPDIR='.deps' -+ECHO_C='' -+ECHO_N='-n' -+ECHO_T='' -+EGREP='grep -E' -+EXEEXT='' -+GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' -+GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 ' -+GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' -+GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 ' -+INSTALL_DATA='${INSTALL} -m 644' -+INSTALL_PROGRAM='${INSTALL}' -+INSTALL_SCRIPT='${INSTALL}' -+INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' -+LDFLAGS='' -+LIBOBJS='' -+LIBS='' -+LTLIBOBJS='' -+MAKEINFO='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run makeinfo' -+OBJEXT='o' -+PACKAGE='xarchive' -+PACKAGE_BUGREPORT='Lee Bigelow ' -+PACKAGE_NAME='XArchive' -+PACKAGE_STRING='XArchive 0.2.8-6' -+PACKAGE_TARNAME='xarchive' -+PACKAGE_VERSION='0.2.8-6' -+PATH_SEPARATOR=':' -+PKG_CONFIG='/usr/bin/pkg-config' -+SET_MAKE='' -+SHELL='/bin/bash' -+STRIP='' -+VERSION='0.2.8-6' -+ac_ct_CC='' -+ac_ct_STRIP='' -+ac_pt_PKG_CONFIG='/usr/bin/pkg-config' -+am__include='include' -+am__quote='' -+bindir='${exec_prefix}/bin' -+build='i486-pc-linux-gnu' -+build_alias='i486-pc-linux-gnu' -+build_cpu='i486' -+build_os='linux-gnu' -+build_os='linux-gnu' -+build_vendor='pc' -+datadir='${prefix}/share' -+exec_prefix='NONE' -+host_alias='i486-pc-linux-gnu' -+includedir='${prefix}/include' -+infodir='/usr/share/info' -+install_sh='/home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/install-sh' -+libdir='${exec_prefix}/lib' -+libexecdir='${exec_prefix}/libexec' -+localstatedir='${prefix}/var' -+mandir='/usr/share/man' -+oldincludedir='/usr/include' -+prefix='/usr' -+program_transform_name='s,x,x,' -+sbindir='${exec_prefix}/sbin' -+sharedstatedir='${prefix}/com' -+sysconfdir='${prefix}/etc' -+target_alias='' -+ -+## ----------- ## -+## confdefs.h. ## -+## ----------- ## -+ -+#define HAVE_DIRENT_H 1 -+#define HAVE_INTTYPES_H 1 -+#define HAVE_MEMORY_H 1 -+#define HAVE_STDINT_H 1 -+#define HAVE_STDLIB_H 1 -+#define HAVE_STDLIB_H 1 -+#define HAVE_STRINGS_H 1 -+#define HAVE_STRING_H 1 -+#define HAVE_STRING_H 1 -+#define HAVE_SYS_STAT_H 1 -+#define HAVE_SYS_TYPES_H 1 -+#define HAVE_UNISTD_H 1 -+#define HAVE_UNISTD_H 1 -+#define PACKAGE "xarchive" -+#define PACKAGE_BUGREPORT "Lee Bigelow " -+#define PACKAGE_NAME "XArchive" -+#define PACKAGE_STRING "XArchive 0.2.8-6" -+#define PACKAGE_TARNAME "xarchive" -+#define PACKAGE_VERSION "0.2.8-6" -+#define STDC_HEADERS 1 -+#define VERSION "0.2.8-6" -+#define _GNU_SOURCE 1 -+ -+configure: caught signal 2 -+configure: exit 1 ---- xarchive-0.2.8-6.old/wrappers/7za.src Tue Nov 15 12:59:51 2005 -+++ xarchive-0.2.8-6/wrappers/7za.src Sat Mar 22 13:01:15 2008 -@@ -51,9 +51,9 @@ - # the shifting will leave the files passed as - # all the remaining args: "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # Command line options for prog functions - NEW_OPTS="a -ms=off" ---- xarchive-0.2.8-6.old/wrappers/ace.src Sat Jan 14 04:49:36 2006 -+++ xarchive-0.2.8-6/wrappers/ace.src Sat Mar 22 13:01:15 2008 -@@ -48,9 +48,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # Command line options for prog functions - # disable comments when opening ---- xarchive-0.2.8-6.old/wrappers/arj.src Tue Nov 15 12:59:56 2005 -+++ xarchive-0.2.8-6/wrappers/arj.src Sat Mar 22 13:01:15 2008 -@@ -52,9 +52,9 @@ - # the shifting will leave the files passed as - # all the remaining args: "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # Command line options for prog functions - NEW_OPTS="a" ---- xarchive-0.2.8-6.old/wrappers/deb.src Tue Nov 8 17:49:13 2005 -+++ xarchive-0.2.8-6/wrappers/deb.src Sat Mar 22 13:01:15 2008 -@@ -40,9 +40,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - - # Command line options for prog functions ---- xarchive-0.2.8-6.old/wrappers/rar.src Mon Nov 14 21:41:21 2005 -+++ xarchive-0.2.8-6/wrappers/rar.src Sat Mar 22 13:01:15 2008 -@@ -53,9 +53,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # Command line options for prog functions - # disable comments when opening ---- xarchive-0.2.8-6.old/wrappers/rpm-bsd.src Tue Nov 8 17:49:13 2005 -+++ xarchive-0.2.8-6/wrappers/rpm-bsd.src Sat Mar 22 13:01:16 2008 -@@ -42,9 +42,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # the option switches - case "$opt" in ---- xarchive-0.2.8-6.old/wrappers/rpm-gnu.src Tue Nov 8 17:49:13 2005 -+++ xarchive-0.2.8-6/wrappers/rpm-gnu.src Sat Mar 22 13:01:16 2008 -@@ -41,9 +41,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # the option switches - case "$opt" in ---- xarchive-0.2.8-6.old/wrappers/tar-bsd.src Tue Nov 8 20:51:54 2005 -+++ xarchive-0.2.8-6/wrappers/tar-bsd.src Sat Mar 22 13:01:16 2008 -@@ -43,9 +43,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # set up compression variables for our compression functions. - # translate archive name to lower case for pattern matching. ---- xarchive-0.2.8-6.old/wrappers/tar-gnu.src Tue Nov 8 20:50:59 2005 -+++ xarchive-0.2.8-6/wrappers/tar-gnu.src Sat Mar 22 13:16:15 2008 -@@ -42,9 +42,9 @@ - # the shifting will leave the files passed as - # all the remaining args "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # set up compression variables for our compression functions. - # translate archive name to lower case for pattern matching. -@@ -54,14 +54,14 @@ - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then - DECOMPRESS="gzip -dc" - COMPRESS="gzip -c" -- TAR_COMPRESS_OPT="--use-compress-prog=gzip" -+ TAR_COMPRESS_OPT="z" - fi - done - for ext in $BZIP2_EXTS; do - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then - DECOMPRESS="bzip2 -dc" - COMPRESS="bzip2 -c" -- TAR_COMPRESS_OPT="--use-compress-prog=bzip2" -+ TAR_COMPRESS_OPT="j" - fi - done - for ext in $COMPRESS_EXTS; do -@@ -76,8 +76,8 @@ - # open and extract can use tar's cmd line option - # add, new, and remove need to decompress the tar first - # do their thing, than recompress the tar. --OPEN_OPTS="$TAR_COMPRESS_OPT -tvf" --EXTRACT_OPTS="$TAR_COMPRESS_OPT -xf" -+OPEN_OPTS="-tv${TAR_COMPRESS_OPT}f" -+EXTRACT_OPTS="-x${TAR_COMPRESS_OPT}f" - ADD_OPTS="-rf" - NEW_OPTS="-cf" - REMOVE_OPTS="--delete -f" -@@ -206,11 +206,12 @@ - ;; - - -r) # remove: from archive passed files -- decompress_func -- $TAR_PROG $REMOVE_OPTS "$archive" "$@" -- wrapper_status=$? -- compress_func -- exit $wrapper_status -+ #decompress_func -+ #$TAR_PROG $REMOVE_OPTS "$archive" "$@" -+ #wrapper_status=$? -+ #compress_func -+ #exit $wrapper_status -+ exit $E_UNSUPPORTED - ;; - - -e) # extract: from archive passed files ---- xarchive-0.2.8-6.old/wrappers/zip.src Tue Nov 15 13:02:08 2005 -+++ xarchive-0.2.8-6/wrappers/zip.src Sat Mar 22 13:01:16 2008 -@@ -51,9 +51,9 @@ - # the shifting will leave the files passed as - # all the remaining args: "$@" - opt="$1" --shift 1 -+test -z $1 || shift 1 - archive="$1" --shift 1 -+test -z $1 || shift 1 - - # Command line options for prog functions - ---- xarchive-0.2.8-6/xarchive.desktop.src -+++ xarchive-0.2.8-6/xarchive.desktop.src -@@ -12,7 +12,7 @@ - Comment[en_GB]=Create, modify and browse an archive - GenericName=Archive Manager - --Categories=Gtk;Application;System;Utility; -+Categories=Gtk;Utility; - Exec=xarchive %F - Icon=/path/to/icons/xarchive.xpm - StartupNotify=true - ---- xarchive-0.2.8-6/src/main.c -+++ xarchive-0.2.8-6/src/main.c -@@ -178,6 +178,10 @@ - { - ext = (gchar *) g_ptr_array_index(wrapent->ext_array, e); - g_string_append_printf(info_text,"%s ", ext); -+ if (e % 10 == 9) -+ { -+ g_string_append_printf(info_text,"\n "); -+ } - } - g_string_append_c(info_text, '\n'); - } diff -r c7b121a4ffd9 -r d6378d455338 xbattle/receipt --- a/xbattle/receipt Wed May 09 17:03:28 2018 +0300 +++ b/xbattle/receipt Thu May 10 21:12:00 2018 +0300 @@ -17,8 +17,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src - patch -p0 < $stuff/pseudo_color.u xmkmf make && make DESTDIR=$DESTDIR install } diff -r c7b121a4ffd9 -r d6378d455338 xbattle/stuff/patches/pseudo_color.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xbattle/stuff/patches/pseudo_color.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,71 @@ +--- window.c ++++ window.c +@@ -708,8 +708,7 @@ + unsigned long valuemask; + XSetWindowAttributes attrib; + XVisualInfo vinfo; +- long event_mask, +- full_depth; ++ long event_mask; + Atom wm_delete_window; + + /** Open display and screen **/ +@@ -742,36 +741,11 @@ + /** Set bitplane depth to default **/ + + xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen); +- full_depth = xwindow->depth; + + /** Get a visual **/ + + visual = DefaultVisual (xwindow->display, xwindow->screen); + +- /** Try to force the display to 8 planes **/ +- +- if (xwindow->depth != 8) +- { +- if (XMatchVisualInfo +- (xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo)) +- { +- visual = vinfo.visual; +- xwindow->depth = 8; +- } +- } +- +- /** If couldn't find an 8 bit visual, try a 16 bit visual **/ +- +- if (xwindow->depth != 8) +- { +- if (XMatchVisualInfo +- (xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo)) +- { +- visual = vinfo.visual; +- xwindow->depth = 16; +- } +- } +- + /** If have less than 8 planes, just use a single plane **/ + + if (xwindow->depth < 8) +@@ -790,20 +764,8 @@ + #else + /** Allocate existing colormap **/ + +- if (full_depth > 8) ++ if (xwindow->depth > 8) + { +- /** XBattle won't work for 24 bit displays with no optional **/ +- /** visuals with 8 or 16 bits. This may be the case on some PCs. **/ +- /** In these cases, it may be possible to reconfigure the display **/ +- /** to 8 or 16 bits. **/ +- +- if (xwindow->depth > 16) +- { +- throw_warning ("No PseudoColor visual available\n%s", +- " Try changing display to <= 16 bits"); +- throw_error ("Unable to continue without colormap", NULL); +- } +- + /** If display is 24 bit, have to create a dedicated colormap **/ + + xwindow->cmap = XCreateColormap (xwindow->display, diff -r c7b121a4ffd9 -r d6378d455338 xbattle/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xbattle/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|pseudo_color.u diff -r c7b121a4ffd9 -r d6378d455338 xbattle/stuff/pseudo_color.u --- a/xbattle/stuff/pseudo_color.u Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ ---- window.c -+++ window.c -@@ -708,8 +708,7 @@ - unsigned long valuemask; - XSetWindowAttributes attrib; - XVisualInfo vinfo; -- long event_mask, -- full_depth; -+ long event_mask; - Atom wm_delete_window; - - /** Open display and screen **/ -@@ -742,36 +741,11 @@ - /** Set bitplane depth to default **/ - - xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen); -- full_depth = xwindow->depth; - - /** Get a visual **/ - - visual = DefaultVisual (xwindow->display, xwindow->screen); - -- /** Try to force the display to 8 planes **/ -- -- if (xwindow->depth != 8) -- { -- if (XMatchVisualInfo -- (xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo)) -- { -- visual = vinfo.visual; -- xwindow->depth = 8; -- } -- } -- -- /** If couldn't find an 8 bit visual, try a 16 bit visual **/ -- -- if (xwindow->depth != 8) -- { -- if (XMatchVisualInfo -- (xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo)) -- { -- visual = vinfo.visual; -- xwindow->depth = 16; -- } -- } -- - /** If have less than 8 planes, just use a single plane **/ - - if (xwindow->depth < 8) -@@ -790,20 +764,8 @@ - #else - /** Allocate existing colormap **/ - -- if (full_depth > 8) -+ if (xwindow->depth > 8) - { -- /** XBattle won't work for 24 bit displays with no optional **/ -- /** visuals with 8 or 16 bits. This may be the case on some PCs. **/ -- /** In these cases, it may be possible to reconfigure the display **/ -- /** to 8 or 16 bits. **/ -- -- if (xwindow->depth > 16) -- { -- throw_warning ("No PseudoColor visual available\n%s", -- " Try changing display to <= 16 bits"); -- throw_error ("Unable to continue without colormap", NULL); -- } -- - /** If display is 24 bit, have to create a dedicated colormap **/ - - xwindow->cmap = XCreateColormap (xwindow->display, diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/receipt --- a/xfmedia/receipt Wed May 09 17:03:28 2018 +0300 +++ b/xfmedia/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,9 +18,6 @@ compile_rules() { export LDFLAGS="$LDFLAGS -lXext -lm -lgmodule-2.0" sed -i 's/return xine_trick_mode.*/return 0;/' src/xfmedia-xine.c - patch -Np1 -i $stuff/xfmedia-dbus-0.6-support.patch - patch -Np1 -i $stuff/xfmedia-empty-prev-next-fix.patch - patch -Np1 -i $stuff/xfmedia-exo-0.6.patch ./configure \ --enable-exo \ diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfmedia/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,3 @@ +xfmedia-dbus-0.6-support.patch +xfmedia-empty-prev-next-fix.patch +xfmedia-exo-0.6.patch diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/patches/xfmedia-dbus-0.6-support.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfmedia/stuff/patches/xfmedia-dbus-0.6-support.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +diff -Naur xfmedia-0.9.1.orig/src/remote.c xfmedia-0.9.1/src/remote.c +--- xfmedia-0.9.1.orig/src/remote.c 2005-09-05 00:56:37.000000000 -0400 ++++ xfmedia-0.9.1/src/remote.c 2006-04-08 00:27:18.000000000 -0400 +@@ -55,6 +55,10 @@ + #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER DBUS_SERVICE_REPLY_PRIMARY_OWNER + #endif + ++#ifndef DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT ++#define DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT DBUS_NAME_FLAG_DO_NOT_QUEUE ++#endif ++ + #endif /* HAVE_DBUS */ + + #include diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/patches/xfmedia-empty-prev-next-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfmedia/stuff/patches/xfmedia-empty-prev-next-fix.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,25 @@ +diff -wbBur xfmedia-0.9.2/src/mainwin.c xfmedia-0.9.2.my/src/mainwin.c +--- xfmedia-0.9.2/src/mainwin.c 2006-11-27 07:21:23.000000000 +0000 ++++ xfmedia-0.9.2.my/src/mainwin.c 2010-11-01 13:01:17.000000000 +0000 +@@ -1865,6 +1865,10 @@ + gboolean use_playlist_q = xfmedia_playlist_queue_n_entries(mwin->playlist_q); + gboolean ret = FALSE; + ++ if(xfmedia_playlist_get_n_entries(mwin->plist) == 0) ++// if(xfmedia_playlist_queue_is_empty(mwin->plist)) ++ return; ++ + if(mwin->cur_playing + && xfmedia_settings_get_bool("/xfmedia/playlist/shuffle") + && !use_playlist_q ) +@@ -1899,6 +1903,10 @@ + { + gint tot_items, idx = -1; + ++ if(xfmedia_playlist_get_n_entries(mwin->plist) == 0) ++// if(xfmedia_playlist_queue_is_empty(mwin->plist)) ++ return; ++ + if(xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")) { + XfmediaPlaylistEntryRef *ref = NULL; + gboolean playing = FALSE; diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/patches/xfmedia-exo-0.6.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfmedia/stuff/patches/xfmedia-exo-0.6.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,196 @@ +diff -wbBur xfmedia-0.9.2/configure xfmedia-0.9.2.my/configure +--- xfmedia-0.9.2/configure 2006-11-27 20:20:59.000000000 +0000 ++++ xfmedia-0.9.2.my/configure 2011-01-31 17:15:58.000000000 +0000 +@@ -27417,7 +27417,7 @@ + + + if test x"$xdt_cv_EXO_check" = x"yes"; then +- if $PKG_CONFIG --exists "exo-0.3 >= 0.3.0" >/dev/null 2>&1; then ++ if $PKG_CONFIG --exists "exo-1 >= 0.3.0" >/dev/null 2>&1; then + + + # minimum supported version of pkg-config +@@ -27501,22 +27501,22 @@ + fi + + +- { echo "$as_me:$LINENO: checking for exo-0.3 >= 0.3.0" >&5 +-echo $ECHO_N "checking for exo-0.3 >= 0.3.0... $ECHO_C" >&6; } +- if $PKG_CONFIG "--atleast-version=0.3.0" "exo-0.3" >/dev/null 2>&1; then +- EXO_VERSION=`$PKG_CONFIG --modversion "exo-0.3"` ++ { echo "$as_me:$LINENO: checking for exo-1 >= 0.3.0" >&5 ++echo $ECHO_N "checking for exo-1 >= 0.3.0... $ECHO_C" >&6; } ++ if $PKG_CONFIG "--atleast-version=0.3.0" "exo-1" >/dev/null 2>&1; then ++ EXO_VERSION=`$PKG_CONFIG --modversion "exo-1"` + { echo "$as_me:$LINENO: result: $EXO_VERSION" >&5 + echo "${ECHO_T}$EXO_VERSION" >&6; } + + { echo "$as_me:$LINENO: checking EXO_CFLAGS" >&5 + echo $ECHO_N "checking EXO_CFLAGS... $ECHO_C" >&6; } +- EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-0.3"` ++ EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-1"` + { echo "$as_me:$LINENO: result: $EXO_CFLAGS" >&5 + echo "${ECHO_T}$EXO_CFLAGS" >&6; } + + { echo "$as_me:$LINENO: checking EXO_LIBS" >&5 + echo $ECHO_N "checking EXO_LIBS... $ECHO_C" >&6; } +- EXO_LIBS=`$PKG_CONFIG --libs "exo-0.3"` ++ EXO_LIBS=`$PKG_CONFIG --libs "exo-1"` + { echo "$as_me:$LINENO: result: $EXO_LIBS" >&5 + echo "${ECHO_T}$EXO_LIBS" >&6; } + +@@ -27535,15 +27535,15 @@ + + EXO_FOUND="yes" + +- elif $PKG_CONFIG --exists "exo-0.3" >/dev/null 2>&1; then +- xdt_cv_version=`$PKG_CONFIG --modversion "exo-0.3"` ++ elif $PKG_CONFIG --exists "exo-1" >/dev/null 2>&1; then ++ xdt_cv_version=`$PKG_CONFIG --modversion "exo-1"` + { echo "$as_me:$LINENO: result: found, but $xdt_cv_version" >&5 + echo "${ECHO_T}found, but $xdt_cv_version" >&6; } + + +- echo "*** The required package exo-0.3 was found on your system," ++ echo "*** The required package exo-1 was found on your system," + echo "*** but the installed version ($xdt_cv_version) is too old." +- echo "*** Please upgrade exo-0.3 to atleast version 0.3.0, or adjust" ++ echo "*** Please upgrade exo-1 to atleast version 0.3.0, or adjust" + echo "*** the PKG_CONFIG_PATH environment variable if you installed" + echo "*** the new version of the package in a nonstandard prefix so" + echo "*** pkg-config is able to find it." +@@ -27554,8 +27554,8 @@ + echo "${ECHO_T}not found" >&6; } + + +- echo "*** The required package exo-0.3 was not found on your system." +- echo "*** Please install exo-0.3 (atleast version 0.3.0) or adjust" ++ echo "*** The required package exo-1 was not found on your system." ++ echo "*** Please install exo-1 (atleast version 0.3.0) or adjust" + echo "*** the PKG_CONFIG_PATH environment variable if you" + echo "*** installed the package in a nonstandard prefix so that" + echo "*** pkg-config is able to find it." +@@ -27564,14 +27564,14 @@ + fi + + else +- { echo "$as_me:$LINENO: checking for optional package exo-0.3 >= 0.3.0" >&5 +-echo $ECHO_N "checking for optional package exo-0.3 >= 0.3.0... $ECHO_C" >&6; } ++ { echo "$as_me:$LINENO: checking for optional package exo-1 >= 0.3.0" >&5 ++echo $ECHO_N "checking for optional package exo-1 >= 0.3.0... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: not found" >&5 + echo "${ECHO_T}not found" >&6; } + fi + else +- { echo "$as_me:$LINENO: checking for optional package exo-0.3" >&5 +-echo $ECHO_N "checking for optional package exo-0.3... $ECHO_C" >&6; } ++ { echo "$as_me:$LINENO: checking for optional package exo-1" >&5 ++echo $ECHO_N "checking for optional package exo-1... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: disabled" >&5 + echo "${ECHO_T}disabled" >&6; } + fi +diff -wbBur xfmedia-0.9.2/src/main.c xfmedia-0.9.2.my/src/main.c +--- xfmedia-0.9.2/src/main.c 2006-11-27 07:21:23.000000000 +0000 ++++ xfmedia-0.9.2.my/src/main.c 2011-02-01 11:08:02.000000000 +0000 +@@ -388,6 +388,23 @@ + return optind; + } + ++/** ++ * exo_str_get_md5_str: ++ * @contents : The string to create a digest of. ++ * ++ * Creates a character array MD5 digestof the string ++ * @contents. ++ * ++ * Return value: A newly-allocated character array which ++ * should be free with g_free() when no ++ * longer needed. ++ **/ ++gchar* ++exo_str_get_md5_str (const gchar *contents) ++{ ++ return g_compute_checksum_for_string (G_CHECKSUM_MD5, contents, -1); ++} ++ + int + main(int argc, char **argv) + { +diff -wbBur xfmedia-0.9.2/src/mediamarks.c xfmedia-0.9.2.my/src/mediamarks.c +--- xfmedia-0.9.2/src/mediamarks.c 2006-11-27 07:21:23.000000000 +0000 ++++ xfmedia-0.9.2.my/src/mediamarks.c 2011-02-01 11:04:42.000000000 +0000 +@@ -684,9 +684,9 @@ + + render = exo_cell_renderer_ellipsized_text_new(); + if(gtk_major_version == 2 && gtk_minor_version >= 6) +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); + else { +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, NULL); + } + gtk_tree_view_column_pack_start(col, render, TRUE); +@@ -1693,9 +1693,9 @@ + + render = exo_cell_renderer_ellipsized_text_new(); + if(gtk_major_version == 2 && gtk_minor_version >= 6) +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); + else { +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, NULL); + } + gtk_tree_view_column_pack_start(col, render, TRUE); +@@ -1705,9 +1705,9 @@ + + render = exo_cell_renderer_ellipsized_text_new(); + if(gtk_major_version == 2 && gtk_minor_version >= 6) +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); + else { +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, NULL); + } + col = gtk_tree_view_column_new_with_attributes(_("Location"), render, +diff -wbBur xfmedia-0.9.2/src/playlist.c xfmedia-0.9.2.my/src/playlist.c +--- xfmedia-0.9.2/src/playlist.c 2006-11-27 07:21:22.000000000 +0000 ++++ xfmedia-0.9.2.my/src/playlist.c 2011-02-01 11:04:47.000000000 +0000 +@@ -1409,9 +1409,9 @@ + + render = exo_cell_renderer_ellipsized_text_new(); + if(gtk_major_version == 2 && gtk_minor_version >= 6) +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); + else { +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, NULL); + } + col = gtk_tree_view_column_new_with_attributes(_("Title"), render, "text", +diff -wbBur xfmedia-0.9.2/src/settings-dialog.c xfmedia-0.9.2.my/src/settings-dialog.c +--- xfmedia-0.9.2/src/settings-dialog.c 2006-11-27 07:21:23.000000000 +0000 ++++ xfmedia-0.9.2.my/src/settings-dialog.c 2011-02-01 11:04:53.000000000 +0000 +@@ -552,7 +552,7 @@ + render = exo_cell_renderer_ellipsized_text_new(); + col = gtk_tree_view_column_new_with_attributes("name", render, + "text", PLUGINS_NAME, NULL); +- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col); + +diff -wbBur xfmedia-0.9.2/src/xfmedia-playlist-queue.c xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c +--- xfmedia-0.9.2/src/xfmedia-playlist-queue.c 2006-11-27 07:21:22.000000000 +0000 ++++ xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c 2011-02-01 11:04:57.000000000 +0000 +@@ -171,7 +171,7 @@ + + render = exo_cell_renderer_ellipsized_text_new(); + g_object_set(G_OBJECT(render), +- "ellipsize", EXO_PANGO_ELLIPSIZE_END, ++ "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, + NULL); + col = gtk_tree_view_column_new_with_attributes("display-name", render, diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/xfmedia-dbus-0.6-support.patch --- a/xfmedia/stuff/xfmedia-dbus-0.6-support.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -Naur xfmedia-0.9.1.orig/src/remote.c xfmedia-0.9.1/src/remote.c ---- xfmedia-0.9.1.orig/src/remote.c 2005-09-05 00:56:37.000000000 -0400 -+++ xfmedia-0.9.1/src/remote.c 2006-04-08 00:27:18.000000000 -0400 -@@ -55,6 +55,10 @@ - #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER DBUS_SERVICE_REPLY_PRIMARY_OWNER - #endif - -+#ifndef DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT -+#define DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT DBUS_NAME_FLAG_DO_NOT_QUEUE -+#endif -+ - #endif /* HAVE_DBUS */ - - #include diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/xfmedia-empty-prev-next-fix.patch --- a/xfmedia/stuff/xfmedia-empty-prev-next-fix.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -diff -wbBur xfmedia-0.9.2/src/mainwin.c xfmedia-0.9.2.my/src/mainwin.c ---- xfmedia-0.9.2/src/mainwin.c 2006-11-27 07:21:23.000000000 +0000 -+++ xfmedia-0.9.2.my/src/mainwin.c 2010-11-01 13:01:17.000000000 +0000 -@@ -1865,6 +1865,10 @@ - gboolean use_playlist_q = xfmedia_playlist_queue_n_entries(mwin->playlist_q); - gboolean ret = FALSE; - -+ if(xfmedia_playlist_get_n_entries(mwin->plist) == 0) -+// if(xfmedia_playlist_queue_is_empty(mwin->plist)) -+ return; -+ - if(mwin->cur_playing - && xfmedia_settings_get_bool("/xfmedia/playlist/shuffle") - && !use_playlist_q ) -@@ -1899,6 +1903,10 @@ - { - gint tot_items, idx = -1; - -+ if(xfmedia_playlist_get_n_entries(mwin->plist) == 0) -+// if(xfmedia_playlist_queue_is_empty(mwin->plist)) -+ return; -+ - if(xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")) { - XfmediaPlaylistEntryRef *ref = NULL; - gboolean playing = FALSE; diff -r c7b121a4ffd9 -r d6378d455338 xfmedia/stuff/xfmedia-exo-0.6.patch --- a/xfmedia/stuff/xfmedia-exo-0.6.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -diff -wbBur xfmedia-0.9.2/configure xfmedia-0.9.2.my/configure ---- xfmedia-0.9.2/configure 2006-11-27 20:20:59.000000000 +0000 -+++ xfmedia-0.9.2.my/configure 2011-01-31 17:15:58.000000000 +0000 -@@ -27417,7 +27417,7 @@ - - - if test x"$xdt_cv_EXO_check" = x"yes"; then -- if $PKG_CONFIG --exists "exo-0.3 >= 0.3.0" >/dev/null 2>&1; then -+ if $PKG_CONFIG --exists "exo-1 >= 0.3.0" >/dev/null 2>&1; then - - - # minimum supported version of pkg-config -@@ -27501,22 +27501,22 @@ - fi - - -- { echo "$as_me:$LINENO: checking for exo-0.3 >= 0.3.0" >&5 --echo $ECHO_N "checking for exo-0.3 >= 0.3.0... $ECHO_C" >&6; } -- if $PKG_CONFIG "--atleast-version=0.3.0" "exo-0.3" >/dev/null 2>&1; then -- EXO_VERSION=`$PKG_CONFIG --modversion "exo-0.3"` -+ { echo "$as_me:$LINENO: checking for exo-1 >= 0.3.0" >&5 -+echo $ECHO_N "checking for exo-1 >= 0.3.0... $ECHO_C" >&6; } -+ if $PKG_CONFIG "--atleast-version=0.3.0" "exo-1" >/dev/null 2>&1; then -+ EXO_VERSION=`$PKG_CONFIG --modversion "exo-1"` - { echo "$as_me:$LINENO: result: $EXO_VERSION" >&5 - echo "${ECHO_T}$EXO_VERSION" >&6; } - - { echo "$as_me:$LINENO: checking EXO_CFLAGS" >&5 - echo $ECHO_N "checking EXO_CFLAGS... $ECHO_C" >&6; } -- EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-0.3"` -+ EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-1"` - { echo "$as_me:$LINENO: result: $EXO_CFLAGS" >&5 - echo "${ECHO_T}$EXO_CFLAGS" >&6; } - - { echo "$as_me:$LINENO: checking EXO_LIBS" >&5 - echo $ECHO_N "checking EXO_LIBS... $ECHO_C" >&6; } -- EXO_LIBS=`$PKG_CONFIG --libs "exo-0.3"` -+ EXO_LIBS=`$PKG_CONFIG --libs "exo-1"` - { echo "$as_me:$LINENO: result: $EXO_LIBS" >&5 - echo "${ECHO_T}$EXO_LIBS" >&6; } - -@@ -27535,15 +27535,15 @@ - - EXO_FOUND="yes" - -- elif $PKG_CONFIG --exists "exo-0.3" >/dev/null 2>&1; then -- xdt_cv_version=`$PKG_CONFIG --modversion "exo-0.3"` -+ elif $PKG_CONFIG --exists "exo-1" >/dev/null 2>&1; then -+ xdt_cv_version=`$PKG_CONFIG --modversion "exo-1"` - { echo "$as_me:$LINENO: result: found, but $xdt_cv_version" >&5 - echo "${ECHO_T}found, but $xdt_cv_version" >&6; } - - -- echo "*** The required package exo-0.3 was found on your system," -+ echo "*** The required package exo-1 was found on your system," - echo "*** but the installed version ($xdt_cv_version) is too old." -- echo "*** Please upgrade exo-0.3 to atleast version 0.3.0, or adjust" -+ echo "*** Please upgrade exo-1 to atleast version 0.3.0, or adjust" - echo "*** the PKG_CONFIG_PATH environment variable if you installed" - echo "*** the new version of the package in a nonstandard prefix so" - echo "*** pkg-config is able to find it." -@@ -27554,8 +27554,8 @@ - echo "${ECHO_T}not found" >&6; } - - -- echo "*** The required package exo-0.3 was not found on your system." -- echo "*** Please install exo-0.3 (atleast version 0.3.0) or adjust" -+ echo "*** The required package exo-1 was not found on your system." -+ echo "*** Please install exo-1 (atleast version 0.3.0) or adjust" - echo "*** the PKG_CONFIG_PATH environment variable if you" - echo "*** installed the package in a nonstandard prefix so that" - echo "*** pkg-config is able to find it." -@@ -27564,14 +27564,14 @@ - fi - - else -- { echo "$as_me:$LINENO: checking for optional package exo-0.3 >= 0.3.0" >&5 --echo $ECHO_N "checking for optional package exo-0.3 >= 0.3.0... $ECHO_C" >&6; } -+ { echo "$as_me:$LINENO: checking for optional package exo-1 >= 0.3.0" >&5 -+echo $ECHO_N "checking for optional package exo-1 >= 0.3.0... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: not found" >&5 - echo "${ECHO_T}not found" >&6; } - fi - else -- { echo "$as_me:$LINENO: checking for optional package exo-0.3" >&5 --echo $ECHO_N "checking for optional package exo-0.3... $ECHO_C" >&6; } -+ { echo "$as_me:$LINENO: checking for optional package exo-1" >&5 -+echo $ECHO_N "checking for optional package exo-1... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: disabled" >&5 - echo "${ECHO_T}disabled" >&6; } - fi -diff -wbBur xfmedia-0.9.2/src/main.c xfmedia-0.9.2.my/src/main.c ---- xfmedia-0.9.2/src/main.c 2006-11-27 07:21:23.000000000 +0000 -+++ xfmedia-0.9.2.my/src/main.c 2011-02-01 11:08:02.000000000 +0000 -@@ -388,6 +388,23 @@ - return optind; - } - -+/** -+ * exo_str_get_md5_str: -+ * @contents : The string to create a digest of. -+ * -+ * Creates a character array MD5 digestof the string -+ * @contents. -+ * -+ * Return value: A newly-allocated character array which -+ * should be free with g_free() when no -+ * longer needed. -+ **/ -+gchar* -+exo_str_get_md5_str (const gchar *contents) -+{ -+ return g_compute_checksum_for_string (G_CHECKSUM_MD5, contents, -1); -+} -+ - int - main(int argc, char **argv) - { -diff -wbBur xfmedia-0.9.2/src/mediamarks.c xfmedia-0.9.2.my/src/mediamarks.c ---- xfmedia-0.9.2/src/mediamarks.c 2006-11-27 07:21:23.000000000 +0000 -+++ xfmedia-0.9.2.my/src/mediamarks.c 2011-02-01 11:04:42.000000000 +0000 -@@ -684,9 +684,9 @@ - - render = exo_cell_renderer_ellipsized_text_new(); - if(gtk_major_version == 2 && gtk_minor_version >= 6) -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - else { -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, NULL); - } - gtk_tree_view_column_pack_start(col, render, TRUE); -@@ -1693,9 +1693,9 @@ - - render = exo_cell_renderer_ellipsized_text_new(); - if(gtk_major_version == 2 && gtk_minor_version >= 6) -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - else { -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, NULL); - } - gtk_tree_view_column_pack_start(col, render, TRUE); -@@ -1705,9 +1705,9 @@ - - render = exo_cell_renderer_ellipsized_text_new(); - if(gtk_major_version == 2 && gtk_minor_version >= 6) -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - else { -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, NULL); - } - col = gtk_tree_view_column_new_with_attributes(_("Location"), render, -diff -wbBur xfmedia-0.9.2/src/playlist.c xfmedia-0.9.2.my/src/playlist.c ---- xfmedia-0.9.2/src/playlist.c 2006-11-27 07:21:22.000000000 +0000 -+++ xfmedia-0.9.2.my/src/playlist.c 2011-02-01 11:04:47.000000000 +0000 -@@ -1409,9 +1409,9 @@ - - render = exo_cell_renderer_ellipsized_text_new(); - if(gtk_major_version == 2 && gtk_minor_version >= 6) -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL); -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - else { -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, NULL); - } - col = gtk_tree_view_column_new_with_attributes(_("Title"), render, "text", -diff -wbBur xfmedia-0.9.2/src/settings-dialog.c xfmedia-0.9.2.my/src/settings-dialog.c ---- xfmedia-0.9.2/src/settings-dialog.c 2006-11-27 07:21:23.000000000 +0000 -+++ xfmedia-0.9.2.my/src/settings-dialog.c 2011-02-01 11:04:53.000000000 +0000 -@@ -552,7 +552,7 @@ - render = exo_cell_renderer_ellipsized_text_new(); - col = gtk_tree_view_column_new_with_attributes("name", render, - "text", PLUGINS_NAME, NULL); -- g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col); - -diff -wbBur xfmedia-0.9.2/src/xfmedia-playlist-queue.c xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c ---- xfmedia-0.9.2/src/xfmedia-playlist-queue.c 2006-11-27 07:21:22.000000000 +0000 -+++ xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c 2011-02-01 11:04:57.000000000 +0000 -@@ -171,7 +171,7 @@ - - render = exo_cell_renderer_ellipsized_text_new(); - g_object_set(G_OBJECT(render), -- "ellipsize", EXO_PANGO_ELLIPSIZE_END, -+ "ellipsize", PANGO_ELLIPSIZE_END, - "ellipsize-set", TRUE, - NULL); - col = gtk_tree_view_column_new_with_attributes("display-name", render, diff -r c7b121a4ffd9 -r d6378d455338 xfprint/receipt --- a/xfprint/receipt Wed May 09 17:03:28 2018 +0300 +++ b/xfprint/receipt Thu May 10 21:12:00 2018 +0300 @@ -18,7 +18,6 @@ compile_rules() { export LDFLAGS="$LDFLAGS -lX11" - patch -p1 < $stuff/xfprint-4.6.1-cups-1.6.patch ./configure \ --prefix=/usr \ diff -r c7b121a4ffd9 -r d6378d455338 xfprint/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfprint/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p1|xfprint-4.6.1-cups-1.6.patch diff -r c7b121a4ffd9 -r d6378d455338 xfprint/stuff/patches/xfprint-4.6.1-cups-1.6.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xfprint/stuff/patches/xfprint-4.6.1-cups-1.6.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,136 @@ +>From 2b5b2efdf2ce8233933c1304dc00c271303a4d92 Mon Sep 17 00:00:00 2001 +From: Matt Philips +Date: Fri, 19 Apr 2013 14:31:37 -0400 +Subject: [PATCH] Use CUPS-1.6 IPP API getter/setter functions + +CUPS 1.6 makes various structures private and introduces these ippGet +and ippSet functions for all of the fields in these structures. +http://www.cups.org/str.php?L3928 + +We define our own accessors when building against CUPS < 1.6. + +Based on work by Jiri Popelka at +https://bugzilla.gnome.org/show_bug.cgi?id=679759 +--- + printing-systems/cups/cups.c | 64 +++++++++++++++++----------- + 1 file changed, 38 insertions(+), 26 deletions(-) + +diff --git a/printing-systems/cups/cups.c b/xfprint-4.6.1/printing-systems/cups/cups.c +index 96b30d1..9d5df01 100644 +--- a/printing-systems/cups/cups.c ++++ b/printing-systems/cups/cups.c +@@ -44,6 +44,37 @@ G_MODULE_EXPORT const gchar version[] = VERSION; + G_MODULE_EXPORT const gchar author[] = "Jean-François Wauthy"; + G_MODULE_EXPORT const gchar homepage[] = "http://www.xfce.org"; + ++/* fix for cups 1.6 incompatibility */ ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetState(request) request->state ++#define ippGetInteger(attr, element) attr->values[element].integer ++#define ippGetString(attr, element, language) attr->values[element].string.text ++#define ippNewRequest(operation_id) cups_request_new(operation_id) ++ ++static ipp_t * ++cups_request_new (int operation_id) ++{ ++ ipp_t *request; ++ cups_lang_t *language; ++ ++ language = cupsLangDefault (); ++ request = ippNew (); ++ request->request.op.operation_id = operation_id; ++ request->request.op.request_id = 1; ++ ++ ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); ++ ++ ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); ++ cupsLangFree (language); ++ ++ return request; ++} ++#endif ++ + static GtkActionEntry printer_list_action_entries[] = { + {"set-default-printer", GTK_STOCK_PRINT, N_("Set as default printer"), NULL, + N_("Set as default CUPS printer"), G_CALLBACK (action_set_default_printer_cb),}, +@@ -126,25 +157,6 @@ cups_password_cb (const char *prompt) + } + + static ipp_t * +-cups_request_new (int operation_id) +-{ +- ipp_t *request; +- cups_lang_t *language; +- +- language = cupsLangDefault (); +- request = ippNew (); +- request->request.op.operation_id = operation_id; +- request->request.op.request_id = 1; +- +- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); +- +- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); +- cupsLangFree (language); +- +- return request; +-} +- +-static ipp_t * + cups_request_new_for_printer (int operation_id, const gchar * printer) + { + ipp_t *request; +@@ -160,7 +172,7 @@ cups_request_new_for_printer (int operation_id, const gchar * printer) + } + + printer_uri = g_strdup_printf ("ipp://%s/printers/%s", server, printer); +- request = cups_request_new (operation_id); ++ request = ippNewRequest (operation_id); + + ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); + +@@ -242,24 +254,24 @@ get_printers () + + if (!request) + continue; +- if (request->state == IPP_ERROR || request->state == IPP_IDLE) { ++ if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) { + ippDelete (request); + continue; + } + + attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT); +- if (!attr || strlen (attr->values[0].string.text) == 0) { ++ if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) { + attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT); + if (attr) +- printer->alias = g_strdup (attr->values[0].string.text); ++ printer->alias = g_strdup (ippGetString (attr, 0, NULL)); + else + printer->alias = g_strdup (""); + } + else +- printer->alias = g_strdup (attr->values[0].string.text); ++ printer->alias = g_strdup (ippGetString (attr, 0, NULL)); + + attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM); +- if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS)) ++ if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS)) + printer->type = PRINTER_TYPE_CLASS; + else + printer->type = PRINTER_TYPE_PRINTER; +@@ -309,7 +321,7 @@ get_printer_state (const gchar * printer) + ipp_attribute_t *attr = ippFindAttribute (request, "printer-state", + IPP_TAG_ENUM); + if (attr) +- switch (attr->values[0].integer) { ++ switch (ippGetInteger (attr, 0)) { + case IPP_PRINTER_IDLE: + state = PRINTER_STATE_IDLE; + break; +-- +1.7.9.5 + diff -r c7b121a4ffd9 -r d6378d455338 xfprint/stuff/xfprint-4.6.1-cups-1.6.patch --- a/xfprint/stuff/xfprint-4.6.1-cups-1.6.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ ->From 2b5b2efdf2ce8233933c1304dc00c271303a4d92 Mon Sep 17 00:00:00 2001 -From: Matt Philips -Date: Fri, 19 Apr 2013 14:31:37 -0400 -Subject: [PATCH] Use CUPS-1.6 IPP API getter/setter functions - -CUPS 1.6 makes various structures private and introduces these ippGet -and ippSet functions for all of the fields in these structures. -http://www.cups.org/str.php?L3928 - -We define our own accessors when building against CUPS < 1.6. - -Based on work by Jiri Popelka at -https://bugzilla.gnome.org/show_bug.cgi?id=679759 ---- - printing-systems/cups/cups.c | 64 +++++++++++++++++----------- - 1 file changed, 38 insertions(+), 26 deletions(-) - -diff --git a/printing-systems/cups/cups.c b/xfprint-4.6.1/printing-systems/cups/cups.c -index 96b30d1..9d5df01 100644 ---- a/printing-systems/cups/cups.c -+++ b/printing-systems/cups/cups.c -@@ -44,6 +44,37 @@ G_MODULE_EXPORT const gchar version[] = VERSION; - G_MODULE_EXPORT const gchar author[] = "Jean-François Wauthy"; - G_MODULE_EXPORT const gchar homepage[] = "http://www.xfce.org"; - -+/* fix for cups 1.6 incompatibility */ -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetState(request) request->state -+#define ippGetInteger(attr, element) attr->values[element].integer -+#define ippGetString(attr, element, language) attr->values[element].string.text -+#define ippNewRequest(operation_id) cups_request_new(operation_id) -+ -+static ipp_t * -+cups_request_new (int operation_id) -+{ -+ ipp_t *request; -+ cups_lang_t *language; -+ -+ language = cupsLangDefault (); -+ request = ippNew (); -+ request->request.op.operation_id = operation_id; -+ request->request.op.request_id = 1; -+ -+ ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); -+ -+ ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); -+ cupsLangFree (language); -+ -+ return request; -+} -+#endif -+ - static GtkActionEntry printer_list_action_entries[] = { - {"set-default-printer", GTK_STOCK_PRINT, N_("Set as default printer"), NULL, - N_("Set as default CUPS printer"), G_CALLBACK (action_set_default_printer_cb),}, -@@ -126,25 +157,6 @@ cups_password_cb (const char *prompt) - } - - static ipp_t * --cups_request_new (int operation_id) --{ -- ipp_t *request; -- cups_lang_t *language; -- -- language = cupsLangDefault (); -- request = ippNew (); -- request->request.op.operation_id = operation_id; -- request->request.op.request_id = 1; -- -- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); -- -- ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language); -- cupsLangFree (language); -- -- return request; --} -- --static ipp_t * - cups_request_new_for_printer (int operation_id, const gchar * printer) - { - ipp_t *request; -@@ -160,7 +172,7 @@ cups_request_new_for_printer (int operation_id, const gchar * printer) - } - - printer_uri = g_strdup_printf ("ipp://%s/printers/%s", server, printer); -- request = cups_request_new (operation_id); -+ request = ippNewRequest (operation_id); - - ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); - -@@ -242,24 +254,24 @@ get_printers () - - if (!request) - continue; -- if (request->state == IPP_ERROR || request->state == IPP_IDLE) { -+ if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) { - ippDelete (request); - continue; - } - - attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT); -- if (!attr || strlen (attr->values[0].string.text) == 0) { -+ if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) { - attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT); - if (attr) -- printer->alias = g_strdup (attr->values[0].string.text); -+ printer->alias = g_strdup (ippGetString (attr, 0, NULL)); - else - printer->alias = g_strdup (""); - } - else -- printer->alias = g_strdup (attr->values[0].string.text); -+ printer->alias = g_strdup (ippGetString (attr, 0, NULL)); - - attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM); -- if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS)) -+ if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS)) - printer->type = PRINTER_TYPE_CLASS; - else - printer->type = PRINTER_TYPE_PRINTER; -@@ -309,7 +321,7 @@ get_printer_state (const gchar * printer) - ipp_attribute_t *attr = ippFindAttribute (request, "printer-state", - IPP_TAG_ENUM); - if (attr) -- switch (attr->values[0].integer) { -+ switch (ippGetInteger (attr, 0)) { - case IPP_PRINTER_IDLE: - state = PRINTER_STATE_IDLE; - break; --- -1.7.9.5 - diff -r c7b121a4ffd9 -r d6378d455338 xpat2/receipt --- a/xpat2/receipt Wed May 09 17:03:28 2018 +0300 +++ b/xpat2/receipt Thu May 10 21:12:00 2018 +0300 @@ -16,11 +16,6 @@ # Rules to configure and make the package. compile_rules() { - for i in xpat2.patch layout.patch ; do - [ -f done.$i ] && continue - patch -p1 < $stuff/$i - touch done.$i - done cd src cp $stuff/Makefile . make LDFLAGS="-lX11 -lXaw -lXmu -lXt -lXpm" && diff -r c7b121a4ffd9 -r d6378d455338 xpat2/stuff/layout.patch --- a/xpat2/stuff/layout.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ ---- xpat2-1.07.orig/src/layout.c -+++ xpat2-1.07/src/layout.c -@@ -332,17 +332,9 @@ - } - } else { - /* enough space for the slots! */ -- int currentx = geo.dx; --/* printf("generating high layout for %d,%d\n", geo.w, geo.h); */ -- if (rem_x >= (rules.numslots + 1) * (geo.cw + geo.dx) && -- !(rules.variant & NODEAL)) { -- /* there is space for the deck, and we can use one! */ -- geo.pg[game.numpiles-1].x = geo.dx; -- geo.pg[game.numpiles-1].y = geo.dy + geo.ch + geo.dy; -- currentx += geo.cw + geo.dx; -- new_layout_type = GEN_BIG_LAYOUT_WITH_DECK; -- geo.preferred_width += geo.dx + geo.cw; -- } -+ int currentx = geo.dx + rules.numdecks * (geo.cw + geo.dx); -+ new_layout_type = GEN_BIG_LAYOUT_WITH_DECK; -+ geo.preferred_width += rules.numdecks * (geo.dx + geo.cw); - for (i = 0; i < rules.numslots; ++i) { - /* create slot of full window height */ - p->x = currentx; -@@ -351,6 +343,14 @@ - currentx += geo.cw + geo.dx; - ++p; - } -+ /* finally, position the decks */ -+ for (i = 0; i < rules.numdecks; ++i) { -+ p[0].x = i * (geo.dx + geo.cw); -+ p[1].x = p[0].x; -+ p[0].y = geo.dy + 2 * (geo.ch + geo.dy); -+ p[1].y = geo.dy + geo.ch + geo.dy; -+ p += 2; -+ } - /* redo pos. of stacks */ - p = geo.pg; - for (i = 0; i < rules.numstacks; ++i) { diff -r c7b121a4ffd9 -r d6378d455338 xpat2/stuff/patches/layout.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xpat2/stuff/patches/layout.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,38 @@ +--- xpat2-1.07.orig/src/layout.c ++++ xpat2-1.07/src/layout.c +@@ -332,17 +332,9 @@ + } + } else { + /* enough space for the slots! */ +- int currentx = geo.dx; +-/* printf("generating high layout for %d,%d\n", geo.w, geo.h); */ +- if (rem_x >= (rules.numslots + 1) * (geo.cw + geo.dx) && +- !(rules.variant & NODEAL)) { +- /* there is space for the deck, and we can use one! */ +- geo.pg[game.numpiles-1].x = geo.dx; +- geo.pg[game.numpiles-1].y = geo.dy + geo.ch + geo.dy; +- currentx += geo.cw + geo.dx; +- new_layout_type = GEN_BIG_LAYOUT_WITH_DECK; +- geo.preferred_width += geo.dx + geo.cw; +- } ++ int currentx = geo.dx + rules.numdecks * (geo.cw + geo.dx); ++ new_layout_type = GEN_BIG_LAYOUT_WITH_DECK; ++ geo.preferred_width += rules.numdecks * (geo.dx + geo.cw); + for (i = 0; i < rules.numslots; ++i) { + /* create slot of full window height */ + p->x = currentx; +@@ -351,6 +343,14 @@ + currentx += geo.cw + geo.dx; + ++p; + } ++ /* finally, position the decks */ ++ for (i = 0; i < rules.numdecks; ++i) { ++ p[0].x = i * (geo.dx + geo.cw); ++ p[1].x = p[0].x; ++ p[0].y = geo.dy + 2 * (geo.ch + geo.dy); ++ p[1].y = geo.dy + geo.ch + geo.dy; ++ p += 2; ++ } + /* redo pos. of stacks */ + p = geo.pg; + for (i = 0; i < rules.numstacks; ++i) { diff -r c7b121a4ffd9 -r d6378d455338 xpat2/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xpat2/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,2 @@ +-p1|xpat2.patch +-p1|layout.patch diff -r c7b121a4ffd9 -r d6378d455338 xpat2/stuff/patches/xpat2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xpat2/stuff/patches/xpat2.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,10 @@ +--- xpat2-1.07-orig/src/loadsave.c Fri Jul 11 19:33:50 2008 ++++ xpat2-1.07/src/loadsave.c Fri Jul 11 19:35:36 2008 +@@ -31,6 +31,7 @@ + # define NAME_MAX 14 /* every UNIX should have at least this */ + #else + # include /* for pathconf() */ ++# include + # include /* for uname() */ + #endif + diff -r c7b121a4ffd9 -r d6378d455338 xpat2/stuff/xpat2.patch --- a/xpat2/stuff/xpat2.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- xpat2-1.07-orig/src/loadsave.c Fri Jul 11 19:33:50 2008 -+++ xpat2-1.07/src/loadsave.c Fri Jul 11 19:35:36 2008 -@@ -31,6 +31,7 @@ - # define NAME_MAX 14 /* every UNIX should have at least this */ - #else - # include /* for pathconf() */ -+# include - # include /* for uname() */ - #endif - diff -r c7b121a4ffd9 -r d6378d455338 yarock/receipt --- a/yarock/receipt Wed May 09 17:03:28 2018 +0300 +++ b/yarock/receipt Thu May 10 21:12:00 2018 +0300 @@ -27,7 +27,6 @@ sed -i 's/TAGLIB_VERSION STRLESS/TAGLIB_VERSION VERSION_LESS/' \ cmake/FindTaglib.cmake cp -f $stuff/yarock_ru.ts $src/translation - patch -p0 < $stuff/yarock.patch mkdir build; cd build cmake -DCMAKE_INSTALL_PREFIX=/usr .. diff -r c7b121a4ffd9 -r d6378d455338 yarock/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yarock/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|yarock.patch diff -r c7b121a4ffd9 -r d6378d455338 yarock/stuff/patches/yarock.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yarock/stuff/patches/yarock.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,16 @@ +--- src/core/player/engine_phonon.cpp ++++ src/core/player/engine_phonon.cpp +@@ -26,6 +26,7 @@ + // Qt + #include + #include ++#include + + // phonon + #include + +--- src/dbus/org.mpris.MediaPlayer2.Player.xml ++++ src/dbus/org.mpris.MediaPlayer2.Player.xml +@@ -30 +30 @@ +- ++ diff -r c7b121a4ffd9 -r d6378d455338 yarock/stuff/yarock.patch --- a/yarock/stuff/yarock.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ ---- src/core/player/engine_phonon.cpp -+++ src/core/player/engine_phonon.cpp -@@ -26,6 +26,7 @@ - // Qt - #include - #include -+#include - - // phonon - #include - ---- src/dbus/org.mpris.MediaPlayer2.Player.xml -+++ src/dbus/org.mpris.MediaPlayer2.Player.xml -@@ -30 +30 @@ -- -+ diff -r c7b121a4ffd9 -r d6378d455338 yasr/receipt --- a/yasr/receipt Wed May 09 17:03:28 2018 +0300 +++ b/yasr/receipt Thu May 10 21:12:00 2018 +0300 @@ -15,9 +15,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src/yasr - patch -p0 < $stuff/yasr.patch || return 1 - cd ../ ./configure \ --prefix=/usr $CONFIGURE_ARGS && make && make DESTDIR=$DESTDIR install diff -r c7b121a4ffd9 -r d6378d455338 yasr/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yasr/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|yasr.patch diff -r c7b121a4ffd9 -r d6378d455338 yasr/stuff/patches/yasr.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yasr/stuff/patches/yasr.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,22 @@ +--- yasr/yasr.h.old Thu Jan 31 12:56:45 2008 ++++ yasr/yasr.h Sat Jan 30 11:37:31 2010 +@@ -309,7 +309,9 @@ + extern void opt_write(FILE * fp); + + /* openpty.c prototypes */ ++#ifndef HAVE_OPENPTY + extern int openpty(int *, int *, char *, struct termios *, struct winsize *); ++#endif + + /* cfmakeraw.c prototypes */ + extern void cfmakeraw(struct termios *); +@@ -318,7 +320,9 @@ + extern int login_tty(int); + + /* forkpty.c prototypes */ ++#ifndef HAVE_FORKPTY + extern int forkpty(int *, char *, struct termios *, struct winsize *); ++#endif + + /* tbc - Would it be more efficient to ensure that "blank" grids always held + ascii 0x20 rather than ascii 0x00? */ diff -r c7b121a4ffd9 -r d6378d455338 yasr/stuff/yasr.patch --- a/yasr/stuff/yasr.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ ---- yasr.h.old Thu Jan 31 12:56:45 2008 -+++ yasr.h Sat Jan 30 11:37:31 2010 -@@ -309,7 +309,9 @@ - extern void opt_write(FILE * fp); - - /* openpty.c prototypes */ -+#ifndef HAVE_OPENPTY - extern int openpty(int *, int *, char *, struct termios *, struct winsize *); -+#endif - - /* cfmakeraw.c prototypes */ - extern void cfmakeraw(struct termios *); -@@ -318,7 +320,9 @@ - extern int login_tty(int); - - /* forkpty.c prototypes */ -+#ifndef HAVE_FORKPTY - extern int forkpty(int *, char *, struct termios *, struct winsize *); -+#endif - - /* tbc - Would it be more efficient to ensure that "blank" grids always held - ascii 0x20 rather than ascii 0x00? */ diff -r c7b121a4ffd9 -r d6378d455338 ypserv/receipt --- a/ypserv/receipt Wed May 09 17:03:28 2018 +0300 +++ b/ypserv/receipt Thu May 10 21:12:00 2018 +0300 @@ -14,7 +14,6 @@ BUILD_DEPENDS="gdbm-dev" compile_rules() { - patch -Np1 -i $stuff/confpost.patch ./configure \ $CONFIGURE_ARGS && make && diff -r c7b121a4ffd9 -r d6378d455338 ypserv/stuff/confpost.patch --- a/ypserv/stuff/confpost.patch Wed May 09 17:03:28 2018 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -up ypserv-2.27/conf_post.h.qdbm ypserv-2.27/conf_post.h ---- ypserv-2.27/conf_post.h.qdbm 2012-02-01 14:18:01.780846425 +0100 -+++ ypserv-2.27/conf_post.h 2012-02-01 14:18:01.780846425 +0100 -@@ -0,0 +1,10 @@ -+/* Define common preprocessor symbol for HAVE_LIBGDBM and HAVE_LIBQDBM, since -+ * libraries gdbm and qdbm have same symbol names. */ -+#undef HAVE_COMPAT_LIBGDBM -+#ifdef HAVE_LIBGDBM -+#define HAVE_COMPAT_LIBGDBM -+#endif -+#ifdef HAVE_LIBQDBM -+#define HAVE_COMPAT_LIBGDBM -+#endif -+ diff -r c7b121a4ffd9 -r d6378d455338 ypserv/stuff/patches/confpost.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ypserv/stuff/patches/confpost.patch Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,14 @@ +diff -up ypserv-2.27/conf_post.h.qdbm ypserv-2.27/conf_post.h +--- ypserv-2.27/conf_post.h.qdbm 2012-02-01 14:18:01.780846425 +0100 ++++ ypserv-2.27/conf_post.h 2012-02-01 14:18:01.780846425 +0100 +@@ -0,0 +1,10 @@ ++/* Define common preprocessor symbol for HAVE_LIBGDBM and HAVE_LIBQDBM, since ++ * libraries gdbm and qdbm have same symbol names. */ ++#undef HAVE_COMPAT_LIBGDBM ++#ifdef HAVE_LIBGDBM ++#define HAVE_COMPAT_LIBGDBM ++#endif ++#ifdef HAVE_LIBQDBM ++#define HAVE_COMPAT_LIBGDBM ++#endif ++ diff -r c7b121a4ffd9 -r d6378d455338 ypserv/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ypserv/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +confpost.patch diff -r c7b121a4ffd9 -r d6378d455338 zerobin/receipt --- a/zerobin/receipt Wed May 09 17:03:28 2018 +0300 +++ b/zerobin/receipt Thu May 10 21:12:00 2018 +0300 @@ -13,7 +13,6 @@ WGET_URL="https://github.com/sebsauvage/ZeroBin/archive/$VERSION.tar.gz" compile_rules() { - patch -p0 < $stuff/zerobin.u mkdir -p \ $install/usr/share/zerobin/ \ $install/var/lib/zerobin/data/ \ diff -r c7b121a4ffd9 -r d6378d455338 zerobin/stuff/patches/series --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zerobin/stuff/patches/series Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,1 @@ +-p0|zerobin.u diff -r c7b121a4ffd9 -r d6378d455338 zerobin/stuff/patches/zerobin.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zerobin/stuff/patches/zerobin.u Thu May 10 21:12:00 2018 +0300 @@ -0,0 +1,92 @@ +--- index.php ++++ index.php +@@ -17,6 +17,13 @@ + $_COOKIE = array_map('stripslashes_deep', $_COOKIE); + } + ++function remote_address() ++{ ++ // if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) ++ // return $_SERVER["HTTP_X_FORWARDED_FOR"]; ++ return $_SERVER["REMOTE_ADDR"]; ++} ++ + // trafic_limiter : Make sure the IP address makes at most 1 request every 10 seconds. + // Will return false if IP address made a call less than 10 seconds ago. + function trafic_limiter_canPass($ip) +@@ -157,7 +164,7 @@ + } + + // Make sure last paste from the IP address was more than 10 seconds ago. +- if (!trafic_limiter_canPass($_SERVER['REMOTE_ADDR'])) ++ if (!trafic_limiter_canPass(remote_address())) + { echo json_encode(array('status'=>1,'message'=>'Please wait 10 seconds between each post.')); exit; } + + // Make sure content is not too big. +@@ -229,7 +236,7 @@ + // (We assume that if the user did not enter a nickname, he/she wants + // to be anonymous and we will not generate the vizhash.) + $vz = new vizhash16x16(); +- $pngdata = $vz->generate($_SERVER['REMOTE_ADDR']); ++ $pngdata = $vz->generate(remote_address()); + if ($pngdata!='') $meta['vizhash'] = 'data:image/png;base64,'.base64_encode($pngdata); + // Once the avatar is generated, we do not keep the IP address, nor its hash. + } +--- js/zerobin.js ++++ js/zerobin.js +@@ -340,7 +340,13 @@ + + showStatus('Sending paste...', spin=true); + +- var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8, 0), 0); ++ var randomkey = (window.location.hash.length > 2) ? ++ // force key ++ window.location.hash.substring(1) : ++ // Generate a random 256 bits key, encoded in base64: ++ sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); ++ if (randomkey.charAt(randomkey.length-1) !== '=') ++ randomkey+='='; // Add trailing = if missing. + var cipherdata = zeroCipher(randomkey, $('textarea#message').val()); + var data_to_send = { data: cipherdata, + expire: $('select#pasteExpiration').val(), +@@ -410,6 +416,7 @@ + $('button#sendbutton').show(); + $('button#clonebutton').hide(); + $('button#rawtextbutton').hide(); ++ $('button#downloadbutton').hide(); + $('div#expiration').show(); + $('div#remainingtime').hide(); + $('div#burnafterreadingoption').show(); +@@ -438,6 +445,7 @@ + $('button#clonebutton').show(); + } + $('button#rawtextbutton').show(); ++ $('button#downloadbutton').show(); + + $('div#expiration').hide(); + $('div#burnafterreadingoption').hide(); +@@ -457,6 +465,14 @@ + var newDoc = document.open('text/html', 'replace'); + newDoc.write('
    '+paste+'
    '); + newDoc.close(); ++} ++ ++/** Download raw text ++ */ ++function downLoad() ++{ ++ var paste = $('div#cleartext').html(); ++ document.location = 'data:Application/octet-stream,' + encodeURIComponent(paste); + } + + /** +--- tpl/page.html ++++ tpl/page.html +@@ -47,6 +47,7 @@ + + + ++ +