Sha256: a9d77b69d382d2cc3b3ad6fb8f0417f104f22e02a8451276cd1c64ecd319ac42

Contents?: true

Size: 428 Bytes

Versions: 9

Compression:

Stored size: 428 Bytes

Contents

#!/usr/bin/env ruby

require 'fileutils'
include FileUtils::Verbose

msg = "Usage: #$0 EXECUTABLE DIR [LIB ..]"
executable = ARGV.shift or fail msg
dir = ARGV.shift or fail msg 
dir = File.expand_path dir
mkdir_p dir

executable = `which #{executable}`.chomp
libs = `ldd #{executable}`.gsub(/^(?:.*?\s+=>\s+|\s+)(.*?)\(.*/, '\1').grep(/\S/).map { |x| x.strip }
libs.concat ARGV
cd dir
for l in libs
  cp l, File.basename(l)
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
utils-0.0.10 bin/chroot-libs
utils-0.0.8 bin/chroot-libs
utils-0.0.7 bin/chroot-libs
utils-0.0.6 bin/chroot-libs
utils-0.0.5 bin/chroot-libs
utils-0.0.4 bin/chroot-libs
utils-0.0.3 bin/chroot-libs
utils-0.0.2 bin/chroot-libs
utils-0.0.0 bin/chroot-libs