1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

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>
This commit is contained in:
Dan McGee 2007-06-17 23:40:21 -04:00
parent f401e52398
commit 2ae0438660

View File

@ -466,7 +466,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
memset(filename, 0, PATH_MAX); /* just to be sure */ 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); archive_read_data_skip(archive);
continue; continue;
} else if(strcmp(entryname, ".INSTALL") == 0) { } 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 */ /* the changelog goes inside the db */
snprintf(filename, PATH_MAX, "%s/%s-%s/changelog", db->path, snprintf(filename, PATH_MAX, "%s/%s-%s/changelog", db->path,
newpkg->name, newpkg->version); 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 { } else {
/* build the new entryname relative to handle->root */ /* build the new entryname relative to handle->root */
snprintf(filename, PATH_MAX, "%s%s", handle->root, entryname); snprintf(filename, PATH_MAX, "%s%s", handle->root, entryname);