patch-src_tuxpaint-import_sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $OpenBSD: patch-src_tuxpaint-import_sh,v 1.2 2007/07/04 17:39:08 ajacoutot Exp $
  2. --- src/tuxpaint-import.sh.orig Sun Aug 13 03:14:35 2006
  3. +++ src/tuxpaint-import.sh Wed Jul 4 10:01:04 2007
  4. @@ -52,21 +52,17 @@ fi
  5. # Determine preferred savedir
  6. -# First, check /usr/local/etc/
  7. -x=`grep -m 1 "^savedir=" /usr/local/etc/tuxpaint/tuxpaint.conf`
  8. -if test $? = 0 ; then
  9. - SAVEDIR=`echo $x | cut -d = -f 2-99`
  10. -fi
  11. -
  12. # First, check /etc/
  13. -x=`grep -m 1 "^savedir=" /etc/tuxpaint/tuxpaint.conf`
  14. +x=`grep -s "^savedir=" /etc/tuxpaint/tuxpaint.conf`
  15. if test $? = 0 ; then
  16. + x=`grep -s "^savedir=" /etc/tuxpaint/tuxpaint.conf | head -n 1`
  17. SAVEDIR=`echo $x | cut -d = -f 2-99`
  18. fi
  19. # First, check $HOME
  20. -x=`grep -m 1 "^savedir=" $HOME/.tuxpaintrc`
  21. +x=`grep -s "^savedir=" $HOME/.tuxpaintrc`
  22. if test $? = 0 ; then
  23. + x=`grep -s "^savedir=" $HOME/.tuxpaintrc | head -n 1`
  24. SAVEDIR=`echo $x | cut -d = -f 2-99`
  25. fi
  26. @@ -77,19 +73,19 @@ echo "Using save directory: $SAVEDIR/saved"
  27. # Make sure savedir exists!
  28. if [ ! -d $SAVEDIR ]; then
  29. echo "Creating $SAVEDIR"
  30. - mkdir -p $SAVEDIR
  31. + eval "mkdir -p $SAVEDIR"
  32. fi
  33. # Make sure savedir/saved exists!
  34. if [ ! -d $SAVEDIR/saved ]; then
  35. echo "Creating $SAVEDIR/saved"
  36. - mkdir -p $SAVEDIR/saved
  37. + eval "mkdir -p $SAVEDIR/saved"
  38. fi
  39. # Make sure savedir thumbs directory exists!
  40. if [ ! -d $SAVEDIR/saved/.thumbs ]; then
  41. echo "Creating $SAVEDIR/saved/.thumbs"
  42. - mkdir -p $SAVEDIR/saved/.thumbs
  43. + eval "mkdir -p $SAVEDIR/saved/.thumbs"
  44. fi
  45. @@ -100,23 +96,18 @@ fi
  46. window_width=800
  47. window_height=600
  48. -# First, check /usr/local/etc/
  49. -x=`grep -m 1 "^windowsize=" /usr/local/etc/tuxpaint/tuxpaint.conf`
  50. -if test $? = 0 ; then
  51. - window_width=`echo $x | cut -d = -f 2 | cut -d x -f 1`
  52. - window_height=`echo $x | cut -d = -f 2 | cut -d x -f 2`
  53. -fi
  54. -
  55. # First, check /etc/
  56. -x=`grep -m 1 "^windowsize=" /etc/tuxpaint/tuxpaint.conf`
  57. +x=`grep -s "^windowsize=" /etc/tuxpaint/tuxpaint.conf`
  58. if test $? = 0 ; then
  59. + x=`grep -s "^windowsize=" /etc/tuxpaint/tuxpaint.conf | head -n 1`
  60. window_width=`echo $x | cut -d = -f 2 | cut -d x -f 1`
  61. window_height=`echo $x | cut -d = -f 2 | cut -d x -f 2`
  62. fi
  63. # First, check $HOME
  64. -x=`grep -m 1 "^windowsize=" $HOME/.tuxpaintrc`
  65. +x=`grep -s "^windowsize=" $HOME/.tuxpaintrc`
  66. if test $? = 0 ; then
  67. + x=`grep -s "^windowsize=" $HOME/.tuxpaintrc | head -n 1`
  68. window_width=`echo $x | cut -d = -f 2 | cut -d x -f 1`
  69. window_height=`echo $x | cut -d = -f 2 | cut -d x -f 2`
  70. fi