Hello community,
here is the log from the commit of package fusepod
checked in at Mon Oct 2 14:57:48 CEST 2006.
--------
--- fusepod/fusepod.changes 2006-07-04 08:23:41.000000000 +0200
+++ /mounts/work_src_done/STABLE/fusepod/fusepod.changes 2006-10-01 14:58:41.000000000 +0200
@@ -1,0 +2,10 @@
+Sun Oct 1 14:56:49 CEST 2006 - cthiel@suse.de
+
+- update to version 0.5.1
+ * Fixed crash in autodetecting.
+ * Adds orphaned files to the iTunesDB on startup
+ * When copying a file into the transfer directory it will updates the
+ filesystem at the same time.
+ * Added more extended attributes.
+
+-------------------------------------------------------------------
Old:
----
fusepod-0.5.tar.bz2
New:
----
fusepod-0.5.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fusepod.spec ++++++
--- /var/tmp/diff_new_pack.yC03ja/_old 2006-10-02 14:57:16.000000000 +0200
+++ /var/tmp/diff_new_pack.yC03ja/_new 2006-10-02 14:57:16.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package fusepod (Version 0.5)
+# spec file for package fusepod (Version 0.5.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,8 +13,8 @@
Name: fusepod
BuildRequires: fuse-devel gcc-c++ libgpod-devel pkgconfig taglib-devel
Summary: FUSEPod is a virtual user-space filesystem that mounts your iPod
-Version: 0.5
-Release: 2
+Version: 0.5.1
+Release: 1
License: GPL, LGPL
Group: System/Filesystems
Source: %{name}-%{version}.tar.bz2
@@ -34,7 +34,7 @@
Keegan Carrruthers-Smith
%prep
-%setup
+%setup -q
%build
autoreconf -fi
@@ -55,6 +55,13 @@
%{_mandir}/man1/fusepod.1.gz
%changelog -n fusepod
+* Sun Oct 01 2006 - cthiel@suse.de
+- update to version 0.5.1
+ * Fixed crash in autodetecting.
+ * Adds orphaned files to the iTunesDB on startup
+ * When copying a file into the transfer directory it will updates the
+ filesystem at the same time.
+ * Added more extended attributes.
* Tue Jul 04 2006 - cthiel@suse.de
- fix BuildRequires (s/pkg-config/pkgconfig/)
* Thu Jun 29 2006 - cthiel@suse.de
++++++ fusepod-0.5.tar.bz2 -> fusepod-0.5.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/ChangeLog new/fusepod-0.5.1/ChangeLog
--- old/fusepod-0.5/ChangeLog 2006-06-26 23:19:54.000000000 +0200
+++ new/fusepod-0.5.1/ChangeLog 2006-08-07 16:40:04.000000000 +0200
@@ -1,3 +1,20 @@
+2006-08-07
+
+ * src/fusepod.cpp: Fixed crash in autodetecting.
+
+2006-07-03
+
+ * src/fusepod_ipod.cpp: Adds orphaned files to the iTunesDB on startup
+
+2006-06-30
+
+ * src/fusepod.cpp: When copying a file into the transfer directory it will updates the filesystem
+ at the same time.
+
+2006-06-29
+
+ * src/fusepod.cpp: Added more extended attributes.
+
2006-06-26
* src/fusepod_ipod.cpp: iPod finder is now aware if there is more than one iPod already mounted
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/TODO new/fusepod-0.5.1/TODO
--- old/fusepod-0.5/TODO 2006-06-27 23:25:21.000000000 +0200
+++ new/fusepod-0.5.1/TODO 2006-06-30 13:44:32.000000000 +0200
@@ -9,7 +9,8 @@
* Configurable Layout
* Transparent copying of mp3s
+ Short-term: In transfer folder
- * Mid-term: Anywhere and auto-updating filesystem
+ * Mid-term: Anywhere
+ + Mid-term: Auto-updating filesystem
* Copying files into certian folders updates tags
+ Implement libgpod and taglib
* Have more actions to perform on ipod
@@ -26,7 +27,7 @@
* Certian genre's have bookmark switched on in iTunesDB
* Extended Attributes
+ tags
- * iPod stats (Playcount...)
+ + iPod stats (Playcount...)
* Change tags
+ Finding mountpoint: If /proc/mounts doesn't exist, try /etc/mtab
* Video, photo and cd cover support
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/configure new/fusepod-0.5.1/configure
--- old/fusepod-0.5/configure 2006-06-26 23:47:12.000000000 +0200
+++ new/fusepod-0.5.1/configure 2006-08-07 16:42:37.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for fusepod 0.5.
+# Generated by GNU Autoconf 2.59 for fusepod 0.5.1.
#
# Report bugs to >.
#
@@ -269,8 +269,8 @@
# Identity of this package.
PACKAGE_NAME='fusepod'
PACKAGE_TARNAME='fusepod'
-PACKAGE_VERSION='0.5'
-PACKAGE_STRING='fusepod 0.5'
+PACKAGE_VERSION='0.5.1'
+PACKAGE_STRING='fusepod 0.5.1'
PACKAGE_BUGREPORT='Keegan Carruthers-Smith '
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE PKG_CONFIG ac_pt_PKG_CONFIG FUSE_CFLAGS FUSE_LIBS libgpod_CFLAGS libgpod_LIBS TAGLIB_CONFIG taglib_CFLAGS taglib_LIBS LIBOBJS LTLIBOBJS'
@@ -766,7 +766,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures fusepod 0.5 to adapt to many kinds of systems.
+\`configure' configures fusepod 0.5.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -828,7 +828,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of fusepod 0.5:";;
+ short | recursive ) echo "Configuration of fusepod 0.5.1:";;
esac
cat <<\_ACEOF
@@ -955,7 +955,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-fusepod configure 0.5
+fusepod configure 0.5.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -969,7 +969,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by fusepod $as_me 0.5, which was
+It was created by fusepod $as_me 0.5.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1612,7 +1612,7 @@
# Define the identity of the package.
PACKAGE='fusepod'
- VERSION='0.5'
+ VERSION='0.5.1'
cat >>confdefs.h <<_ACEOF
@@ -3372,7 +3372,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by fusepod $as_me 0.5, which was
+This file was extended by fusepod $as_me 0.5.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3430,7 +3430,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-fusepod config.status 0.5
+fusepod config.status 0.5.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/configure.ac new/fusepod-0.5.1/configure.ac
--- old/fusepod-0.5/configure.ac 2006-06-26 23:20:18.000000000 +0200
+++ new/fusepod-0.5.1/configure.ac 2006-08-07 16:42:25.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT([fusepod], [0.5],
+AC_INIT([fusepod], [0.5.1],
[Keegan Carruthers-Smith ])
AM_INIT_AUTOMAKE
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/src/fusepod.cpp new/fusepod-0.5.1/src/fusepod.cpp
--- old/fusepod-0.5/src/fusepod.cpp 2006-06-27 00:09:38.000000000 +0200
+++ new/fusepod-0.5.1/src/fusepod.cpp 2006-08-07 16:39:18.000000000 +0200
@@ -47,6 +47,7 @@
/* I know globals are regarded as bad, but I'm lazy */
static FUSEPod * fusepod;
static string fuse_mount_point;
+static string ipod_mount_point;
static string sync_script;
static string add_files_script;
static char * add_songs;
@@ -338,11 +339,11 @@
truncate (add_songs, 0);
/* Recursively add songs in transfer */
- string transfer_path = "/" + dir_transfer;
+ /*string transfer_path = "/" + dir_transfer;
Node * transfer_node = fusepod->get_node ( ("/" + dir_transfer).c_str() );
transfer_add_songs (transfer_node, transfer_path);
- transfer_remove_empty_dirs (transfer_node, transfer_path, false);
+ transfer_remove_empty_dirs (transfer_node, transfer_path, false);*/
currently_syncing = "iTunesDB";
cout << "Syncing database... ";
@@ -447,6 +448,30 @@
return 0;
}
+#define XATTRS gint32 _playcount = (gint32) track->playcount; \
+ gint32 _rating = track->rating / 20; \
+ const void * xattrs [14][2] = { \
+ {"tag.title", track->title}, \
+ {"tag.artist", track->artist}, \
+ {"tag.album", track->album}, \
+ {"tag.genre", track->genre}, \
+ {"tag.comment", track->comment}, \
+ {"tag.composer", track->composer}, \
+ {"tag.description", track->description}, \
+ {"tag.podcasturl", track->podcasturl}, \
+ {"tag.podcastrss", track->podcastrss}, \
+\
+ {"tag.track", &track->track_nr}, \
+ {"tag.length", &track->tracklen}, \
+ {"tag.year", &track->year}, \
+ {"tag.playcount", &_playcount}, \
+ {"tag.rating", &_rating} \
+ };
+
+#define XATTRS_LEN 14
+#define XATTRS_NUM 9
+
+
static int fusepod_listxattr (const char * path, char * attrs, size_t size) {
Node * node = fusepod->get_node (path);
if (!node)
@@ -458,36 +483,24 @@
size_t count = 0, pos = 0;
Track * track = node->value.track;
- string track_num = fusepod_int_to_string (track->track_nr);
+ XATTRS
- const char * tags [7][2] = {
- {"tag.title", track->title},
- {"tag.artist", track->artist},
- {"tag.album", track->album},
- {"tag.genre", track->genre},
- {"tag.comment", track->comment},
- {"tag.composer", track->composer},
- {"tag.track", track_num.c_str()}
- };
-
- for (int i = 0; i < 7; i++) {
- if (!tags [i][1])
+ for (int i = 0; i < XATTRS_LEN; i++) {
+ if (i < XATTRS_NUM && !xattrs [i][1])
continue;
- if (pos < size) {
- size_t len = strlen (tags [i][0]) + 1;
+ size_t len = strlen ((char*)xattrs [i][0]) + 1;
- if (size == 0) {
- count += len;
- continue;
- }
-
- if (len > size + pos)
- return -ERANGE;
-
- memcpy (attrs + pos, tags [i][0], len);
- pos += len;
+ if (size == 0) {
+ count += len;
+ continue;
}
+
+ if (len > size + pos)
+ return -ERANGE;
+
+ memcpy (attrs + pos, xattrs [i][0], len);
+ pos += len;
}
return size == 0 ? count : pos;
@@ -503,34 +516,42 @@
Track * track = node->value.track;
- string track_num = fusepod_int_to_string (track->track_nr);
+ XATTRS
- const char * tags [7][2] = {
- {"tag.title", track->title},
- {"tag.artist", track->artist},
- {"tag.album", track->album},
- {"tag.genre", track->genre},
- {"tag.comment", track->comment},
- {"tag.composer", track->composer},
- {"tag.track", track_num.c_str()}
- };
-
- for (int i = 0; i < 7; i++) {
- if (strcmp (tags [i][0], attr) != 0)
+ for (int i = 0; i < XATTRS_LEN; i++) {
+ if (strcmp ((char*)xattrs [i][0], attr) != 0)
continue;
- if (!tags [i][1])
+ if (!xattrs [i][1])
return -EACCES; //-ENOATTR;
-
- size_t len = strlen (tags [i][1]) + 1;
- if (size == 0)
+ char * val;
+
+ if (i < XATTRS_NUM) {
+ val = (char*)xattrs[i][1];
+ }
+ else {
+ val = new char [11]; //Max length of gint32 string is 10
+ snprintf (val, 11, "%d", *(gint32*)(xattrs[i][1]));
+ val [10] = 0;
+ }
+
+ size_t len = strlen (val) + 1;
+
+ if (size == 0) {
+ if (i >= XATTRS_NUM) delete val;
return len;
+ }
- if (len > size)
+ if (len > size) {
+ if (i >= XATTRS_NUM) delete val;
return -ERANGE;
+ }
+
+ strcpy (buf, val);
- strcpy (buf, tags [i][1]);
+ if (i >= XATTRS_NUM)
+ delete val;
return len;
}
@@ -579,6 +600,20 @@
if (node)
node->value.mode = S_IFREG | 0444;
+ //TODO: Add the songs here
+ currently_syncing = fusepod->get_transfer_path (path);
+ cout << "Adding track " << currently_syncing << "... ";
+ Track * track = fusepod->upload_song (currently_syncing, false);
+ if (track)
+ cout << "Successful" << endl;
+ else
+ cout << "Failed" << endl;
+
+ transfer_remove (path);
+
+ if (track)
+ fusepod->add_track (track);
+
return 0;
}
@@ -618,7 +653,7 @@
}
if (config)
- cout << "Reading configuration file" << endl;
+ cout << "Reading configuration file " << endl;
else
config = new istringstream (default_config_file);
@@ -645,10 +680,8 @@
vector<string> pd = get_string_desc ();
- string mountpoint = FUSEPod::discover_ipod ();
-
- cout << "Reading iPod at " << mountpoint << endl;
- fusepod = new FUSEPod (mountpoint, pd);
+ cout << "Reading iPod at " << ipod_mount_point << endl;
+ fusepod = new FUSEPod (ipod_mount_point, pd);
cout << "Finished reading iPod" << endl;
/* These are special extensions to the filesystem for adding songs to the iPod*/
@@ -739,7 +772,7 @@
static struct fuse_operations fusepod_oper;
int main (int argc, char **argv) {
-
+ //TODO Apparantly error messages aren't clear enough
if (argc > 1) {
/* This finds out were the mount point is so that any app can use it.
Note that it may contain ../ and ./ in it */
@@ -759,9 +792,9 @@
if (strcmp (argv [i], "--help") == 0 || strcmp (argv [i], "-h") == 0)
found = true;
- string discover_ipod = FUSEPod::discover_ipod ();
+ ipod_mount_point = FUSEPod::discover_ipod ();
- if (!found && discover_ipod == "") {
+ if (!found && ipod_mount_point == "") {
cerr << "ERROR: Cannot find the iPod mount point.\n";
cerr << "This may happen because the iPod is not mounted or you have not created an itunes database yet\n";
cerr << "Please specifiy the mount point through the enviroment variable IPOD_DIR\n";
@@ -773,7 +806,7 @@
char * ipod_dir = getenv ("IPOD_DIR");
if (!ipod_dir) ipod_dir = getenv ("IPOD_MOUNTPOINT");
- if (!found && ipod_dir && discover_ipod == ipod_dir &&
+ if (!found && ipod_dir && ipod_mount_point == ipod_dir &&
access ( (string (ipod_dir) + ITUNESDB_PATH).c_str (), F_OK ) != 0) { // Checks for itunesdb
cerr << "ERROR: Cannot find the iTunesDB in the directory specified by the IPOD_DIR or IPOD_MOUNTPOINT environment variable.\n";
cerr << "Do you want to create the iTunesDB in the specified directory? (y/n): ";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/src/fusepod_ipod.cpp new/fusepod-0.5.1/src/fusepod_ipod.cpp
--- old/fusepod-0.5/src/fusepod_ipod.cpp 2006-06-27 00:07:06.000000000 +0200
+++ new/fusepod-0.5.1/src/fusepod_ipod.cpp 2006-08-08 23:28:23.000000000 +0200
@@ -29,6 +29,7 @@
#include
#include
#include
+#include
}
using namespace std;
@@ -84,6 +85,8 @@
itdb_set_mountpoint (ipod, mount_point.c_str ());
}
+ add_orphaned_tracks ();
+
this->num_tracks = g_list_length (ipod->tracks);
this->num_playlists = g_list_length (ipod->playlists);
@@ -126,8 +129,9 @@
ifstream stats ( (dir + "/" + filename_stats).c_str() );
string line;
- while (stats) {
+ while (stats) {//TODO Check if this causes a crash
getline (stats, line);
+ cout << line << endl;
if (!fusepod_starts_with (line.c_str(), "Real Mountpoint: "))
continue;
@@ -141,7 +145,7 @@
fin.close ();
for (vector<string>::iterator it = possible.begin(); it != possible.end(); ++it)
- if (already_mounted.find (*it) != already_mounted.end())
+ if (already_mounted.find (*it) == already_mounted.end())
return *it;
if (possible.size () > 0) {
@@ -428,6 +432,11 @@
return stats.str ();
}
+void FUSEPod::add_track (Track * track) {
+ for (unsigned int a = 0; a < paths_descs.size (); a++)
+ add_track (track, paths_descs [a]);
+}
+
string FUSEPod::get_track_val (Track * track, char symbol) {
string val = "Unknown";
size_t pos;
@@ -590,6 +599,76 @@
}
}
+/**
+ * Adds all files that are not in the itdb but are in the music dir
+ */
+void FUSEPod::add_orphaned_tracks () {
+ //TODO FIX THIS CODE
+ if (true)
+ return;
+ set<string> files_in_itdb;
+
+ for (GList * i=ipod->tracks; i; i=i->next) {
+ Track * track = (Track*) i->data;
+
+ if (track->ipod_path) {
+ gchar * str = strdup (track->ipod_path);
+ int pos = strlen (str);
+ int count = 0;
+
+ for (; pos >= 0 && count < 2; pos--)
+ if (str[pos] == ':') {
+ count++;
+ str [pos] = '/';
+ }
+
+ pos++;
+
+ string s = &(str[pos]);
+ free (str);
+
+ if (count != 2)
+ continue;
+
+ files_in_itdb.insert (s);
+ }
+ }
+
+ DIR * music = opendir ( (mount_point + "/iPod_Control/Music").c_str() );
+
+ struct dirent * dir_ent;
+
+ while (dir_ent = readdir (music)) {
+ if (strcmp(dir_ent->d_name, ".") == 0 ||
+ strcmp(dir_ent->d_name, "..") == 0)
+ continue;
+
+ DIR * subdir = opendir ( (mount_point + "/iPod_Control/Music/" + dir_ent->d_name).c_str() );
+
+ if (!subdir)
+ continue;
+
+ struct dirent * subdir_ent;
+
+ while (subdir_ent = readdir (subdir)) {
+ if (strcmp(subdir_ent->d_name, ".") == 0 ||
+ strcmp(subdir_ent->d_name, "..") == 0)
+ continue;
+
+ string path = "/" + string(dir_ent->d_name) + "/" + subdir_ent->d_name;
+
+ if (files_in_itdb.find (path) == files_in_itdb.end ()) {
+ upload_song (mount_point + "/iPod_Control/Music" + path, false);
+ cout << path << " is not in the iTunesDB. Adding" << endl;
+ }
+ }
+
+ closedir (subdir);
+ }
+
+ closedir (music);
+}
+
bool FUSEPod::move_file (const string & path, Track * track) {
string subdir = mount_point + "/iPod_Control/Music/F";
string ext (path, path.rfind('.')+1, path.size()-1);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusepod-0.5/src/fusepod_ipod.h new/fusepod-0.5.1/src/fusepod_ipod.h
--- old/fusepod-0.5/src/fusepod_ipod.h 2006-06-27 00:06:53.000000000 +0200
+++ new/fusepod-0.5.1/src/fusepod_ipod.h 2006-07-03 20:18:53.000000000 +0200
@@ -176,6 +176,11 @@
*/
string get_statistics ();
+ /**
+ * Adds a track to FUSEPod filesystem layout.
+ */
+ void add_track (Track * track);
+
IPod * ipod;
Node * root;
string mount_point;
@@ -191,6 +196,7 @@
void add_playlists ();
void add_all_tracks ();
bool move_file (const string & path, Track * track);
+ void add_orphaned_tracks ();
bool syncing;
string syncing_file;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org