[PATCH 3/3] compact: Provide user with more error feedback

2013-10-28 Thread Ben Gamari
Tomi Ollila  writes:

> On Sun, Oct 27 2013, Ben Gamari  wrote:
>
>> Provide instructions on what to do when we couldn't move the compacted
>> database into place.
>>
>> Signed-off-by: Ben Gamari 
>> ---
>>  lib/database.cc | 18 +-
>>  1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/database.cc b/lib/database.cc
>> index 57c2292..6f9fed1 100644
>> --- a/lib/database.cc
>> +++ b/lib/database.cc
>> @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
>>  }
>>  
>>  if (rename(compact_xapian_path, xapian_path)) {
>> -fprintf (stderr, "Error moving compacted database\n");
>> +fprintf (stderr, "Error moving compacted database into place: %s\n", 
>> strerror(errno));
>> +fprintf (stderr, "\n");
>> +fprintf (stderr, "Encountered error %s while moving the compacted 
>> database,\n",
>> + strerror(errno));
>
> You probably missed my comments in id:m2d2mz7qv7.fsf at guru.guru-group.fi ?
>
Indeed I did. My apologies. New set coming.

Cheers,

- Ben
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: 



[PATCH 3/3] compact: Provide user with more error feedback

2013-10-28 Thread Tomi Ollila
On Sun, Oct 27 2013, Ben Gamari  wrote:

> Provide instructions on what to do when we couldn't move the compacted
> database into place.
>
> Signed-off-by: Ben Gamari 
> ---
>  lib/database.cc | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 57c2292..6f9fed1 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
>  }
>  
>  if (rename(compact_xapian_path, xapian_path)) {
> - fprintf (stderr, "Error moving compacted database\n");
> + fprintf (stderr, "Error moving compacted database into place: %s\n", 
> strerror(errno));
> + fprintf (stderr, "\n");
> + fprintf (stderr, "Encountered error %s while moving the compacted 
> database,\n",
> +  strerror(errno));

You probably missed my comments in id:m2d2mz7qv7.fsf at guru.guru-group.fi ?

Tomi

> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", compact_xapian_path);
> + fprintf (stderr, "\n");
> + fprintf (stderr, "to\n");
> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", xapian_path);
> + fprintf (stderr, "\n");
> + fprintf (stderr, "Please identify the reason for this and move the 
> compacted database into place manually.\n");
> + if (backup_path != NULL) {
> + fprintf (stderr, "Otherwise, you can revert to the backup database 
> located at,\n");
> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", backup_path);
> + }
>   ret = NOTMUCH_STATUS_FILE_ERROR;
>   goto DONE;
>  }
> -- 
> 1.8.3.2
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 3/3] compact: Provide user with more error feedback

2013-10-28 Thread Ben Gamari
Tomi Ollila tomi.oll...@iki.fi writes:

 On Sun, Oct 27 2013, Ben Gamari bgamari.f...@gmail.com wrote:

 Provide instructions on what to do when we couldn't move the compacted
 database into place.

 Signed-off-by: Ben Gamari bgamari.f...@gmail.com
 ---
  lib/database.cc | 18 +-
  1 file changed, 17 insertions(+), 1 deletion(-)

 diff --git a/lib/database.cc b/lib/database.cc
 index 57c2292..6f9fed1 100644
 --- a/lib/database.cc
 +++ b/lib/database.cc
 @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
  }
  
  if (rename(compact_xapian_path, xapian_path)) {
 -fprintf (stderr, Error moving compacted database\n);
 +fprintf (stderr, Error moving compacted database into place: %s\n, 
 strerror(errno));
 +fprintf (stderr, \n);
 +fprintf (stderr, Encountered error %s while moving the compacted 
 database,\n,
 + strerror(errno));

 You probably missed my comments in id:m2d2mz7qv7@guru.guru-group.fi ?

Indeed I did. My apologies. New set coming.

Cheers,

- Ben


pgptHpiHJ_QFy.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/3] compact: Provide user with more error feedback

2013-10-27 Thread Ben Gamari
Provide instructions on what to do when we couldn't move the compacted
database into place.

