misc/105220: maintainer update: audio/kid3
Max Brazhnikov
makc at issp.ac.ru
Mon Nov 6 19:20:23 UTC 2006
>Number: 105220
>Category: misc
>Synopsis: maintainer update: audio/kid3
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Mon Nov 06 19:20:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Max Brazhnikov
>Release: FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
FreeBSD luna.zuzino.mipt.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Sat Oct 28 18:43:15 MSD 2006 root at luna.zuzino.mipt.ru:/usr/obj/usr/src/sys/LUNA i386
>Description:
include upstream patches:
- allow building with tunepimp 0.5.x
- fix inadvertent changes of ID3v2.3 genre strings
- import from freedb2.org
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -ruN --exclude=CVS /usr/ports/audio/kid3/Makefile /home/makc/porting/ports/audio/kid3/Makefile
--- /usr/ports/audio/kid3/Makefile Wed Sep 13 01:49:38 2006
+++ /home/makc/porting/ports/audio/kid3/Makefile Mon Nov 6 21:30:55 2006
@@ -7,6 +7,7 @@
PORTNAME= kid3
PORTVERSION= 0.7
+PORTREVISION= 1
CATEGORIES= audio kde
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -18,7 +19,7 @@
FLAC.7:${PORTSDIR}/audio/flac \
ogg.5:${PORTSDIR}/audio/libogg \
vorbis.3:${PORTSDIR}/audio/libvorbis \
- tunepimp-0.4.3:${PORTSDIR}/audio/libtunepimp-old
+ tunepimp.5:${PORTSDIR}/audio/libtunepimp
USE_KDELIBS_VER=3
USE_GMAKE= yes
@@ -26,14 +27,6 @@
USE_GETTEXT= yes
GNU_CONFIGURE= yes
INSTALLS_ICONS= yes
-CONFIGURE_ARGS+=CFLAGS=-I${LOCALBASE}/include/tunepimp-0.4 \
- LDFLAGS=-L${LOCALBASE}/lib/tunepimp-0.4
-
-post-patch:
- @${REINPLACE_CMD} -e 's|-ltunepimp|-ltunepimp-0.4|g' \
- -e 's|<tunepimp/tp_c.h>|<tunepimp-0.4/tunepimp/tp_c.h>|g' \
- ${WRKSRC}/configure ${WRKSRC}/kid3/musicbrainzclient.h \
- ${WRKSRC}/admin/Makefile
.include <bsd.port.pre.mk>
@@ -42,4 +35,3 @@
.endif
.include <bsd.port.post.mk>
-
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-Makefile.in
--- /usr/ports/audio/kid3/files/patch-Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-Makefile.in Sat Sep 23 01:30:29 2006
@@ -0,0 +1,31 @@
+--- ./Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./Makefile.in Sat Sep 23 01:27:55 2006
+@@ -317,7 +317,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
+
+@@ -740,9 +740,8 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+-KDE_DIST=configure.files kid3_ru.qm build-stamp kid3_de.qm configure.in.in stamp-h.in subdirs Makefile.in kid3_de.html kid3_en.html Makefile.cvs kid3_es.qm LICENSE
++KDE_DIST=stamp-h.in subdirs Makefile.in kid3_de.html configure.files kid3_en.html kid3_ru.qm kid3_de.qm Makefile.cvs configure.in.in kid3_es.qm LICENSE
+
+ #>+ 2
+ docs-am:
+@@ -751,7 +750,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-admin__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-admin__Makefile.in
--- /usr/ports/audio/kid3/files/patch-admin__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-admin__Makefile.in Sat Sep 23 01:30:29 2006
@@ -0,0 +1,31 @@
+--- ./admin/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./admin/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -295,7 +295,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu admin/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/admin/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit admin/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+@@ -451,9 +451,8 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+-KDE_DIST=configure.in.bot.end bcheck.pl detect-autoconf.sh deps.am configure.in.min debianrules cvs.sh config.pl oldinclude.m4.in am_edit Makefile.common cvs-clean.pl Makefile.in Doxyfile.global acinclude.m4.in libtool.m4.in nmcheck Doxyfile.am conf.change.pl
++KDE_DIST=configure.in.bot.end bcheck.pl cvs-clean.pl Makefile.in detect-autoconf.sh Doxyfile.global deps.am configure.in.min acinclude.m4.in debianrules libtool.m4.in nmcheck cvs.sh config.pl Doxyfile.am oldinclude.m4.in am_edit conf.change.pl Makefile.common
+
+ #>+ 2
+ docs-am:
+@@ -462,7 +461,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu admin/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/admin/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit admin/Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-configure /home/makc/porting/ports/audio/kid3/files/patch-configure
--- /usr/ports/audio/kid3/files/patch-configure Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-configure Sat Sep 23 01:30:29 2006
@@ -0,0 +1,261 @@
+--- ./configure.orig Tue Jun 27 22:55:03 2006
++++ ./configure Sat Sep 23 01:27:55 2006
+@@ -31630,22 +31630,146 @@
+
+ fi;
+ if test "$with_musicbrainz" != "no"; then
++ if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
++ echo "$as_me:$LINENO: checking for tunepimp-0.5/tp_c.h" >&5
++echo $ECHO_N "checking for tunepimp-0.5/tp_c.h... $ECHO_C" >&6
++if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_tunepimp_0_5_tp_c_h" >&5
++echo "${ECHO_T}$ac_cv_header_tunepimp_0_5_tp_c_h" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking tunepimp-0.5/tp_c.h usability" >&5
++echo $ECHO_N "checking tunepimp-0.5/tp_c.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <tunepimp-0.5/tp_c.h>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
+
++# Is the header present?
++echo "$as_me:$LINENO: checking tunepimp-0.5/tp_c.h presence" >&5
++echo $ECHO_N "checking tunepimp-0.5/tp_c.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <tunepimp-0.5/tp_c.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
+
+- kde_safe_cppflags=$CPPFLAGS
+- CPPFLAGS="$CPPFLAGS $all_includes"
+- ac_ext=cc
+-ac_cpp='$CXXCPP $CPPFLAGS'
+-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+-
+-ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for tunepimp-0.5/tp_c.h" >&5
++echo $ECHO_N "checking for tunepimp-0.5/tp_c.h... $ECHO_C" >&6
++if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_header_tunepimp_0_5_tp_c_h=$ac_header_preproc
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_tunepimp_0_5_tp_c_h" >&5
++echo "${ECHO_T}$ac_cv_header_tunepimp_0_5_tp_c_h" >&6
+
+- if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
++fi
++if test $ac_cv_header_tunepimp_0_5_tp_c_h = yes; then
++ build_musicbrainz="yes"
++else
++ if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for tunepimp/tp_c.h" >&5
+ echo $ECHO_N "checking for tunepimp/tp_c.h... $ECHO_C" >&6
+ if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
+@@ -31675,7 +31799,7 @@
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -31718,8 +31842,8 @@
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+- ac_cpp_err=$ac_cxx_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -31739,7 +31863,7 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: tunepimp/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: tunepimp/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+@@ -31788,19 +31912,14 @@
+ fi
+
+
+- CPPFLAGS=$kde_safe_cppflags
+- ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
++fi
+
+
+ fi
+ if test "$build_musicbrainz" = "yes"; then
+- echo "$as_me:$LINENO: checking for tp_SetPUIDCollisionThreshold in -ltunepimp" >&5
+-echo $ECHO_N "checking for tp_SetPUIDCollisionThreshold in -ltunepimp... $ECHO_C" >&6
+-if test "${ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold+set}" = set; then
++ echo "$as_me:$LINENO: checking for tr_GetPUID in -ltunepimp" >&5
++echo $ECHO_N "checking for tr_GetPUID in -ltunepimp... $ECHO_C" >&6
++if test "${ac_cv_lib_tunepimp_tr_GetPUID+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -31818,11 +31937,11 @@
+ #endif
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+-char tp_SetPUIDCollisionThreshold ();
++char tr_GetPUID ();
+ int
+ main ()
+ {
+-tp_SetPUIDCollisionThreshold ();
++tr_GetPUID ();
+ ;
+ return 0;
+ }
+@@ -31848,20 +31967,20 @@
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+- ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold=yes
++ ac_cv_lib_tunepimp_tr_GetPUID=yes
+ else
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold=no
++ac_cv_lib_tunepimp_tr_GetPUID=no
+ fi
+ rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold" >&5
+-echo "${ECHO_T}$ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold" >&6
+-if test $ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold = yes; then
++echo "$as_me:$LINENO: result: $ac_cv_lib_tunepimp_tr_GetPUID" >&5
++echo "${ECHO_T}$ac_cv_lib_tunepimp_tr_GetPUID" >&6
++if test $ac_cv_lib_tunepimp_tr_GetPUID = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_TUNEPIMP 5
+@@ -31977,6 +32096,7 @@
+
+ fi;
+ if test "$with_vorbis" != "no"; then
++
+
+
+
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-doc__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-doc__Makefile.in
--- /usr/ports/audio/kid3/files/patch-doc__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-doc__Makefile.in Sat Sep 23 01:30:28 2006
@@ -0,0 +1,28 @@
+--- ./doc/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./doc/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -307,7 +307,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+@@ -593,7 +593,6 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+ KDE_DIST=Makefile.in
+
+@@ -604,7 +603,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-doc__de__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-doc__de__Makefile.in
--- /usr/ports/audio/kid3/files/patch-doc__de__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-doc__de__Makefile.in Sat Sep 23 01:30:28 2006
@@ -0,0 +1,28 @@
+--- ./doc/de/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./doc/de/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -296,7 +296,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/de/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/de/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/de/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+@@ -446,7 +446,6 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+ KDE_DIST=Makefile.in
+
+@@ -499,7 +498,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/de/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/de/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/de/Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-doc__en__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-doc__en__Makefile.in
--- /usr/ports/audio/kid3/files/patch-doc__en__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-doc__en__Makefile.in Sat Sep 23 01:30:28 2006
@@ -0,0 +1,28 @@
+--- ./doc/en/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./doc/en/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -296,7 +296,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/en/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/en/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/en/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+@@ -446,7 +446,6 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+ KDE_DIST=Makefile.in
+
+@@ -499,7 +498,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/en/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/en/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit doc/en/Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3-oggfile.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3-oggfile.cpp
--- /usr/ports/audio/kid3/files/patch-kid3-oggfile.cpp Mon Aug 7 13:06:48 2006
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3-oggfile.cpp Thu Jan 1 03:00:00 1970
@@ -1,11 +0,0 @@
---- kid3/oggfile.cpp.orig Sat Jan 28 02:15:27 2006
-+++ kid3/oggfile.cpp Mon Aug 7 16:13:25 2006
-@@ -143,7 +143,7 @@
- bool setUtime = false;
- struct utimbuf times;
- if (preserve) {
-- int fd = ::fileno(fpIn);
-+ int fd = fileno(fpIn);
- if (fd >= 0) {
- struct stat fileStat;
- if (::fstat(fd, &fileStat) == 0) {
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-kid3__Makefile.in
--- /usr/ports/audio/kid3/files/patch-kid3__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__Makefile.in Sat Sep 23 01:30:28 2006
@@ -0,0 +1,28 @@
+--- ./kid3/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./kid3/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -491,7 +491,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu kid3/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/kid3/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit kid3/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+@@ -910,7 +910,6 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 3
+ importdialog.moc.cpp: $(srcdir)/importdialog.h
+ $(MOC) $(srcdir)/importdialog.h -o importdialog.moc.cpp
+@@ -1023,7 +1022,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu kid3/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/kid3/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit kid3/Makefile.in
+
+
+ #>+ 21
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__freedbclient.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__freedbclient.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.cpp Mon Nov 6 21:26:13 2006
@@ -0,0 +1,101 @@
++++ ./kid3/freedbclient.cpp 2006-05-28 15:05:28.000000000 +0200
++++ ./kid3/freedbclient.cpp 2006-10-07 21:32:21.000000000 +0200
+@@ -21,6 +21,7 @@
+ #include <qregexp.h>
+ #include <qsocket.h>
+ #include <qstatusbar.h>
++#include <qurl.h>
+ #include "freedbconfig.h"
+ #include "freedbclient.h"
+
+@@ -34,7 +35,8 @@
+ *
+ * @param sb status bar to display progress information.
+ */
+-FreedbClient::FreedbClient(QStatusBar *sb) : statusBar(sb)
++FreedbClient::FreedbClient(QStatusBar *sb) :
++ statusBar(sb), m_requestType(RT_None)
+ {
+ sock = new QSocket();
+ connect(sock, SIGNAL(hostFound()),
+@@ -158,7 +160,39 @@
+ }
+ #endif
+ sock->connectToHost(dest, destPort);
+- isAlbumRequest = false;
++ m_requestType = RT_FindFreedbSearch;
++
++ statusBar->message(i18n("Connecting..."));
++}
++
++/**
++ * Find keyword in freedb with "cddb album" command of freedb2.org.
++ *
++ * @param cfg freedb configuration
++ * @param what string with words to search
++ */
++void FreedbClient::findCddbAlbum(const FreedbConfig *cfg, QString what)
++{
++ QString destNamePort(getProxyOrDest(cfg, cfg->server));
++ QString dest;
++ int destPort;
++ splitNamePort(destNamePort, dest, destPort);
++ what.replace(QRegExp(" +"), " "); // collapse spaces
++ QUrl::encode(what);
++ what.replace("%20", "+"); // replace spaces by '+'
++ request = "GET http://" + cfg->server + cfg->cgiPath +
++ "?cmd=cddb+album+" + what + "&hello=noname+localhost+" +
++ "Kid3+" VERSION "&proto=1 HTTP/1.1\r\nHost: " + cfg->server +
++ "\r\nConnection: close\r\n\r\n";
++#if defined WIN32 && QT_VERSION < 300
++ int err = hostnameToAddress(dest);
++ if (err) {
++ statusBar->message(QString("WinSock error %1").arg(err));
++ return;
++ }
++#endif
++ sock->connectToHost(dest, destPort);
++ m_requestType = RT_FindCddbAlbum;
+
+ statusBar->message(i18n("Connecting..."));
+ }
+@@ -186,14 +220,23 @@
+ */
+ void FreedbClient::slotConnectionClosed()
+ {
+- rcvStr = "";
+- while (sock->canReadLine()) {
+- rcvStr += sock->readLine();
+- }
+- if (isAlbumRequest) {
+- emit albumFinished(rcvStr);
+- } else {
+- emit findFinished(rcvStr);
++ Q_ULONG len = sock->bytesAvailable();
++ QCString s;
++ s.resize(len + 1);
++ sock->readBlock(s.data(), len);
++ rcvStr = QString::fromUtf8(s.data());
++ switch (m_requestType) {
++ case RT_Album:
++ emit albumFinished(rcvStr);
++ break;
++ case RT_FindFreedbSearch:
++ emit findFinished(rcvStr);
++ break;
++ case RT_FindCddbAlbum:
++ emit findCddbAlbumFinished(rcvStr);
++ break;
++ default:
++ qWarning("Unknown freedb request type");
+ }
+ sock->close();
+ statusBar->message(i18n("Ready."));
+@@ -256,6 +299,6 @@
+ }
+ #endif
+ sock->connectToHost(dest, destPort);
+- isAlbumRequest = true;
++ m_requestType = RT_Album;
+ statusBar->message(i18n("Connecting..."));
+ }
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__freedbclient.h /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.h
--- /usr/ports/audio/kid3/files/patch-kid3__freedbclient.h Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.h Mon Nov 6 21:26:19 2006
@@ -0,0 +1,44 @@
++++ ./kid3/freedbclient.h 2006-01-05 19:15:21.000000000 +0100
++++ ./kid3/freedbclient.h 2006-10-07 16:06:53.000000000 +0200
+@@ -44,6 +44,13 @@
+ */
+ void find(const FreedbConfig *cfg, QString what);
+ /**
++ * Find keyword in freedb with "cddb album" command of freedb2.org.
++ *
++ * @param cfg freedb configuration
++ * @param what string with words to search
++ */
++ void findCddbAlbum(const FreedbConfig *cfg, QString what);
++ /**
+ * Request track list from freedb server.
+ *
+ * @param cfg freedb configuration
+@@ -92,6 +99,11 @@
+ */
+ void findFinished(QString);
+ /**
++ * Emitted when findCddbAlbum request finished.
++ * Parameter: text containing result of findCddbAlbum request
++ */
++ void findCddbAlbumFinished(QString);
++ /**
+ * Emitted when album track data request finished.
+ * Parameter: text containing result of album request
+ */
+@@ -105,8 +117,13 @@
+ QString request;
+ /** buffer for received data */
+ QString rcvStr;
+- /** true if last request was album track data request */
+- bool isAlbumRequest;
++ /** type of current request */
++ enum RequestType {
++ RT_None,
++ RT_FindFreedbSearch,
++ RT_FindCddbAlbum,
++ RT_Album
++ } m_requestType;
+ };
+
+ #endif
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__freedbdialog.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__freedbdialog.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.cpp Mon Nov 6 21:26:23 2006
@@ -0,0 +1,96 @@
++++ ./kid3/freedbdialog.cpp 2006-02-23 22:48:14.000000000 +0100
++++ ./kid3/freedbdialog.cpp 2006-10-07 21:31:43.000000000 +0200
+@@ -24,6 +24,7 @@
+ #include <qlistbox.h>
+ #include <qlabel.h>
+ #include <qstatusbar.h>
++#include <qregexp.h>
+ #include "freedbconfig.h"
+ #include "freedbclient.h"
+ #include "freedbdialog.h"
+@@ -109,6 +110,7 @@
+ if (serverLayout && serverLabel && serverComboBox &&
+ cgiLabel && cgiLineEdit) {
+ static const char *serverList[] = {
++ "freedb2.org:80",
+ "freedb.freedb.org:80",
+ "at.freedb.org:80",
+ "au.freedb.org:80",
+@@ -155,6 +157,8 @@
+ client = new FreedbClient(statusBar);
+ connect(client, SIGNAL(findFinished(QString)),
+ this, SLOT(slotFindFinished(QString)));
++ connect(client, SIGNAL(findCddbAlbumFinished(QString)),
++ this, SLOT(slotFindCddbAlbumFinished(QString)));
+ connect(client, SIGNAL(albumFinished(QString)),
+ this, SLOT(slotAlbumFinished(QString)));
+ }
+@@ -315,7 +319,8 @@
+ {
+ FreedbConfig cfg;
+ getFreedbConfig(&cfg);
+- client->find(&cfg, findLineEdit->currentText());
++// client->find(&cfg, findLineEdit->currentText());
++ client->findCddbAlbum(&cfg, findLineEdit->currentText());
+ }
+
+ /**
+@@ -364,6 +369,58 @@
+ }
+
+ /**
++ * Process finished findCddbAlbum request.
++ *
++ * @param searchStr search data received
++ */
++void FreedbDialog::slotFindCddbAlbumFinished(QString searchStr)
++{
++/*
++210 exact matches found
++categ discid dtitle
++(more matches...)
++.
++or
++211 close matches found
++rock 920b810c Catharsis / Imago
++.
++theoretically, but never seen
++200 categ discid dtitle
++*/
++ QRegExp catIdTitleRe("([a-z]+)\\s+([0-9a-f]+)\\s+([^/]+ / .+)");
++ QStringList lines = QStringList::split(QRegExp("[\\r\\n]+"), searchStr);
++ bool inEntries = false;
++ albumListBox->clear();
++ for (QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it) {
++ if (*it == ".") {
++ break;
++ }
++ if (inEntries) {
++ if (catIdTitleRe.exactMatch(*it)) {
++ new AlbumListItem(
++ albumListBox,
++ catIdTitleRe.cap(3),
++ catIdTitleRe.cap(1),
++ catIdTitleRe.cap(2));
++ }
++ } else {
++ if ((*it).startsWith("21") && (*it).find(" match") != -1) {
++ inEntries = true;
++ } else if ((*it).startsWith("200 ")) {
++ if (catIdTitleRe.exactMatch((*it).mid(4))) {
++ new AlbumListItem(
++ albumListBox,
++ catIdTitleRe.cap(3),
++ catIdTitleRe.cap(1),
++ catIdTitleRe.cap(2));
++ }
++ }
++ }
++ }
++ albumListBox->setFocus();
++}
++
++/**
+ * Process finished album data.
+ *
+ * @param albumStr album track data received
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__freedbdialog.h /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.h
--- /usr/ports/audio/kid3/files/patch-kid3__freedbdialog.h Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.h Mon Nov 6 21:26:28 2006
@@ -0,0 +1,15 @@
++++ ./kid3/freedbdialog.h 2006-02-23 22:39:28.000000000 +0100
++++ ./kid3/freedbdialog.h 2006-10-07 17:19:08.000000000 +0200
+@@ -117,6 +117,12 @@
+ */
+ void slotFindFinished(QString searchStr);
+ /**
++ * Process finished findCddbAlbum request.
++ *
++ * @param searchStr search data received
++ */
++ void slotFindCddbAlbumFinished(QString searchStr);
++ /**
+ * Process finished album data.
+ *
+ * @param albumStr album track data received
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__genres.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__genres.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.cpp Sat Sep 23 01:30:28 2006
@@ -0,0 +1,11 @@
+--- ./kid3/genres.cpp.orig Thu May 25 19:58:19 2006
++++ ./kid3/genres.cpp Sat Sep 23 01:28:25 2006
+@@ -385,7 +385,7 @@
+ * @return genre number, 255 for unknown index.
+ */
+
+-int Genres::getNumber(QString &str)
++int Genres::getNumber(const QString &str)
+ {
+ for (int i = 0; i < Genres::count + 1; i++) {
+ if (QString(genre[i]) == str) {
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__genres.h /home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.h
--- /usr/ports/audio/kid3/files/patch-kid3__genres.h Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.h Sat Sep 23 01:30:28 2006
@@ -0,0 +1,11 @@
+--- ./kid3/genres.h.orig Thu Jan 5 21:15:20 2006
++++ ./kid3/genres.h Sat Sep 23 01:28:25 2006
+@@ -46,7 +46,7 @@
+ *
+ * @return genre number, 255 for unknown index.
+ */
+- static int getNumber(QString &str);
++ static int getNumber(const QString &str);
+ /** Number of genres */
+ #if defined _WIN32 || defined WIN32
+ enum { count = 148 };
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__id3form.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__id3form.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__id3form.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__id3form.cpp Sat Sep 23 01:30:28 2006
@@ -0,0 +1,11 @@
+--- ./kid3/id3form.cpp.orig Sat Jun 17 14:46:00 2006
++++ ./kid3/id3form.cpp Sat Sep 23 01:28:25 2006
+@@ -588,7 +588,7 @@
+ st->track = trackV2CheckBox->isChecked() ? trackV2SpinBox->value()
+ : -1;
+ st->genre = genreV2CheckBox->isChecked() ?
+- Genres::getNumber(genreV2ComboBox->currentItem()) : -1;
++ Genres::getNumber(genreV2ComboBox->currentText()) : -1;
+ st->genreStr = st->genre == 0xff ? genreV2ComboBox->currentText()
+ : QString::null;
+ }
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__mp3file.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__mp3file.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__mp3file.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__mp3file.cpp Sat Sep 23 01:30:29 2006
@@ -0,0 +1,14 @@
+--- ./kid3/mp3file.cpp.orig Thu Jan 5 21:15:21 2006
++++ ./kid3/mp3file.cpp Sat Sep 23 01:28:25 2006
+@@ -365,6 +365,11 @@
+ if (!ok || n > 0xff) {
+ n = 0xff;
+ }
++ } else {
++ // ID3v2 genres can be stored as "(9)", "(9)Metal" or "Metal".
++ // If the string does not start with '(', try to get the genre number
++ // from a string containing a genre text.
++ n = Genres::getNumber(str);
+ }
+ return n;
+ }
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__musicbrainzclient.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__musicbrainzclient.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.cpp Sat Sep 23 01:30:28 2006
@@ -0,0 +1,356 @@
+--- ./kid3/musicbrainzclient.cpp.orig Tue Jun 6 00:18:36 2006
++++ ./kid3/musicbrainzclient.cpp Sat Sep 23 01:27:55 2006
+@@ -17,10 +17,161 @@
+ #define I18N_NOOP(s) QT_TR_NOOP(s)
+ #endif
+ #include <qfile.h>
++#if HAVE_TUNEPIMP >= 5
++#include <qsocket.h>
++#include <qdom.h>
++#endif
+ #include "musicbrainzconfig.h"
+ #include "freedbclient.h"
+ #include "importtrackdata.h"
+
++#if HAVE_TUNEPIMP >= 5
++/**
++ * Constructor.
++ *
++ * @param numFiles number of files to be queried
++ * @param serverName server name
++ * @param serverPort server port
++ * @param proxyName proxy name, empty if no proxy
++ * @param proxyPort proxy port
++ */
++LookupQuery::LookupQuery(int numFiles,
++ const QString& serverName, Q_UINT16 serverPort,
++ const QString& proxyName, Q_UINT16 proxyPort) :
++ m_numFiles(numFiles), m_serverName(serverName), m_serverPort(serverPort),
++ m_proxyName(proxyName), m_proxyPort(proxyPort),
++ m_currentFile(-1), m_fileQueries(new FileQuery[numFiles]),
++ m_sock(new QSocket)
++{
++ for (int i = 0; i < m_numFiles; ++i) {
++ m_fileQueries[i].requested = false;
++ m_fileQueries[i].puid = "";
++ }
++ connect(m_sock, SIGNAL(connected()),
++ this, SLOT(socketConnected()));
++ connect(m_sock, SIGNAL(error(int)),
++ this, SLOT(socketError()));
++ connect(m_sock, SIGNAL(connectionClosed()),
++ this, SLOT(socketConnectionClosed()));
++}
++
++/**
++ * Destructor.
++ */
++LookupQuery::~LookupQuery()
++{
++ m_sock->close();
++ m_sock->disconnect();
++ delete m_sock;
++ delete [] m_fileQueries;
++}
++
++/**
++ * Connect to server to query information about the current file.
++ */
++void LookupQuery::socketQuery()
++{
++ if (m_currentFile >= 0 && m_currentFile < m_numFiles) {
++ QString destName = m_proxyName.isEmpty() ? m_serverName : m_proxyName;
++ Q_UINT16 destPort = m_proxyName.isEmpty() ? m_serverPort : m_proxyPort;
++ m_request = "GET http://";
++ m_request += m_serverName;
++ if (m_serverPort != 80) {
++ m_request += ':';
++ m_request += QString::number(m_serverPort);
++ }
++ m_request += "/ws/1/track/?type=xml&puid=";
++ m_request += m_fileQueries[m_currentFile].puid;
++ m_request += " HTTP/1.0\r\nHost: ";
++ m_request += m_serverName;
++ m_request += "\r\nUser-agent: Kid3/" VERSION "\r\n\r\n";
++ m_sock->connectToHost(destName, destPort);
++ m_fileQueries[m_currentFile].requested = true;
++ }
++}
++
++/**
++ * Query the next file.
++ */
++void LookupQuery::queryNext()
++{
++ // handle the first pending query
++ for (int i = 0; i < m_numFiles; ++i) {
++ if (!m_fileQueries[i].requested &&
++ !m_fileQueries[i].puid.isEmpty()) {
++ m_currentFile = i;
++ socketQuery();
++ return;
++ }
++ }
++ // no pending query => socketQuery() will be done in next query()
++ m_currentFile = -1;
++}
++
++/**
++ * Query a PUID from the server.
++ *
++ * @param puid PUID
++ * @param index index of file
++ */
++void LookupQuery::query(const char* puid, int index)
++{
++ m_fileQueries[index].puid = QString(puid);
++ // if no request is being executed, start the current request
++ if (m_currentFile < 0 || m_currentFile >= m_numFiles ||
++ !m_fileQueries[m_currentFile].requested) {
++ m_currentFile = index;
++ socketQuery();
++ }
++}
++
++/**
++ * Send query when the socket is connected.
++ */
++void LookupQuery::socketConnected()
++{
++ m_sock->writeBlock(m_request.latin1(), m_request.length());
++}
++
++/**
++ * Error on socket connection.
++ */
++void LookupQuery::socketError()
++{
++ queryNext();
++}
++
++/**
++ * Read received data when the server has closed the connection.
++ */
++void LookupQuery::socketConnectionClosed()
++{
++ Q_ULONG len = m_sock->bytesAvailable();
++ QCString buf;
++ buf.resize(len + 1 );
++ m_sock->readBlock(buf.data(), len);
++ m_sock->close();
++
++ int xmlStart = buf.find("<?xml");
++ if (xmlStart >= 0 &&
++ m_currentFile >= 0 && m_currentFile < m_numFiles &&
++ m_fileQueries[m_currentFile].requested) {
++ emit queryResponseReceived(m_currentFile, buf.mid(xmlStart, len - xmlStart));
++ }
++ queryNext();
++}
++
++#else
++
++LookupQuery::LookupQuery(int, const QString&, Q_UINT16, const QString&, Q_UINT16) {}
++LookupQuery::~LookupQuery() {}
++void LookupQuery::socketConnected() {}
++void LookupQuery::socketError() {}
++void LookupQuery::socketConnectionClosed() {}
++
++#endif
++
++
+ /**
+ * Constructor.
+ *
+@@ -29,6 +180,9 @@
+ */
+ MusicBrainzClient::MusicBrainzClient(ImportTrackDataVector& trackDataList) :
+ m_trackDataVector(trackDataList), m_tp(0), m_ids(0), m_numFiles(0)
++#if HAVE_TUNEPIMP >= 5
++ , m_lookupQuery(0)
++#endif
+ {
+ m_tp = tp_New("kid3", VERSION);
+ #ifdef WIN32
+@@ -39,7 +193,11 @@
+ #else
+ tp_SetUseUTF8(m_tp, 1);
+ #endif
++#if HAVE_TUNEPIMP >= 5
++ tp_SetMusicDNSClientId(m_tp, "a95f5c7cd37fd4bce12dc86d196fb4fe");
++#else
+ tp_SetAutoFileLookup(m_tp, 1);
++#endif
+ tp_SetRenameFiles(m_tp, 0);
+ tp_SetMoveFiles(m_tp, 0);
+ tp_SetWriteID3v1(m_tp, 0);
+@@ -110,8 +268,13 @@
+ { eUnrecognized, I18N_NOOP("Unrecognized") },
+ { eRecognized, I18N_NOOP("Recognized") },
+ { ePending, I18N_NOOP("Pending") },
++#if HAVE_TUNEPIMP >= 5
++ { ePUIDLookup, I18N_NOOP("PUID Lookup") },
++ { ePUIDCollision, I18N_NOOP("PUID Collision") },
++#else
+ { eTRMLookup, I18N_NOOP("TRM Lookup") },
+ { eTRMCollision, I18N_NOOP("TRM Collision") },
++#endif
+ { eFileLookup, I18N_NOOP("File Lookup") },
+ { eUserSelection, I18N_NOOP("User Selection") },
+ { eVerified, I18N_NOOP("Verified") },
+@@ -163,7 +326,11 @@
+ track_t track = tp_GetTrack(m_tp, id);
+ if (track) {
+ tr_Lock(track);
++#if HAVE_TUNEPIMP >= 5
++ tr_GetPUID(track, trm, sizeof(trm));
++#else
+ tr_GetTRM(track, trm, sizeof(trm));
++#endif
+ if (trm[0] == '\0') {
+ tr_SetStatus(track, ePending);
+ tp_Wake(m_tp, track);
+@@ -189,13 +356,33 @@
+ ImportTrackData trackData;
+ getMetaData(id, trackData);
+ emit metaDataReceived(index, trackData);
+- } else if (statusCode == eTRMCollision ||
+- statusCode == eUserSelection) {
++ }
++#if HAVE_TUNEPIMP >= 5
++ else if (statusCode == ePUIDLookup ||
++ statusCode == ePUIDCollision ||
++ statusCode == eFileLookup) {
++ char puid[255];
++ puid[0] = '\0';
++ track_t track = tp_GetTrack(m_tp, id);
++ if (track) {
++ tr_Lock(track);
++ tr_GetPUID(track, puid, sizeof(puid));
++ tr_Unlock(track);
++ tp_ReleaseTrack(m_tp, track);
++ }
++ if (m_lookupQuery) {
++ m_lookupQuery->query(puid, index);
++ }
++ }
++#else
++ else if (statusCode == eTRMCollision ||
++ statusCode == eUserSelection) {
+ ImportTrackDataVector trackDataList;
+ if (getResults(id, trackDataList)) {
+ emit resultsReceived(index, trackDataList);
+ }
+ }
++#endif
+ }
+ break;
+ }
+@@ -242,6 +429,16 @@
+ m_numFiles = m_trackDataVector.count();
+ #endif
+ m_ids = new int[m_numFiles];
++#if HAVE_TUNEPIMP >= 5
++ char serverName[80], proxyName[80];
++ short serverPort, proxyPort;
++ tp_GetServer(m_tp, serverName, sizeof(serverName) - 1, &serverPort);
++ tp_GetProxy(m_tp, proxyName, sizeof(proxyName) - 1, &proxyPort);
++ m_lookupQuery = new LookupQuery(m_numFiles, serverName, serverPort,
++ proxyName, proxyPort);
++ connect(m_lookupQuery, SIGNAL(queryResponseReceived(int, const QCString&)),
++ this, SLOT(parseLookupResponse(int, const QCString&)));
++#endif
+ int i = 0;
+ for (
+ #if QT_VERSION >= 300
+@@ -271,6 +468,10 @@
+ }
+ delete [] m_ids;
+ m_ids = 0;
++#if HAVE_TUNEPIMP >= 5
++ delete m_lookupQuery;
++ m_lookupQuery = 0;
++#endif
+ m_numFiles = 0;
+ }
+ }
+@@ -308,6 +509,68 @@
+ }
+ }
+
++#if HAVE_TUNEPIMP >= 5
++
++bool MusicBrainzClient::getResults(int, ImportTrackDataVector&) {
++ return false;
++}
++
++/**
++ * Process server response with lookup data.
++ *
++ * @param index index of file
++ * @param response response from server
++ */
++void MusicBrainzClient::parseLookupResponse(int index, const QCString& response)
++{
++ ImportTrackDataVector trackDataList;
++ QDomDocument doc;
++ if (doc.setContent(response)) {
++ QDomElement trackList =
++ doc.namedItem("metadata").toElement().namedItem("track-list").toElement();
++
++ for (QDomNode trackNode = trackList.namedItem("track");
++ !trackNode.isNull();
++ trackNode = trackNode.nextSibling()) {
++ QDomElement track = trackNode.toElement();
++
++ ImportTrackData trackData;
++ trackData.artist =
++ track.namedItem("artist").toElement().namedItem("name").toElement().text();
++ trackData.title = track.namedItem("title").toElement().text();
++
++ for (QDomNode releaseNode =
++ track.namedItem("release-list").toElement().namedItem("release");
++ !releaseNode.isNull();
++ releaseNode = releaseNode.nextSibling() ) {
++ QDomElement release = releaseNode.toElement();
++
++ trackData.album = release.namedItem("title").toElement().text();
++ trackData.track = -1;
++ QDomNode releaseTrackNode = release.namedItem("track-list");
++ if (!releaseTrackNode.isNull()) {
++ QDomElement releaseTrack = releaseTrackNode.toElement();
++ if (!releaseTrack.attribute("offset").isEmpty())
++ trackData.track = releaseTrack.attribute("offset").toInt() + 1;
++ }
++ }
++ trackDataList.append(trackData);
++ }
++ }
++
++ if (trackDataList.size() > 1) {
++ emit resultsReceived(index, trackDataList);
++ emit statusChanged(index, i18n("User Selection"));
++ } else if (trackDataList.size() == 1) {
++ emit metaDataReceived(index, *trackDataList.begin());
++ emit statusChanged(index, i18n("Recognized"));
++ } else {
++ emit statusChanged(index, i18n("Unrecognized"));
++ }
++}
++
++#else
++
+ /**
+ * Get results for an ambiguous file.
+ *
+@@ -387,6 +650,10 @@
+ }
+ return resultsAvailable;
+ }
++
++void MusicBrainzClient::parseLookupResponse(int, const QCString&) {}
++
++#endif
+
+ #else // HAVE_TUNEPIMP
+
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__musicbrainzclient.h /home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.h
--- /usr/ports/audio/kid3/files/patch-kid3__musicbrainzclient.h Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.h Sat Sep 23 01:30:28 2006
@@ -0,0 +1,146 @@
+--- ./kid3/musicbrainzclient.h.orig Thu Feb 23 22:48:34 2006
++++ ./kid3/musicbrainzclient.h Sat Sep 23 01:27:55 2006
+@@ -15,7 +15,13 @@
+ #include <qobject.h>
+
+ #ifdef HAVE_TUNEPIMP
++#if HAVE_TUNEPIMP >= 5
++#include <qbuffer.h>
++#include <tunepimp-0.5/tp_c.h>
++class QSocket;
++#else
+ #include <tunepimp/tp_c.h>
++#endif
+ #endif // HAVE_TUNEPIMP
+
+ class MusicBrainzConfig;
+@@ -23,6 +29,103 @@
+ class ImportTrackDataVector;
+
+ /**
++ * A HTTP query to a musicbrainz server for HAVE_TUNEPIMP >= 5.
++ */
++class LookupQuery : public QObject {
++Q_OBJECT
++
++public:
++ /**
++ * Constructor.
++ *
++ * @param numFiles number of files to be queried
++ * @param serverName server name
++ * @param serverPort server port
++ * @param proxyName proxy name, empty if no proxy
++ * @param proxyPort proxy port
++ */
++ LookupQuery(int numFiles,
++ const QString& serverName, Q_UINT16 serverPort = 80,
++ const QString& proxyName = "", Q_UINT16 proxyPort = 80);
++
++ /**
++ * Destructor.
++ */
++ virtual ~LookupQuery();
++
++#if HAVE_TUNEPIMP >= 5
++ /**
++ * Query a PUID from the server.
++ *
++ * @param puid PUID
++ * @param index index of file
++ */
++ void query(const char* puid, int index);
++#endif
++
++signals:
++ /**
++ * Emitted when the query response is received
++ */
++ void queryResponseReceived(int, const QCString&);
++
++private slots:
++ /**
++ * Send query when the socket is connected.
++ */
++ void socketConnected();
++
++ /**
++ * Error on socket connection.
++ */
++ void socketError();
++
++ /**
++ * Read received data when the server has closed the connection.
++ */
++ void socketConnectionClosed();
++
++#if HAVE_TUNEPIMP >= 5
++private:
++ /**
++ * Connect to server to query information about the current file.
++ */
++ void socketQuery();
++
++ /**
++ * Query the next file.
++ */
++ void queryNext();
++
++ struct FileQuery {
++ bool requested;
++ QString puid;
++ };
++
++ /** Number of files to be queried. */
++ int m_numFiles;
++ /** MusicBrainz server */
++ QString m_serverName;
++ /** Port of MusicBrainz server */
++ Q_UINT16 m_serverPort;
++ /** Proxy */
++ QString m_proxyName;
++ /** Port of proxy */
++ Q_UINT16 m_proxyPort;
++ /**
++ * -1 if not yet started,
++ * 0..m_numFiles-1 if a file is currently processed,
++ * >=m_numFiles if all files processed.
++ */
++ int m_currentFile;
++ FileQuery* m_fileQueries;
++ QSocket* m_sock;
++ QString m_request;
++#endif
++};
++
++
++/**
+ * MusicBrainz client.
+ */
+ class MusicBrainzClient : public QObject
+@@ -85,6 +188,15 @@
+ */
+ void resultsReceived(int, ImportTrackDataVector&);
+
++private slots:
++ /**
++ * Process server response with lookup data.
++ *
++ * @param index index of file
++ * @param response response from server
++ */
++ void parseLookupResponse(int index, const QCString& response);
++
+ #ifdef HAVE_TUNEPIMP
+ private:
+ /**
+@@ -126,6 +238,9 @@
+ tunepimp_t m_tp;
+ int* m_ids;
+ int m_numFiles;
++#if HAVE_TUNEPIMP >= 5
++ LookupQuery* m_lookupQuery;
++#endif
+ #endif // HAVE_TUNEPIMP
+ };
+
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-kid3__oggfile.cpp /home/makc/porting/ports/audio/kid3/files/patch-kid3__oggfile.cpp
--- /usr/ports/audio/kid3/files/patch-kid3__oggfile.cpp Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-kid3__oggfile.cpp Sat Sep 23 01:30:28 2006
@@ -0,0 +1,11 @@
+--- ./kid3/oggfile.cpp.orig Fri Jan 27 21:15:27 2006
++++ ./kid3/oggfile.cpp Sat Sep 23 01:27:49 2006
+@@ -143,7 +143,7 @@
+ bool setUtime = false;
+ struct utimbuf times;
+ if (preserve) {
+- int fd = ::fileno(fpIn);
++ int fd = fileno(fpIn);
+ if (fd >= 0) {
+ struct stat fileStat;
+ if (::fstat(fd, &fileStat) == 0) {
diff -ruN --exclude=CVS /usr/ports/audio/kid3/files/patch-po__Makefile.in /home/makc/porting/ports/audio/kid3/files/patch-po__Makefile.in
--- /usr/ports/audio/kid3/files/patch-po__Makefile.in Thu Jan 1 03:00:00 1970
+++ /home/makc/porting/ports/audio/kid3/files/patch-po__Makefile.in Sat Sep 23 01:30:28 2006
@@ -0,0 +1,28 @@
+--- ./po/Makefile.in.orig Tue Jun 27 23:34:40 2006
++++ ./po/Makefile.in Sat Sep 23 01:27:55 2006
+@@ -297,7 +297,7 @@
+ #>+ 3
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu po/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/po/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit po/Makefile.in
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+@@ -451,7 +451,6 @@
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+
+-
+ #>+ 2
+ KDE_DIST=ru.gmo de.po de.gmo es.po es.gmo kid3.pot ru.po Makefile.in
+
+@@ -511,7 +510,7 @@
+ force-reedit:
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu po/Makefile
+- cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/po/Makefile.in
++ cd $(top_srcdir) && perl admin/am_edit po/Makefile.in
+
+
+ #>+ 21
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list