# HG changeset patch # User Christophe Lincoln # Date 1244918703 -7200 # Node ID 08241a181a2482366217e48919f62e969ddcf603 # Parent f2ec7a93b8a6fbd48b4aee79cf7050885a0f0c15 Move man alias to /usr/bin/man diff -r f2ec7a93b8a6 -r 08241a181a24 rootfs/etc/profile --- a/rootfs/etc/profile Thu Apr 16 19:45:51 2009 +0200 +++ b/rootfs/etc/profile Sat Jun 13 20:45:03 2009 +0200 @@ -11,8 +11,8 @@ PS1='\u@\h:\w\$ ' else # Light green and blue colored prompt. - PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " - #PS1='\u@\h:\w\$ ' + #PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " + PS1='\u@\h:\w\$ ' fi # Max 64M for programs (prevent memory leak crashs) @@ -28,61 +28,6 @@ # which ldd > /dev/null || alias ldd='LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so' -# man fake -# -if [ ! -x /usr/bin/man ]; then - -man() -{ -local i -local SECTION -local MSG -local TOPIC -local MAN_SECTION -case "$1" in -''|-*) - cat < /dev/null) | less -M;; - *) less -M $i;; - esac - return - fi - if [ -x /usr/bin/retawq -a -f $i/$TOPIC.html ]; then - retawq --dump=file://$i/$TOPIC.html | less -M - return - fi -done -(wget -O - "http://mirror.slitaz.org/man/$SECTION/$TOPIC.html" || \ - wget -O - "http://man.he.net/?topic=$TOPIC§ion=$SECTION") 2> /dev/null | \ - awk "BEGIN { s=0; n=0 } /
/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"No manual entry for $TOPIC$MSG\" }" | \
-	sed -e 's/<[^>]*>//g' -e 's/<//g' -e 's/&/\&/g' | less -M
-}
-
-fi
-
-
 # Export all variables defined above and set mask.
 #
 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING ignoreeof
diff -r f2ec7a93b8a6 -r 08241a181a24 rootfs/usr/bin/man
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rootfs/usr/bin/man	Sat Jun 13 20:45:03 2009 +0200
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# Tiny man fake using online manuals.
+# (c) 2009 SliTaz GNU/Linux.
+#
+
+if [ ! -x /usr/bin/retawq ]; then
+	echo -e "\nMissing Retawq webbrouwser..."
+	echo -e "Please run: su -c 'tazpkg get-install retawq'\n"
+	exit 0
+fi
+
+local i
+local SECTION
+local MSG
+local TOPIC
+local MAN_SECTION
+
+case "$1" in
+	''|-*)
+		cat < /dev/null) | less -M;;
+		*) less -M $i;;
+		esac
+		return
+	fi
+	if [ -x /usr/bin/retawq -a -f $i/$TOPIC.html ]; then
+		retawq --dump=file://$i/$TOPIC.html | less -M
+		return
+	fi
+done
+
+(wget -O - "http://mirror.slitaz.org/man/$SECTION/$TOPIC.html" || \
+	wget -O - "http://man.he.net/?topic=$TOPIC§ion=$SECTION") 2> /dev/null | \
+	awk "BEGIN { s=0; n=0 } /
/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"No manual entry for $TOPIC$MSG\" }" | \
+	sed -e 's/<[^>]*>//g' -e 's/<//g' -e 's/&/\&/g' | less -M
+
+exit 0