summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Mtree.pod
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Mtree.pod')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Mtree.pod28
1 files changed, 28 insertions, 0 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Mtree.pod b/usr.sbin/pkg_add/OpenBSD/Mtree.pod
new file mode 100644
index 00000000000..55a13aca679
--- /dev/null
+++ b/usr.sbin/pkg_add/OpenBSD/Mtree.pod
@@ -0,0 +1,28 @@
+$OpenBSD: Mtree.pod,v 1.1 2020/12/20 15:30:58 daniel Exp $
+
+=head1 NAME
+
+OpenBSD::Mtree - simple C<mtree(8)> spec parser
+
+=head1 SYNOPSIS
+
+ use OpenBSD::Mtree;
+
+ my %hier;
+
+ OpenBSD::Mtree::parse(\%hier, "/", "/etc/mtree/4.4BSD.dist");
+
+=head1 DESCRIPTION
+
+C<OpenBSD::Mtree> is a parser for C<mtree(8)> specifications that
+can reconstruct directory hierarchies.
+
+The basic function C<OpenBSD::Mtree::parse_fh(\%hash, $basedir, $fh)>
+will populate the hash C<$hash> with defined entries for each directory
+seen while reading from C<$fh>, assuming the specification is to be interpreted
+relative to C<$basedir> (some canonicalization of directory names will
+occur).
+
+C<OpenBSD::Mtree:parse(\%hash, $basedir, $filename)> is a convenience
+function which also handles opening the filehandle from C<$filename>
+and closing it after reading the specification.