File rv-maketestfiles.diff of Package rasterview

--- test/maketestfiles.sh.orig	2015-08-26 03:46:51.000000000 +0200
+++ test/maketestfiles.sh	2015-11-10 10:39:35.000000000 +0100
@@ -3,29 +3,39 @@
 # Make test files using the CUPS imagetoraster filter and the test PPD
 # in this directory...
 #
 # Usage:
 #
 #     ./maketestfiles.sh [depth(s)] [colorspace(s)] [order(s)] [all]
 #                        [pstoraster | imagetoraster | cgpdftoraster |
-#                         cgimagetoraster]
+#                         cgimagetoraster | gstoraster]
 #
 
 PPD=rasterview.ppd; export PPD
 basedir=`dirname $0`
 depths=""
 cspaces=""
 orders=""
 filter=""
 if test -d /usr/libexec/cups/filter; then
 	filterpath="/usr/libexec/cups/filter"
 else
 	filterpath="/usr/lib/cups/filter"
 fi
 
+if ! test -w $basedir; then
+  basedir=`readlink -n -f $basedir`
+  tmpdir=`mktemp -d --tmpdir rasterview_test.XXXX`
+  echo -e "\nUsing $tmpdir for output ...\n"
+  cd $tmpdir
+  for file in $PPD testprint.jpg testprint.ps testprint.pdf ; do
+    ln -s $basedir/$file .
+  done
+fi
+
 for file in imagetoraster cgimagetoraster; do
 	if test -x $filterpath/$file; then
 		filter=$file
 		break
 	fi
 done
 
@@ -48,16 +58,20 @@
 		ICC6 | ICC7 | ICC8 | ICC9 | ICCA | ICCB | ICCC | ICCD | \
 		ICCE | ICCF | \
 		Device1 | Device2 | Device3 | Device4 | Device5 | Device6 | \
 		Device7 | Device8 | Device9 | DeviceA | DeviceB | DeviceC | \
 		DeviceD | DeviceE | DeviceF)
 			cspaces="$cspaces $option"
 			;;
-		pstoraster | imagetoraster | cgimagetoraster | cgpdftoraster)
-			filter="$option"
+		gstoraster | pstoraster | imagetoraster | cgimagetoraster | cgpdftoraster)
+			if test -x $filterpath/$option; then
+				filter="$option"
+			else
+				echo "Filter $option not found, skipping ..."
+			fi
 			;;
 		all)
 			cspaces="W RGB RGBA K CMY YMC CMYK YMCK KCMY KCMYcm"
 			cspaces="$cspaces GMCK GMCS WHITE GOLD SILVER RGBW"
 			cspaces="$cspaces sW sRGB AdobeRGB"
 			cspaces="$cspaces CIEXYZ CIELab ICC1 ICC2 ICC3 ICC4"
 			cspaces="$cspaces ICC5 ICC6 ICC7 ICC8 ICC9 ICCA ICCB"
@@ -139,14 +153,23 @@
 						;;
 				esac
 			fi
 
 			echo -n $filter-$cspace-$depth-$order.ras:
 
 			case $filter in
+                                gstoraster)
+                                        ($filterpath/pstops job user title 1 \
+                                                "ColorModel=$cspace cupsBitsPerColor=$depth cupsColorOrder=$order" \
+                                                $basedir/testprint.ps | \
+                                        $filterpath/gstoraster job user \
+                                                title 1 "") \
+                                                > $filter-$cspace-$depth-$order.ras \
+                                                2> $filter-$cspace-$depth-$order.log
+                                        ;;
 				pstoraster)
 					($filterpath/pstops job user title 1 \
 						"ColorModel=$cspace cupsBitsPerColor=$depth cupsColorOrder=$order" \
 						$basedir/testprint.ps | \
 					$filterpath/pstoraster job user \
 						title 1 "") \
 						> $filter-$cspace-$depth-$order.ras \
openSUSE Build Service is sponsored by