Skip to content

Commit 5c6bfbf

Browse files
committed
improve
1 parent 6542817 commit 5c6bfbf

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

usr/bin/apt-key-install

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
## This script is used by package anon-shared-build-apt-sources-tpo.
77

8+
#set -x
89
set -e
910
set -o pipefail
1011

@@ -34,7 +35,10 @@ sudo $0 $source_file $target_file" >&2
3435
exit 4
3536
fi
3637

37-
if ! sq cert lint --cert-file "$source_file" &>/dev/null; then
38+
command=( sq cert lint --cert-file "$source_file" )
39+
if ! "${command[@]}" &>/dev/null; then
40+
printf '%s\n' "$0: ERROR: Command '${command[*]} failed.' Re-running to show output:"
41+
"${command[@]}" || exit 5
3842
exit 5
3943
fi
4044

@@ -45,12 +49,10 @@ fi
4549
#gpg-dearmor "$source_file" "$target_file"
4650
cp --verbose -- "$source_file" "$target_file"
4751

48-
if ! test -r "$target_file" ; then
49-
printf '%s\n' "$0: ERROR: target_file '$target_file' not readable after writing!" >&2
50-
exit 6
51-
fi
52-
53-
if ! sq cert lint --cert-file "$target_file" &>/dev/null; then
52+
command=( sq cert lint --cert-file "$target_file" )
53+
if ! "${command[@]}" &>/dev/null; then
54+
printf '%s\n' "$0: ERROR: Command '${command[*]} failed.' Re-running to show output:"
55+
"${command[@]}" || exit 5
5456
exit 7
5557
fi
5658

0 commit comments

Comments
 (0)