Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Last active February 7, 2016 21:13
Show Gist options
  • Save jbergstroem/c459b8d33be8634db7ed to your computer and use it in GitHub Desktop.
Save jbergstroem/c459b8d33be8634db7ed to your computer and use it in GitHub Desktop.
foo.diff
diff --git a/net-libs/nodejs/nodejs-5.5.0.ebuild b/net-libs/nodejs/nodejs-5.5.0.ebuild
index 8eed590..07bcccc 100644
--- a/net-libs/nodejs/nodejs-5.5.0.ebuild
+++ b/net-libs/nodejs/nodejs-5.5.0.ebuild
@@ -148,35 +148,26 @@ src_install() {
# Move man pages
doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
- rm -rf "${LIBDIR}"/node_modules/npm/man
# Clean up
rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
- rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die
-
- # Remove various development and/or inappropriate files and useless docs of dependend packages
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
+
+ local temp_name=("'AUTHORS*'" "'CHANGELOG*'" "'CONTRIBUT*'" \
+ "'README*'" "'.travis.yml'" "'.eslint*'" "'.wercker.yml'" \
+ "'.npmignore'" "'*.md'" "'*.markdown'" "'*.bat'" "'*.cmd'")
+ local find_exp="-or -name"
+ local find_name=( "${temp_name[@]/%/ ${find_exp}}" )
+ # drop last "-or -name"
+ find_name[-1]="${find_name[-1]%${find_exp}}"
+ local find_iname="-iname 'LICEN?E*' ${find_exp}"
+ # Remove various development and/or inappropriate files and
+ # useless docs of dependend packages.
find "${LIBDIR}"/node_modules \
- \( -type d -name examples \) -or \
- \( \
- -type f \( \
- -name 'LICENSE*' -or \
- -name 'LICENCE*' -or \
- -name 'License*' -or \
- -name 'AUTHORS*' -or \
- -name 'CONTRIBUTORS*' -or \
- -name 'CONTRIBUTING.*' -or \
- -name 'README*' -or \
- -name 'CHANGELOG*' -or \
- -name '.travis.yml' -or \
- -name '.eslint*' -or \
- -name '.wercker.yml' -or \
- -name '.npmignore' -or \
- -name '*.md' -or \
- -name '*.markdown' -or \
- -name '*.bat' -or \
- -name '*.cmd' \
- \) \
- \) -delete
+ \( -type d -name examples \) -or \( -type f \( \
+ "${find_iname}" "${find_name[@]}" \
+ \) \) -exec rm -rf "{}" \; \
eend $?
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment