1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/*/stone/stone_mod_packages.sh
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # [MAIN] 90 packages Package Management (Install, Update and Remove)
18 if [ -n "$ROCK_INSTALL_SOURCE_DEV" ] ; then
19 dev
="$ROCK_INSTALL_SOURCE_DEV"
20 dir
="/media" ; root
="/mnt"
23 SDECFG_SHORTID
="Automatically choose first"
24 elif [ -n "$ROCK_INSTALL_SOURCE_URL" ] ; then
26 dir
="$ROCK_INSTALL_SOURCE_URL" ; root
="/mnt"
29 SDECFG_SHORTID
="$( grep '^export SDECFG_SHORTID=' \
30 /etc/SDE-CONFIG/config 2> /dev/null | cut -f2- -d= )"
31 SDECFG_SHORTID
="${SDECFG_SHORTID//\'/}"
34 dir
="/media/cdrom" ; root
="/"
37 SDECFG_SHORTID
="$( grep '^export SDECFG_SHORTID=' \
38 /etc/SDE-CONFIG/config 2> /dev/null | cut -f2- -d= )"
39 SDECFG_SHORTID
="${SDECFG_SHORTID//\'/}"
44 rm -f $mnt ; mkdir
$mnt
48 if mount
$opt $dev $mnt ; then
49 for x
in `cd $mnt; ls -d */{,TOOLCHAIN/}pkgs 2> /dev/null | sed -e 's,/pkgs$,,'`
51 cmd
="$cmd '$x' 'SDECFG_SHORTID=\"$x\"'"
55 cmd
="$cmd 'The medium could not be mounted!' ''"
62 [ -z "$( cd $dir; ls )" ] && mount
$opt -v -o ro
$dev $dir
63 if [ "$SDECFG_SHORTID" = "Automatically choose first" ]; then
64 SDECFG_SHORTID
="$( cd $dir; ls -d */{,TOOLCHAIN/}pkgs 2> /dev/null | \
65 sed -e 's,/pkgs$,,' | head -n 1 )"
66 echo "Using Config-ID <${SDECFG_SHORTID:-None}> .."
68 SDECFG_PKGFILE_TYPE
="$(grep '^export SDECFG_PKGFILE_TYPE=' \
69 /etc/SDE-CONFIG/config 2> /dev/null | cut -f2- -d=)"
70 SDECFG_PKGFILE_TYPE
="${SDECFG_PKGFILE_TYPE//\'/}"
71 if [ $startgas = 1 ] ; then
73 echo "Running: gasgui $gasguiopt \\"
74 echo " -c '$SDECFG_SHORTID' \\"
78 echo " -S '$SDECFG_PKGFILE_TYPE'"
80 gasgui
$gasguiopt -c "$SDECFG_SHORTID" -t "$root" -d "$dev" -s "$dir" -S "$SDECFG_PKGFILE_TYPE"
81 elif [ $startgas = 2 ] ; then
83 echo "Running: stone gas main \\"
84 echo " '$SDECFG_SHORTID' \\"
88 $STONE gas main
"$SDECFG_SHORTID" "$root" "$dev" "$dir"
95 cmd
="gui_menu packages 'Package Management
97 Note: You can install, update and remove packages (as well as query
98 package information) with the command-line tool \"mine\". This is just
99 a simple frontend for the \"mine\" program.'"
101 cmd
="$cmd 'Mount Options: $opt'"
102 cmd
="$cmd 'gui_input \"Mount Options (e.g. -s -o sync) \" \"\$opt\" opt'"
104 cmd
="$cmd 'Source Device: $dev'"
105 cmd
="$cmd 'gui_input \"Source Device\" \"\$dev\" dev'"
107 cmd
="$cmd 'Mountpoint: $dir'"
108 cmd
="$cmd 'gui_input \"Mountpoint\" \"\$dir\" dir'"
110 cmd
="$cmd 'Config ID: $SDECFG_SHORTID'"
111 cmd
="$cmd 'gui_input \"Config ID\""
112 cmd
="$cmd \"\$SDECFG_SHORTID\" SDECFG_SHORTID'"
117 type -p gasgui
> /dev
/null
&&
118 cmd
="$cmd 'Start gasgui Package Manager (recommended)' 'startgas=1'"
119 cmd
="$cmd 'Start gastone Package manager (minimal)' 'startgas=2'"
121 if eval "$cmd" ; then
122 if [ $startgas != 0 ]; then