#!/bin/dash
# (C) James Budiono 2014
# License: GPL Version 3 or later.
#
### view contents of a zipball
# $1 - tarball package

[ -z "$1" ] && echo "Usage: ${0##*/} zipball" && exit
out=$(mktemp -p /tmp viewtarball.XXXXXXXX)

### 1. List
unzip -l "$1" 2> /dev/null |
awk -v fn="$1" '
{
	for (i=4; i<=NF; i++) printf ("%s",$i)
	print ""
}
END {
	print "===\nListing completed."
}' > $out &

Xdialog --title "View Zipball $1" --no-cancel --tailbox $out 25 80
rm $out
