Changes to sysfiles for better -text and install support. stone_gui_dialog.sh, stone_gui_text.sh, stone.sh: use type -p instead of which (the latter does not exist in 2nd stage small). IMHO, we should prefer type -p to which, because we depend on bash, which has type -p, and our which is an alias or a replacement script. stone_gui_text.sh: instead of "Press ENTER for next page" on long menus, display a ">>" prompt and read. Valid input is processed as usual, EOF or invalid input exits to caller, and ENTER (i.e. an empty line) displays the next page (as before). The last prompt, ">", remains unchanged. stone_gui_text.sh: clear the input line when a gui_input is answered with EOF. Currently there is no way to clear an input line (can't clear clock_rtc, con_blank, ...) stone_mod_gas.sh: this is gastone, a simple stone-based package manager. Supports categories and (un)installing a single package or an entire category. Requires gzip. stone_mod_packages.sh: allow mount options (I use --bind) and support gastone. Don't Display gasgui if it's missing. stone_mod_setup.sh: while installing, call set_tmarea() instead of set_tmzone [it's the new entrypoint for setting time zone] and call set_vcfont [seems logical - all other i18n-setting stone stuff is called]. git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1364 c5f82cb5-29bc-0310-9cd0-bff59a50e3bcrocklinux
@ -0,0 +1,93 @@ |
|||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/sysfiles/stone_mod_gas.sh |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
select_packages() { |
||||
|
local namever installed uninstalled |
||||
|
|
||||
|
for (( ; ; )) ; do |
||||
|
cmd="gui_menu gastone 'Install/Remove packages: $5 |
||||
|
|
||||
|
Note: any (un)installations are done immediately'" |
||||
|
|
||||
|
installed="" |
||||
|
uninstalled="" |
||||
|
time for (( i=${#pkgs[@]} - 1; i >= 0; i-- )) ; do |
||||
|
if echo "${cats[$i]}" | grep -q -F "$5" ; then |
||||
|
namever="${pkgs[$i]}-${vers[$i]}" |
||||
|
if [ -f $2/var/adm/packages/${pkgs[$i]} ] ; then |
||||
|
cmd="$cmd '[*] $namever' 'mine -r -R $2 ${pkgs[$i]}'" |
||||
|
installed="$installed ${pkgs[$i]}" |
||||
|
elif [ -f "$4/$1/pkgs/$namever.gem" ] ; then |
||||
|
cmd="$cmd '[ ] $namever' 'mine -i -R $2 $4/$1/pkgs/$namever.gem'" |
||||
|
uninstalled="$uninstalled $4/$1/pkgs/$namever.gem" |
||||
|
elif [ -f "$4/$1/pkgs/${pkgs[$i]}.gem" ] ; then |
||||
|
cmd="$cmd '[ ] $namever' 'mine -i -R $2 $4/$1/pkgs/${pkgs[$i]}.gem'" |
||||
|
uninstalled="$uninstalled $4/$1/pkgs/${pkgs[$i]}.gem" |
||||
|
fi |
||||
|
fi |
||||
|
done |
||||
|
[ "$uninstalled$installed" ] && cmd="$cmd '' ''" |
||||
|
[ "$uninstalled" ] && \ |
||||
|
cmd="$cmd 'Install all packages marked as [ ]' 'mine -i -R $2 $uninstalled'" |
||||
|
[ "$installed" ] && \ |
||||
|
cmd="$cmd 'Uninstall all packages marked as [*]' 'mine -r -R $2 $installed'" |
||||
|
|
||||
|
eval "$cmd" || break |
||||
|
done |
||||
|
} |
||||
|
|
||||
|
main() { |
||||
|
if ! [ -f $4/$1/packages.db ] ; then |
||||
|
gui_message "gas: package database not accessible." |
||||
|
return |
||||
|
fi |
||||
|
|
||||
|
if ! [ -d $2 ] ; then |
||||
|
gui_message "gas: target directory not accessible." |
||||
|
return |
||||
|
fi |
||||
|
|
||||
|
declare -a pkgs vers cats |
||||
|
local a b category |
||||
|
unset package |
||||
|
|
||||
|
while read a b ; do |
||||
|
if [ "$a" = "[C]" ] ; then cats[${#pkgs[@]}]="${cats[${#pkgs[@]}]} $b" |
||||
|
elif [ "$a" = "[V]" ] ; then vers[${#pkgs[@]}]="$b" |
||||
|
elif [ -z "$b" ] ; then |
||||
|
pkgs[${#pkgs[@]}]="$package" |
||||
|
vers[${#pkgs[@]}]="0.0" |
||||
|
cats[${#pkgs[@]}]="all/all" |
||||
|
package="$a" |
||||
|
else |
||||
|
gui_message "gas: invalid package database input '$a $b'." |
||||
|
return |
||||
|
fi |
||||
|
done < <( gzip -d < $4/$1/packages.db | grep "^[a-zA-Z0-9_+.-]\+$\|^\[[CV]\]") |
||||
|
[ "$package" ] && pkgs[${#pkgs[@]}]="$package" |
||||
|
|
||||
|
category="gui_menu category 'Select category'" |
||||
|
for i in `echo ${cats[@]} | sed -e 's/ /\n/g' | sort -u` ; do |
||||
|
category="$category $i 'select_packages $1 $2 $3 $4 $i'" |
||||
|
done |
||||
|
while eval "$category" ; do : ; done |
||||
|
} |