X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fjava-package.git;a=blobdiff_plain;f=lib%2Fcommon.sh;h=268c458085765822d722241835f3bff1a27cfa22;hp=4f9edd48bbd6cfbd3af9aa4a37c2a365e9402d9f;hb=3507a234b95476fe4ed3e6d7be685e4ffb2df576;hpb=96e84143de30aca040f44983e00cf4011fb794e8 diff --git a/lib/common.sh b/lib/common.sh index 4f9edd4..268c458 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -18,7 +18,7 @@ read_yn() { # diskusage : prints size in MB diskusage() { local path="$1" - read size dummy < <( du -sm "$path" ) + read size dummy < <( du -sm --apparent-size "$path" ) echo "$size" } @@ -69,7 +69,7 @@ EOF mkdir "$extract_dir" cd "$extract_dir" echo - + local extract_cmd case "$archive_path" in *.tar) @@ -83,7 +83,7 @@ EOF *) extract_cmd=sh esac - + if ! $extract_cmd "$archive_path"; then cat << EOF @@ -137,7 +137,7 @@ read_maintainer_info() { maintainer_name="$DEBNAME" else default_name="$(getent passwd $(id -run) | cut -d: -f5| cut -d, -f1)" - + cat << EOF Please enter your full name. This value will be used in the maintainer @@ -154,12 +154,12 @@ EOF done fi fi - + if [ -z "$maintainer_email" ]; then local default_email= if [ -n "$DEBEMAIL" ]; then maintainer_email="$DEBEMAIL" - else + else if [ -r "/etc/mailname" ]; then default_email="$( id -run )@$( cat /etc/mailname )" else @@ -187,8 +187,25 @@ get_architecture() { export DEB_BUILD_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH) export DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - + echo "Detected Debian build architecture: ${DEB_BUILD_ARCH:-N/A}" - + echo "Detected Debian GNU type: ${DEB_BUILD_GNU_TYPE:-N/A}" } + +# get browser plugin directories +get_browser_plugin_dirs() { + if dpkg-vendor --derives-from Ubuntu; then + export browser_plugin_dirs="xulrunner-addons firefox iceape iceweasel mozilla midbrowser xulrunner" + else + export browser_plugin_dirs=mozilla + fi +} + +get_distribution() { + if [ -n "$distribution" ]; then + target_distribution="$distribution" + else + target_distribution="unstable" + fi +}