summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-09 17:51:03 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-09 17:51:03 -0400
commitbccc28a6462712dc325186e7a43bb468f26f289e (patch)
treee0e4f0b7d4c6588dfce55223d1e58a1c9c59ac4e
parentd0d463e9b96b6671b09837900c58e50442e2e01f (diff)
librefetch-install: change how the messages look.
This looks better with recent pacman/PKGBUILD conventions.
-rw-r--r--src/librefetch/librefetch-install.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librefetch/librefetch-install.in b/src/librefetch/librefetch-install.in
index 34815a7..23c1928 100644
--- a/src/librefetch/librefetch-install.in
+++ b/src/librefetch/librefetch-install.in
@@ -55,18 +55,18 @@ del_line() {
post_install() {
local file=$1
if grep -q 'librefetch' "$file"; then
- msg2 "%s: librefetch is already in %q" "${0##*/}" "$(realpath -s "$file")"
+ print ":: %s: librefetch is already in %q" "${0##*/}" "$(realpath -s "$file")"
local line del=false
for line in "${old_code[@]}"; do
if has_line "$file" "$line"; then
- msg2 "%s: ... but it's an old version" "${0##*/}"
+ print ":: %s: ... but it's an old version" "${0##*/}"
pre_remove "$file"
post_install "$file"
return $?
fi
done
else
- msg2 "%s: adding librefetch to %q" "${0##*/}" "$(realpath -s "$file")"
+ print ":: %s: adding librefetch to %q" "${0##*/}" "$(realpath -s "$file")"
printf '%s\n' "$new_code" >> "$file"
fi
}
@@ -74,7 +74,7 @@ post_install() {
# pre_remove $file
pre_remove() {
local file=$1
- msg2 "%s: removing librefetch from %q" "${0##*/}" "$(realpath -s "$file")"
+ print ":: %s: removing librefetch from %q" "${0##*/}" "$(realpath -s "$file")"
# Check for the old stuff
sed -ri 's/^#(.*) # commented out by the libretools post_install script/\1/' "$file"
@@ -99,10 +99,10 @@ main() {
fi
local file=$2
if [[ ! -f "$file" ]]; then
- msg2 "%s: does not exist: %q" "${0##*/}" "$(realpath -s "$file")"
+ error "%s: does not exist: %q" "${0##*/}" "$(realpath -s "$file")"
fi
if [[ ! -w "$file" ]]; then
- msg2 "%s: cannot write to file: %q" "${0##*/}" "$(realpath -s "$file")"
+ error "%s: cannot write to file: %q" "${0##*/}" "$(realpath -s "$file")"
fi
case "$1" in
install) post_install "$file";;