2006-07-03 01:17:05 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
2006-07-12 13:26:04 +05:30
|
|
|
/*
|
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
|
|
|
*/
|
|
|
|
|
2002-09-25 08:17:48 +05:30
|
|
|
#include "libbb.h"
|
|
|
|
#include "unarchive.h"
|
|
|
|
|
2008-06-27 08:22:20 +05:30
|
|
|
void FAST_FUNC header_verbose_list(const file_header_t *file_header)
|
2002-09-25 08:17:48 +05:30
|
|
|
{
|
2005-11-12 08:24:06 +05:30
|
|
|
struct tm *mtime = localtime(&(file_header->mtime));
|
2002-09-25 08:17:48 +05:30
|
|
|
|
2008-02-15 02:07:54 +05:30
|
|
|
#if ENABLE_FEATURE_TAR_UNAME_GNAME
|
2010-01-06 14:13:11 +05:30
|
|
|
char uid[sizeof(int)*3 + 2];
|
|
|
|
/*char gid[sizeof(int)*3 + 2];*/
|
|
|
|
char *user;
|
|
|
|
char *group;
|
2008-02-15 02:07:54 +05:30
|
|
|
|
2010-01-06 14:13:11 +05:30
|
|
|
user = file_header->uname;
|
2008-02-15 02:07:54 +05:30
|
|
|
if (user == NULL) {
|
2010-01-06 14:13:11 +05:30
|
|
|
sprintf(uid, "%u", (unsigned)file_header->uid);
|
2008-02-15 02:07:54 +05:30
|
|
|
user = uid;
|
|
|
|
}
|
2010-01-06 14:13:11 +05:30
|
|
|
group = file_header->gname;
|
2008-02-15 02:07:54 +05:30
|
|
|
if (group == NULL) {
|
2010-01-06 14:13:11 +05:30
|
|
|
/*sprintf(gid, "%u", (unsigned)file_header->gid);*/
|
|
|
|
group = utoa(file_header->gid);
|
2008-02-15 02:07:54 +05:30
|
|
|
}
|
2008-12-12 07:44:35 +05:30
|
|
|
printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
|
2008-02-15 02:07:54 +05:30
|
|
|
bb_mode_string(file_header->mode),
|
|
|
|
user,
|
|
|
|
group,
|
2008-12-12 07:44:35 +05:30
|
|
|
file_header->size,
|
2008-02-15 02:07:54 +05:30
|
|
|
1900 + mtime->tm_year,
|
|
|
|
1 + mtime->tm_mon,
|
|
|
|
mtime->tm_mday,
|
|
|
|
mtime->tm_hour,
|
|
|
|
mtime->tm_min,
|
|
|
|
mtime->tm_sec,
|
|
|
|
file_header->name);
|
|
|
|
#else /* !FEATURE_TAR_UNAME_GNAME */
|
2010-01-06 14:13:11 +05:30
|
|
|
printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
|
2003-03-19 14:43:01 +05:30
|
|
|
bb_mode_string(file_header->mode),
|
2010-01-06 14:13:11 +05:30
|
|
|
(unsigned)file_header->uid,
|
|
|
|
(unsigned)file_header->gid,
|
2006-11-24 20:23:18 +05:30
|
|
|
file_header->size,
|
2002-09-25 08:17:48 +05:30
|
|
|
1900 + mtime->tm_year,
|
|
|
|
1 + mtime->tm_mon,
|
|
|
|
mtime->tm_mday,
|
|
|
|
mtime->tm_hour,
|
|
|
|
mtime->tm_min,
|
|
|
|
mtime->tm_sec,
|
|
|
|
file_header->name);
|
2008-02-15 02:07:54 +05:30
|
|
|
#endif /* FEATURE_TAR_UNAME_GNAME */
|
2002-09-25 08:17:48 +05:30
|
|
|
|
2007-06-20 20:19:47 +05:30
|
|
|
if (file_header->link_target) {
|
|
|
|
printf(" -> %s", file_header->link_target);
|
2002-09-25 08:17:48 +05:30
|
|
|
}
|
2007-09-27 15:50:47 +05:30
|
|
|
bb_putchar('\n');
|
2002-09-25 08:17:48 +05:30
|
|
|
}
|