Bug#573066: task: does not emit rfc4122 conforming uuids

2010-03-09 Thread Federico Hernandez
 I will upload a Debian-Package with libuuid-support, thanks for the hint.


Please do not yet as we might fix this internally in task. But more
important we don't want to release a bug fix without having passed all our
3800 regression tests first and have coordinated with other bug fixes first.

Thank you.

/Fredde


Bug#573066: task: does not emit rfc4122 conforming uuids

2010-03-09 Thread Alexander Neumann
Hi,

* Federico Hernandez ultrafre...@gmail.com wrote:
  I will upload a Debian-Package with libuuid-support, thanks for the hint.
 Please do not yet as we might fix this internally in task. But more
 important we don't want to release a bug fix without having passed all our
 3800 regression tests first and have coordinated with other bug fixes first.

Ok, I will reopen the Debian-bugreport and upload 1.9.0-3, which restores
the old behaviour until you have fixed this bug upstream.

Regards,
- Alexander


pgpPuzLVVYUEg.pgp
Description: PGP signature


Bug#573066: task: does not emit rfc4122 conforming uuids

2010-03-08 Thread Helmut Grohne
Package: task
Version: 1.9.0-1
Severity: normal
Tags: upstream patch

Task uses uuids to identify tasks. However these uuids are not
conforming to rfc4122.

Steps to reproduce:
Create a task and look at .task/pending.data.
With probability around 98% the generated uuid is invalid.

There are basically two methods to solve this problem:

1) Link against libuuid. Task has support for this, however the Debian
   package does not do this.

2) Fix tasks own implementation for generating uuids. A patch for this
   is attached.

The upstream bugreport can be found at
http://taskwarrior.org/issues/show/394.

As a maintainer reading this, could you link this bug report to the
upstream bug report?

Thanks

Helmut
From 54495557addff37ff52df7edc3ff4d30e1182571 Mon Sep 17 00:00:00 2001
From: Helmut Grohne hel...@subdivi.de
Date: Mon, 8 Mar 2010 17:37:20 +0100
Subject: [PATCH] emit rfc4122 (version 4) conforming uuids

This only applies when not linking against libuuid.
---
 src/util.cpp |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/util.cpp b/src/util.cpp
index a10e928..9012ae6 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -313,12 +313,19 @@ const std::string uuid ()
   id[11] = randomHexDigit ();
   id[12] = randomHexDigit ();
   id[13] = '-';
-  id[14] = randomHexDigit ();
+  id[14] = '4';
   id[15] = randomHexDigit ();
   id[16] = randomHexDigit ();
   id[17] = randomHexDigit ();
   id[18] = '-';
   id[19] = randomHexDigit ();
+  switch(id[19])
+  {
+case '0': case '4': case '8': case 'c': id[19] = '8'; break;
+case '1': case '5': case '9': case 'd': id[19] = '9'; break;
+case '2': case '6': case 'a': case 'e': id[19] = 'a'; break;
+case '3': case '7': case 'b': case 'f': id[19] = 'b'; break;
+  }
   id[20] = randomHexDigit ();
   id[21] = randomHexDigit ();
   id[22] = randomHexDigit ();
-- 
1.6.6.1



Bug#573066: task: does not emit rfc4122 conforming uuids

2010-03-08 Thread Alexander Neumann
Hi,

* Helmut Grohne hel...@subdivi.de wrote:
 Task uses uuids to identify tasks. However these uuids are not
 conforming to rfc4122.

I will upload a Debian-Package with libuuid-support, thanks for the hint.

Regards,
- Alexander


pgpSL4LyhmmX5.pgp
Description: PGP signature