lib/conjur/fpm/debify_utils.sh in conjur-debify-1.10.2 vs lib/conjur/fpm/debify_utils.sh in conjur-debify-1.10.3
- old
+ new
@@ -7,5 +7,26 @@
# some cleanup
rm -rf vendor/bundle/ruby/${ruby_version}/cache
rm -rf vendor/bundle/ruby/${ruby_version}/gems/*/{test,spec,examples,example,contrib,doc,ext,sample}
fi
}
+
+# Remove files from the current directory that also exist in another given
+# directory. For example, say in the current directory there is:
+# foo
+# bar/baz
+# bar/xyzzy
+# bacon
+# people/phlebas
+# and in dir2 there is
+# bacon
+# alice
+# people/phlebas
+# bar/xyzzy
+# then after running `remove_matching dir2` current directory will be left with only:
+# foo
+# bar/baz
+# Note it probably isn't 100% fool-proof, so don't launch it out to space or something.
+function remove_matching() {
+ find "$1" -type f -print0 | sed -ze "s@^$1@.@" | xargs -0 rm -f
+ find . -type d -empty -delete
+}