From 2ae043866045bbeef129a4b503ee1f5486545821 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 17 Jun 2007 23:40:21 -0400 Subject: 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 --- lib/libalpm/add.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/libalpm') 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); -- cgit v1.2.3-24-g4f1b