Stuf
This commit is contained in:
parent
a9c95ea655
commit
d80e851dc0
@ -11,6 +11,11 @@
|
|||||||
* NFS support added to mount by Eric Delaunay. It costs 10k when compiled
|
* NFS support added to mount by Eric Delaunay. It costs 10k when compiled
|
||||||
in, but that is still a big win for those that use NFS.
|
in, but that is still a big win for those that use NFS.
|
||||||
* Made 'rm -f' be silent for non-existant files (thanks to Eric Delaunay).
|
* Made 'rm -f' be silent for non-existant files (thanks to Eric Delaunay).
|
||||||
|
* changed zcat.c to gunzip.c. It now obeys the principle of least surprise
|
||||||
|
and acts as god intended gunzip and zcat to act. They answer --help and
|
||||||
|
obey the '-c' flag.
|
||||||
|
* Fixed a bug in mv which caused it to not move files when the destination
|
||||||
|
was a directory name.
|
||||||
|
|
||||||
-Erik Andersen
|
-Erik Andersen
|
||||||
|
|
||||||
|
26
Makefile
26
Makefile
@ -31,6 +31,30 @@ DOSTATIC=false
|
|||||||
#This will choke on a non-debian system
|
#This will choke on a non-debian system
|
||||||
ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
|
ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
|
||||||
|
|
||||||
|
GCCMAJVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\1/p"`
|
||||||
|
GCCMINVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\2/p"`
|
||||||
|
|
||||||
|
GCCSUPPORTSOPTSIZE=$(shell \
|
||||||
|
if ( test $(GCCMAJVERSION) -eq 2 ) ; then \
|
||||||
|
if ( test $(GCCMINVERSION) -ge 95 ) ; then \
|
||||||
|
echo "true"; \
|
||||||
|
else \
|
||||||
|
echo "false"; \
|
||||||
|
fi; \
|
||||||
|
else \
|
||||||
|
if ( test $(GCCMAJVERSION) -gt 2 ) ; then \
|
||||||
|
echo "true"; \
|
||||||
|
else \
|
||||||
|
echo "false"; \
|
||||||
|
fi; \
|
||||||
|
fi; )
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(GCCSUPPORTSOPTSIZE), true)
|
||||||
|
OPTIMIZATION=-Os
|
||||||
|
else
|
||||||
|
OPTIMIZATION=-O2
|
||||||
|
endif
|
||||||
|
|
||||||
# -D_GNU_SOURCE is needed because environ is used in init.c
|
# -D_GNU_SOURCE is needed because environ is used in init.c
|
||||||
ifeq ($(DODEBUG),true)
|
ifeq ($(DODEBUG),true)
|
||||||
@ -38,7 +62,7 @@ ifeq ($(DODEBUG),true)
|
|||||||
STRIP=
|
STRIP=
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
else
|
else
|
||||||
CFLAGS+=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
|
CFLAGS+=-Wall $(OPTIMIZATION) -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
|
||||||
LDFLAGS= -s
|
LDFLAGS= -s
|
||||||
STRIP= strip --remove-section=.note --remove-section=.comment $(PROG)
|
STRIP= strip --remove-section=.note --remove-section=.comment $(PROG)
|
||||||
#Only staticly link when _not_ debugging
|
#Only staticly link when _not_ debugging
|
||||||
|
@ -174,9 +174,9 @@ static const struct Applet applets[] = {
|
|||||||
#ifdef BB_UPDATE //sbin
|
#ifdef BB_UPDATE //sbin
|
||||||
{"update", update_main},
|
{"update", update_main},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_ZCAT //bin
|
#ifdef BB_GUNZIP //bin
|
||||||
{"zcat", zcat_main},
|
{"zcat", gunzip_main},
|
||||||
{"gunzip", zcat_main},
|
{"gunzip", gunzip_main},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GZIP //bin
|
#ifdef BB_GZIP //bin
|
||||||
{"gzip", gzip_main},
|
{"gzip", gzip_main},
|
||||||
|
@ -1788,7 +1788,6 @@ int gzip_main(int argc, char ** argv)
|
|||||||
tostdout = 1;
|
tostdout = 1;
|
||||||
}
|
}
|
||||||
while (*(++(*argv))) {
|
while (*(++(*argv))) {
|
||||||
fprintf(stderr, "**argv='%c'\n", **argv);
|
|
||||||
switch (**argv) {
|
switch (**argv) {
|
||||||
case 'c':
|
case 'c':
|
||||||
tostdout = 1;
|
tostdout = 1;
|
||||||
|
@ -174,9 +174,9 @@ static const struct Applet applets[] = {
|
|||||||
#ifdef BB_UPDATE //sbin
|
#ifdef BB_UPDATE //sbin
|
||||||
{"update", update_main},
|
{"update", update_main},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_ZCAT //bin
|
#ifdef BB_GUNZIP //bin
|
||||||
{"zcat", zcat_main},
|
{"zcat", gunzip_main},
|
||||||
{"gunzip", zcat_main},
|
{"gunzip", gunzip_main},
|
||||||
#endif
|
#endif
|
||||||
#ifdef BB_GZIP //bin
|
#ifdef BB_GZIP //bin
|
||||||
{"gzip", gzip_main},
|
{"gzip", gzip_main},
|
||||||
|
@ -59,8 +59,8 @@
|
|||||||
#define BB_UMOUNT
|
#define BB_UMOUNT
|
||||||
#define BB_UPDATE
|
#define BB_UPDATE
|
||||||
#define BB_UNAME
|
#define BB_UNAME
|
||||||
#define BB_ZCAT
|
|
||||||
#define BB_GZIP
|
#define BB_GZIP
|
||||||
|
#define BB_GUNZIP
|
||||||
// Don't turn BB_UTILITY off. It contains support code
|
// Don't turn BB_UTILITY off. It contains support code
|
||||||
// that compiles to 0 if everything else if turned off.
|
// that compiles to 0 if everything else if turned off.
|
||||||
#define BB_UTILITY
|
#define BB_UTILITY
|
||||||
|
@ -54,6 +54,8 @@ static int fileAction(const char *fileName, struct stat* statbuf)
|
|||||||
strcat(newdestName, "/");
|
strcat(newdestName, "/");
|
||||||
if ( skipName != NULL)
|
if ( skipName != NULL)
|
||||||
strcat(newdestName, strstr(fileName, skipName));
|
strcat(newdestName, strstr(fileName, skipName));
|
||||||
|
else
|
||||||
|
strcat(newdestName, srcName);
|
||||||
}
|
}
|
||||||
return (copyFile(fileName, newdestName, preserveFlag, followLinks));
|
return (copyFile(fileName, newdestName, preserveFlag, followLinks));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ extern int mv_main(int argc, char **argv)
|
|||||||
fprintf(stderr, "%s: not a directory\n", destName);
|
fprintf(stderr, "%s: not a directory\n", destName);
|
||||||
exit (FALSE);
|
exit (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (argc-- > 1) {
|
while (argc-- > 1) {
|
||||||
srcName = *(argv++);
|
srcName = *(argv++);
|
||||||
skipName = strrchr(srcName, '/');
|
skipName = strrchr(srcName, '/');
|
||||||
@ -67,6 +67,11 @@ extern int mv_main(int argc, char **argv)
|
|||||||
strcat(newdestName, "/");
|
strcat(newdestName, "/");
|
||||||
if ( skipName != NULL)
|
if ( skipName != NULL)
|
||||||
strcat(newdestName, strstr(srcName, skipName));
|
strcat(newdestName, strstr(srcName, skipName));
|
||||||
|
else
|
||||||
|
strcat(newdestName, srcName);
|
||||||
|
fprintf(stderr, "srcName='%s'\n", srcName);
|
||||||
|
fprintf(stderr, "skipName='%s'\n", skipName);
|
||||||
|
fprintf(stderr, "newdestName='%s'\n", newdestName);
|
||||||
}
|
}
|
||||||
if (copyFile(srcName, newdestName, FALSE, FALSE) == FALSE) {
|
if (copyFile(srcName, newdestName, FALSE, FALSE) == FALSE) {
|
||||||
exit( FALSE);
|
exit( FALSE);
|
||||||
|
2
cp.c
2
cp.c
@ -54,6 +54,8 @@ static int fileAction(const char *fileName, struct stat* statbuf)
|
|||||||
strcat(newdestName, "/");
|
strcat(newdestName, "/");
|
||||||
if ( skipName != NULL)
|
if ( skipName != NULL)
|
||||||
strcat(newdestName, strstr(fileName, skipName));
|
strcat(newdestName, strstr(fileName, skipName));
|
||||||
|
else
|
||||||
|
strcat(newdestName, srcName);
|
||||||
}
|
}
|
||||||
return (copyFile(fileName, newdestName, preserveFlag, followLinks));
|
return (copyFile(fileName, newdestName, preserveFlag, followLinks));
|
||||||
}
|
}
|
||||||
|
1
gzip.c
1
gzip.c
@ -1788,7 +1788,6 @@ int gzip_main(int argc, char ** argv)
|
|||||||
tostdout = 1;
|
tostdout = 1;
|
||||||
}
|
}
|
||||||
while (*(++(*argv))) {
|
while (*(++(*argv))) {
|
||||||
fprintf(stderr, "**argv='%c'\n", **argv);
|
|
||||||
switch (**argv) {
|
switch (**argv) {
|
||||||
case 'c':
|
case 'c':
|
||||||
tostdout = 1;
|
tostdout = 1;
|
||||||
|
4
init.c
4
init.c
@ -538,7 +538,3 @@ extern int init_main(int argc, char **argv)
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined FOO
|
|
||||||
#error Ack!
|
|
||||||
#endif
|
|
||||||
|
@ -538,7 +538,3 @@ extern int init_main(int argc, char **argv)
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined FOO
|
|
||||||
#error Ack!
|
|
||||||
#endif
|
|
||||||
|
@ -114,7 +114,7 @@ extern int tryopen_main(int argc, char** argv);
|
|||||||
extern int umount_main(int argc, char** argv);
|
extern int umount_main(int argc, char** argv);
|
||||||
extern int update_main(int argc, char** argv);
|
extern int update_main(int argc, char** argv);
|
||||||
extern int uname_main(int argc, char** argv);
|
extern int uname_main(int argc, char** argv);
|
||||||
extern int zcat_main(int argc, char** argv);
|
extern int gunzip_main (int argc, char** argv);
|
||||||
extern int gzip_main(int argc, char** argv);
|
extern int gzip_main(int argc, char** argv);
|
||||||
|
|
||||||
|
|
||||||
|
7
mv.c
7
mv.c
@ -56,7 +56,7 @@ extern int mv_main(int argc, char **argv)
|
|||||||
fprintf(stderr, "%s: not a directory\n", destName);
|
fprintf(stderr, "%s: not a directory\n", destName);
|
||||||
exit (FALSE);
|
exit (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (argc-- > 1) {
|
while (argc-- > 1) {
|
||||||
srcName = *(argv++);
|
srcName = *(argv++);
|
||||||
skipName = strrchr(srcName, '/');
|
skipName = strrchr(srcName, '/');
|
||||||
@ -67,6 +67,11 @@ extern int mv_main(int argc, char **argv)
|
|||||||
strcat(newdestName, "/");
|
strcat(newdestName, "/");
|
||||||
if ( skipName != NULL)
|
if ( skipName != NULL)
|
||||||
strcat(newdestName, strstr(srcName, skipName));
|
strcat(newdestName, strstr(srcName, skipName));
|
||||||
|
else
|
||||||
|
strcat(newdestName, srcName);
|
||||||
|
fprintf(stderr, "srcName='%s'\n", srcName);
|
||||||
|
fprintf(stderr, "skipName='%s'\n", skipName);
|
||||||
|
fprintf(stderr, "newdestName='%s'\n", newdestName);
|
||||||
}
|
}
|
||||||
if (copyFile(srcName, newdestName, FALSE, FALSE) == FALSE) {
|
if (copyFile(srcName, newdestName, FALSE, FALSE) == FALSE) {
|
||||||
exit( FALSE);
|
exit( FALSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user