commit 8588279046e21530df29e53a5a8d8cc25278baec
Author: Christophe Fergeau <[email protected]>
Date: Mon Oct 19 23:26:18 2009 +0200
add iPhone support to ipod-read-sysinfoextended
tools/Makefile.am | 18 +++++++++----
...foextended-sgutils.c => read-sysinfoextended.c} | 25 +++++++++++++++++--
2 files changed, 34 insertions(+), 9 deletions(-)
---
diff --git a/tools/Makefile.am b/tools/Makefile.am
index efc4591..ee6cf1e 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,10 +1,16 @@
-if HAVE_SGUTILS
bin_PROGRAMS=ipod-read-sysinfo-extended
-ipod_read_sysinfo_extended_SOURCES = \
- read-sysinfoextended-sgutils.c \
- ipod-scsi.c
-ipod_read_sysinfo_extended_CFLAGS=$(LIBGPOD_CFLAGS) $(SGUTILS_CFLAGS)
-I$(top_srcdir)/src
-ipod_read_sysinfo_extended_LDADD=$(LIBGPOD_LIBS) $(SGUTILS_LIBS)
$(top_builddir)/src/libgpod.la
+ipod_read_sysinfo_extended_SOURCES = read-sysinfoextended.c
+ipod_read_sysinfo_extended_CFLAGS=$(LIBGPOD_CFLAGS) -I$(top_srcdir)/src
+ipod_read_sysinfo_extended_LDADD=$(LIBGPOD_LIBS) $(top_builddir)/src/libgpod.la
+if HAVE_SGUTILS
+ipod_read_sysinfo_extended_SOURCES+=ipod-scsi.c
+ipod_read_sysinfo_extended_CFLAGS+=$(SGUTILS_CFLAGS)
+ipod_read_sysinfo_extended_LDADD+=$(SGUTILS_LIBS)
+endif
+if HAVE_LIBIPHONE
+ipod_read_sysinfo_extended_SOURCES+=ipod-lockdown.c
+ipod_read_sysinfo_extended_CFLAGS+=$(LIBIPHONE_CFLAGS)
+ipod_read_sysinfo_extended_LDADD+=$(LIBIPHONE_LIBS)
endif
if HAVE_HAL
diff --git a/tools/read-sysinfoextended-sgutils.c b/tools/read-sysinfoextended.c
similarity index 74%
rename from tools/read-sysinfoextended-sgutils.c
rename to tools/read-sysinfoextended.c
index 42a4665..f1a2830 100644
--- a/tools/read-sysinfoextended-sgutils.c
+++ b/tools/read-sysinfoextended.c
@@ -27,8 +27,12 @@
#include <glib/gi18n.h>
#include "itdb.h"
-
+#ifdef HAVE_SGUTILS
extern char *read_sysinfo_extended (const char *device);
+#endif
+#ifdef HAVE_LIBIPHONE
+extern char *read_sysinfo_extended_by_uuid (const char *uuid);
+#endif
int
main (int argc, char **argv)
@@ -36,11 +40,26 @@ main (int argc, char **argv)
char *xml;
if (argc < 3) {
- g_print (_("usage: %s <device> <mountpoint>\n"), g_basename (argv[0]));
+ g_print (_("usage: %s <device|uuid> <mountpoint>\n"), g_basename
(argv[0]));
return 1;
}
- xml = read_sysinfo_extended (argv[1]);
+ if (*argv[1] == '/') {
+ /* assume it's a device name */
+#ifdef HAVE_SGUTILS
+ xml = read_sysinfo_extended (argv[1]);
+#else
+ g_warning ("Compiled without sgutils support, can't read
SysInfoExtended from a device");
+#endif
+ } else {
+ /* argument doesn't look like a filename, might be an UUID */
+#ifdef HAVE_LIBIPHONE
+ xml = read_sysinfo_extended_by_uuid (argv[1]);
+#else
+ g_warning ("Compiled without libiphone support, can't read
SysInfoExtended from an iPhone UUID");
+#endif
+ }
+
if (xml == NULL) {
g_print (_("Couldn't read xml sysinfo from %s\n"), argv[1]);
return 1;
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2