mdxp/knife-cleanup — pull request #3 by pburkholder (2013-12-25 00:18:16+00:00)
Title: Runlist feature -- Merry Christmas!

I added this feature because the current behavior would delete cookbooks that are constrained by cookbook metadata, instead of being pinned by environment.

```
Here's an example of the diffs between the default behavior and the new behavior:

```
diff -U0 OLDversion NEWversion
--- OLDversion	2013-12-24 15:30:56.000000000 -0500
+++ NEWversion	2013-12-24 18:54:45.000000000 -0500
@@ -50,2 +50,2 @@
- 1 rsyslog 1.6.0
- 2 runit 1.3.0 1.2.0
+ 0 rsyslog
+ 1 runit 1.2.0
@@ -64 +64 @@
- 6 yum 2.4.3 2.4.2 2.4.0 2.3.4 2.3.2 2.3.0
+ 5 yum 2.4.3 2.4.2 2.4.0 2.3.2 2.3.0
```

This shows that, for example, the old code would have marked yum:2.3.4 for deletion, but's it's expected by $work-mongodb, which has depends `yum ~>2.3.0` in its metadata.

Likewise, the new version saves rsyslog:1.6.0, which is specified in $work-common `rsyslog ~> 1.6.0`

I think this makes it far less likely to delete cookbooks that are, in fact, still expected by chef.