summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-06-17 23:40:21 -0400
committerDan McGee <dan@archlinux.org>2007-06-26 11:42:41 -0400
commit2ae043866045bbeef129a4b503ee1f5486545821 (patch)
tree8764067654a0cd351f8ec5b8d0135396b1767fcd
parentf401e523981a72664d7f52e5697e3e09de597aeb (diff)
downloadpacman-2ae043866045bbeef129a4b503ee1f5486545821.tar.xz
Don't extract any top-level files in a package that start with '.'
For future possibilities, don't extract any files that start with '.'. This will allow us to add features such as the ChangeLog viewing without having to wait to include these files in packages, because older versions of pacman will be forward compatable with 'hidden' files at the root level of the package. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/add.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 8ccf4a37..5c9885e7 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -466,7 +466,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
memset(filename, 0, PATH_MAX); /* just to be sure */
- if(strcmp(entryname, ".PKGINFO") == 0 || strcmp(entryname, ".FILELIST") == 0) {
+ if(strcmp(entryname, ".PKGINFO") == 0
+ || strcmp(entryname, ".FILELIST") == 0) {
archive_read_data_skip(archive);
continue;
} else if(strcmp(entryname, ".INSTALL") == 0) {
@@ -477,6 +478,12 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
/* the changelog goes inside the db */
snprintf(filename, PATH_MAX, "%s/%s-%s/changelog", db->path,
newpkg->name, newpkg->version);
+ } else if(*entryname == '.') {
+ /* for now, ignore all files starting with '.' that haven't
+ * already been handled (for future possibilities) */
+ _alpm_log(PM_LOG_DEBUG, _("skipping extraction of '%s'"), entryname);
+ archive_read_data_skip(archive);
+ continue;
} else {
/* build the new entryname relative to handle->root */
snprintf(filename, PATH_MAX, "%s%s", handle->root, entryname);