The new tar for busybox is now done, and works just fine
for extracting files. Creation of tarballs is next... -Erik
This commit is contained in:
parent
e454fb68a3
commit
1ad302ac90
2
Makefile
2
Makefile
@ -21,6 +21,8 @@
|
||||
PROG := busybox
|
||||
VERSION := 0.43
|
||||
BUILDTIME := $(shell TZ=GMT date "+%Y%m%d-%H%M")
|
||||
BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
|
||||
BUILDTIME := $(shell TZ=UTC date --utc -R)
|
||||
|
||||
# Set the following to `true' to make a debuggable build.
|
||||
# Leave this set to `false' for production use.
|
||||
|
1201
archival/tar.c
1201
archival/tar.c
File diff suppressed because it is too large
Load Diff
@ -64,8 +64,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
&(tm_time->tm_min), &(tm_time->tm_year));
|
||||
|
||||
if (nr < 4 || nr > 5) {
|
||||
fprintf(stderr, invalid_date, "date", t_string);
|
||||
exit(FALSE);
|
||||
fatalError(invalid_date, "date", t_string);
|
||||
}
|
||||
|
||||
/* correct for century - minor Y2K problem here? */
|
||||
@ -149,10 +148,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
|
||||
|
||||
}
|
||||
|
||||
fprintf(stderr, invalid_date, "date", t_string);
|
||||
|
||||
exit(FALSE);
|
||||
|
||||
fatalError(invalid_date, "date", t_string);
|
||||
}
|
||||
|
||||
|
||||
@ -187,10 +183,8 @@ int date_main(int argc, char **argv)
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0) {
|
||||
fprintf(stderr, memory_exhausted, "date");
|
||||
exit(FALSE);
|
||||
}
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted, "date");
|
||||
/* Look ma, no break. Don't fix it either. */
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
@ -239,16 +233,13 @@ int date_main(int argc, char **argv)
|
||||
|
||||
/* Correct any day of week and day of year etc fields */
|
||||
tm = mktime(&tm_time);
|
||||
if (tm < 0) {
|
||||
fprintf(stderr, invalid_date, "date", date_str);
|
||||
exit(FALSE);
|
||||
}
|
||||
if (tm < 0)
|
||||
fatalError(invalid_date, "date", date_str);
|
||||
|
||||
/* if setting time, set it */
|
||||
if (set_time) {
|
||||
if (stime(&tm) < 0) {
|
||||
fprintf(stderr, "date: can't set date.\n");
|
||||
exit(FALSE);
|
||||
fatalError("date: can't set date.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,8 +57,8 @@ static const char dd_usage[] =
|
||||
|
||||
extern int dd_main(int argc, char **argv)
|
||||
{
|
||||
const char *inFile = NULL;
|
||||
const char *outFile = NULL;
|
||||
char *inFile = NULL;
|
||||
char *outFile = NULL;
|
||||
char *cp;
|
||||
int inFd;
|
||||
int outFd;
|
||||
|
@ -90,6 +90,11 @@
|
||||
#define DISP_DIRNAME 128 /* show directory name (for internal use) */
|
||||
#define DIR_RECURSE 256 /* -R (not yet implemented) */
|
||||
|
||||
#ifndef MAJOR
|
||||
#define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
#define MINOR(dev) ((dev)&0xff)
|
||||
#endif
|
||||
|
||||
static unsigned char display_fmt = FMT_AUTO;
|
||||
static unsigned short opts = 0;
|
||||
static unsigned short column = 0;
|
||||
|
23
date.c
23
date.c
@ -64,8 +64,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
&(tm_time->tm_min), &(tm_time->tm_year));
|
||||
|
||||
if (nr < 4 || nr > 5) {
|
||||
fprintf(stderr, invalid_date, "date", t_string);
|
||||
exit(FALSE);
|
||||
fatalError(invalid_date, "date", t_string);
|
||||
}
|
||||
|
||||
/* correct for century - minor Y2K problem here? */
|
||||
@ -149,10 +148,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
|
||||
|
||||
}
|
||||
|
||||
fprintf(stderr, invalid_date, "date", t_string);
|
||||
|
||||
exit(FALSE);
|
||||
|
||||
fatalError(invalid_date, "date", t_string);
|
||||
}
|
||||
|
||||
|
||||
@ -187,10 +183,8 @@ int date_main(int argc, char **argv)
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0) {
|
||||
fprintf(stderr, memory_exhausted, "date");
|
||||
exit(FALSE);
|
||||
}
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted, "date");
|
||||
/* Look ma, no break. Don't fix it either. */
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
@ -239,16 +233,13 @@ int date_main(int argc, char **argv)
|
||||
|
||||
/* Correct any day of week and day of year etc fields */
|
||||
tm = mktime(&tm_time);
|
||||
if (tm < 0) {
|
||||
fprintf(stderr, invalid_date, "date", date_str);
|
||||
exit(FALSE);
|
||||
}
|
||||
if (tm < 0)
|
||||
fatalError(invalid_date, "date", date_str);
|
||||
|
||||
/* if setting time, set it */
|
||||
if (set_time) {
|
||||
if (stime(&tm) < 0) {
|
||||
fprintf(stderr, "date: can't set date.\n");
|
||||
exit(FALSE);
|
||||
fatalError("date: can't set date.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
dd.c
4
dd.c
@ -57,8 +57,8 @@ static const char dd_usage[] =
|
||||
|
||||
extern int dd_main(int argc, char **argv)
|
||||
{
|
||||
const char *inFile = NULL;
|
||||
const char *outFile = NULL;
|
||||
char *inFile = NULL;
|
||||
char *outFile = NULL;
|
||||
char *cp;
|
||||
int inFd;
|
||||
int outFd;
|
||||
|
10
internal.h
10
internal.h
@ -47,11 +47,6 @@
|
||||
#define EXPAND_ALLOC 1024
|
||||
|
||||
|
||||
#ifndef MAJOR
|
||||
#define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
#define MINOR(dev) ((dev)&0xff)
|
||||
#endif
|
||||
|
||||
#define isBlank(ch) (((ch) == ' ') || ((ch) == '\t'))
|
||||
#define isDecimal(ch) (((ch) >= '0') && ((ch) <= '9'))
|
||||
#define isOctal(ch) (((ch) >= '0') && ((ch) <= '7'))
|
||||
@ -168,8 +163,8 @@ extern int yes_main(int argc, char** argv);
|
||||
|
||||
|
||||
extern void usage(const char *usage) __attribute__ ((noreturn));
|
||||
extern void errorMsg(char *s, ...);
|
||||
extern void fatalError(char *s, ...) __attribute__ ((noreturn));
|
||||
extern void errorMsg(const char *s, ...);
|
||||
extern void fatalError(const char *s, ...) __attribute__ ((noreturn));
|
||||
|
||||
const char *modeString(int mode);
|
||||
const char *timeString(time_t timeVal);
|
||||
@ -203,6 +198,7 @@ const char* timeString(time_t timeVal);
|
||||
extern int createPath (const char *name, int mode);
|
||||
extern int parse_mode( const char* s, mode_t* theMode);
|
||||
|
||||
extern int get_kernel_revision(void);
|
||||
extern uid_t my_getpwnam(char *name);
|
||||
extern gid_t my_getgrnam(char *name);
|
||||
extern void my_getpwuid(char* name, uid_t uid);
|
||||
|
5
ls.c
5
ls.c
@ -90,6 +90,11 @@
|
||||
#define DISP_DIRNAME 128 /* show directory name (for internal use) */
|
||||
#define DIR_RECURSE 256 /* -R (not yet implemented) */
|
||||
|
||||
#ifndef MAJOR
|
||||
#define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
#define MINOR(dev) ((dev)&0xff)
|
||||
#endif
|
||||
|
||||
static unsigned char display_fmt = FMT_AUTO;
|
||||
static unsigned short opts = 0;
|
||||
static unsigned short column = 0;
|
||||
|
@ -56,4 +56,7 @@ BB_DEF_MESSAGE(name_too_long, "%s: file name too long\n")
|
||||
#if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN
|
||||
BB_DEF_MESSAGE(invalid_option, "%s: invalid option -- %c\n")
|
||||
#endif
|
||||
#if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN
|
||||
BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s\n")
|
||||
#endif
|
||||
#endif /* _BB_MESSAGES_C */
|
||||
|
@ -89,7 +89,7 @@ extern void usage(const char *usage)
|
||||
exit FALSE;
|
||||
}
|
||||
|
||||
extern void errorMsg(char *s, ...)
|
||||
extern void errorMsg(const char *s, ...)
|
||||
{
|
||||
va_list p;
|
||||
|
||||
@ -100,7 +100,7 @@ extern void errorMsg(char *s, ...)
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
extern void fatalError(char *s, ...)
|
||||
extern void fatalError(const char *s, ...)
|
||||
{
|
||||
va_list p;
|
||||
|
||||
@ -117,7 +117,7 @@ extern void fatalError(char *s, ...)
|
||||
* so, for example, to check if the kernel is greater than 2.2.11:
|
||||
* if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> }
|
||||
*/
|
||||
int get_kernel_revision()
|
||||
extern int get_kernel_revision(void)
|
||||
{
|
||||
struct utsname name;
|
||||
int major = 0, minor = 0, patch = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user