Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168371762
D59037.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1012 B
Referenced Files
None
Subscribers
None
D59037.diff
View Options
diff --git a/tools/tools/nanobsd/_xxx_includes.subr b/tools/tools/nanobsd/_xxx_includes.subr
--- a/tools/tools/nanobsd/_xxx_includes.subr
+++ b/tools/tools/nanobsd/_xxx_includes.subr
@@ -40,3 +40,31 @@
_xxx_libarchive_mtree_bug() {
sed -i "" -e 's|^/\. |\. |' "$NANO_METALOG"
}
+
+#######################################################################
+# freebsd-base(7) (pkgbase) variables and functions
+#
+
+#
+# Add an entry to the metalog
+# $1=file/direcrory, $2=mode (optional), $3=metalog file (optional)
+#
+metalog_add_data() {
+ local entry metalog mode type
+
+ entry="$1"
+ if [ -f "${NANO_WORLDDIR}/${entry}" ]; then
+ type="file"
+ mode=${2:-0644}
+ elif [ -d "${NANO_WORLDDIR}/${entry}" ]; then
+ type="dir"
+ mode=${2:-0755}
+ else
+ err "metalog_add_data: ${entry} not found"
+ fi
+ metalog=${3:-$NANO_METALOG}
+ if [ -n "$metalog" ]; then
+ printf "%s type=%s uname=%s gname=%s mode=%s\n" \
+ "$entry" "$type" "$NANO_DEF_UNAME" "$NANO_DEF_GNAME" "$mode" >> "$metalog"
+ fi
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 28, 8:12 PM (7 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37031016
Default Alt Text
D59037.diff (1012 B)
Attached To
Mode
D59037: nanobsd: Add metalog_add_data helper
Attached
Detach File
Event Timeline
Log In to Comment