recursive_delete, fix_make_dist patches

I haven't been using moc long, but wanted to delete music from the current play list by directory, so here is a patch that does that. Usefulness probably depends on the layout of your music directories.
diff -r 75d635531903 interface.c
--- a/interface.c Mon Jan 25 07:29:36 2010 +1100
+++ b/interface.c Wed Jan 27 03:57:16 2010 +1100
@@ -2579,20 +2579,78 @@
static void delete_item ()
{
char *file;
-
- if (!iface_in_plist_menu()) {
- error ("You can only delete an item from the "
- "playlist.");
+ enum file_type type;
+
+ if (!playlist->not_deleted)
+ return; // don't even bother
+
+ file = iface_get_curr_file ();
+ if (!file)
return;
+
+ type = iface_curritem_get_type ();
+
+ if (iface_in_dir_menu()) {
+ if (type != F_SOUND && type != F_DIR && type != F_PLAYLIST) {
+ error ("Don't know how to delete selected item.");
+ free (file);
+ return;
+ }
+
+ if (!strcmp (file, "..")) {
+ error ("Can't delete '..'.");
+ free (file);
+ return;
+ }
+
+ if (type == F_SOUND) {
+ if(plist_find_fname (playlist, file) == -1) {
+ error ("File not in playlist.");
+ free (file);
+ return;
+ }
+
+ iface_menu_key (KEY_CMD_MENU_DOWN);
+ }
}
-
- assert (plist_count(playlist) > 0);
-
- file = iface_get_curr_file ();
-
- send_int_to_srv (CMD_LOCK);
- remove_file_from_playlist (file);
- send_int_to_srv (CMD_UNLOCK);
+ else
+ assert (plist_count (playlist) > 0);
+
+ if (type == F_DIR || type == F_PLAYLIST) {
+ struct plist plist;
+ int i;
+
+ iface_set_status ("Reading directories...");
+ plist_init (&plist);
+
+ if (type == F_DIR) {
+ read_directory_recurr (file, &plist);
+ plist_sort_fname (&plist);
+ }
+ else
+ plist_load (&plist, file, cwd, 0);
+
+ if(plist.num)
+ {
+ send_int_to_srv (CMD_LOCK);
+ for (i = 0; i < plist.num; ++i)
+ if(plist_find_fname (playlist, plist.items.file) != -1)
+ remove_file_from_playlist (plist.items.file);
+ send_int_to_srv (CMD_UNLOCK);
+ }
+ else
+ {
+ error ("No items to delete");
+ }
+ iface_set_status ("");
+
+ plist_free (&plist);
+ }
+ else {
+ send_int_to_srv (CMD_LOCK);
+ remove_file_from_playlist (file);
+ send_int_to_srv (CMD_UNLOCK);
+ }

free (file);
}

I also found that "make dist" produces incomplete tarballs if ./configure decides things are missing from the host. (As I am not at all familiar with autotools/automake and just read http://www.gnu.org/software/libtool/manual/automake/Unconfigured-Subdirectories.html there may be a better solution to this.)
diff -r c34b35d22d89 decoder_plugins/Makefile.am
--- a/decoder_plugins/Makefile.am Mon Feb 01 02:28:14 2010 +1100
+++ b/decoder_plugins/Makefile.am Mon Feb 01 08:02:07 2010 +1100
@@ -1,1 +1,2 @@
SUBDIRS = @DECODER_PLUGINS@
+DIST_SUBDIRS = aac flac modplug musepack sndfile timidity wavpack ffmpeg mp3 sidplay2 speex vorbis

Yes, it is very useful for well-organized music libraries :-)
It works well, thank you for it, I hope it gets to trunk soon.