prepcompress is a new internal function needed for controllable compression in EAPI 4: <http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59ea804b01cd711d4235e46e4cc4fdef8390d5fe> It's still using D instead of ED throughout. Patch will follow.
Created attachment 258729 [details, diff] proposed patch for bin/misc-functions.sh
thanks, I pushed your patch
released in 2.2.01.17555