+# some Ruby code to replace library paths in binary files
+# should work with Ruby 1.9 and 1.8
+! read -d '' fixpath <<"EOF"
+if String.method_defined?(:encode)
+ $_.encode!("UTF-8", "UTF-8", :invalid => :replace)
+end
+$_.gsub!(/#{ENV["br"]}(.*?)\0/) do |s|
+ $1 + ( "\0" * ENV["br"].size ) + "\0"
+end
+EOF
+