Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2001 13:01:16 -0500 (EST)
From:      "Alexander N. Kabaev" <ak03@gte.com>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        kde@freebsd.org
Subject:   ports/32358: bashisms in kdelibs/kdeprint/filters/imagetops script
Message-ID:  <200111281801.fASI1Gc67150@h132-197-97-45.gte.com>

next in thread | raw e-mail | index | archive | help

>Number:         32358
>Category:       ports
>Synopsis:       bashisms in kdelibs/kdeprint/filters/imagetops script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 28 10:10:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Alexander N. Kabaev
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #7: Mon Nov 26 13:00:28 EST 2001 root@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386


	
>Description:
	There is a imagetops script installed kdelibs2/kdeprint which uses
	bash specific constructs, even though it claims to be a sh script.
	Our /bin/sh obviously fails executing it. Attached patch makes it
	work correctly with our shell. Warning - it introduces a new
	patch file in the port 'files' directory.
>How-To-Repeat:
	imagetops <any image>
>Fix:

Index: files/patch-kdeprint::imagetops
===================================================================
RCS file: files/patch-kdeprint::imagetops
diff -N files/patch-kdeprint::imagetops
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-kdeprint::imagetops	28 Nov 2001 17:36:09 -0000
@@ -0,0 +1,25 @@
+--- kdeprint/filters/imagetops.orig	Wed Nov 28 12:25:21 2001
++++ kdeprint/filters/imagetops	Wed Nov 28 12:29:50 2001
+@@ -27,11 +27,17 @@
+ # check the file mime type, and set the command correspondingly
+ cmd=
+ magic=`file -bi $FILE`
+-if [[ $magic != image/* ]] ; then
+-	echo "Not an image"
+-	exit 1;
+-fi
+-case ${magic/image\//} in
++
++case $magic in
++	image/*)
++		;;
++	*)
++		echo "Not an image"
++		exit 1;
++		;;
++esac
++
++case ${magic##image\/} in
+ 	jpeg)
+ 		cmd="djpeg -pnm"
+ 		;;
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111281801.fASI1Gc67150>