--- /usr/bin/updatedb	2004-06-29 08:14:35.000000000 -0400
+++ iupdatedb	2004-08-06 11:06:26.000000000 -0400
@@ -18,11 +18,13 @@
 # USA.
 
 # csh original by James Woods; sh conversion by David MacKenzie.
+# Modified by Yaroslav Halchenko <debian@onerussian.com> to support search by
+# ilink numbers
 
 usage="\
 Usage: updatedb [--localpaths='dir1 dir2...'] [--netpaths='dir1 dir2...']
        [--prunepaths='dir1 dir2...'] [--prunefs='fs1 fs2...']
-       [--output=dbfile] [--netuser=user] [--localuser=user] 
+       [--output=dbfile] [--netuser=user] [--localuser=user]
        [--old-format] [--version] [--help]
 
   Report bugs to <bug-findutils@gnu.org>.
@@ -73,13 +75,16 @@
 : ${LOCATE_DB=/var/cache/locate/locatedb}
 
 # Directory to hold intermediate files.
-if test -d /var/tmp; then
-  : ${TMPDIR=/var/tmp}
-elif test -d /usr/tmp; then
-  : ${TMPDIR=/usr/tmp}
-else
-  : ${TMPDIR=/tmp}
-fi
+#if test -d /var/tmp; then
+#  : ${TMPDIR=/var/tmp}
+#elif test -d /usr/tmp; then
+#  : ${TMPDIR=/usr/tmp}
+#else
+#  : ${TMPDIR=/tmp}
+#fi
+# For now local directory because index file grows bigger than regular updatedb file
+# and I was lacking space in /var for it
+: ${TMPDIR=.}
 export TMPDIR
 
 # The user to search network directories as.
@@ -123,20 +128,20 @@
     su $LOCALUSER -s $SHELL -c \
     "$find $SEARCHPATHS \
      \\( $prunefs_exp \
-     -type d -regex '$PRUNEREGEX' \\) -prune -o -print"
+     -type d -regex '$PRUNEREGEX' \\) -prune -o -printf \"%p/%i\\n\""
   else
     $find $SEARCHPATHS \
      \( $prunefs_exp \
-     -type d -regex "$PRUNEREGEX" \) -prune -o -print
+     -type d -regex "$PRUNEREGEX" \) -prune -o -printf "%p/%i\n"
   fi
 fi
 
 if test -n "$NETPATHS"; then
 if [ "`id -u`" = 0 ]; then
     su $NETUSER -c \
-     "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print"
+     "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print  -printf \"%p/%i\\n\""
   else
-    $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print
+    $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o  -printf "%p/%i\n"
   fi
 fi
 } | sort -f | $frcode > $LOCATE_DB.n
