From owner-freebsd-ports@FreeBSD.ORG Mon Sep 22 17:52:52 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA71106564A for ; Mon, 22 Sep 2008 17:52:52 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (wrzx28.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 584618FC08 for ; Mon, 22 Sep 2008 17:52:51 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 60C64198E1B; Mon, 22 Sep 2008 19:52:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id 53DEC198E12; Mon, 22 Sep 2008 19:52:50 +0200 (CEST) Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id 38805198E11; Mon, 22 Sep 2008 19:52:50 +0200 (CEST) Received: from wep4035.physik.uni-wuerzburg.de ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.0.2) with ESMTP id 2008092219524972-42718 ; Mon, 22 Sep 2008 19:52:49 +0200 Received: by wep4035.physik.uni-wuerzburg.de (sSMTP sendmail emulation); Mon, 22 Sep 2008 19:52:49 +0200 From: "Alexey Shuvaev" Date: Mon, 22 Sep 2008 19:52:49 +0200 To: Jeremy Messenger Message-ID: <20080922175249.GA43367@wep4035.physik.uni-wuerzburg.de> MIME-Version: 1.0 Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.18 (2008-05-17) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 09/22/2008 07:52:49 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 09/22/2008 07:52:50 PM, Serialize complete at 09/22/2008 07:52:50 PM Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Cc: freebsd-ports@freebsd.org Subject: x11-wm/fluxbox fluxbox-generate_menu lists all available programs. X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2008 17:52:52 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello! The script fluxbox-generate_menu shipped with current versions of fluxbox (fluxbox-1.1.0.1_1 and 1.1.1 too, I think) produces menu with all known programs. The reason for it is find_it* family of functions used to determine if the program exists (see attached test.sh). It expects that 'hash' will return non-zero exit code when it cannot find the command and it is true on linix (some Ubuntu with 'dash', surprisingly enough, man says it is BSD sh), but not here: ~> uname -a FreeBSD wep4035.physik.uni-wuerzburg.de 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sun Sep 21 18:51:53 CEST 2008 root@wep4035.physik.uni-wuerzburg.de:/usr/obj/usr/src/sys/GENERIC amd64 ~> ./test.sh ls Found ls ~> ./test.sh bla-bla-non-existent Found bla-bla-non-existent Substituting 'hash' with 'which' solves the problem more or less, but I am not a sh guru to claim it is 100% correct. It could be also a sh(1) bug... Alexey. --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="test.sh" #!/bin/sh find_it() { [ -n "$1" ] && hash $1 2> /dev/null && shift && "$@" } find_it $1 echo "Found $1" exit 0 --8t9RHnE3ZwKMSgU+--