]>
git.saurik.com Git - apt.git/blob - dselect/install
3 # Set the textdomain for the translations using $"..."
6 # Get the configuration from /etc/apt/apt.conf
9 DSELECT_UPGRADE_OPTS
="-f"
10 APTGET
="/usr/bin/apt-get"
12 DPKG_OPTS
="--admindir=$1"
13 APT_OPT0
="-oDir::State::status=$1/status"
14 APT_OPT1
="-oDPkg::Options::=$DPKG_OPTS"
16 RES
=$
(apt
-config shell CLEAN DSelect
::Clean OPTS DSelect
::Options \
17 DPKG Dir
::Bin
::dpkg
/f APTGET Dir
::Bin
::apt
-get/f \
18 ARCHIVES Dir
::Cache
::Archives
/d \
19 WAIT DSelect
::WaitAfterDownload
/b \
20 CHECKDIR DSelect
::CheckDir
/b
)
31 Y
|y
) defp
="[Y/n]" def
=y
;;
32 N
|n
) defp
="[y/N]" def
=n
;;
33 *) echo $
"Bad default setting!" 1>&2; exit 1;;
39 echo -n "$1 $defp " 1>&3
50 if [ "$WAIT" = "true" ]; then
51 $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect
-upgrade
52 echo $
"Press [Enter] to continue." && read RES
53 $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" dselect
-upgrade
56 $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" dselect
-upgrade
60 # 1 means the user choose no at the prompt
61 if [ $RES -eq 1 ]; then
66 if [ $RES -eq 0 ]; then
68 if [ $(ls $ARCHIVES $ARCHIVES/partial | grep -E -v "^lock$|^partial$" | wc -l) \
73 NEWLS
=$(ls -ld $ARCHIVES)
74 if [ "$CHECKDIR" = "true" ]; then
75 if [ "$OLDLS" = "$NEWLS" ]; then
80 # Check the cleaning mode
81 case $(echo $CLEAN | tr '[:upper:]' '[:lower:]') in
83 $APTGET "$APT_OPT0" "$APT_OPT1" autoclean
&&
84 echo $
"Press [Enter] to continue." && read RES
&& exit 0;
87 $APTGET "$APT_OPT0" "$APT_OPT1" clean
&&
88 echo $
"Press [Enter] to continue." && read RES
&& exit 0;
92 echo -n $
"Do you want to erase any previously downloaded .deb files?"
93 if [ $(yesno "" y) = y
]; then
94 $APTGET "$APT_OPT0" "$APT_OPT1" clean
&&
95 echo $
"Press [Enter] to continue." && read RES
&& exit 0;
102 echo $
"Some errors occurred while unpacking. Packages that were installed"
103 echo $
"will be configured. This may result in duplicate errors"
104 echo $
"or errors caused by missing dependencies. This is OK, only the errors"
105 echo $
"above this message are important. Please fix them and run [I]nstall again"
106 echo $
"Press [Enter] to continue."
107 read RES
&& $DPKG "$DPKG_OPTS" --configure -a