diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2013-12-30 19:51:07 +0800 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2013-12-30 19:51:07 +0800 |
commit | ae002a252a18d3672cf3882fa3336673e671673b (patch) | |
tree | 1c7a286b8fdc9c31039192fd2fd0a8dfefe1f19b /graphics/netpbm | |
parent | 3d06de3703491a2f12b7fdde2b04e683fa6a28df (diff) | |
download | freebsd-ports-gnome-ae002a252a18d3672cf3882fa3336673e671673b.tar.gz freebsd-ports-gnome-ae002a252a18d3672cf3882fa3336673e671673b.tar.zst freebsd-ports-gnome-ae002a252a18d3672cf3882fa3336673e671673b.zip |
- convert from bash to sh
PR: 185189
Submitted by: Matthieu Volat
- bugfix for filenames with spaces.
Diffstat (limited to 'graphics/netpbm')
-rw-r--r-- | graphics/netpbm/Makefile | 1 | ||||
-rw-r--r-- | graphics/netpbm/files/patch-ppmquantall | 63 | ||||
-rw-r--r-- | graphics/netpbm/files/patch-ppmquantall.csh | 13 |
3 files changed, 68 insertions, 9 deletions
diff --git a/graphics/netpbm/Makefile b/graphics/netpbm/Makefile index a01dcb989001..f6e913e8484a 100644 --- a/graphics/netpbm/Makefile +++ b/graphics/netpbm/Makefile @@ -18,7 +18,6 @@ LIB_DEPENDS= libtiff.so:${PORTSDIR}/graphics/tiff \ libjbig.so:${PORTSDIR}/graphics/jbigkit \ libjasper.so:${PORTSDIR}/graphics/jasper \ libxml2.so:${PORTSDIR}/textproc/libxml2 -RUN_DEPENDS= bash:${PORTSDIR}/shells/bash USES= gmake perl5 CFLAGS+= -DPNG_DEPSTRUCT= -Iutil diff --git a/graphics/netpbm/files/patch-ppmquantall b/graphics/netpbm/files/patch-ppmquantall index 9fc434d3ee6a..c2363d19cb17 100644 --- a/graphics/netpbm/files/patch-ppmquantall +++ b/graphics/netpbm/files/patch-ppmquantall @@ -1,8 +1,55 @@ ---- editor/ppmquantall.orig 2012-03-09 22:16:02.000000000 +0900 -+++ editor/ppmquantall 2012-03-09 22:16:29.000000000 +0900 -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/usr/local/bin/bash - # - # ppmquantall - run ppmquant on a bunch of files all at once, so they share - # a common colormap +--- editor/ppmquantall.orig 2009-04-28 03:43:45.000000000 +0200 ++++ editor/ppmquantall 2013-12-30 12:26:49.000000000 +0100 +@@ -53,8 +53,6 @@ + + newcolors=$1 + shift +-nfiles=$# +-files=($@) + + # Extract the width and height of each of the images. + # Here, we make the assumption that the width and height are on the +@@ -62,14 +60,6 @@ + # To be robust, we need to use Pnmfile to get that information, or + # Put this program in C and use ppm_readppminit(). + +-widths=() +-heights=() +- +-for i in ${files[@]}; do +- widths=(${widths[*]} `grep -v '^#' $i | sed '1d; s/ .*//; 2q'`) +- heights=(${heights[*]} `grep -v '^#' $i | sed '1d; s/.* //; 2q'`) +-done +- + tempdir="${TMPDIR-/tmp}/ppmquantall.$$" + mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;} + chmod 700 $tempdir +@@ -78,7 +68,7 @@ + + all=$tempdir/pqa.all.$$ + +-pnmcat -topbottom -jleft -white ${files[@]} | pnmquant $newcolors > $all ++pnmcat -topbottom -jleft -white "$@" | pnmquant $newcolors > $all + if [ $? != 0 ]; then + exit $? + fi +@@ -86,12 +76,15 @@ + y=0 + i=0 + +-while [ $i -lt $nfiles ]; do +- pamcut -left 0 -top $y -width ${widths[$i]} -height ${heights[$i]} $all \ +- > ${files[$i]}$ext ++for f in "$@"; do ++ width=`grep -v '^#' "$f" | sed '1d; s/ .*//; 2q'` ++ height=`grep -v '^#' "$f" | sed '1d; s/.* //; 2q'` ++ ++ pamcut -left 0 -top $y -width $width -height $height $all \ ++ > "$f$ext" + if [ $? != 0 ]; then + exit $? + fi +- y=$(($y + ${heights[$i]})) ++ y=$(($y + $height)) + i=$(($i + 1)) + done diff --git a/graphics/netpbm/files/patch-ppmquantall.csh b/graphics/netpbm/files/patch-ppmquantall.csh new file mode 100644 index 000000000000..11b31fc0fa90 --- /dev/null +++ b/graphics/netpbm/files/patch-ppmquantall.csh @@ -0,0 +1,13 @@ +--- editor/ppmquantall.csh.orig 2006-08-19 05:12:28.000000000 +0200 ++++ editor/ppmquantall.csh 2013-12-25 21:56:17.183814873 +0100 +@@ -30,8 +30,8 @@ + set widths=() + set heights=() + foreach i ( $files ) +- set widths=( $widths `sed '1d; s/ .*//; 2q' $i` ) +- set heights=( $heights `sed '1d; s/.* //; 2q' $i` ) ++ set widths=( $widths `grep -v '^#' "$i" | sed '1d; s/ .*//; 2q'` ) ++ set heights=( $heights `grep -v '^#' "$i" | sed '1d; s/.* //; 2q'` ) + end + + set all=/tmp/pqa.all.$$ |