Signed-off-by: Ben Gamari 
---
 lib/database.cc | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 57c2292..6f9fed1 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
 }

 if (rename(compact_xapian_path, xapian_path)) {
-   fprintf (stderr, "Error moving compacted database\n");
+   fprintf (stderr, "Error moving compacted database into place: %s\n", 
strerror(errno));
+   fprintf (stderr, "\n");
+   fprintf (stderr, "Encountered error %s while moving the compacted 
database,\n",
+strerror(errno));
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", compact_xapian_path);
+   fprintf (stderr, "\n");
+   fprintf (stderr, "to\n");
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", xapian_path);
+   fprintf (stderr, "\n");
+   fprintf (stderr, "Please identify the reason for this and move the 
compacted database into place manually.\n");
+   if (backup_path != NULL) {
+   fprintf (stderr, "Otherwise, you can revert to the backup database 
located at,\n");
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", backup_path);
+   }
ret = NOTMUCH_STATUS_FILE_ERROR;
goto DONE;
 }
-- 
1.8.3.2



Re: [PATCH 3/3] compact: Provide user with more error feedback

2013-10-27 Thread Tomi Ollila
On Sun, Oct 27 2013, Ben Gamari bgamari.f...@gmail.com wrote:

 Provide instructions on what to do when we couldn't move the compacted
 database into place.

 Signed-off-by: Ben Gamari bgamari.f...@gmail.com
 ---
  lib/database.cc | 18 +-
  1 file changed, 17 insertions(+), 1 deletion(-)

 diff --git a/lib/database.cc b/lib/database.cc
 index 57c2292..6f9fed1 100644
 --- a/lib/database.cc
 +++ b/lib/database.cc
 @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
  }
  
  if (rename(compact_xapian_path, xapian_path)) {
 - fprintf (stderr, Error moving compacted database\n);
 + fprintf (stderr, Error moving compacted database into place: %s\n, 
 strerror(errno));
 + fprintf (stderr, \n);
 + fprintf (stderr, Encountered error %s while moving the compacted 
 database,\n,
 +  strerror(errno));

You probably missed my comments in id:m2d2mz7qv7@guru.guru-group.fi ?

Tomi

 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, compact_xapian_path);
 + fprintf (stderr, \n);
 + fprintf (stderr, to\n);
 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, xapian_path);
 + fprintf (stderr, \n);
 + fprintf (stderr, Please identify the reason for this and move the 
 compacted database into place manually.\n);
 + if (backup_path != NULL) {
 + fprintf (stderr, Otherwise, you can revert to the backup database 
 located at,\n);
 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, backup_path);
 + }
   ret = NOTMUCH_STATUS_FILE_ERROR;
   goto DONE;
  }
 -- 
 1.8.3.2

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/3] compact: Provide user with more error feedback

2013-10-20 Thread Tomi Ollila
On Tue, Oct 15 2013, Ben Gamari  wrote:

> Provide instructions on what to do when we couldn't move the compacted
> database into place.
>
> Signed-off-by: Ben Gamari 
> ---
>  lib/database.cc | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 57c2292..6f9fed1 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
>  }
>  
>  if (rename(compact_xapian_path, xapian_path)) {
> - fprintf (stderr, "Error moving compacted database\n");
> + fprintf (stderr, "Error moving compacted database into place: %s\n", 
> strerror(errno));
> + fprintf (stderr, "\n");
> + fprintf (stderr, "Encountered error %s while moving the compacted 
> database,\n",
> +  strerror(errno));

At this point 'errno' may have changed, so the above error string might not
be the same. Maybe removing the '%s ' part altogether as inserting the part
looks a bit strange...

> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", compact_xapian_path);
> + fprintf (stderr, "\n");
> + fprintf (stderr, "to\n");
> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", xapian_path);
> + fprintf (stderr, "\n");
> + fprintf (stderr, "Please identify the reason for this and move the 
> compacted database into place manually.\n");
> + if (backup_path != NULL) {
> + fprintf (stderr, "Otherwise, you can revert to the backup database 
> located at,\n");

the commas (,) here and a few lines above looks a bit strange to me. 

> + fprintf (stderr, "\n");
> + fprintf (stderr, "%s\n", backup_path);

Maybe saying something how to do this revert would be enlightening to the
user... (i.e. mentioning that backup_path needs to be moved as xapian_path).


> + }

>   ret = NOTMUCH_STATUS_FILE_ERROR;
>   goto DONE;
>  }
> -- 

Tomi


Re: [PATCH 3/3] compact: Provide user with more error feedback

2013-10-20 Thread Tomi Ollila
On Tue, Oct 15 2013, Ben Gamari bgamari.f...@gmail.com wrote:

 Provide instructions on what to do when we couldn't move the compacted
 database into place.

 Signed-off-by: Ben Gamari bgamari.f...@gmail.com
 ---
  lib/database.cc | 18 +-
  1 file changed, 17 insertions(+), 1 deletion(-)

 diff --git a/lib/database.cc b/lib/database.cc
 index 57c2292..6f9fed1 100644
 --- a/lib/database.cc
 +++ b/lib/database.cc
 @@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
  }
  
  if (rename(compact_xapian_path, xapian_path)) {
 - fprintf (stderr, Error moving compacted database\n);
 + fprintf (stderr, Error moving compacted database into place: %s\n, 
 strerror(errno));
 + fprintf (stderr, \n);
 + fprintf (stderr, Encountered error %s while moving the compacted 
 database,\n,
 +  strerror(errno));

At this point 'errno' may have changed, so the above error string might not
be the same. Maybe removing the '%s ' part altogether as inserting the part
looks a bit strange...

 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, compact_xapian_path);
 + fprintf (stderr, \n);
 + fprintf (stderr, to\n);
 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, xapian_path);
 + fprintf (stderr, \n);
 + fprintf (stderr, Please identify the reason for this and move the 
 compacted database into place manually.\n);
 + if (backup_path != NULL) {
 + fprintf (stderr, Otherwise, you can revert to the backup database 
 located at,\n);

the commas (,) here and a few lines above looks a bit strange to me. 

 + fprintf (stderr, \n);
 + fprintf (stderr, %s\n, backup_path);

Maybe saying something how to do this revert would be enlightening to the
user... (i.e. mentioning that backup_path needs to be moved as xapian_path).


 + }

   ret = NOTMUCH_STATUS_FILE_ERROR;
   goto DONE;
  }
 -- 

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/3] compact: Provide user with more error feedback

