[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#374643: htdig: Fairly urgent patch baseline.



Dear all,

before I leave the KDE-dependency of Htdig behind,
let me contribute to whom it may concern the patches
I began testing for the purpose of moving some static
files from "/etc/htdig/" to "/usr/share/htdig/", where
they righteously belong. The package has been mistreating
the location for a very long time, replaceing the correct
choice of upstream.

The patch text is contributed as is without further
guarantee, and placed under identical license as Htdig
comes with. It is the modification to "khelp_htdig" that
was not reviewed by the Qt/KDE team, only on my system.

Best regards,
  Mats Erik Andersson, DM
Description: Changes to source code proper.
 The Debian packaging has accumulated a smaller number
 of patches to the soource code over the years.
 .
 The following alterations are all that touched C/C++
 och shell scripts in the package htdig_3.2.0b6-9.1.
X-Remark: Patch recovered from previous Debian packaging method.
From: Mats Erik Andersson <debian@gisladisker.se>
Last-Update: 2011-04-13

--- htdig-3.2.0b6.orig/htword/WordDBPage.cc
+++ htdig-3.2.0b6/htword/WordDBPage.cc
@@ -82,7 +82,7 @@
   	if(debuglevel>2)printf("TOTAL SIZE: %6d %8f\n",size,size/8.0);
 	// argh! compare failed somthing went wrong
 	// display the compress/decompress sequence and fail
-	if(cmp || size>8*1024*1000000000)
+	if(cmp || size>8*1024)
 	{
 	    if(size>8*1024)
 	    {
--- htdig-3.2.0b6.orig/htdig/Server.cc
+++ htdig-3.2.0b6/htdig/Server.cc
@@ -341,6 +341,8 @@
     {
 	String	fullpatt = "^[^:]*://[^/]*(";
 	fullpatt << pattern << ')';
+	if (pattern.length() == 0)
+		fullpatt = "";
 	_disallow.set(fullpatt, config->Boolean("case_sensitive"));
     }
 }
--- htdig-3.2.0b6.orig/installdir/rundig
+++ htdig-3.2.0b6/installdir/rundig
@@ -7,17 +7,18 @@
 #
 # This is a sample script to create a search database for ht://Dig.
 #
-DBDIR=@DATABASE_DIR@
-COMMONDIR=@COMMON_DIR@
-BINDIR=@BIN_DIR@
-conffile=@DEFAULT_CONFIG_FILE@
+DBDIR=/var/lib/htdig
+COMMONDIR=/etc/htdig
+BINDIR=/usr/bin
+conffile=/etc/htdig/htdig.conf
 
 # To help debug problems, try running rundig -vvv
 # This will add lots of debugging output to all of the programs
-stats= opts= alt=
+stats= opts= alt= nohtnotify=
 while [ "$#" -gt 0 ]
 do
     case "$1" in
+    --no-htnotify) nohtnotify="true" ;;
     -a)  alt="$1" ;;
     -s)  stats="$1" ;;
     -c)  shift
@@ -65,7 +66,11 @@
     test -f db.words.db.work_weakcmpr &&
 	mv -f db.words.db.work_weakcmpr db.words.db_weakcmpr) ;;
 esac
-$BINDIR/htnotify $opts
+if [ "$nohtnotify" = "true" ]; then
+	echo "Skipping htnotify."
+else
+	$BINDIR/htnotify $opts
+fi
 # If you want to use the soundex and (or) metaphone fuzzy matchings,
 # Uncomment the following line
 # $BINDIR/htfuzzy $opts soundex metaphone
--- htdig-3.2.0b6.orig/htcommon/defaults.cc
+++ htdig-3.2.0b6/htcommon/defaults.cc
@@ -596,7 +596,7 @@
 	<a href=\"htfuzzy.html\">htfuzzy</a> for more information on the \
 	format of this file. \
 " }, \
-{ "endings_root2word_db", "${common_dir}/root2word.db",  \
+{ "endings_root2word_db", "${database_dir}/root2word.db",  \
 	"string", "htfuzzy htsearch", "", "all", "File Layout", "endings_root2word_db: /var/htdig/r2w.db", " \
 	This attributes specifies the database filename to be \
 	used in the 'endings' fuzzy search algorithm. The \
@@ -610,7 +610,7 @@
 	This is because this database can be shared with \
 	different search databases. \
 " }, \
-{ "endings_word2root_db", "${common_dir}/word2root.db",  \
+{ "endings_word2root_db", "${database_dir}/word2root.db",  \
 	"string", "htfuzzy htsearch", "", "all", "File Layout", "endings_word2root_db: /var/htdig/w2r.bm", " \
 	This attributes specifies the database filename to be \
 	used in the 'endings' fuzzy search algorithm. The \
@@ -2426,7 +2426,7 @@
 	that this does not limit the number of documents that \
 	are matched in any way. \
 " }, \
-{ "synonym_db", "${common_dir}/synonyms.db",  \
+{ "synonym_db", "${database_dir}/synonyms.db",  \
 	"string", "htsearch htfuzzy", "", "3.0", "File Layout", "synonym_db: ${database_base}.syn.db", " \
 	Points to the database that <a href=\"htfuzzy.html\"> \
 	htfuzzy</a> creates when the <strong>synonyms</strong> \
X-Remark: Patch recovered from previous Debian packaging methods.
Last-Update: 2010-02-12
--- htdig-3.2.0b6.orig/libhtdig/ResultFetch.cc
+++ htdig-3.2.0b6/libhtdig/ResultFetch.cc
@@ -142,7 +142,7 @@
         // Must temporarily stash the message in a String, since
         // displaySyntaxError will overwrite the static temp used in form.
 
-        String s(form("No such sort method: `%s'", (const char *) config->Find("sort")));
+        String s("Invalid search method.");
 
         displaySyntaxError(s);
         //return;
--- htdig-3.2.0b6.orig/htsearch/qtest.cc
+++ htdig-3.2.0b6/htsearch/qtest.cc
@@ -132,8 +132,7 @@
 
     if (access((char*)configFile, R_OK) < 0)
     {
-	reportError(form("Unable to find configuration file '%s'",
-			 configFile.get()));
+    	reportError("Unable to find configuration file");
     }
 	
     config->Read(configFile);
--- htdig-3.2.0b6.orig/htsearch/Collection.h
+++ htdig-3.2.0b6/htsearch/Collection.h
@@ -36,9 +36,9 @@
                const char *docExcerpt);
     ~Collection();
 
-    void Collection::Open();
+    void Open();
 
-    void Collection::Close(); 
+    void Close(); 
 
     char *getWordFile() { return wordFile.get(); }
     DocumentRef         *getDocumentRef(int id);
--- htdig-3.2.0b6.orig/htsearch/Display.cc
+++ htdig-3.2.0b6/htsearch/Display.cc
@@ -54,6 +54,7 @@
 
 #include <math.h>
 #include <float.h>
+#include <values.h>
 
 #if !defined(DBL_MAX)
 # if defined (MAXDOUBLE)
@@ -137,7 +138,7 @@
       // Must temporarily stash the message in a String, since
       // displaySyntaxError will overwrite the static temp used in form.
 
-      String s(form("No such sort method: `%s'", (const char*)config->Find("sort")));
+      String s("Invalid sort method.");
 
       displaySyntaxError(s);
       return;
--- htdig-3.2.0b6.orig/htsearch/htsearch.cc
+++ htdig-3.2.0b6/htsearch/htsearch.cc
@@ -211,8 +211,7 @@
 	}
 	if (access((char*)configFile, R_OK) < 0)
 	{
-	    reportError(form("Unable to read configuration file '%s'",
-			     configFile.get()));
+		reportError("Unable to read configuration file");
 	}
 	config->Read(configFile);
 
--- htdig-3.2.0b6.orig/db/os_rw.c
+++ htdig-3.2.0b6/db/os_rw.c
@@ -5,6 +5,13 @@
  *	Sleepycat Software.  All rights reserved.
  */
 
