]> git.cameronkatri.com Git - apple_cmds.git/commitdiff
file_cmds: mtree probably won't work, but it does compile
authorCameron Katri <me@cameronkatri.com>
Mon, 10 May 2021 13:13:28 +0000 (09:13 -0400)
committerCameron Katri <me@cameronkatri.com>
Mon, 10 May 2021 13:13:28 +0000 (09:13 -0400)
33 files changed:
file_cmds/Makefile [new file with mode: 0644]
file_cmds/chflags/Makefile [new file with mode: 0644]
file_cmds/chmod/Makefile [new file with mode: 0644]
file_cmds/chown/Makefile [new file with mode: 0644]
file_cmds/cksum/Makefile [new file with mode: 0644]
file_cmds/compress/Makefile [new file with mode: 0644]
file_cmds/cp/Makefile [new file with mode: 0644]
file_cmds/dd/Makefile [new file with mode: 0644]
file_cmds/df/Makefile [new file with mode: 0644]
file_cmds/du/Makefile [new file with mode: 0644]
file_cmds/gzip/Makefile [new file with mode: 0644]
file_cmds/install/Makefile [new file with mode: 0644]
file_cmds/ipcrm/Makefile [new file with mode: 0644]
file_cmds/ipcs/Makefile [new file with mode: 0644]
file_cmds/ln/Makefile [new file with mode: 0644]
file_cmds/ls/Makefile [new file with mode: 0644]
file_cmds/ls/ls.c
file_cmds/mkdir/Makefile [new file with mode: 0644]
file_cmds/mkfifo/Makefile [new file with mode: 0644]
file_cmds/mknod/Makefile [new file with mode: 0644]
file_cmds/mtree/Makefile [new file with mode: 0644]
file_cmds/mtree/commoncrypto.c
file_cmds/mv/Makefile [new file with mode: 0644]
file_cmds/pathchk/Makefile [new file with mode: 0644]
file_cmds/pax/Makefile [new file with mode: 0644]
file_cmds/pax/extern.h
file_cmds/pax/options.c
file_cmds/rm/Makefile [new file with mode: 0644]
file_cmds/rmdir/Makefile [new file with mode: 0644]
file_cmds/rmt/Makefile [new file with mode: 0644]
file_cmds/shar/Makefile [new file with mode: 0644]
file_cmds/stat/Makefile [new file with mode: 0644]
file_cmds/touch/Makefile [new file with mode: 0644]

diff --git a/file_cmds/Makefile b/file_cmds/Makefile
new file mode 100644 (file)
index 0000000..d1f3031
--- /dev/null
@@ -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 (file)
index 0000000..287e327
--- /dev/null
@@ -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 (file)
index 0000000..c134e4a
--- /dev/null
@@ -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 (file)
index 0000000..be9d786
--- /dev/null
@@ -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 (file)
index 0000000..c5c38fa
--- /dev/null
@@ -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 (file)
index 0000000..2f87c36
--- /dev/null
@@ -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 (file)
index 0000000..e5fb6a8
--- /dev/null
@@ -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 (file)
index 0000000..7e90f72
--- /dev/null
@@ -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 (file)
index 0000000..5d8456d
--- /dev/null
@@ -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 (file)
index 0000000..ab61aa3
--- /dev/null
@@ -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 (file)
index 0000000..760cb20
--- /dev/null
@@ -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 (file)
index 0000000..41bdd0d
--- /dev/null
@@ -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 (file)
index 0000000..c3dc182
--- /dev/null
@@ -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 (file)
index 0000000..b26436a
--- /dev/null
@@ -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 (file)
index 0000000..674541a
--- /dev/null
@@ -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 (file)
index 0000000..8edb47a
--- /dev/null
@@ -0,0 +1,6 @@
+PROG=  ls
+SRCS=  cmp.c ls.c print.c util.c
+
+LDADD=-lutil
+
+.include <bsd.prog.mk>
index e07933392be74e12087450f8e03962c86e69a3f3..50fb91caa12bd46513147f6188b5720e0eadbe23 100644 (file)
@@ -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 (file)
index 0000000..baa4bc3
--- /dev/null
@@ -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 (file)
index 0000000..aa19b2a
--- /dev/null
@@ -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 (file)
index 0000000..0eae59b
--- /dev/null
@@ -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 (file)
index 0000000..aedc899
--- /dev/null
@@ -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>
index 11e97ceb085199f58afa79e19e050dc8cdf91043..36cfcb8ea4c4ce1a6f746b596f3be479fba04fa5 100644 (file)
@@ -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 (file)
index 0000000..b7be72c
--- /dev/null
@@ -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 (file)
index 0000000..a3ea46c
--- /dev/null
@@ -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 (file)
index 0000000..fe5902c
--- /dev/null
@@ -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>
index 16d31958b261bda04572da0e22199bed63e4b282..d2823de3bff3c7679a5cbf640685cc9daeab7a8c 100644 (file)
@@ -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
index 0544e5efa9ebf93ab8602e818ac10a2ab0d2398b..2d968bddee2034d57e5eb6f13f237705a50aa85f 100644 (file)
@@ -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 (file)
index 0000000..29b0c5b
--- /dev/null
@@ -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 (file)
index 0000000..a05d665
--- /dev/null
@@ -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 (file)
index 0000000..1e515ee
--- /dev/null
@@ -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 (file)
index 0000000..261ee43
--- /dev/null
@@ -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 (file)
index 0000000..71d9ee0
--- /dev/null
@@ -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 (file)
index 0000000..fcb8859
--- /dev/null
@@ -0,0 +1,3 @@
+PROG=  touch
+
+.include <bsd.prog.mk>