Hash :
c29c4552
Author :
Thomas de Grivel
Date :
2023-02-22T00:31:45
usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
#!/usr/bin/env ruby
require __FILE__ + '/../../lib/rbpkg'
log_path = Rbpkg.log_path("rbpkg")
FileUtils.mkdir_p(File.dirname(log_path))
$log = File.open(log_path, "w")
#verbose 2, "Logging to #{log_path}"
Rbpkg.init()
Rbpkg.lock("rbpkg")
def usage()
STDERR.puts """Usage: #{File.basename($0)} COMMAND REPO ...
Source directory commands :
clone shortcut for git clone
clean-sources remove source directory
fetch shortcut for git fetch
pull shortcut for git pull
checkout TREE shortcut for git checkout
Build commands :
configure configure build for this system
clean-configure remove configure-done tag file
build run parallel build
clean-build remove object files
test run tests
Package commands :
fake install into fake installation directory
clean-fake remove fake installation directory
package build package
clean-package remove package file
install install package
uninstall uninstall package
Misc commands :
clean-all clean all files
info show information
"""
exit 1
end
$ARGS = ARGV
def shift
usage if $ARGS == []
arg = $ARGS[0]
$ARGS = $ARGS[1..] || []
arg
end
def rbpkg
case shift
when "-h"
usage()
when "--help"
usage()
when "clone"
Rbpkg.git_clone($ARGS)
when "clean-sources"
Rbpkg.clean_sources($ARGS)
when "fetch"
Rbpkg.fetch($ARGS)
when "pull"
Rbpkg.pull($ARGS)
when "checkout"
branch = shift()
Rbpkg.checkout(branch, $ARGS)
when "configure"
Rbpkg.configure($ARGS)
when "clean-configure"
Rbpkg.clean_configure($ARGS)
when "build"
Rbpkg.build($ARGS)
when "clean-build"
Rbpkg.clean_build($ARGS)
when "test"
Rbpkg.test($ARGS)
when "fake"
Rbpkg.fake($ARGS)
when "clean-fake"
Rbpkg.clean_fake($ARGS)
when "package"
Rbpkg.package($ARGS)
when "clean-package"
Rbpkg.clean_package($ARGS)
when "clean-package"
Rbpkg.clean_package($ARGS)
when "install"
Rbpkg.install($ARGS)
when "uninstall"
Rbpkg.uninstall($ARGS)
when "clean-all"
Rbpkg.clean_all($ARGS)
when "info"
Rbpkg.info($ARGS)
else
usage
end
end
rbpkg