aboutsummaryrefslogtreecommitdiff
path: root/build/blog/2014-10-25-os-x-package-receipts.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2017-04-28 00:30:19 +0200
committerneodarz <neodarz@neodarz.net>2017-04-28 00:30:19 +0200
commit9a88e9ff0385f66e7c565a394908503dc6e916ad (patch)
tree05ea8b356163f06c5fc99c2caf67fa8d3a28d67d /build/blog/2014-10-25-os-x-package-receipts.html
parentf1965c50670f611ef54f9471490d45a554f7d866 (diff)
downloadmy_new_personal_website-9a88e9ff0385f66e7c565a394908503dc6e916ad.tar.xz
my_new_personal_website-9a88e9ff0385f66e7c565a394908503dc6e916ad.zip
Site updated at 2017-04-28T00:29:42+02:00
source branch was at: f1965c50670f611ef54f9471490d45a554f7d866 Correct a link
Diffstat (limited to 'build/blog/2014-10-25-os-x-package-receipts.html')
-rw-r--r--build/blog/2014-10-25-os-x-package-receipts.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/build/blog/2014-10-25-os-x-package-receipts.html b/build/blog/2014-10-25-os-x-package-receipts.html
new file mode 100644
index 00000000..863156ab
--- /dev/null
+++ b/build/blog/2014-10-25-os-x-package-receipts.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<meta content="pandoc" name="generator"/>
+<meta content="Zhiming Wang" name="author"/>
+<meta content="2014-10-25T13:26:02-0700" name="date"/>
+<title>OS X package receipts</title>
+<link href="/img/apple-touch-icon-152.png" rel="apple-touch-icon-precomposed"/>
+<meta content="#FFFFFF" name="msapplication-TileColor"/>
+<meta content="/img/favicon-144.png" name="msapplication-TileImage"/>
+<meta content="width=device-width, initial-scale=1" name="viewport"/>
+<link href="/css/normalize.min.css" media="all" rel="stylesheet" type="text/css"/>
+<link href="/css/theme.css" media="all" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="archival-notice">This blog has been archived.<br/>Visit my home page at <a href="https://zhimingwang.org">zhimingwang.org</a>.</div>
+<nav class="nav">
+<a class="nav-icon" href="/" title="Home"><!--blog icon--></a>
+<a class="nav-title" href="/"><!--blog title--></a>
+<a class="nav-author" href="https://github.com/zmwangx" target="_blank"><!--blog author--></a>
+</nav>
+<article class="content">
+<header class="article-header">
+<h1 class="article-title">OS X package receipts</h1>
+<div class="article-metadata">
+<time class="article-timestamp" datetime="2014-10-25T13:26:02-0700">October 25, 2014</time>
+</div>
+</header>
+<p>I just learned something new. Whenever you install a <code>pkg</code> on OS X, OS X stores a receipt of what was installed in <code>/var/db/receipts</code> (I'm running OS X 10.9.5 at the time of writing), called a <strong>bom</strong> — bill of materials (I’d rather call it a manifest, whatever). This feature was introduced in NeXTSTEP. From <code>man 5 bom</code>:</p>
+<blockquote>
+<p>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, <strong>bom</strong>, 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.</p>
+</blockquote>
+<p><code>man 5 bom</code> 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 <code>/var/db/receipts</code> a long time ago.</p>
+<p><code>.bom</code> files are binary, but you can access the contents via <code>lsbom</code>. For instance, to list the files installed,</p>
+<pre><code>lsbom -f /var/db/receipts/org.macports.MacPorts.bom</code></pre>
+<p>Note that the paths printed are always relative to <code>/</code>. See <code>man 1 lsbom</code> for detailed option listing.</p>
+<p>(Beware when you try to clean up unwanted packages using the <code>lsbom</code> 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 <code>sudo</code> anyway.)</p>
+</article>
+<hr class="content-separator"/>
+<footer class="footer">
+<span class="rfooter">
+<a class="rss-icon" href="/rss.xml" target="_blank" title="RSS feed"><!--RSS feed icon--></a><a class="atom-icon" href="/atom.xml" target="_blank" title="Atom feed"><!--Atom feed icon--></a><a class="cc-icon" href="https://creativecommons.org/licenses/by/4.0/" target="_blank" title="Released under the Creative Commons Attribution 4.0 International license."><!--CC icon--></a>
+<a href="https://github.com/zmwangx" target="_blank">Zhiming Wang</a>
+</span>
+</footer>
+</body>
+</html>