aboutsummaryrefslogtreecommitdiff
path: root/source/blog/2014-10-25-os-x-package-receipts.md
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2015-05-04 14:55:10 -0700
committerZhiming Wang <zmwangx@gmail.com>2015-05-04 14:55:10 -0700
commit301679861a2440a10c9eac746cec86459f445ef9 (patch)
tree5aad22ead01cf0da226623f603f33867896c0fea /source/blog/2014-10-25-os-x-package-receipts.md
parentd0a07c64afba47bbe8bfb56ba9893296a73fc7db (diff)
downloadmy_new_personal_website-301679861a2440a10c9eac746cec86459f445ef9.tar.xz
my_new_personal_website-301679861a2440a10c9eac746cec86459f445ef9.zip
remove all Octopress stuff
Diffstat (limited to 'source/blog/2014-10-25-os-x-package-receipts.md')
-rw-r--r--source/blog/2014-10-25-os-x-package-receipts.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blog/2014-10-25-os-x-package-receipts.md b/source/blog/2014-10-25-os-x-package-receipts.md
new file mode 100644
index 00000000..a3695600
--- /dev/null
+++ b/source/blog/2014-10-25-os-x-package-receipts.md
@@ -0,0 +1,20 @@
+---
+layout: post
+title: "OS X package receipts"
+date: 2014-10-25 13:26:02 -0700
+comments: true
+categories:
+---
+I just learned something new. Whenever you install a `pkg` on OS X, OS X stores a receipt of what was installed in `/var/db/receipts` (I'm running OS X 10.9.5 at the time of writing), called a **bom** — bill of materials (I’d rather call it a manifest, whatever). This feature was introduced in NeXTSTEP. From `man 5 bom`:
+
+> The Mac OS X Installer uses a file system "bill of materials" to determine which files to install, remove, or upgrade. A bill of materials, **bom**, contains all the files within a directory, along with some information about each file. File information includes: the file's UNIX permissions, its owner and group, its size, its time of last modification, and so on. Also included are a checksum of each file and information about hard links.
+
+`man 5 bom` is actually badly maintained, as it says "The bill of materials for installed packages are found within the package receipts located in /Library/Receipts," whereas those have been migrated to `/var/db/receipts` a long time ago.
+
+`.bom` files are binary, but you can access the contents via `lsbom`. For instance, to list the files installed,
+
+ lsbom -f /var/db/receipts/org.macports.MacPorts.bom
+
+Note that the paths printed are always relative to `/`. See `man 1 lsbom` for detailed option listing.
+
+(Beware when you try to clean up unwanted packages using the `lsbom` listing. Packages might overwrite files, so make sure you review the listing first and know what you are doing. "Knowing what you are doing" is the prerequisite for using `sudo` anyway.)