diff options
Diffstat (limited to 'file_cmds')
38 files changed, 265 insertions, 7 deletions
diff --git a/file_cmds/Makefile b/file_cmds/Makefile new file mode 100644 index 0000000..44e87bb --- /dev/null +++ b/file_cmds/Makefile @@ -0,0 +1,30 @@ +SUBDIR= chflags \ + chmod \ + chown \ + cksum \ + compress \ + cp \ + dd \ + df \ + du \ + gzip \ + ipcrm \ + ipcs \ + ln \ + ls \ + mkdir \ + mkfifo \ + mknod \ + mtree \ + mv \ + pathchk \ + pax \ + rm \ + rmdir \ + rmt \ + shar \ + stat \ + touch \ + xinstall + +.include <bsd.subdir.mk> diff --git a/file_cmds/Makefile.inc b/file_cmds/Makefile.inc new file mode 100644 index 0000000..01b5f23 --- /dev/null +++ b/file_cmds/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/file_cmds/chflags/Makefile b/file_cmds/chflags/Makefile new file mode 100644 index 0000000..a734b6e --- /dev/null +++ b/file_cmds/chflags/Makefile @@ -0,0 +1,5 @@ +PROG= chflags + +BINDIR=/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/chmod/Makefile b/file_cmds/chmod/Makefile new file mode 100644 index 0000000..0815c98 --- /dev/null +++ b/file_cmds/chmod/Makefile @@ -0,0 +1,7 @@ +PROG= chmod +SRCS= chmod.c \ + chmod_acl.c + +BINDIR=/bin + +.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..be8950d --- /dev/null +++ b/file_cmds/cksum/Makefile @@ -0,0 +1,12 @@ +PROG= cksum +MAN= cksum.1 sum.1 +SRCS= cksum.c \ + crc.c \ + crc32.c \ + print.c \ + sum1.c \ + sum2.c + +LINKS+= ${BINDIR}/cksum ${BINDIR}/sum + +.include <bsd.prog.mk> diff --git a/file_cmds/compress/Makefile b/file_cmds/compress/Makefile new file mode 100644 index 0000000..1dba0de --- /dev/null +++ b/file_cmds/compress/Makefile @@ -0,0 +1,10 @@ +PROG= compress +MAN= compress.1 uncompress.1 zopen.3 +SRCS= compress.c zopen.c +SCRIPTS= zcat.sh + +BINDIR=/usr/bin + +LINKS+= ${BINDIR}/compress ${BINDIR}/uncompress + +.include <bsd.prog.mk> diff --git a/file_cmds/cp/Makefile b/file_cmds/cp/Makefile new file mode 100644 index 0000000..492fb0d --- /dev/null +++ b/file_cmds/cp/Makefile @@ -0,0 +1,6 @@ +PROG= cp +SRCS= cp.c utils.c + +BINDIR=/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/dd/Makefile b/file_cmds/dd/Makefile new file mode 100644 index 0000000..72f3c3a --- /dev/null +++ b/file_cmds/dd/Makefile @@ -0,0 +1,6 @@ +PROG= dd +SRCS= args.c conv_tab.c conv.c dd.c misc.c position.c + +BINDIR=/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/df/Makefile b/file_cmds/df/Makefile new file mode 100644 index 0000000..99a7194 --- /dev/null +++ b/file_cmds/df/Makefile @@ -0,0 +1,3 @@ +MAN= df.1 + +.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..8250e3e --- /dev/null +++ b/file_cmds/gzip/Makefile @@ -0,0 +1,17 @@ +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 + +BINDIR=/usr/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/install/Makefile b/file_cmds/install/Makefile new file mode 100644 index 0000000..3116d07 --- /dev/null +++ b/file_cmds/install/Makefile @@ -0,0 +1,9 @@ +# @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ + +PROG= xinstall +PROGNAME= install +SRCS= xinstall.c +MAN= install.1 + +.include <bsd.prog.mk> diff --git a/file_cmds/install/xinstall.c b/file_cmds/install/xinstall.c index 5e6bcec..49934aa 100644 --- a/file_cmds/install/xinstall.c +++ b/file_cmds/install/xinstall.c @@ -721,21 +721,29 @@ void strip(to_name) char *to_name; { + const char *stripbin; + const char *args[3]; pid_t pid; int error; extern char** environ; - char *const argv[] = { "xcrun", "strip", "-", to_name, NULL }; + + stripbin = getenv("STRIPBIN"); + if (stripbin == NULL) + stripbin = "strip"; + args[0] = stripbin; + args[1] = to_name; + args[2] = NULL; - if (0 == (error = posix_spawnp(&pid, "xcrun", NULL, NULL, argv, environ))) { + if (0 == (error = posix_spawnp(&pid, stripbin, NULL, NULL, (char**)args, environ))) { int status = 0; pid_t child = waitpid(pid, &status, 0); if ((child == -1) || status) { unlink(to_name); - errx(EX_SOFTWARE, "child process failed: xcrun strip - %s", to_name); + errx(EX_SOFTWARE, "child process failed: %p", args); } } else { errno = error; - err(EX_OSERR, "xcrun strip - %s", to_name); + err(EX_OSERR, "%p", args); } } 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..1d79542 --- /dev/null +++ b/file_cmds/ipcs/Makefile @@ -0,0 +1,5 @@ +PROG= ipcs + +CFLAGS+=-Duser32_time_t=user_time_t -Duser32_addr_t=user_addr_t -Duser64_time_t=user_time_t + +.include <bsd.prog.mk> diff --git a/file_cmds/ln/Makefile b/file_cmds/ln/Makefile new file mode 100644 index 0000000..db89bfa --- /dev/null +++ b/file_cmds/ln/Makefile @@ -0,0 +1,6 @@ +PROG= ln +MAN= link.1 ln.1 symlink.7 +BINDIR=/bin +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..2872cbe --- /dev/null +++ b/file_cmds/ls/Makefile @@ -0,0 +1,10 @@ +PROG= ls +SRCS= cmp.c ls.c print.c util.c + +CFLAGS+=-DCOLORLS + +LDADD=-lutil -lncursesw + +BINDIR=/bin + +.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..ea70b14 --- /dev/null +++ b/file_cmds/mkdir/Makefile @@ -0,0 +1,5 @@ +PROG= mkdir + +BINDIR=/bin + +.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..04efea7 --- /dev/null +++ b/file_cmds/mknod/Makefile @@ -0,0 +1,6 @@ +PROG= mknod +MAN= mknod.8 + +BINDIR=/sbin + +.include <bsd.prog.mk> diff --git a/file_cmds/mtree/Makefile b/file_cmds/mtree/Makefile new file mode 100644 index 0000000..177c7e8 --- /dev/null +++ b/file_cmds/mtree/Makefile @@ -0,0 +1,22 @@ +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: ${.CURDIR}/../cksum + +CFLAGS+=-DENABLE_MD5 -DENABLE_RMD160 -DENABLE_SHA1 -DENABLE_SHA256 +LDADD=-framework CoreFoundation + +BINDIR=/usr/sbin + +.include <bsd.prog.mk> diff --git a/file_cmds/mtree/commoncrypto.c b/file_cmds/mtree/commoncrypto.c index 0ac621c..fd4258e 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" @@ -256,6 +256,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 @@ -277,6 +278,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..81f7de0 --- /dev/null +++ b/file_cmds/mv/Makefile @@ -0,0 +1,7 @@ +PROG= mv + +LDADD+=-liosexec + +BINDIR=/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/mv/mv.c b/file_cmds/mv/mv.c index 52a2938..e237123 100644 --- a/file_cmds/mv/mv.c +++ b/file_cmds/mv/mv.c @@ -80,6 +80,8 @@ __RCSID("$FreeBSD: src/bin/mv/mv.c,v 1.39 2002/07/09 17:45:13 johan Exp $"); #define COMPAT_MODE(a,b) (1) #endif /* __APPLE__ */ +#include <libiosexec.h> + #include "pathnames.h" int fflg, iflg, nflg, vflg; 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..1ea323c --- /dev/null +++ b/file_cmds/pax/Makefile @@ -0,0 +1,25 @@ +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 + +LDADD+=-liosexec + +BINDIR=/bin + +.include <bsd.prog.mk> diff --git a/file_cmds/pax/ar_io.c b/file_cmds/pax/ar_io.c index 1c4b943..6ed3e83 100644 --- a/file_cmds/pax/ar_io.c +++ b/file_cmds/pax/ar_io.c @@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: ar_io.c,v 1.38 2008/06/11 00:49:08 #include "options.h" #include "extern.h" +#include <libiosexec.h> + /* * Routines which deal directly with the archive I/O device/file. */ 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..c20e93e --- /dev/null +++ b/file_cmds/rm/Makefile @@ -0,0 +1,8 @@ +PROG= rm +MAN= rm.1 unlink.1 + +BINDIR=/bin + +LINKS+= ${BINDIR}/rm ${BINDIR}/unlink + +.include <bsd.prog.mk> diff --git a/file_cmds/rmdir/Makefile b/file_cmds/rmdir/Makefile new file mode 100644 index 0000000..e54393e --- /dev/null +++ b/file_cmds/rmdir/Makefile @@ -0,0 +1,5 @@ +PROG= rmdir + +BINDIR=/bin + +.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..28b769e --- /dev/null +++ b/file_cmds/stat/Makefile @@ -0,0 +1,6 @@ +PROG= stat +MAN= readlink.1 stat.1 + +LINKS+= ${BINDIR}/stat ${BINDIR}/readlink + +.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> diff --git a/file_cmds/xinstall b/file_cmds/xinstall new file mode 120000 index 0000000..f7ffc47 --- /dev/null +++ b/file_cmds/xinstall @@ -0,0 +1 @@ +install
\ No newline at end of file |