tazpkg diff modules/install @ rev 876
modules getenv, get, install: provide --quiet option (don't display service messages, show errors only)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Nov 30 01:45:37 2015 +0200 (2015-11-30) |
parents | af67b2269d1f |
children | 97454e15c034 |
line diff
1.1 --- a/modules/install Thu Nov 19 04:07:05 2015 +0200 1.2 +++ b/modules/install Mon Nov 30 01:45:37 2015 +0200 1.3 @@ -188,7 +188,7 @@ 1.4 extract_package() { 1.5 # input: $1 - path to package to be extracted; package should be in the current dir 1.6 # ROOT INDEPENDENT 1.7 - action 'Extracting package...' 1.8 + qaction 'Extracting package...' 1.9 1.10 # Extract "outer layer": cpio; remove the original package file 1.11 cpio -idm --quiet < "$1" && rm -f "$1" 1.12 @@ -202,7 +202,7 @@ 1.13 zcat fs.cpio.gz | cpio -idm --quiet && rm fs.cpio.gz 1.14 fi 1.15 1.16 - status 1.17 + qstatus 1.18 } 1.19 1.20 1.21 @@ -248,12 +248,12 @@ 1.22 call_pre_install() { 1.23 local tmp 1.24 if grep -q '^pre_install()' "$1"; then 1.25 - action 'Execute pre-install commands...' 1.26 + qaction 'Execute pre-install commands...' 1.27 tmp="$(mktemp)" 1.28 cp "$1" "$tmp" 1.29 sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp" 1.30 ( . "$tmp"; pre_install "$root" ) 1.31 - status 1.32 + qstatus 1.33 rm "$tmp" 1.34 fi 1.35 1.36 @@ -262,12 +262,12 @@ 1.37 call_post_install() { 1.38 local tmp 1.39 if grep -q '^post_install()' "$1"; then 1.40 - action 'Execute post-install commands...' 1.41 + qaction 'Execute post-install commands...' 1.42 tmp="$(mktemp)" 1.43 cp "$1" "$tmp" 1.44 sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp" 1.45 ( . "$tmp"; post_install "$root" ) 1.46 - status 1.47 + qstatus 1.48 rm "$tmp" 1.49 fi 1.50 } 1.51 @@ -332,17 +332,19 @@ 1.52 #[ -n "$INSTALL_LIST" ] && echo "$PACKAGE_FILE" >> "$PKGS_DB/$INSTALL_LIST-processed" 1.53 1.54 if [ -n "$sequence" ]; then 1.55 - title 'Installation of package "%s" (%s)' "$PACKAGE" "$sequence" 1.56 + qtitle 'Installation of package "%s" (%s)' "$PACKAGE" "$sequence" 1.57 else 1.58 - title 'Installation of package "%s"' "$PACKAGE" 1.59 + qtitle 'Installation of package "%s"' "$PACKAGE" 1.60 fi 1.61 1.62 - print_short_description "$PACKAGE" 1.63 - separator '-' 1.64 + if [ -z "$quiet" ]; then 1.65 + print_short_description "$PACKAGE" 1.66 + separator '-' 1.67 + fi 1.68 1.69 - action 'Copying package...' 1.70 + qaction 'Copying package...' 1.71 cp "$PACKAGE_FILE" "$TMP_DIR" 1.72 - status 1.73 + qstatus 1.74 1.75 cd "$TMP_DIR" 1.76 extract_package "$(basename "$PACKAGE_FILE")" 1.77 @@ -370,7 +372,7 @@ 1.78 1.79 1.80 # Remember modified packages 1.81 - action 'Remember modified packages...' 1.82 + qaction 'Remember modified packages...' 1.83 { 1.84 check=false 1.85 # TODO: why '[' the special? 1.86 @@ -416,7 +418,7 @@ 1.87 fi 1.88 echo "$PACKAGE" >> "$dir/modifiers" 1.89 done 1.90 - status 1.91 + qstatus 1.92 1.93 1.94 cd "$TMP_DIR" 1.95 @@ -432,7 +434,7 @@ 1.96 1.97 if [ -n "$CONFIG_FILES" ]; then 1.98 # Save "official" configuration files 1.99 - action 'Saving configuration files...' 1.100 + qaction 'Saving configuration files...' 1.101 debug "\n" 1.102 1.103 cd fs 1.104 @@ -458,12 +460,12 @@ 1.105 done 1.106 fi 1.107 # always '[ Done ]' status, unless '--newconf' is passed or not 1.108 - :; status 1.109 + :; qstatus 1.110 fi 1.111 1.112 1.113 if [ -n "$(ls fs/* 2>/dev/null)" ]; then 1.114 - action 'Installing package...' 1.115 + qaction 'Installing package...' 1.116 1.117 debug '\n resolving destination links in source' 1.118 IFS=$'\n' 1.119 @@ -478,12 +480,12 @@ 1.120 1.121 debug ' copying folders and files to destination' 1.122 cp -af fs/* "$root/" 1.123 - status 1.124 + qstatus 1.125 fi 1.126 1.127 1.128 if [ -s files2remove.list ]; then 1.129 - action 'Removing old files...' 1.130 + qaction 'Removing old files...' 1.131 while read file; do 1.132 dir="$root$file" 1.133 # Remove specified file 1.134 @@ -494,15 +496,14 @@ 1.135 rmdir "$dir" 2>/dev/null || break 1.136 done 1.137 done < files2remove.list 1.138 - true 1.139 - status 1.140 + :; qstatus 1.141 fi 1.142 1.143 1.144 # Remove the temporary random directory. 1.145 - action "Removing all tmp files..." 1.146 + qaction "Removing all tmp files..." 1.147 cd ..; rm -rf "$TMP_DIR" 1.148 - status 1.149 + qstatus 1.150 1.151 1.152 # Post install commands 1.153 @@ -525,7 +526,7 @@ 1.154 fgrep -q /lib/modules "$fl" && ukrnl='yes' 1.155 1.156 if [ -n "$udesk$umime$uicon$uschm$upixb$ukrnl" ]; then 1.157 - action 'Update system databases...' 1.158 + qaction 'Update system databases...' 1.159 upd=1 1.160 fi 1.161 1.162 @@ -542,7 +543,7 @@ 1.163 # packages 'busybox', 'kmod', 'depmod' 1.164 [ -n "$ukrnl" ] && grep '/lib/modules' "$fl" | cut -d'/' -f4 | uniq | xargs chroot "$root/" /sbin/depmod -a 1.165 1.166 - [ "$upd" -eq 1 ] && status 1.167 + [ "$upd" -eq 1 ] && qstatus 1.168 1.169 1.170 1.171 @@ -563,7 +564,7 @@ 1.172 sort "$ii" > "$TEMP_FILE"; mv -f "$TEMP_FILE" "$ii"; chmod a+r "$ii"; unset ii 1.173 1.174 cd "$CUR_DIR" 1.175 - footer "$(_ 'Package "%s" (%s) is installed.' "$PACKAGE" "$VERSION$EXTRAVERSION")" 1.176 + qfooter "$(_ 'Package "%s" (%s) is installed.' "$PACKAGE" "$VERSION$EXTRAVERSION")" 1.177 1.178 # Log this activity 1.179 log_pkg Installed