tazpkg diff tazpkg-box @ rev 845

install: rebuild fs/ tree respecting destination symlinks before installing files and folders to filesystem
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Oct 06 15:46:41 2015 +0300 (2015-10-06)
parents 3f3db6d5be82
children b069086a45a4
line diff
     1.1 --- a/tazpkg-box	Fri Jul 24 15:11:32 2015 +0300
     1.2 +++ b/tazpkg-box	Tue Oct 06 15:46:41 2015 +0300
     1.3 @@ -1,13 +1,11 @@
     1.4  #!/bin/sh
     1.5 -#
     1.6 -# Small GTK boxes to TazPkg for deep desktop integration. PCManFM 0.5.x has a
     1.7 -# patch to extract a TazPkg file but not Thunar and other FM. TazPkgBox tries
     1.8 -# to follow Freedesktop standards.
     1.9 -#
    1.10 -# Copyright (C) 2011-2015 SliTaz GNU/Linux - GNU GPL v2
    1.11 -#
    1.12 -# Authors: Christophe Lincoln <pankso@slitaz.org>
    1.13 -#
    1.14 +# TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg
    1.15 +# tazpkg-box - part of TazPkg
    1.16 +# Small GTK boxes to TazPkg for deep desktop integration
    1.17 +
    1.18 +# Copyright (C) 2011-2015 SliTaz - GNU General Public License v3.
    1.19 +# Authors: See the AUTHORS files
    1.20 +
    1.21  
    1.22  # Internationalization.
    1.23  
    1.24 @@ -16,18 +14,18 @@
    1.25  
    1.26  text="<b>$(_ 'SliTaz Package Action')</b>"
    1.27  opts="--window-icon=tazpkg --image=tazpkg --image-on-top --center --on-top \
    1.28 ---height=260 --width=520 --title=TazPkg"
    1.29 +--height=350 --width=520 --title=TazPkg"
    1.30  
    1.31  
    1.32  usage() {
    1.33  	cat <<EOT
    1.34  $(_ 'Usage:') $(basename $0) [actions|URL] [$(_ 'package')]
    1.35 -
    1.36 + 
    1.37  Examples:
    1.38 -
    1.39 + 
    1.40  $(basename $0) actions /path/to/package-1.0.tazpkg
    1.41      display box to extract or install given package
    1.42 -
    1.43 + 
    1.44  $(basename $0) tazpkg://example.com/path/to/package-1.0.tazpkg
    1.45      download and install given package
    1.46  EOT
    1.47 @@ -43,16 +41,7 @@
    1.48  
    1.49  
    1.50  pkginfo() {
    1.51 -	tmp="$(mktemp -d)"; cd "$tmp"
    1.52 -	{ cpio --quiet -i receipt >/dev/null 2>&1; } < "$dir/$pkg"
    1.53 -	. "$tmp/receipt"
    1.54 -	rm -rf "$tmp"
    1.55 -	size=$(du -sh "$dir/$pkg" | awk '{print $1}')
    1.56 -	echo -e "$(_ 'Package')\n$PACKAGE
    1.57 -$(_ 'Version')\n$VERSION
    1.58 -$(_ 'Short desc')\n$SHORT_DESC
    1.59 -$(_ 'Unpacked size')\n$UNPACKED_SIZE
    1.60 -$(_ 'Depends')\n$DEPENDS"
    1.61 +	tazpkg info --output=gtk "$dir/$pkg" | sed 's| *:</b> |</b>\n|'
    1.62  }
    1.63  
    1.64  
    1.65 @@ -60,10 +49,10 @@
    1.66  
    1.67  actions_main() {
    1.68  	pkgname="${pkg%.tazpkg}"
    1.69 -	pkginfo | yad $opts --list --no-headers --no-click --text="$text" \
    1.70 -		--column '' --column '' \
    1.71 -		--button="$(_ 'Install'):3" \
    1.72 -		--button="$(_ 'Extract'):2" \
    1.73 +	pkginfo | yad $opts --list --no-headers --dclick-action="echo" --text="$text" \
    1.74 +		--column='' --column='' \
    1.75 +		--button="$(_ 'Install')!package-install:3" \
    1.76 +		--button="$(_ 'Extract')!extract-archive:2" \
    1.77  		--button='gtk-cancel:1'
    1.78  }
    1.79  
    1.80 @@ -87,9 +76,10 @@
    1.81  dl_inst() {
    1.82  	pkg="$(basename $url)"
    1.83  	_ 'Downloading: %s' "$pkg"; newline
    1.84 -	cd /tmp; wget "$url" 2>&1
    1.85 -	tazpkg -i "$pkg" --forced --output='raw' 2>&1
    1.86 -	rm -f "$pkg"
    1.87 +	TMP_DIR=$(mktemp); cd "$TMP_DIR"
    1.88 +	wget "$url" 2>&1
    1.89 +	tazpkg -i "$TMP_DIR/$pkg" --forced --output='raw' 2>&1
    1.90 +	rm -f "$TMP_DIR"
    1.91  }
    1.92  
    1.93  
    1.94 @@ -107,7 +97,8 @@
    1.95  		dl_inst | output ;;
    1.96  	actions)
    1.97  		[ -z "$2" ] && exit 1
    1.98 -		pkg="$(basename "$(realpath "${2%% }")")"		# fight against strange space at the end
    1.99 +		# fight against strange space at the end
   1.100 +		pkg="$(basename "$(realpath "${2%% }")")"
   1.101  		dir="$(dirname "$(realpath "${2%% }")")"
   1.102  		cd "$dir"
   1.103  		actions ;;