archival/*: move "applet:" snippets into .c files
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 14 Nov 2013 08:54:24 +0000 (09:54 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 14 Nov 2013 08:54:24 +0000 (09:54 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 files changed:
archival/ar.c
archival/bbunzip.c
archival/bzip2.c
archival/cpio.c
archival/dpkg.c
archival/dpkg_deb.c
archival/gzip.c
archival/lzop.c
archival/rpm.c
archival/rpm2cpio.c
archival/tar.c
include/applets.src.h

index 0a8d828d63fa0011bb8d65f44ccddd876698bf87..866856f871589c6275e0da84b5b47814b9135fc5 100644 (file)
@@ -17,6 +17,7 @@
  * http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html
  */
 
+//applet:IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_AR) += ar.o
 
 //usage:#define ar_trivial_usage
index f2d796e679496a8299248c2b85ffed524dea8ff8..d34f56885ea45d07b6a157481ed153bc0fdddb72 100644 (file)
@@ -215,6 +215,7 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext)
 //usage:     "\n       -c      Write to stdout"
 //usage:     "\n       -f      Overwrite"
 
+//applet:IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_UNCOMPRESS) += bbunzip.o
 #if ENABLE_UNCOMPRESS
 static
@@ -256,9 +257,6 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv)
  * Portions of the lzw code are derived from the public domain 'compress'
  * written by Spencer Thomas, Joe Orost, James Woods, Jim McKie, Steve Davies,
  * Ken Turkowski, Dave Mack and Peter Jannesen.
- *
- * See the license_msg below and the file COPYING for the software license.
- * See the file algorithm.doc for the compression algorithms and file formats.
  */
 //usage:#define gunzip_trivial_usage
 //usage:       "[-cft] [FILE]..."
@@ -280,6 +278,8 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv)
 //usage:#define zcat_full_usage "\n\n"
 //usage:       "Decompress to stdout"
 
+//applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
+//applet:IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
 //kbuild:lib-$(CONFIG_GZIP) += bbunzip.o
 //kbuild:lib-$(CONFIG_GUNZIP) += bbunzip.o
 #if ENABLE_GUNZIP
@@ -432,6 +432,7 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
 //usage:#define xzcat_full_usage "\n\n"
 //usage:       "Decompress to stdout"
 
+//applet:IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_UNLZMA) += bbunzip.o
 #if ENABLE_UNLZMA
 static
@@ -458,6 +459,7 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv)
 #endif
 
 
+//applet:IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_UNXZ) += bbunzip.o
 #if ENABLE_UNXZ
 static
index 485afeb24f020531aaca33111388b138e31d1451..eabd1c2d61492a467abf2b5f8ce8b73d9eae5461 100644 (file)
@@ -7,6 +7,7 @@
  * about bzip2 library code.
  */
 
+//applet:IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_BZIP2) += bzip2.o
 
 //usage:#define bzip2_trivial_usage
index c228aabcc38b7c82c7ef7086a050a57508013767..41eb6f659f3d7a55ea88877219a62a37b919840a 100644 (file)
@@ -9,11 +9,11 @@
  * Limitations:
  * Doesn't check CRC's
  * Only supports new ASCII and CRC formats
- *
  */
 #include "libbb.h"
 #include "bb_archive.h"
 
+//applet:IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_CPIO) += cpio.o
 
 //usage:#define cpio_trivial_usage
index cd88a79c27fbe8e16a832e323bced465df69109d..288e7fa9f889eea4484a5bc1417678b3a36acc59 100644 (file)
@@ -25,9 +25,9 @@
  *
  * bugs that need to be fixed
  *  - (unknown, please let me know when you find any)
- *
  */
 
+//applet:IF_DPKG(APPLET(dpkg, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_DPKG) += dpkg.o
 
 //usage:#define dpkg_trivial_usage
