Browse Source

Merge commit '1.16.0.2'

Raphaël Hertzog 15 years ago
parent
commit
398a601671
4 changed files with 21 additions and 6 deletions
  1. 9 0
      debian/changelog
  2. 1 1
      dpkg-split/queue.c
  3. 6 4
      dpkg-split/split.c
  4. 5 1
      lib/dpkg/i18n.h

+ 9 - 0
debian/changelog

@@ -18,6 +18,15 @@ dpkg (1.16.1) UNRELEASED; urgency=low
  
  -- Raphaël Hertzog <hertzog@debian.org>  Sat, 02 Apr 2011 09:21:26 +0200
 
+dpkg (1.16.0.2) unstable; urgency=high
+
+  * Fix dpkg-split --auto to not fail when opening the new depot file.
+  * Fix dpkg-split to correctly set the last part split size.
+  * Fix build failure on DEB_BUILD_OPTIONS=noopt due to a missing <locale.h>
+    include in gettext.h needed by the gettext context functions.
+
+ -- Guillem Jover <guillem@debian.org>  Sat, 16 Apr 2011 00:14:15 +0200
+
 dpkg (1.16.0.1) unstable; urgency=low
 
   [ Raphaël Hertzog ]

+ 1 - 1
dpkg-split/queue.c

@@ -178,7 +178,7 @@ do_auto(const char *const *argv)
     if (fd_src < 0)
       ohshite(_("unable to reopen part file `%.250s'"), partfile);
     fd_dst = creat(p, 0644);
-    if (fd_dst)
+    if (fd_dst < 0)
       ohshite(_("unable to open new depot file `%.250s'"), p);
 
     fd_fd_copy(fd_src, fd_dst, refi->filesize, _("extracting split part"));

+ 6 - 4
dpkg-split/split.c

@@ -119,7 +119,7 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
 	char *package, *version;
 	int nparts, curpart;
 	off_t partsize;
-	off_t last_partsize;
+	off_t cur_partsize, last_partsize;
 	char *prefixdir = NULL, *msdos_prefix = NULL;
 	struct varbuf file_dst = VARBUF_INIT;
 	struct varbuf partmagic = VARBUF_INIT;
@@ -186,9 +186,11 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
 		}
 
 		if (curpart == nparts)
-			partsize = last_partsize;
+			cur_partsize = last_partsize;
+		else
+			cur_partsize = partsize;
 
-		if (partsize > maxpartsize) {
+		if (cur_partsize > maxpartsize) {
 			ohshit(_("Header is too long, making part too long. "
 			       "Your package name or version\n"
 			       "numbers must be extraordinarily long, "
@@ -215,7 +217,7 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
 		/* Write the data part. */
 		varbuf_printf(&partname, "data.%d", curpart);
 		dpkg_ar_member_put_file(file_dst.buf, fd_dst, partname.buf,
-		                        fd_src, partsize);
+		                        fd_src, cur_partsize);
 		varbuf_reset(&partname);
 
 		close(fd_dst);

+ 5 - 1
lib/dpkg/i18n.h

@@ -2,7 +2,7 @@
  * libdpkg - Debian packaging suite library routines
  * i18n.h - i18n support
  *
- * Copyright © 2008-2010 Guillem Jover <guillem@debian.org>
+ * Copyright © 2008-2011 Guillem Jover <guillem@debian.org>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,6 +27,10 @@ DPKG_BEGIN_DECLS
 
 #include <gettext.h>
 
+/* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
+ * which gets pulled by gettext.h only includes it if building optimized. */
+#include <locale.h>
+
 #define _(str) gettext(str)
 #define P_(str, str_plural, n) ngettext(str, str_plural, n)
 #define N_(str) gettext_noop(str)