Package: eyefiserver
Version: 2.3~rc2+dfsg-1
Severity: wishlist
Tags: patch

--- Please enter the report below this line. ---

EyeFi puts its own logs into the tarfiles, which are of little use and just 
litter the upload directory. Proposed patch corrects this behavior.

--- System information. ---
Architecture: amd64
Kernel:       Linux 3.14.12-custom0-amd64

Debian Release: jessie/sid
  990 stable          security.debian.org 
  990 stable          kxstudio.sourceforge.net 
  990 stable          ftp.fi.debian.org 
  990 stable          dl.google.com 
  990 stable          deb.torproject.org 
  500 testing         security.debian.org 
  500 testing         ftp.fi.debian.org 
  500 testing         deb.torproject.org 
  500 lucid           ppa.launchpad.net 
  100 unstable        deb.i2p2.no 
  100 jessie-backports ftp.debian.org 

--- Package information. ---
Depends      (Version) | Installed
======================-+-===========
python                 | 2.7.8-1


Package's Recommends field is empty.

Package's Suggests field is empty.


diff -uri a/etc/eyefiserver.conf b/etc/eyefiserver.conf
--- a/etc/eyefiserver.conf	2012-10-17 19:44:55.000000000 +0600
+++ b/etc/eyefiserver.conf	2014-07-27 17:33:31.000000000 +0600
@@ -34,6 +34,10 @@
 
 use_date_from_file=no
 
+# Should we extract EyeFi logs from image tarfile.
+# They are of little use usually, so default is 'no'.
+
+#extract_logs=yes
 
 # This parameter executes the specified command on each incoming file passing in
 # the full file path as the first argument.
diff -uri a/src/eyefiserver b/src/eyefiserver
--- a/src/eyefiserver	2012-10-17 19:44:55.000000000 +0600
+++ b/src/eyefiserver	2014-07-27 17:35:10.000000000 +0600
@@ -702,7 +702,14 @@
 
         eyeFiLogger.debug("Extracting TAR file %s", tarpath)
         imagefilename = imagetarfile.getnames()[0]
-        imagetarfile.extractall(path=upload_dir)
+
+        extract_logs = self.server.config.getboolean(macaddress,
+            'extract_logs', False)
+
+        if extract_logs:
+            imagetarfile.extractall(path=upload_dir)
+        else:
+            imagetarfile.extract(imagefilename, path=upload_dir)
 
         eyeFiLogger.debug("Closing TAR file %s", tarpath)
         imagetarfile.close()

Reply via email to