Magellan Linux

Annotation of /trunk/mkinitrd-magellan/busybox/archival/libunarchive/header_verbose_list.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 984 - (hide 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)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 niro 532 /* 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 niro 816 void FAST_FUNC header_verbose_list(const file_header_t *file_header)
10 niro 532 {
11 niro 984 struct tm tm_time;
12     struct tm *ptm = &tm_time; //localtime(&file_header->mtime);
13 niro 532
14 niro 816 #if ENABLE_FEATURE_TAR_UNAME_GNAME
15 niro 984 char uid[sizeof(int)*3 + 2];
16     /*char gid[sizeof(int)*3 + 2];*/
17     char *user;
18     char *group;
19 niro 816
20 niro 984 localtime_r(&file_header->mtime, ptm);
21    
22     user = file_header->tar__uname;
23 niro 816 if (user == NULL) {
24 niro 984 sprintf(uid, "%u", (unsigned)file_header->uid);
25 niro 816 user = uid;
26     }
27 niro 984 group = file_header->tar__gname;
28 niro 816 if (group == NULL) {
29 niro 984 /*sprintf(gid, "%u", (unsigned)file_header->gid);*/
30     group = utoa(file_header->gid);
31 niro 816 }
32 niro 984 printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
33 niro 816 bb_mode_string(file_header->mode),
34     user,
35     group,
36 niro 984 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 niro 816 file_header->name);
44 niro 984
45 niro 816 #else /* !FEATURE_TAR_UNAME_GNAME */
46 niro 984
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 niro 532 bb_mode_string(file_header->mode),
51 niro 984 (unsigned)file_header->uid,
52     (unsigned)file_header->gid,
53 niro 532 file_header->size,
54 niro 984 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 niro 532 file_header->name);
61 niro 984
62 niro 816 #endif /* FEATURE_TAR_UNAME_GNAME */
63 niro 532
64 niro 816 if (file_header->link_target) {
65     printf(" -> %s", file_header->link_target);
66 niro 532 }
67 niro 816 bb_putchar('\n');
68 niro 532 }