From ad3d9102dbec58bdd72fffe933081e8d258e962d Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Mon, 10 May 2021 09:13:28 -0400 Subject: [PATCH 1/1] file_cmds: mtree probably won't work, but it does compile --- file_cmds/Makefile | 30 ++++++++++++++++++++++++++++++ file_cmds/chflags/Makefile | 3 +++ file_cmds/chmod/Makefile | 5 +++++ file_cmds/chown/Makefile | 8 ++++++++ file_cmds/cksum/Makefile | 10 ++++++++++ file_cmds/compress/Makefile | 6 ++++++ file_cmds/cp/Makefile | 4 ++++ file_cmds/dd/Makefile | 4 ++++ file_cmds/df/Makefile | 6 ++++++ file_cmds/du/Makefile | 3 +++ file_cmds/gzip/Makefile | 15 +++++++++++++++ file_cmds/install/Makefile | 4 ++++ file_cmds/ipcrm/Makefile | 3 +++ file_cmds/ipcs/Makefile | 3 +++ file_cmds/ln/Makefile | 5 +++++ file_cmds/ls/Makefile | 6 ++++++ file_cmds/ls/ls.c | 1 - file_cmds/mkdir/Makefile | 3 +++ file_cmds/mkfifo/Makefile | 3 +++ file_cmds/mknod/Makefile | 4 ++++ file_cmds/mtree/Makefile | 19 +++++++++++++++++++ file_cmds/mtree/commoncrypto.c | 4 +++- file_cmds/mv/Makefile | 3 +++ file_cmds/pathchk/Makefile | 3 +++ file_cmds/pax/Makefile | 21 +++++++++++++++++++++ file_cmds/pax/extern.h | 2 +- file_cmds/pax/options.c | 2 ++ file_cmds/rm/Makefile | 4 ++++ file_cmds/rmdir/Makefile | 3 +++ file_cmds/rmt/Makefile | 4 ++++ file_cmds/shar/Makefile | 4 ++++ file_cmds/stat/Makefile | 4 ++++ file_cmds/touch/Makefile | 3 +++ 33 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 file_cmds/Makefile create mode 100644 file_cmds/chflags/Makefile create mode 100644 file_cmds/chmod/Makefile create mode 100644 file_cmds/chown/Makefile create mode 100644 file_cmds/cksum/Makefile create mode 100644 file_cmds/compress/Makefile create mode 100644 file_cmds/cp/Makefile create mode 100644 file_cmds/dd/Makefile create mode 100644 file_cmds/df/Makefile create mode 100644 file_cmds/du/Makefile create mode 100644 file_cmds/gzip/Makefile create mode 100644 file_cmds/install/Makefile create mode 100644 file_cmds/ipcrm/Makefile create mode 100644 file_cmds/ipcs/Makefile create mode 100644 file_cmds/ln/Makefile create mode 100644 file_cmds/ls/Makefile create mode 100644 file_cmds/mkdir/Makefile create mode 100644 file_cmds/mkfifo/Makefile create mode 100644 file_cmds/mknod/Makefile create mode 100644 file_cmds/mtree/Makefile create mode 100644 file_cmds/mv/Makefile create mode 100644 file_cmds/pathchk/Makefile create mode 100644 file_cmds/pax/Makefile create mode 100644 file_cmds/rm/Makefile create mode 100644 file_cmds/rmdir/Makefile create mode 100644 file_cmds/rmt/Makefile create mode 100644 file_cmds/shar/Makefile create mode 100644 file_cmds/stat/Makefile create mode 100644 file_cmds/touch/Makefile diff --git a/file_cmds/Makefile b/file_cmds/Makefile new file mode 100644 index 0000000..d1f3031 --- /dev/null +++ b/file_cmds/Makefile @@ -0,0 +1,30 @@ +SUBDIR= chflags \ + chmod \ + chown \ + cksum \ + compress \ + cp \ + dd \ + df \ + du \ + gzip \ + install \ + ipcrm \ + ipcs \ + ln \ + ls \ + mkdir \ + mkfifo \ + mknod \ + mtree \ + mv \ + pathchk \ + pax \ + rm \ + rmdir \ + rmt \ + shar \ + stat \ + touch + +.include diff --git a/file_cmds/chflags/Makefile b/file_cmds/chflags/Makefile new file mode 100644 index 0000000..287e327 --- /dev/null +++ b/file_cmds/chflags/Makefile @@ -0,0 +1,3 @@ +PROG= chflags + +.include diff --git a/file_cmds/chmod/Makefile b/file_cmds/chmod/Makefile new file mode 100644 index 0000000..c134e4a --- /dev/null +++ b/file_cmds/chmod/Makefile @@ -0,0 +1,5 @@ +PROG= chmod +SRCS= chmod.c \ + chmod_acl.c + +.include diff --git a/file_cmds/chown/Makefile b/file_cmds/chown/Makefile new file mode 100644 index 0000000..be9d786 --- /dev/null +++ b/file_cmds/chown/Makefile @@ -0,0 +1,8 @@ +PROG= chown +MAN= chown.8 chgrp.1 + +BINDIR=/usr/sbin + +LINKS= ${BINDIR}/chown /usr/bin/chgrp + +.include diff --git a/file_cmds/cksum/Makefile b/file_cmds/cksum/Makefile new file mode 100644 index 0000000..c5c38fa --- /dev/null +++ b/file_cmds/cksum/Makefile @@ -0,0 +1,10 @@ +PROG= cksum +MAN= cksum.1 sum.1 +SRCS= cksum.c \ + crc.c \ + crc32.c \ + print.c \ + sum1.c \ + sum2.c + +.include diff --git a/file_cmds/compress/Makefile b/file_cmds/compress/Makefile new file mode 100644 index 0000000..2f87c36 --- /dev/null +++ b/file_cmds/compress/Makefile @@ -0,0 +1,6 @@ +PROG= compress +MAN= compress.1 uncompress.1 zopen.3 +SRCS= compress.c zopen.c +SCRIPTS= zcat.sh + +.include diff --git a/file_cmds/cp/Makefile b/file_cmds/cp/Makefile new file mode 100644 index 0000000..e5fb6a8 --- /dev/null +++ b/file_cmds/cp/Makefile @@ -0,0 +1,4 @@ +PROG= cp +SRCS= cp.c utils.c + +.include diff --git a/file_cmds/dd/Makefile b/file_cmds/dd/Makefile new file mode 100644 index 0000000..7e90f72 --- /dev/null +++ b/file_cmds/dd/Makefile @@ -0,0 +1,4 @@ +PROG= dd +SRCS= args.c conv_tab.c conv.c dd.c misc.c position.c + +.include diff --git a/file_cmds/df/Makefile b/file_cmds/df/Makefile new file mode 100644 index 0000000..5d8456d --- /dev/null +++ b/file_cmds/df/Makefile @@ -0,0 +1,6 @@ +PROG= df +SRCS= df.c vfslist.c + +LDADD=-lutil + +.include diff --git a/file_cmds/du/Makefile b/file_cmds/du/Makefile new file mode 100644 index 0000000..ab61aa3 --- /dev/null +++ b/file_cmds/du/Makefile @@ -0,0 +1,3 @@ +PROG= du + +.include diff --git a/file_cmds/gzip/Makefile b/file_cmds/gzip/Makefile new file mode 100644 index 0000000..760cb20 --- /dev/null +++ b/file_cmds/gzip/Makefile @@ -0,0 +1,15 @@ +PROG= gzip +SRCS= futimens.c \ + gzip.c +MAN= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1 +SCRIPTS= gzexe \ + gzip \ + zdiff \ + zforce \ + zmore \ + znew + +CFLAGS+=-DGZIP_APPLE_VERSION=\"321.40.3\" +LDADD=-llzma -lz -lbz2 + +.include diff --git a/file_cmds/install/Makefile b/file_cmds/install/Makefile new file mode 100644 index 0000000..41bdd0d --- /dev/null +++ b/file_cmds/install/Makefile @@ -0,0 +1,4 @@ +PROG= install +SRCS= xinstall.c + +.include diff --git a/file_cmds/ipcrm/Makefile b/file_cmds/ipcrm/Makefile new file mode 100644 index 0000000..c3dc182 --- /dev/null +++ b/file_cmds/ipcrm/Makefile @@ -0,0 +1,3 @@ +PROG= ipcrm + +.include diff --git a/file_cmds/ipcs/Makefile b/file_cmds/ipcs/Makefile new file mode 100644 index 0000000..b26436a --- /dev/null +++ b/file_cmds/ipcs/Makefile @@ -0,0 +1,3 @@ +PROG= ipcs + +.include diff --git a/file_cmds/ln/Makefile b/file_cmds/ln/Makefile new file mode 100644 index 0000000..674541a --- /dev/null +++ b/file_cmds/ln/Makefile @@ -0,0 +1,5 @@ +PROG= ln +MAN= link.1 ln.1 symlink.7 +LINKS= ${BINDIR}/ln ${BINDIR}/link + +.include diff --git a/file_cmds/ls/Makefile b/file_cmds/ls/Makefile new file mode 100644 index 0000000..8edb47a --- /dev/null +++ b/file_cmds/ls/Makefile @@ -0,0 +1,6 @@ +PROG= ls +SRCS= cmp.c ls.c print.c util.c + +LDADD=-lutil + +.include diff --git a/file_cmds/ls/ls.c b/file_cmds/ls/ls.c index e079333..50fb91c 100644 --- a/file_cmds/ls/ls.c +++ b/file_cmds/ls/ls.c @@ -75,7 +75,6 @@ __RCSID("$FreeBSD: src/bin/ls/ls.c,v 1.66 2002/09/21 01:28:36 wollman Exp $"); #include #include #include -#include #else #define COMPAT_MODE(a,b) (1) #endif /* __APPLE__ */ diff --git a/file_cmds/mkdir/Makefile b/file_cmds/mkdir/Makefile new file mode 100644 index 0000000..baa4bc3 --- /dev/null +++ b/file_cmds/mkdir/Makefile @@ -0,0 +1,3 @@ +PROG= mkdir + +.include diff --git a/file_cmds/mkfifo/Makefile b/file_cmds/mkfifo/Makefile new file mode 100644 index 0000000..aa19b2a --- /dev/null +++ b/file_cmds/mkfifo/Makefile @@ -0,0 +1,3 @@ +PROG= mkfifo + +.include diff --git a/file_cmds/mknod/Makefile b/file_cmds/mknod/Makefile new file mode 100644 index 0000000..0eae59b --- /dev/null +++ b/file_cmds/mknod/Makefile @@ -0,0 +1,4 @@ +PROG= mknod +MAN= mknod.8 + +.include diff --git a/file_cmds/mtree/Makefile b/file_cmds/mtree/Makefile new file mode 100644 index 0000000..aedc899 --- /dev/null +++ b/file_cmds/mtree/Makefile @@ -0,0 +1,19 @@ +PROG= mtree +MAN= mtree.8 +SRCS= commoncrypto.c \ + compare.c \ + create.c \ + excludes.c \ + metrics.c \ + misc.c \ + mtree.c \ + spec.c \ + specspec.c \ + verify.c \ + crc.c + +.PATH: ../cksum + +LDADD=-framework CoreFoundation + +.include diff --git a/file_cmds/mtree/commoncrypto.c b/file_cmds/mtree/commoncrypto.c index 11e97ce..36cfcb8 100644 --- a/file_cmds/mtree/commoncrypto.c +++ b/file_cmds/mtree/commoncrypto.c @@ -12,7 +12,7 @@ #include #include #include -#include +//#include #include "commoncrypto.h" #include "extern.h" @@ -255,6 +255,7 @@ get_xdstream_privateid(char *path, char *buf) { nextName += strlen(name) + 1; } +#ifdef APFSIOC_XDSTREAM_OBJ_ID for (int i = 0; i < xattrIndex; i++) { char *name = xattrs[i]; // System volume has stream based xattrs only in form of resource forks @@ -276,6 +277,7 @@ get_xdstream_privateid(char *path, char *buf) { } } } +#endif ai->xdstream_priv_id = xd_obj_id; // insert a dummy value as digest is not used in presence of mflag diff --git a/file_cmds/mv/Makefile b/file_cmds/mv/Makefile new file mode 100644 index 0000000..b7be72c --- /dev/null +++ b/file_cmds/mv/Makefile @@ -0,0 +1,3 @@ +PROG= mv + +.include diff --git a/file_cmds/pathchk/Makefile b/file_cmds/pathchk/Makefile new file mode 100644 index 0000000..a3ea46c --- /dev/null +++ b/file_cmds/pathchk/Makefile @@ -0,0 +1,3 @@ +PROG= pathchk + +.include diff --git a/file_cmds/pax/Makefile b/file_cmds/pax/Makefile new file mode 100644 index 0000000..fe5902c --- /dev/null +++ b/file_cmds/pax/Makefile @@ -0,0 +1,21 @@ +PROG= pax +MAN= cpio.1 pax.1 +SRCS= ar_io.c \ + ar_subs.c \ + buf_subs.c \ + cache.c \ + cpio.c \ + file_subs.c \ + ftree.c \ + gen_subs.c \ + getoldopt.c \ + options.c \ + pat_rep.c \ + pax_format.c \ + pax.c \ + sel_subs.c \ + tables.c \ + tar.c \ + tty_subs.c + +.include diff --git a/file_cmds/pax/extern.h b/file_cmds/pax/extern.h index 16d3195..d2823de 100644 --- a/file_cmds/pax/extern.h +++ b/file_cmds/pax/extern.h @@ -203,7 +203,7 @@ int opt_add(const char *); int bad_opt(void); int pax_format_opt_add(char *); int pax_opt(void); -char *chdname; +extern char *chdname; /* * pat_rep.c diff --git a/file_cmds/pax/options.c b/file_cmds/pax/options.c index 0544e5e..2d968bd 100644 --- a/file_cmds/pax/options.c +++ b/file_cmds/pax/options.c @@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: options.c,v 1.70 2008/06/11 00:49: #include "tar.h" #include "extern.h" +char *chdname; + /* * Routines which handle command line options */ diff --git a/file_cmds/rm/Makefile b/file_cmds/rm/Makefile new file mode 100644 index 0000000..29b0c5b --- /dev/null +++ b/file_cmds/rm/Makefile @@ -0,0 +1,4 @@ +PROG= rm +MAN= rm.1 unlink.1 + +.include diff --git a/file_cmds/rmdir/Makefile b/file_cmds/rmdir/Makefile new file mode 100644 index 0000000..a05d665 --- /dev/null +++ b/file_cmds/rmdir/Makefile @@ -0,0 +1,3 @@ +PROG= rmdir + +.include diff --git a/file_cmds/rmt/Makefile b/file_cmds/rmt/Makefile new file mode 100644 index 0000000..1e515ee --- /dev/null +++ b/file_cmds/rmt/Makefile @@ -0,0 +1,4 @@ +PROG= rmt +MAN= rmt.8 + +.include diff --git a/file_cmds/shar/Makefile b/file_cmds/shar/Makefile new file mode 100644 index 0000000..261ee43 --- /dev/null +++ b/file_cmds/shar/Makefile @@ -0,0 +1,4 @@ +SCRIPTS= shar.sh +MAN= shar.1 + +.include diff --git a/file_cmds/stat/Makefile b/file_cmds/stat/Makefile new file mode 100644 index 0000000..71d9ee0 --- /dev/null +++ b/file_cmds/stat/Makefile @@ -0,0 +1,4 @@ +PROG= stat +MAN= readlink.1 stat.1 + +.include diff --git a/file_cmds/touch/Makefile b/file_cmds/touch/Makefile new file mode 100644 index 0000000..fcb8859 --- /dev/null +++ b/file_cmds/touch/Makefile @@ -0,0 +1,3 @@ +PROG= touch + +.include -- 2.47.1