+#define _XOPEN_SOURCE 500
+#include <sys/types.h>
+#include <unistd.h>
+#ifndef u_long
+typedef __u_long u_long;
+#endif
+
 #include "db_config.h"
 
 #ifndef lint
Description: Make consistent of use directory locations.
 Revert earlier Debian change that implemented explicitly
 given paths. Go back to build system macros for these,
 since they will respond better to configuration choices.
 .
 Make sure that the tests, prior to rebuilding word indices,
 are really testing databases stored in DATABASE_DIR.
 .
 Assign a specific subdirectory of DATABASE_DIR for temporary
 indexing.
Author: Mats Erik Andersson <debian@gisladisker.se>
 Frank Potortì <Potorti@isti.cnr.it>
Bug-Debian: http://bugs.debian.org/564205
 http://bugs.debian.org/564213
Forwarded: no
Last-Updated: 2011-04-13

--- htdig-3.2.0b6.debian/installdir/rundig
+++ htdig-3.2.0b6/installdir/rundig
@@ -7,10 +7,10 @@
 #
 # This is a sample script to create a search database for ht://Dig.
 #
-DBDIR=/var/lib/htdig
-COMMONDIR=/etc/htdig
-BINDIR=/usr/bin
-conffile=/etc/htdig/htdig.conf
+DBDIR=@DATABASE_DIR@
+COMMONDIR=@COMMON_DIR@
+BINDIR=@BIN_DIR@
+conffile=@DEFAULT_CONFIG_FILE@
 
 # To help debug problems, try running rundig -vvv
 # This will add lots of debugging output to all of the programs
@@ -51,7 +51,8 @@
 # secure.  Also, be aware that on some systems, /tmp is a memory
 # mapped filesystem that takes away from virtual memory.
 #
-TMPDIR=$DBDIR
+TMPDIR=$DBDIR/tmp
+mkdir -p $TMPDIR
 export TMPDIR
 
 $BINDIR/htdig -i $opts $stats $alt
@@ -81,13 +82,13 @@
 # These databases are semi-static, so even if pages change,
 # these databases will not need to be rebuilt.
 #
