The following commit has been merged in the master branch:
commit de24e8d710686a4e271caaccfe3f46a4619ecba1
Author: Guillem Jover <[email protected]>
Date: Mon Jul 13 02:27:15 2009 +0200
dpkg-deb: Remove trailing ‘/’ and ‘/.’ from the directory name on -b
When using “dpkg-deb -b” and specifiyng only the directory name to be
used as the base name for the package name, remove any trailing
characters that would make dpkg-deb create the destination file inside
the directory.
Closes: #218018, #373602
diff --git a/debian/changelog b/debian/changelog
index 19a4194..7e2acae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ dpkg (1.15.4) UNRELEASED; urgency=low
the database on next dump. This obsoletes the --forget-old-unavail option,
thus making it now a no-op. Closes: #33394, #429262
* Document “hold” under package selection states instead of flags in dpkg(1).
+ * Remove trailing ‘/’ and ‘/.’ from the directory name to be used as the
+ package name on “dpkg-deb -b”. Closes: #218018, #373602
[ Raphael Hertzog ]
* Replace install-info by a wrapper around GNU's install-info. The wrapper
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index 1b8219b..220edfb 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -47,6 +47,7 @@
#include <dpkg.h>
#include <dpkg-db.h>
#include "dpkg-deb.h"
+#include "dpkg-priv.h"
#ifndef S_ISLNK
# define S_ISLNK(mode) ((mode&0xF000) == S_IFLNK)
@@ -222,7 +223,9 @@ void do_build(const char *const *argv) {
}
} else {
m= m_malloc(strlen(directory) + sizeof(DEBEXT));
- strcpy(m,directory); strcat(m,DEBEXT);
+ strcpy(m, directory);
+ path_rtrim_slash_slashdot(m);
+ strcat(m, DEBEXT);
debar= m;
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]