tazpkg annotate tazpkg-box @ rev 550
Tiny fix for case when user switch several times between repository with and without ID file
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Thu Mar 01 15:21:09 2012 +0100 (2012-03-01) |
parents | 1eb660b3a57a |
children | 25ebb1a6e665 |
rev | line source |
---|---|
pankso@541 | 1 #!/bin/sh |
pankso@541 | 2 # |
pankso@541 | 3 # Small GTK boxes to TazPKG for deep desktop integration. PcmanFM 0.5.x have a |
pankso@541 | 4 # patch to extract TazPKG file but not Thunar and othet FM. TazPKGbox try to |
pankso@541 | 5 # follow freedesktop standards. |
pankso@541 | 6 # |
pankso@541 | 7 # Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2 |
pankso@541 | 8 # |
pankso@541 | 9 # Authors : Christophe Lincoln <pankso@slitaz.org> |
pankso@541 | 10 # |
pankso@541 | 11 |
pankso@541 | 12 # Main GUI box function with pure Yad spec |
pankso@541 | 13 actions_main() { |
pankso@541 | 14 title=$(gettext "TazPKG actions") |
pankso@541 | 15 text=$(gettext "Package file name:") |
pankso@541 | 16 yad --text="$text <b>$pkg</b>" \ |
pankso@541 | 17 --width=520 --height=80 --dialog-sep \ |
pankso@541 | 18 --center --on-top --window-icon="tazpkg" \ |
pankso@541 | 19 --image="tazpkg" --image-on-top \ |
pankso@541 | 20 --button="Install:3" --button="Extract:2" \ |
pankso@541 | 21 --button="gtk-close:1" |
pankso@541 | 22 } |
pankso@541 | 23 |
pankso@541 | 24 # Actions user can do when clicking on a package. |
pankso@541 | 25 actions() { |
pankso@541 | 26 # Store box results |
pankso@541 | 27 main=$(actions_main) |
pankso@541 | 28 ret=$? |
pankso@541 | 29 # Deal with --button values |
pankso@541 | 30 case $ret in |
pankso@541 | 31 1) exit 0 ;; |
pankso@543 | 32 2) terminal -e "tazpkg extract $pkg" && exit 0 ;; |
pankso@543 | 33 3) terminal -e "tazpkg -i $pkg --forced" && exit 0 ;; |
pankso@541 | 34 esac |
pankso@541 | 35 } |
pankso@541 | 36 |
pankso@541 | 37 # |
pankso@541 | 38 # Script commands |
pankso@541 | 39 # |
pankso@541 | 40 |
pankso@541 | 41 case "$1" in |
pankso@541 | 42 usage) |
pankso@541 | 43 echo "Usage: $(basename $0) [command]" ;; |
pankso@541 | 44 actions) |
pankso@541 | 45 pkg="$2" |
pankso@541 | 46 actions ;; |
pankso@541 | 47 esac |
pankso@541 | 48 |
pankso@541 | 49 exit 0 |
pankso@541 | 50 |