Major rework of the directory structure and the entire build system.
-Erik
This commit is contained in:
43
archival/Makefile
Normal file
43
archival/Makefile
Normal file
@@ -0,0 +1,43 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=..
|
||||
L_TARGET := archival.a
|
||||
|
||||
obj-y :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
||||
obj-$(CONFIG_AR) += ar.o
|
||||
obj-$(CONFIG_BUNZIP2) += bunzip2.o
|
||||
obj-$(CONFIG_CPIO) += cpio.o
|
||||
obj-$(CONFIG_DPKG) += dpkg.o
|
||||
obj-$(CONFIG_DPKG_DEB) += dpkg_deb.o
|
||||
obj-$(CONFIG_GUNZIP) += gunzip.o
|
||||
obj-$(CONFIG_GZIP) += gzip.o
|
||||
obj-$(CONFIG_RPMUNPACK) += rpm2cpio.o
|
||||
obj-$(CONFIG_TAR) += tar.o
|
||||
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
19
archival/config.in
Normal file
19
archival/config.in
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see scripts/kbuild/config-language.txt.
|
||||
#
|
||||
|
||||
mainmenu_option next_comment
|
||||
comment 'Archival Utilities'
|
||||
|
||||
bool 'ar' CONFIG_AR
|
||||
bool 'bunzip2' CONFIG_BUNZIP2
|
||||
bool 'cpio' CONFIG_CPIO
|
||||
bool 'dpkg' CONFIG_DPKG
|
||||
bool 'dpkg_deb' CONFIG_DPKG_DEB
|
||||
bool 'gunzip' CONFIG_GUNZIP
|
||||
bool 'gzip' CONFIG_GZIP
|
||||
bool 'rpm2cpio' CONFIG_RPM2CPIO
|
||||
bool 'tar' CONFIG_TAR
|
||||
endmenu
|
||||
|
@@ -1231,7 +1231,7 @@ int gzip_main(int argc, char **argv)
|
||||
break;
|
||||
case 'q':
|
||||
break;
|
||||
#ifdef BB_GUNZIP
|
||||
#ifdef CONFIG_GUNZIP
|
||||
case 'd':
|
||||
optind = 1;
|
||||
return gunzip_main(argc, argv);
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* ground up. It still has remnents of the old code lying about, but it is
|
||||
* very different now (i.e., cleaner, less global variables, etc.)
|
||||
*
|
||||
* Copyright (C) 1999,2000,2001 by Lineo, inc.
|
||||
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
*
|
||||
* Based in part in the tar implementation in sash
|
||||
* Copyright (c) 1999 by David I. Bell
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <errno.h>
|
||||
#include "busybox.h"
|
||||
|
||||
#ifdef BB_FEATURE_TAR_CREATE
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
|
||||
/* Tar file constants */
|
||||
# define TAR_MAGIC "ustar" /* ustar and a null */
|
||||
@@ -395,11 +395,11 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
|
||||
if (header_name[0] == '\0')
|
||||
return TRUE;
|
||||
|
||||
# if defined BB_FEATURE_TAR_EXCLUDE
|
||||
# if defined CONFIG_FEATURE_TAR_EXCLUDE
|
||||
if (exclude_file(tbInfo->excludeList, header_name)) {
|
||||
return SKIP;
|
||||
}
|
||||
# endif //BB_FEATURE_TAR_EXCLUDE
|
||||
# endif //CONFIG_FEATURE_TAR_EXCLUDE
|
||||
|
||||
if (writeTarHeader(tbInfo, header_name, fileName, statbuf)==FALSE) {
|
||||
return( FALSE);
|
||||
@@ -527,7 +527,7 @@ void append_file_list_to_list(char *filename, char ***name_list, int *num_of_ent
|
||||
fclose(src_stream);
|
||||
}
|
||||
|
||||
#ifdef BB_FEATURE_TAR_EXCLUDE
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
/*
|
||||
* Create a list of names that are in the include list AND NOT in the exclude lists
|
||||
*/
|
||||
@@ -626,7 +626,7 @@ int tar_main(int argc, char **argv)
|
||||
|
||||
/* These are optional */
|
||||
/* Exclude or Include files listed in <filename>*/
|
||||
#ifdef BB_FEATURE_TAR_EXCLUDE
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
case 'X':
|
||||
append_file_list_to_list(optarg, &exclude_list, &exclude_list_count);
|
||||
break;
|
||||
@@ -660,7 +660,7 @@ int tar_main(int argc, char **argv)
|
||||
}
|
||||
extract_function |= extract_list;
|
||||
break;
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
case 'z':
|
||||
untar_funct |= untar_unzip;
|
||||
break;
|
||||
@@ -698,43 +698,43 @@ int tar_main(int argc, char **argv)
|
||||
} else {
|
||||
src_stream = stdin;
|
||||
}
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
/* Get a binary tree of all the tar file headers */
|
||||
if (untar_funct & untar_unzip) {
|
||||
uncompressed_stream = gz_open(src_stream, &gunzip_pid);
|
||||
} else
|
||||
#endif // BB_FEATURE_TAR_GZIP
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
uncompressed_stream = src_stream;
|
||||
|
||||
/* extract or list archive */
|
||||
unarchive(uncompressed_stream, stdout, &get_header_tar, extract_function, dst_prefix, include_list, exclude_list);
|
||||
fclose(uncompressed_stream);
|
||||
}
|
||||
#ifdef BB_FEATURE_TAR_CREATE
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
/* create an archive */
|
||||
else if (untar_funct & untar_create) {
|
||||
int verboseFlag = FALSE;
|
||||
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if (untar_funct && untar_unzip) {
|
||||
error_msg_and_die("Creation of compressed tarfile not internally support by tar, pipe to busybox gunzip");
|
||||
}
|
||||
#endif // BB_FEATURE_TAR_GZIP
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
if (extract_function & extract_verbose_list) {
|
||||
verboseFlag = TRUE;
|
||||
}
|
||||
writeTarFile(src_filename, verboseFlag, &argv[argc - 1], include_list);
|
||||
}
|
||||
#endif // BB_FEATURE_TAR_CREATE
|
||||
#endif // CONFIG_FEATURE_TAR_CREATE
|
||||
|
||||
/* Cleanups */
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if (untar_funct & untar_unzip) {
|
||||
fclose(src_stream);
|
||||
close(gz_fd);
|
||||
gz_close(gunzip_pid);
|
||||
}
|
||||
#endif // BB_FEATURE_TAR_GZIP
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
if (src_filename) {
|
||||
free(src_filename);
|
||||
}
|
||||
|
Reference in New Issue
Block a user