index 39ae3e45e38cce2d1271ab7d640c81131fb596a2..6924f89119e57f0e607d16d9d1663dd9cf7c6ed0 100644 (file)
@@ -5,6 +5,7 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//applet:IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, BB_DIR_USR_BIN, BB_SUID_DROP, dpkg_deb))
 //kbuild:lib-$(CONFIG_DPKG_DEB) += dpkg_deb.o
 
 //usage:#define dpkg_deb_trivial_usage
index c850d5f5f9f7de97d471b7e653763b8e70e07244..5d6fdb91cf026bfdc4d34b50ed44b60ad383b59c 100644 (file)
@@ -39,6 +39,7 @@ gzip: bogus: No such file or directory
 aa:      85.1% -- replaced with aa.gz
 */
 
+//applet:IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_GZIP) += gzip.o
 
 //usage:#define gzip_trivial_usage
index 3c29b6eb8a8f0ed8344217908f332403f8e314f3..a7b42ac9d4de98c5e775c7ba1048697bf06aeecf 100644 (file)
@@ -25,6 +25,7 @@
    "Minimalized" for busybox by Alain Knaff
 */
 
+//applet:IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_LZOP) += lzop.o
 
 //usage:#define lzop_trivial_usage
index 3c386d2385c36a8db877e7f8e866d487462ba112..81a1d1d54543a852d09ae14bea580f9394a0522d 100644 (file)
@@ -7,6 +7,7 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//applet:IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_RPM) += rpm.o
 
 //usage:#define rpm_trivial_usage
index cd6786cc7a230809a2e40ea8e02f4a05e565603c..c48fc14cddc8d52ca636424c99da922545903660 100644 (file)
@@ -7,6 +7,7 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//applet:IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_RPM2CPIO) += rpm2cpio.o
 
 //usage:#define rpm2cpio_trivial_usage
index f75a82ad9b64622c90b9ae98fc6e9067bddf8a6f..25042589c2d90afddcd5c01ff8f3d3cb54b420d0 100644 (file)
@@ -42,6 +42,7 @@
  * This doesn't feel right, and IIRC GNU tar doesn't do that.
  */
 
+//applet:IF_TAR(APPLET(tar, BB_DIR_BIN, BB_SUID_DROP))
 //kbuild:lib-$(CONFIG_TAR) += tar.o
 
 #include <fnmatch.h>
index 0ba88f965513c0005beee3c95d88153c3a4335e2..0edfaacedb1a13eb45dc7503fd87f5b0408fc778 100644 (file)
@@ -79,7 +79,6 @@ IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP))
 IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP))
-IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP))
 IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename))
@@ -87,7 +86,6 @@ IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP))
 IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP))
 IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP))
-IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat))
 IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP))
@@ -106,7 +104,6 @@ IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum))
 IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp))
-IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP))
 IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP))
 /* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */
 IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
@@ -126,8 +123,6 @@ IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP))
 IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname))
 IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix))
-IF_DPKG(APPLET(dpkg, BB_DIR_USR_BIN, BB_SUID_DROP))
-IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, BB_DIR_USR_BIN, BB_SUID_DROP, dpkg_deb))
 IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP))
 IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -172,8 +167,6 @@ IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP))
 IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP))
-IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
-IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP))
 IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd))
 IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP))
 IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head))
@@ -303,8 +296,6 @@ IF_RFKILL(APPLET(rfkill, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm))
 IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir))
 IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP))
-IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
-IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts))
 IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -357,7 +348,6 @@ IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
 IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP))
 IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac))
 IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP))
-IF_TAR(APPLET(tar, BB_DIR_BIN, BB_SUID_DROP))
 IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP))
 /* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */
 IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd))
@@ -386,14 +376,10 @@ IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
 IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd))
 IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP))
 IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
-IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP))
 IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand))
 IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos))
-IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP))
-IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop))
-IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP))
 IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep))
 IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -411,7 +397,6 @@ IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
 IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat))
 IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz))
 IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
-IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
 IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP))
 
 #if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) \