-if [ "`ls -t $COMMONDIR/english.0 $COMMONDIR/word2root.db 2>/dev/null | sed 1q`" = \
+if [ "`ls -t $COMMONDIR/english.0 $DBDIR/word2root.db 2>/dev/null | sed 1q`" = \
 	"$COMMONDIR/english.0" ]
 then
     $BINDIR/htfuzzy $opts endings
 fi
 
-if [ "`ls -t $COMMONDIR/synonyms $COMMONDIR/synonyms.db 2>/dev/null | sed 1q`" = \
+if [ "`ls -t $COMMONDIR/synonyms $DBDIR/synonyms.db 2>/dev/null | sed 1q`" = \
 	"$COMMONDIR/synonyms" ]
 then
     $BINDIR/htfuzzy $opts synonyms
Description: Report database paths in htdig-doc.
 The relocation from '$common_dir' to '$database_dir'
 of word databases must be reflected also in the
 produces documentation.
Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: no
Last-Update: 2011-04-13

--- htdig-3.2.0b6.debian/htcommon/defaults.xml	2004-06-04 10:51:06.000000000 +0200
+++ htdig-3.2.0b6/htcommon/defaults.xml	2011-04-13 19:20:19.000000000 +0200
@@ -906,7 +906,7 @@
               programs="htfuzzy htsearch" 
               version="all" 
               category="File Layout" >
-     <default>${common_dir}/root2word.db</default>
+     <default>${database_dir}/root2word.db</default>
      <example>/var/htdig/r2w.db</example>
      <description> 
 	This attributes specifies the database filename to be 
@@ -928,7 +928,7 @@
               programs="htfuzzy htsearch" 
               version="all" 
               category="File Layout" >
-     <default>${common_dir}/word2root.db</default>
+     <default>${database_dir}/word2root.db</default>
      <example>/var/htdig/w2r.bm</example>
      <description> 
 	This attributes specifies the database filename to be 
@@ -3752,7 +3752,7 @@
               programs="htsearch htfuzzy" 
               version="3.0" 
               category="File Layout" >
-     <default>${common_dir}/synonyms.db</default>
+     <default>${database_dir}/synonyms.db</default>
      <example>${database_base}.syn.db</example>
      <description> 
 	Points to the database that <ref type="program">htfuzzy</ref> creates when the <strong>synonyms</strong> 
--- htdig-3.2.0b6.debian/htdoc/attrs.html.in	2004-06-12 15:39:12.000000000 +0200
+++ htdig-3.2.0b6/htdoc/attrs.html.in	2011-04-13 19:20:19.000000000 +0200
@@ -3548,7 +3548,7 @@
 			<em>default:</em>
 		  </dt>
 		  <dd>
-			${<a href="#common_dir">common_dir</a>}/root2word.db
+			${<a href="#database_dir">database_dir</a>}/root2word.db
 		  </dd>
 		  <dt>
 			<em>block:</em>
@@ -3621,7 +3621,7 @@
 			<em>default:</em>
 		  </dt>
 		  <dd>
-			${<a href="#common_dir">common_dir</a>}/word2root.db
+			${<a href="#database_dir">database_dir</a>}/word2root.db
 		  </dd>
 		  <dt>
 			<em>block:</em>
@@ -12022,7 +12022,7 @@
 			<em>default:</em>
 		  </dt>
 		  <dd>
-			${<a href="#common_dir">common_dir</a>}/synonyms.db
+			${<a href="#database_dir">database_dir</a>}/synonyms.db
 		  </dd>
 		  <dt>
 			<em>block:</em>
--- htdig-3.2.0b6.debian/htdoc/htfuzzy.html	2004-06-12 15:39:13.000000000 +0200
+++ htdig-3.2.0b6/htdoc/htfuzzy.html	2011-04-13 19:20:19.000000000 +0200
@@ -192,7 +192,7 @@
 		</dl>
 		<dl>
 		  <dt>
-			<a href="attrs.html#common_dir">COMMON_DIR</a>/root2word.db, <a href="attrs.html#common_dir">COMMON_DIR</a>/word2rood.db
+			<a href="attrs.html#database_dir">DATABASE_DIR</a>/root2word.db, <a href="attrs.html#database_dir">DATABASE_DIR</a>/word2root.db
 		  </dt>
 		  <dd>
 			(Output) Database used for endings fuzzy rule
@@ -208,7 +208,7 @@
 		</dl>
 		<dl>
 		  <dt>
-			<a href="attrs.html#common_dir">COMMON_DIR</a>/synonyms.db
+			<a href="attrs.html#database_dir">DATABASE_DIR</a>/synonyms.db
 		  </dt>
 		  <dd>
 			(Output) Database used for synonyms fuzzy rule
diff --git a/debian/patches/khelp_htdig.diff b/debian/patches/khelp_htdig.diff
index 9633855..bd9e625 100644
--- a/debian/patches/khelp_htdig.diff
+++ b/debian/patches/khelp_htdig.diff
@@ -5,7 +5,7 @@
  use Getopt::Long;
  
 -my $htdigdata = "/srv/www/htdig/common/";
-+my $htdigdata = "/etc/htdig";
++my $htdigdata = "/usr/share/htdig";
  my $htdigbin = "/usr/bin";
  my $kdeprefix = "@CMAKE_INSTALL_PREFIX@";
  chomp $kdeprefix;
@@ -16,7 +16,7 @@
  use Getopt::Long;
  
 -my $htdigdata = "/srv/www/htdig/common/";
-+my $htdigdata = "/etc/htdig";
++my $htdigdata = "/usr/share/htdig";
  my $htdigbin = "/usr/bin";
  my $kdeprefix = "@CMAKE_INSTALL_PREFIX@";
  chomp $kdeprefix;

Attachment: signature.asc
Description: Digital signature


Reply to: