aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-10 09:13:28 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-10 09:13:28 -0400
commitad3d9102dbec58bdd72fffe933081e8d258e962d (patch)
tree32f91557fb89a7ca44116a828cf25b64e95925fd
parentf6684a2134ecc4959011955e89abb6103dd2eb2f (diff)
downloadapple_cmds-ad3d9102dbec58bdd72fffe933081e8d258e962d.tar.gz
apple_cmds-ad3d9102dbec58bdd72fffe933081e8d258e962d.tar.zst
apple_cmds-ad3d9102dbec58bdd72fffe933081e8d258e962d.zip
file_cmds: mtree probably won't work, but it does compile
-rw-r--r--file_cmds/Makefile30
-rw-r--r--file_cmds/chflags/Makefile3
-rw-r--r--file_cmds/chmod/Makefile5
-rw-r--r--file_cmds/chown/Makefile8
-rw-r--r--file_cmds/cksum/Makefile10
-rw-r--r--file_cmds/compress/Makefile6
-rw-r--r--file_cmds/cp/Makefile4
-rw-r--r--file_cmds/dd/Makefile4
-rw-r--r--file_cmds/df/Makefile6
-rw-r--r--file_cmds/du/Makefile3
-rw-r--r--file_cmds/gzip/Makefile15
-rw-r--r--file_cmds/install/Makefile4
-rw-r--r--file_cmds/ipcrm/Makefile3
-rw-r--r--file_cmds/ipcs/Makefile3
-rw-r--r--file_cmds/ln/Makefile5
-rw-r--r--file_cmds/ls/Makefile6
-rw-r--r--file_cmds/ls/ls.c1
-rw-r--r--file_cmds/mkdir/Makefile3
-rw-r--r--file_cmds/mkfifo/Makefile3
-rw-r--r--file_cmds/mknod/Makefile4
-rw-r--r--file_cmds/mtree/Makefile19
-rw-r--r--file_cmds/mtree/commoncrypto.c4
-rw-r--r--file_cmds/mv/Makefile3
-rw-r--r--file_cmds/pathchk/Makefile3
-rw-r--r--file_cmds/pax/Makefile21
-rw-r--r--file_cmds/pax/extern.h2
-rw-r--r--file_cmds/pax/options.c2
-rw-r--r--file_cmds/rm/Makefile4
-rw-r--r--file_cmds/rmdir/Makefile3
-rw-r--r--file_cmds/rmt/Makefile4
-rw-r--r--file_cmds/shar/Makefile4
-rw-r--r--file_cmds/stat/Makefile4
-rw-r--r--file_cmds/touch/Makefile3
33 files changed, 199 insertions, 3 deletions
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 <bsd.subdir.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <sys/param.h>
#include <get_compat.h>
#include <sys/sysctl.h>
-#include <System/sys/fsctl.h>
#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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <unistd.h>
#include <sys/xattr.h>
#include <sys/mount.h>
-#include <apfs/apfs_fsctl.h>
+//#include <apfs/apfs_fsctl.h>
#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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>
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 <bsd.prog.mk>