[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#602652: marked as done (unblock: debtags/1.7.11)



Your message dated Sun, 07 Nov 2010 11:54:29 +0100
with message-id <4CD68565.9080103@dogguy.org>
and subject line Re: Bug#602652: unblock: debtags/1.7.11
has caused the Debian Bug report #602652,
regarding unblock: debtags/1.7.11
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
602652: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602652
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
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/


--- End Message ---

Reply to: