Contents of /trunk/mkinitrd-magellan/busybox/archival/libunarchive/header_verbose_list.c
Parent Directory | Revision Log
Revision 984 -
(show annotations)
(download)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File MIME type: text/plain
File size: 1543 byte(s)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File MIME type: text/plain
File size: 1543 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 | /* vi: set sw=4 ts=4: */ |
2 | /* |
3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
4 | */ |
5 | |
6 | #include "libbb.h" |
7 | #include "unarchive.h" |
8 | |
9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) |
10 | { |
11 | struct tm tm_time; |
12 | struct tm *ptm = &tm_time; //localtime(&file_header->mtime); |
13 | |
14 | #if ENABLE_FEATURE_TAR_UNAME_GNAME |
15 | char uid[sizeof(int)*3 + 2]; |
16 | /*char gid[sizeof(int)*3 + 2];*/ |
17 | char *user; |
18 | char *group; |
19 | |
20 | localtime_r(&file_header->mtime, ptm); |
21 | |
22 | user = file_header->tar__uname; |
23 | if (user == NULL) { |
24 | sprintf(uid, "%u", (unsigned)file_header->uid); |
25 | user = uid; |
26 | } |
27 | group = file_header->tar__gname; |
28 | if (group == NULL) { |
29 | /*sprintf(gid, "%u", (unsigned)file_header->gid);*/ |
30 | group = utoa(file_header->gid); |
31 | } |
32 | printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
33 | bb_mode_string(file_header->mode), |
34 | user, |
35 | group, |
36 | file_header->size, |
37 | 1900 + ptm->tm_year, |
38 | 1 + ptm->tm_mon, |
39 | ptm->tm_mday, |
40 | ptm->tm_hour, |
41 | ptm->tm_min, |
42 | ptm->tm_sec, |
43 | file_header->name); |
44 | |
45 | #else /* !FEATURE_TAR_UNAME_GNAME */ |
46 | |
47 | localtime_r(&file_header->mtime, ptm); |
48 | |
49 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
50 | bb_mode_string(file_header->mode), |
51 | (unsigned)file_header->uid, |
52 | (unsigned)file_header->gid, |
53 | file_header->size, |
54 | 1900 + ptm->tm_year, |
55 | 1 + ptm->tm_mon, |
56 | ptm->tm_mday, |
57 | ptm->tm_hour, |
58 | ptm->tm_min, |
59 | ptm->tm_sec, |
60 | file_header->name); |
61 | |
62 | #endif /* FEATURE_TAR_UNAME_GNAME */ |
63 | |
64 | if (file_header->link_target) { |
65 | printf(" -> %s", file_header->link_target); |
66 | } |
67 | bb_putchar('\n'); |
68 | } |