Pack : Add iso pack support.
This commit is contained in:
parent
b405b37871
commit
24da2c529f
|
@ -45,6 +45,9 @@ function pack() {
|
|||
"xz")
|
||||
_pack_xz "${output}" "${targets[@]}"
|
||||
;;
|
||||
"iso")
|
||||
_pack_iso "${output}" "${targets[@]}"
|
||||
;;
|
||||
*)
|
||||
_error "${target}: Format not supported."
|
||||
return 2
|
||||
|
@ -130,6 +133,23 @@ function _pack_xz() {
|
|||
pv "${2}" | xz -9e > "${1}"
|
||||
}
|
||||
|
||||
function _pack_iso() {
|
||||
local input=("${@:2}")
|
||||
local output="${1}"
|
||||
local args=()
|
||||
|
||||
for arg in ${input[@]}; do
|
||||
[[ -d "${arg}" ]] || {
|
||||
_error "${arg} is not a directory."
|
||||
return 1
|
||||
};
|
||||
|
||||
args+=("${arg}=${arg}")
|
||||
done
|
||||
|
||||
genisoimage -J -r -pad -o "${output}" -graft-points "${args[@]}"
|
||||
}
|
||||
|
||||
function _unpack_zip() {
|
||||
unzip "${1}"
|
||||
}
|
||||
|
|
Reference in a new issue