Package: gphoto2
Version: 2.4.5-3
Severity: wishlist

To synchronise the time of the camera with gphoto2 one needs to do 
something like:
gphoto2 --set-config /main/settings/time=`date +%s` 
Because of the time passing between the execution of date and the 
setting of the camera clock, the camera clock will lag by a few seconds.
It would be more convenient and accurate if one could use:
gphoto2 --set-config /main/settings/time=now

I have attached a patch that supports this use of the word 'now'. 
The patch is for the stable version, but applies to the version in 
unstable as well, albeit with a large shift. 
-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (650, 'stable'), (620, 'oldstable'), (500, 'squeeze-updates')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/3 CPU cores)
Locale: LANG=nl_NL.UTF-8, LC_CTYPE=nl_NL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gphoto2 depends on:
ii  libaa1                    1.4p5-38       ascii art library
ii  libc6                     2.11.2-10      Embedded GNU C Library: Shared lib
ii  libcdk5                   5.0.20060507-2 C-based curses widget library
ii  libexif12                 0.6.19-1       library to parse EXIF files
ii  libgphoto2-2              2.4.6-3        gphoto2 digital camera library
ii  libgphoto2-port0          2.4.6-3        gphoto2 digital camera port librar
ii  libjpeg62                 6b1-1          The Independent JPEG Group's JPEG 
ii  libncurses5               5.7+20100313-5 shared libraries for terminal hand
ii  libpopt0                  1.16-1         lib for parsing cmdline parameters
ii  libreadline5              5.2-7          GNU readline and history libraries
ii  libslang2                 2.2.2-4        The S-Lang programming library - r
ii  libusb-0.1-4              2:0.1.12-16    userspace USB programming library
ii  libx11-6                  2:1.3.3-4      X11 client-side library

gphoto2 recommends no packages.

Versions of packages gphoto2 suggests:
ii  gthumb                        3:2.11.5-4 an image viewer and browser
pn  gtkam                         <none>     (no description available)

-- no debconf information
--- gphoto2/actions.c~	2009-03-31 22:27:05.000000000 +0200
+++ gphoto2/actions.c	2011-03-17 10:06:43.000000000 +0100
@@ -1528,9 +1528,11 @@ set_config_action (GPParams *p, const ch
 		int	t = -1;
 		struct tm xtm;
 
+		if ( !strcasecmp (value, "now")	|| !strcasecmp (value, _("now")) )
+			t = time(NULL);
 #ifdef HAVE_STRPTIME
-		if (strptime (value, "%c", &xtm) || strptime (value, "%Ec", &xtm))
-			t = mktime (&xtm);
+		else if (strptime (value, "%c", &xtm) || strptime (value, "%Ec", &xtm))
+			t = mktime (&xtm);		
 #endif
 		if (t == -1) {
 			if (!sscanf (value, "%d", &t)) {

Reply via email to