Re: [Musicpd-dev-team] [git pull] mpc *handler fixes

2008-12-21 Thread Max Kellermann
On 2008/12/21 03:08, Avuton Olrich avu...@gmail.com wrote:
 Whoops! Please repull, this time includes the necessary makefile
 changes (guess I should smoke check even for documentation changes
 ;)).

Done.

--
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [git pull] mpc *handler fixes

2008-12-20 Thread Avuton Olrich
Max,

Please pull the latest *handler script improvements from my tree from:

git://git.musicpd.org/avuton/mpc.git handler-fixes


 They should all be posix compatible and they'll fix 1709.

--
Avuton Olrich (6):
  Move the 'handlers' to show the they are specifically for MPD,
in the case they end up installed.
  Rather then put examples of how to parse playlist entries with
mpc in the man page, refer to the scripts that are distributed in the
doc directory.
  Don't automatically assume the user wants their old playlist
cleared and to play after a playlist is added.
  Quote parameter expansions.
  Rather then pipe use a file redirector.
  Remove the unnecessary grep by excluding streams then printing
only when necessary.



diff --git a/doc/m3u-handler.sh b/doc/m3u-handler.sh
deleted file mode 100755
index f8d76dd..000
--- a/doc/m3u-handler.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-test $# -ne 1  echo $0 takes 1 argument  exit 1
-test ! -e $1  echo Argument ($1) needs to be a file  exit 2
-mpc clear
-cat $1 | mpc add
-mpc play
diff --git a/doc/mpc.1 b/doc/mpc.1
index 81b17a6..0103737 100644
--- a/doc/mpc.1
+++ b/doc/mpc.1
@@ -156,30 +156,8 @@ via Unix Domain Socket.
 To use a password with mpd, set MPD_HOST to passw...@host.
 .SH EXAMPLES
 .TP
-Here is a script to load and play m3u playlists (useful for mozilla):
 .br
-
-.br
-#!/bin/bash
-.br
-mpc clear
-.br
-cat $1 | mpc add
-.br
-mpc play
-.br
-.TP
-This script can be used to load and play pls playlists (again, useful
for mozilla):
-.br
-
-.br
-#!/bin/bash
-.br
-mpc clear
-.br
-grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
-.br
-mpc play
+For useful examples of mpc use in playlist parsing, see
mpd-m3u-playlist.sh and mpd-pls-playlist.sh.
 .br
 .SH BUGS
 Report bugs on http://www.musicpd.org/mantis/
diff --git a/doc/mpd-m3u-handler.sh b/doc/mpd-m3u-handler.sh
new file mode 100755
index 000..8868403
--- /dev/null
+++ b/doc/mpd-m3u-handler.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+test $# -ne 1  echo $0 takes 1 argument  exit 1
+test ! -e $1  echo Argument ($1) needs to be a file  exit 2
+mpc add  $1
diff --git a/doc/mpd-pls-handler.sh b/doc/mpd-pls-handler.sh
new file mode 100755
index 000..55aa77d
--- /dev/null
+++ b/doc/mpd-pls-handler.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+test $# -ne 1  echo $0 takes 1 argument  exit 1
+test ! -e $1  echo Argument ($1) needs to be a file  exit 2
+sed -ne 's/^File[0-9]*=//p' $1 | mpc add
diff --git a/doc/pls-handler.sh b/doc/pls-handler.sh
deleted file mode 100755
index 1f41558..000
--- a/doc/pls-handler.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-test $# -ne 1  echo $0 takes 1 argument  exit 1
-test ! -e $1  echo Argument ($1) needs to be a file  exit 2
-mpc clear
-grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
-mpc play
-- 
avuton
--
|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| ()_() world domination.

--
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


Re: [Musicpd-dev-team] [git pull] mpc *handler fixes

2008-12-20 Thread Avuton Olrich
On Sat, Dec 20, 2008 at 3:24 PM, Max Kellermann m...@duempel.org wrote:
 On 2008/12/20 20:36, Avuton Olrich avu...@gmail.com wrote:
 Please pull the latest *handler script improvements from my tree from:

 Done!


Whoops! Please repull, this time includes the necessary makefile
changes (guess I should smoke check even for documentation changes
;)).

Thanks!

git://git.musicpd.org/avuton/mpc.git handler-fixes

--
Avuton Olrich (1):
  Fix the makefile to deal with the renamed scripts.

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 6252bdb..2b2b77a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
 man_MANS = mpc.1
 pkgdata_DATA =
 docdir = $(prefix)/share/doc/$(PACKAGE)
-doc_DATA = mpc-bashrc m3u-handler.sh pls-handler.sh mppledit
+doc_DATA = mpc-bashrc mpd-m3u-handler.sh mpd-pls-handler.sh mppledit
 EXTRA_DIST = $(pkgdata_DATA) $(man_MANS) $(doc_DATA)
-- 
avuton
--
|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| ()_() world domination.

--
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team