2013-10-14 Thread Ben Gamari
Provide instructions on what to do when we couldn't move the compacted
database into place.

Signed-off-by: Ben Gamari 
---
 lib/database.cc | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 57c2292..6f9fed1 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
 }

 if (rename(compact_xapian_path, xapian_path)) {
-   fprintf (stderr, "Error moving compacted database\n");
+   fprintf (stderr, "Error moving compacted database into place: %s\n", 
strerror(errno));
+   fprintf (stderr, "\n");
+   fprintf (stderr, "Encountered error %s while moving the compacted 
database,\n",
+strerror(errno));
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", compact_xapian_path);
+   fprintf (stderr, "\n");
+   fprintf (stderr, "to\n");
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", xapian_path);
+   fprintf (stderr, "\n");
+   fprintf (stderr, "Please identify the reason for this and move the 
compacted database into place manually.\n");
+   if (backup_path != NULL) {
+   fprintf (stderr, "Otherwise, you can revert to the backup database 
located at,\n");
+   fprintf (stderr, "\n");
+   fprintf (stderr, "%s\n", backup_path);
+   }
ret = NOTMUCH_STATUS_FILE_ERROR;
goto DONE;
 }
-- 
1.8.1.2



[PATCH 3/3] compact: Provide user with more error feedback

2013-10-14 Thread Ben Gamari
Provide instructions on what to do when we couldn't move the compacted
database into place.

Signed-off-by: Ben Gamari bgamari.f...@gmail.com
---
 lib/database.cc | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 57c2292..6f9fed1 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -938,7 +938,23 @@ notmuch_database_compact (const char* path,
 }
 
 if (rename(compact_xapian_path, xapian_path)) {
-   fprintf (stderr, Error moving compacted database\n);
+   fprintf (stderr, Error moving compacted database into place: %s\n, 
strerror(errno));
+   fprintf (stderr, \n);
+   fprintf (stderr, Encountered error %s while moving the compacted 
database,\n,
+strerror(errno));
+   fprintf (stderr, \n);
+   fprintf (stderr, %s\n, compact_xapian_path);
+   fprintf (stderr, \n);
+   fprintf (stderr, to\n);
+   fprintf (stderr, \n);
+   fprintf (stderr, %s\n, xapian_path);
+   fprintf (stderr, \n);
+   fprintf (stderr, Please identify the reason for this and move the 
compacted database into place manually.\n);
+   if (backup_path != NULL) {
+   fprintf (stderr, Otherwise, you can revert to the backup database 
located at,\n);
+   fprintf (stderr, \n);
+   fprintf (stderr, %s\n, backup_path);
+   }
ret = NOTMUCH_STATUS_FILE_ERROR;
goto DONE;
 }
-- 
1.8.1.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch