[pacman-dev] [PATCH] Provide full path names in warning messages
Fix bug #31558 by printing filename instead of entryname Signed-off-by: Richard Pougnet <richard@pougnet.ca> --- Resubmission to correctly extend the string onto two lines. --- lib/libalpm/add.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 57c9300..b5a537f 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -182,8 +182,8 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* if a file is in NoExtract then we never extract it */ if(alpm_list_find(handle->noextract, entryname, _alpm_fnmatch)) { - _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", - entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction \ + of %s\n", entryname, filename); alpm_logaction(handle, "note: %s is in NoExtract, skipping extraction\n", entryname); archive_read_data_skip(archive); @@ -222,20 +222,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* if filesystem perms are different than pkg perms, warn user */ mode_t mask = 07777; _alpm_log(handle, ALPM_LOG_WARNING, _("directory permissions differ on %s\n" - "filesystem: %o package: %o\n"), entryname, lsbuf.st_mode & mask, + "filesystem: %o package: %o\n"), filename, lsbuf.st_mode & mask, entrymode & mask); alpm_logaction(handle, "warning: directory permissions differ on %s\n" - "filesystem: %o package: %o\n", entryname, lsbuf.st_mode & mask, + "filesystem: %o package: %o\n", filename, lsbuf.st_mode & mask, entrymode & mask); } _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping dir extraction of %s\n", - entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* case 10/11: trying to overwrite dir with file/symlink, don't allow it */ _alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), - entryname); + filename); archive_read_data_skip(archive); return 1; } @@ -244,20 +244,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(S_ISDIR(sbuf.st_mode)) { /* the symlink on FS is to a directory, so we'll use it */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping symlink overwrite of %s\n", - entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* this is BAD. symlink was not to a directory */ _alpm_log(handle, ALPM_LOG_ERROR, _("extract: symlink %s does not point to dir\n"), - entryname); + filename); archive_read_data_skip(archive); return 1; } } else if(S_ISREG(lsbuf.st_mode) && S_ISDIR(entrymode)) { /* case 6: trying to overwrite file with dir */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n", - entryname); + filename); } else if(S_ISREG(entrymode)) { /* case 4,7: */ /* if file is in NoUpgrade, don't touch it */ -- 1.8.1.1
On 26 January 2013 20:48, Richard Pougnet <richard@pougnet.ca> wrote:
Fix bug #31558 by printing filename instead of entryname
Signed-off-by: Richard Pougnet <richard@pougnet.ca> --- Resubmission to correctly extend the string onto two lines. --- lib/libalpm/add.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 57c9300..b5a537f 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -182,8 +182,8 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
/* if a file is in NoExtract then we never extract it */ if(alpm_list_find(handle->noextract, entryname, _alpm_fnmatch)) { - _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", - entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction \ + of %s\n", entryname, filename);
Wouldn’t this be better as two separate adjacent strings? Otherwise you’ll end up with a giant space in the middle from the indentation. Something like _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction " "of %s\n", entryname, filename);
alpm_logaction(handle, "note: %s is in NoExtract, skipping extraction\n", entryname); archive_read_data_skip(archive); @@ -222,20 +222,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* if filesystem perms are different than pkg perms, warn user */ mode_t mask = 07777; _alpm_log(handle, ALPM_LOG_WARNING, _("directory permissions differ on %s\n" - "filesystem: %o package: %o\n"), entryname, lsbuf.st_mode & mask, + "filesystem: %o package: %o\n"), filename, lsbuf.st_mode & mask, entrymode & mask); alpm_logaction(handle, "warning: directory permissions differ on %s\n" - "filesystem: %o package: %o\n", entryname, lsbuf.st_mode & mask, + "filesystem: %o package: %o\n", filename, lsbuf.st_mode & mask, entrymode & mask); } _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping dir extraction of %s\n", - entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* case 10/11: trying to overwrite dir with file/symlink, don't allow it */ _alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), - entryname); + filename); archive_read_data_skip(archive); return 1; } @@ -244,20 +244,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(S_ISDIR(sbuf.st_mode)) { /* the symlink on FS is to a directory, so we'll use it */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping symlink overwrite of %s\n", - entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* this is BAD. symlink was not to a directory */ _alpm_log(handle, ALPM_LOG_ERROR, _("extract: symlink %s does not point to dir\n"), - entryname); + filename); archive_read_data_skip(archive); return 1; } } else if(S_ISREG(lsbuf.st_mode) && S_ISDIR(entrymode)) { /* case 6: trying to overwrite file with dir */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n", - entryname); + filename); } else if(S_ISREG(entrymode)) { /* case 4,7: */ /* if file is in NoUpgrade, don't touch it */ -- 1.8.1.1
On Sat, Jan 26, 2013 at 9:06 PM, Martin Panter <vadmium+patch@gmail.com>wrote:
On 26 January 2013 20:48, Richard Pougnet <richard@pougnet.ca> wrote:
Fix bug #31558 by printing filename instead of entryname
Signed-off-by: Richard Pougnet <richard@pougnet.ca> --- Resubmission to correctly extend the string onto two lines. --- lib/libalpm/add.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 57c9300..b5a537f 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -182,8 +182,8 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
/* if a file is in NoExtract then we never extract it */ if(alpm_list_find(handle->noextract, entryname, _alpm_fnmatch)) { - _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", - entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction \ + of %s\n", entryname, filename);
Wouldn’t this be better as two separate adjacent strings? Otherwise you’ll end up with a giant space in the middle from the indentation. Something like
_alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction " "of %s\n", entryname, filename);
alpm_logaction(handle, "note: %s is in NoExtract,
skipping extraction\n",
entryname); archive_read_data_skip(archive); @@ -222,20 +222,20 @@ static int extract_single_file(alpm_handle_t
*handle, struct archive *archive,
/* if filesystem perms are
different than pkg perms, warn user */
mode_t mask = 07777; _alpm_log(handle,
- "filesystem: %o package: %o\n"), entryname, lsbuf.st_mode & mask, + "filesystem: %o package: %o\n"), filename, lsbuf.st_mode & mask, entrymode & mask); alpm_logaction(handle, "warning:
- "filesystem: %o
+ "filesystem: %o
ALPM_LOG_WARNING, _("directory permissions differ on %s\n" directory permissions differ on %s\n" package: %o\n", entryname, lsbuf.st_mode & mask, package: %o\n", filename, lsbuf.st_mode & mask,
entrymode &
mask);
} _alpm_log(handle, ALPM_LOG_DEBUG,
- entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* case 10/11: trying to overwrite dir with file/symlink, don't allow it */ _alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), - entryname); + filename); archive_read_data_skip(archive); return 1; } @@ -244,20 +244,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(S_ISDIR(sbuf.st_mode)) { /* the symlink on FS is to a directory, so we'll use it */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping symlink overwrite of %s\n", - entryname); + filename); archive_read_data_skip(archive); return 0; } else { /* this is BAD. symlink was not to a
"extract: skipping dir extraction of %s\n", directory */
_alpm_log(handle, ALPM_LOG_ERROR,
_("extract: symlink %s does not point to dir\n"),
- entryname); + filename); archive_read_data_skip(archive); return 1; } } else if(S_ISREG(lsbuf.st_mode) && S_ISDIR(entrymode)) { /* case 6: trying to overwrite file with dir */ _alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n", - entryname); + filename); } else if(S_ISREG(entrymode)) { /* case 4,7: */ /* if file is in NoUpgrade, don't touch it */ -- 1.8.1.1
Very true, I forgot about the added whitespace.
On Sat, 26 Jan 2013 15:48:53 -0500 Richard Pougnet <richard@pougnet.ca> wrote:
Fix bug #31558 by printing filename instead of entryname
Signed-off-by: Richard Pougnet <richard@pougnet.ca> ---
Am I missing something? This doesn't look related to FS#31558 - List file containing $srcdir
Somehow I turned FS#31556 into 58. Either I was really tired or not thinking, or maybe a bit of both. The real bug number is FS#31556. Any more comments before I make another resubmit? On Sat, Jan 26, 2013 at 9:31 PM, Andrew Gregory <andrew.gregory.8@gmail.com>wrote:
On Sat, 26 Jan 2013 15:48:53 -0500 Richard Pougnet <richard@pougnet.ca> wrote:
Fix bug #31558 by printing filename instead of entryname
Signed-off-by: Richard Pougnet <richard@pougnet.ca> ---
Am I missing something? This doesn't look related to FS#31558 - List file containing $srcdir
On 27/01/13 12:40, Richard Pougnet wrote:
Somehow I turned FS#31556 into 58. Either I was really tired or not thinking, or maybe a bit of both. The real bug number is FS#31556. Any more comments before I make another resubmit?
One last comment.... why split this string at all?
- _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", - entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction \ + of %s\n", entryname, filename); alpm_logaction(handle, "note: %s is in NoExtract, skipping extraction\n", entryname);
Just move the whole string onto the next line if it is too long. Allan
participants (4)
-
Allan McRae
-
Andrew Gregory
-
Martin Panter
-
Richard Pougnet