Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f31ec5fb73b37c2f1318d0af8d380d5132a64a69
commit f31ec5fb73b37c2f1318d0af8d380d5132a64a69 Author: Pingax <pin...@frugalware.fr> Date: Fri Jun 3 21:31:18 2011 +0200 mpc-0.20-2-i686 * Patch lsplaylists command * Closes #4504 diff --git a/source/multimedia-extra/mpc/FrugalBuild b/source/multimedia-extra/mpc/FrugalBuild index afb35fb..ad5d506 100644 --- a/source/multimedia-extra/mpc/FrugalBuild +++ b/source/multimedia-extra/mpc/FrugalBuild @@ -1,9 +1,9 @@ -# Compiling time: 0.03 SBU +# Compiling time: 0.02 SBU # Maintainer: Pingax <pin...@frugalware.fr> pkgname=mpc pkgver=0.20 -pkgrel=1 +pkgrel=2 pkgdesc="A command line tool to interface MPD." _F_sourceforge_dirname="musicpd" Finclude sourceforge @@ -15,7 +15,15 @@ up2date="Flasttar http://sourceforge.net/projects/musicpd/files/$pkgname/$pkgver if [ "$CARCH" == "x86_64" ]; then export CFLAGS="$CFLAGS -fPIC" fi +source=($source lsplaylists.patch) +sha1sums=('8c73d38288432b517157dd347a8e74dc271623e3' \ + 'e717572a7c44dffe865af1cf98de361f76462d3d') -sha1sums=('8c73d38288432b517157dd347a8e74dc271623e3') +build() { + Fcd + Fpatchall + Fmake || Fdie + Fmakeinstall +} # optimization OK diff --git a/source/multimedia-extra/mpc/lsplaylists.patch b/source/multimedia-extra/mpc/lsplaylists.patch new file mode 100644 index 0000000..2a30cda --- /dev/null +++ b/source/multimedia-extra/mpc/lsplaylists.patch @@ -0,0 +1,90 @@ +From e659e2f6f0a1cc60835d93a3fbc3d9bfa56810c4 Mon Sep 17 00:00:00 2001 +From: Max Kellermann <m...@duempel.org> +Date: Fri, 03 Jun 2011 15:09:39 +0000 +Subject: command: show only playlists on command "lsplaylists" + +--- + 0.20 (2011/01/03) +diff --git a/src/command.c b/src/command.c +index 1074726..439eb24 100644 +--- a/src/command.c ++++ b/src/command.c +@@ -601,7 +601,7 @@ int cmd_listall ( int argc, char ** argv, struct mpd_connection *conn ) + if (!mpd_send_list_all_meta(conn, listall)) + printErrorAndExit(conn); + +- print_entity_list(conn); ++ print_entity_list(conn, MPD_ENTITY_TYPE_UNKNOWN); + } else { + if (!mpd_send_list_all(conn, listall)) + printErrorAndExit(conn); +@@ -688,7 +688,7 @@ int cmd_ls ( int argc, char ** argv, struct mpd_connection *conn ) + if (!mpd_send_list_meta(conn, ls)) + printErrorAndExit(conn); + +- print_entity_list(conn); ++ print_entity_list(conn, MPD_ENTITY_TYPE_UNKNOWN); + my_finishCommand(conn); + + } while (++i < argc && (ls = charset_to_utf8(argv[i])) != NULL); +@@ -707,7 +707,7 @@ int cmd_lsplaylists ( int argc, char ** argv, struct mpd_connection *conn ) + if (!mpd_send_list_meta(conn, ls)) + printErrorAndExit(conn); + +- print_entity_list(conn); ++ print_entity_list(conn, MPD_ENTITY_TYPE_PLAYLIST); + my_finishCommand(conn); + + } while (++i < argc && (ls = charset_to_utf8(argv[i])) != NULL); +diff --git a/src/util.c b/src/util.c +index a10ba0f..4a88f37 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -437,7 +437,7 @@ pretty_print_song(const struct mpd_song *song) + } + + void +-print_entity_list(struct mpd_connection *c) ++print_entity_list(struct mpd_connection *c, enum mpd_entity_type filter_type) + { + struct mpd_entity *entity; + while ((entity = mpd_recv_entity(c)) != NULL) { +@@ -445,7 +445,12 @@ print_entity_list(struct mpd_connection *c) + const struct mpd_song *song; + const struct mpd_playlist *playlist; + +- switch (mpd_entity_get_type(entity)) { ++ enum mpd_entity_type type = mpd_entity_get_type(entity); ++ if (filter_type != MPD_ENTITY_TYPE_UNKNOWN && ++ type != filter_type) ++ type = MPD_ENTITY_TYPE_UNKNOWN; ++ ++ switch (type) { + case MPD_ENTITY_TYPE_UNKNOWN: + break; + +diff --git a/src/util.h b/src/util.h +index e07826d..cc41b75 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -23,6 +23,8 @@ + #ifndef MPC_UTIL_H + #define MPC_UTIL_H + ++#include <mpd/client.h> ++ + struct mpd_connection; + struct mpd_song; + +@@ -50,7 +52,7 @@ void + pretty_print_song(const struct mpd_song *song); + + void +-print_entity_list(struct mpd_connection *c); ++print_entity_list(struct mpd_connection *c, enum mpd_entity_type filter_type); + + void + print_filenames(struct mpd_connection *conn); +-- +cgit v0.8.3.4-115-g1759 + _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git