Debian Bug report logs - #602652
unblock: debtags/1.7.11

Package: release.debian.org; Maintainer for release.debian.org is Debian Release Team <debian-release@lists.debian.org>;

Reported by: Enrico Zini <enrico@debian.org>

Date: Sat, 6 Nov 2010 22:15:01 UTC

Severity: normal

Done: Mehdi Dogguy <mehdi@dogguy.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Release Team <debian-release@lists.debian.org>:
Bug#602652; Package release.debian.org. (Sat, 06 Nov 2010 22:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Enrico Zini <enrico@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Release Team <debian-release@lists.debian.org>. (Sat, 06 Nov 2010 22:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Enrico Zini <enrico@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: unblock: debtags/1.7.11
Date: Sat, 06 Nov 2010 22:12:52 +0000
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: freeze-exception

Please unblock package debtags

It fixes bug #602634.

The debdiff is somewhat polluted by autotools updates. The important bit
is this one:

diff --git a/configure.ac b/configure.ac
index d6a1c0a..fd717ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(debtags, 1.7.10, [enrico@debian.org])
+AC_INIT(debtags, 1.7.11, [enrico@debian.org])
 AC_CONFIG_SRCDIR([configure.ac])
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE([foreign])
diff --git a/debian/changelog b/debian/changelog
index 05cec5b..6759936 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+debtags (1.7.11) unstable; urgency=low
+
+  * Update /var/lib/debtags/package-tags. Closes: #602634.
+
+ -- Enrico Zini <enrico@debian.org>  Sat, 06 Nov 2010 19:33:06 +0000
+
 debtags (1.7.10) unstable; urgency=low
 
   * Build with new libept. Closes: #588546
diff --git a/tools/debtags.cc b/tools/debtags.cc
index 4ec2ea0..27a7de9 100644
--- a/tools/debtags.cc
+++ b/tools/debtags.cc
@@ -544,6 +544,68 @@ public:
 	}
 };
 
+struct AtomicStdioWriter
+{
+	std::string fname;
+	char* tmpfname;
+	int fd;
+	FILE* out;
+
+	AtomicStdioWriter(const std::string& fname)
+		: fname(fname), tmpfname(0), out(0), fd(-1)
+	{
+		// Build the temp file template
+		tmpfname = new char[fname.size() + 8];
+		strncpy(tmpfname, fname.c_str(), fname.size());
+		strncpy(tmpfname + fname.size(), ".XXXXXX", 8);
+		// Create and open the temporary file
+		fd = mkstemp(tmpfname);
+		if (fd < 0)
+			throw wibble::exception::File(tmpfname, "opening file");
+
+		// Pass the file descriptor to stdio
+		out = fdopen(fd, "wt");
+		if (!out)
+			throw wibble::exception::File(tmpfname, "fdopening file");
+	}
+
+	~AtomicStdioWriter()
+	{
+		if (out)
+		{
+			if (unlink(tmpfname) == -1)
+				throw wibble::exception::File(tmpfname, "cannot delete temporary file");
+			fclose(out);
+		}
+		if (tmpfname) delete[] tmpfname;
+	}
+
+	void flush()
+	{
+		// Read the current umask
+		mode_t cur_umask = umask(0);
+		umask(cur_umask);
+
+		// Give the file the right permissions
+		if (fchmod(fd, 0666 & ~cur_umask) < 0)
+			throw wibble::exception::File(tmpfname, "setting file permissions");
+
+		// Flush stdio's buffers
+		fflush(out);
+
+		// Flush OS buffers
+		fdatasync(fd);
+
+		// Close the file
+		fclose(out);
+		out = NULL;
+
+		// Rename the successfully written file to its final name
+		if (rename(tmpfname, fname.c_str()) == -1)
+			throw wibble::exception::System(string("renaming ") + tmpfname + " to " + fname);
+	}
+};
+
 int main(int argc, const char* argv[])
 {
 	wibble::commandline::DebtagsOptions opts;
@@ -1172,6 +1234,13 @@ int main(int argc, const char* argv[])
 
 			// Write out the merged, updated vocabulary
 			voc.write();
+
+			// Read and merge all tag sources, and write them out
+			{
+				AtomicStdioWriter writer(debtags::Path::tagdb());
+				env().debtags().output(textformat::StdioWriter(writer.out));
+				writer.flush();
+			}
 		}
 		else if (opts.foundCommand() == opts.vocfilter)
 		{

Code for AtomicStdioWriter comes from ept/debtags/vocabulary.cc in
libept, which is used to atomically write /var/lib/debtags/vocabulary

unblock debtags/1.7.11

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

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




Reply sent to Mehdi Dogguy <mehdi@dogguy.org>:
You have taken responsibility. (Sun, 07 Nov 2010 11:00:07 GMT) Full text and rfc822 format available.

Notification sent to Enrico Zini <enrico@debian.org>:
Bug acknowledged by developer. (Sun, 07 Nov 2010 11:00:07 GMT) Full text and rfc822 format available.

Message #10 received at 602652-done@bugs.debian.org (full text, mbox):

From: Mehdi Dogguy <mehdi@dogguy.org>
To: Enrico Zini <enrico@debian.org>, 602652-done@bugs.debian.org
Subject: Re: Bug#602652: unblock: debtags/1.7.11
Date: Sun, 07 Nov 2010 11:54:29 +0100
On 11/06/2010 11:12 PM, Enrico Zini wrote:
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: freeze-exception
> 
> Please unblock package debtags
> 
> It fixes bug #602634.
> 

Unblocked.

Regards,

-- 
Mehdi Dogguy مهدي الدڤي
http://dogguy.org/




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 06 Dec 2010 07:33:19 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 11:01:21 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.