forked from mirrored-repos/manjaro-tools
[deployiso] add sign/checksum option
This commit is contained in:
parent
d98639e344
commit
358fee880c
4 changed files with 16 additions and 1 deletions
|
@ -43,6 +43,7 @@ display_settings(){
|
||||||
msg "ARGS:"
|
msg "ARGS:"
|
||||||
msg2 "update: %s" "${update}"
|
msg2 "update: %s" "${update}"
|
||||||
msg2 "verbose: %s" "${verbose}"
|
msg2 "verbose: %s" "${verbose}"
|
||||||
|
msg2 "signiso: %s" "${sign}"
|
||||||
msg2 "torrent: %s" "${torrent}"
|
msg2 "torrent: %s" "${torrent}"
|
||||||
|
|
||||||
if ${torrent}; then
|
if ${torrent}; then
|
||||||
|
@ -72,6 +73,7 @@ pretend=false
|
||||||
torrent=false
|
torrent=false
|
||||||
update=false
|
update=false
|
||||||
verbose=false
|
verbose=false
|
||||||
|
sign=false
|
||||||
|
|
||||||
rsync_args=(-aPc --progress -e ssh)
|
rsync_args=(-aPc --progress -e ssh)
|
||||||
|
|
||||||
|
@ -82,6 +84,7 @@ usage() {
|
||||||
echo " -l Limit bandwidth in kB/s [default:${limit}]"
|
echo " -l Limit bandwidth in kB/s [default:${limit}]"
|
||||||
echo " -p Source folder to upload [default:${build_list_iso}]"
|
echo " -p Source folder to upload [default:${build_list_iso}]"
|
||||||
echo ' -q Query settings and pretend upload'
|
echo ' -q Query settings and pretend upload'
|
||||||
|
echo ' -s Sign ISO and create checksums'
|
||||||
echo ' -t Create iso torrent'
|
echo ' -t Create iso torrent'
|
||||||
echo ' -u Update remote directory'
|
echo ' -u Update remote directory'
|
||||||
echo ' -v Verbose output'
|
echo ' -v Verbose output'
|
||||||
|
@ -90,7 +93,7 @@ usage() {
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
opts='dhl:p:qtuv'
|
opts='dhl:p:qstuv'
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
|
@ -98,6 +101,7 @@ while getopts "${opts}" arg; do
|
||||||
l) limit="$OPTARG"; rsync_args+=(--bwlimit=${limit}) ;;
|
l) limit="$OPTARG"; rsync_args+=(--bwlimit=${limit}) ;;
|
||||||
p) build_list_iso="$OPTARG" ;;
|
p) build_list_iso="$OPTARG" ;;
|
||||||
q) pretend=true; rsync_args+=(-n) ;;
|
q) pretend=true; rsync_args+=(-n) ;;
|
||||||
|
s) sign=true ;;
|
||||||
t) torrent=true ;;
|
t) torrent=true ;;
|
||||||
u) update=true; rsync_args+=(-u) ;;
|
u) update=true; rsync_args+=(-u) ;;
|
||||||
v) verbose=true; rsync_args+=(-v --stats) ;;
|
v) verbose=true; rsync_args+=(-v --stats) ;;
|
||||||
|
|
|
@ -6,6 +6,8 @@ LIBDIR='/usr/lib/manjaro-tools'
|
||||||
|
|
||||||
import ${LIBDIR}/util.sh
|
import ${LIBDIR}/util.sh
|
||||||
|
|
||||||
|
[[ ! -z "$1" ]] && cd "$1"
|
||||||
|
|
||||||
for f in $(find . -maxdepth 1 -name '*.iso' | cut -d'/' -f2); do
|
for f in $(find . -maxdepth 1 -name '*.iso' | cut -d'/' -f2); do
|
||||||
if [[ ! -e $f.sha256 ]]; then
|
if [[ ! -e $f.sha256 ]]; then
|
||||||
create_chksums $f
|
create_chksums $f
|
||||||
|
|
|
@ -101,6 +101,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||||
<listitem><para>Query settings and pretend upload.</para></listitem>
|
<listitem><para>Query settings and pretend upload.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>-s</option></term>
|
||||||
|
|
||||||
|
<listitem><para>Sign ISO and create checksums before uploading.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-t</option></term>
|
<term><option>-t</option></term>
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,9 @@ sync_dir(){
|
||||||
cont=1
|
cont=1
|
||||||
max_cont=10
|
max_cont=10
|
||||||
prepare_transfer "$1" "${hidden}"
|
prepare_transfer "$1" "${hidden}"
|
||||||
|
|
||||||
|
${sign} && signiso "$1"
|
||||||
|
|
||||||
msg "Start upload [%s] to [%s] ..." "$1" "${project}"
|
msg "Start upload [%s] to [%s] ..." "$1" "${project}"
|
||||||
while [[ $cont -le $max_cont ]]; do
|
while [[ $cont -le $max_cont ]]; do
|
||||||
rsync ${rsync_args[*]} ${src_dir}/ ${url}/${target_dir}/
|
rsync ${rsync_args[*]} ${src_dir}/ ${url}/${target_dir}/
|
||||||
|
|
Loading…
Reference in a new issue