2013-08-27 15:14:44 +04:00
|
|
|
#!/bin/bash
|
|
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
2014-07-07 22:06:38 +04:00
|
|
|
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
|
|
|
|
urequire DEFAULTS
|
2013-08-27 15:14:44 +04:00
|
|
|
|
|
|
|
function display_help() {
|
|
|
|
uecho "$scriptname: créer une image iso d'un répertoire
|
|
|
|
|
|
|
|
USAGE
|
|
|
|
$scriptname [options] srcdir [dest.iso]
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-M, --hfs
|
|
|
|
créer une image hybride ISO/HFS"
|
|
|
|
}
|
|
|
|
|
|
|
|
hfsmode=
|
|
|
|
parse_opts "${PRETTYOPTS[@]}" \
|
|
|
|
--help '$exit_with display_help' \
|
|
|
|
-M,--hfs hfsmode=1 \
|
|
|
|
@ args -- "$@" && set -- "${args[@]}" || die "$args"
|
|
|
|
|
|
|
|
srcdir="$(abspath "${1:-.}")"; shift
|
|
|
|
srcname="$(basename "$srcdir")"
|
|
|
|
dest="$(abspath "${1:-$srcname.iso}")"; shift
|
|
|
|
|
|
|
|
found=
|
|
|
|
for prog in genisoimage mkisofs; do
|
|
|
|
if progexists "$prog"; then
|
|
|
|
found=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
[ -n "$found" ] || die "Impossible de trouver genisoimage/mkisofs"
|
|
|
|
|
|
|
|
if ask_yesno "$(ppath "$srcdir")/* --> $(ppath "$dest")" O; then
|
|
|
|
"$prog" -A "CD: $srcname" -V "$srcname" -r -hide-rr-moved -J ${hfsmode:+-hfs -part --netatalk} "$@" -o "$dest" "$srcdir"
|
|
|
|
fi
|