update-keys: don't restore cwd in a subprocess

Using popd at the very end of a shell script is unnecessary, because, as
the very last command, there is nothing to restore state for.
Immediately after, the shell subprocess is ended, and processes don't
control the cwd of the parent process. Changing the cwd for the last
microsecond of the shell process, during which no commands are run, is
a mildly expensive no-op.

By the same measure, if popd is never used, pushd is not needed to
record the old cwd. So simply use 'cd'.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Eli Schwartz 2019-08-05 17:47:41 -04:00 committed by Christian Hesse
parent c4264b6784
commit 5cb23e4ce6

View File

@ -21,7 +21,7 @@ armor
no-emit-version no-emit-version
__EOF__ __EOF__
pushd "$(dirname "$0")" >/dev/null cd "$(dirname "$0")"
"${GPG[@]}" --gen-key <<EOF "${GPG[@]}" --gen-key <<EOF
%echo Generating Arch Linux keyring temporary master key... %echo Generating Arch Linux keyring temporary master key...
@ -91,5 +91,3 @@ while read -ra data; do
done < packager-revoked-keyids done < packager-revoked-keyids
cat master/*.asc master-revoked/*.asc packager/*.asc packager-revoked/*.asc > archlinux.gpg cat master/*.asc master-revoked/*.asc packager/*.asc packager-revoked/*.asc > archlinux.gpg
popd >/dev/null