instead of checking for defined-ness and then comparing with the empty string, we can just use 'length' which returns undef if its argument is undef
This commit is contained in:
parent
270fd09b43
commit
d52eaa4814
1 changed files with 4 additions and 4 deletions
|
@ -1219,16 +1219,16 @@ sub run_hooks {
|
||||||
# If the hook script needs a writable TMPDIR, then it can always use /tmp
|
# If the hook script needs a writable TMPDIR, then it can always use /tmp
|
||||||
# inside the chroot. This is also why we do not set a new MMDEBSTRAP_TMPDIR
|
# inside the chroot. This is also why we do not set a new MMDEBSTRAP_TMPDIR
|
||||||
# environment variable.
|
# environment variable.
|
||||||
if (defined $ENV{TMPDIR} && $ENV{TMPDIR} ne "") {
|
if (length $ENV{TMPDIR}) {
|
||||||
push @env_opts, '--unset=TMPDIR';
|
push @env_opts, '--unset=TMPDIR';
|
||||||
}
|
}
|
||||||
# The APT_CONFIG variable, if set, will confuse any manual calls to
|
# The APT_CONFIG variable, if set, will confuse any manual calls to
|
||||||
# apt-get. If you want to use the same config used by mmdebstrap, the
|
# apt-get. If you want to use the same config used by mmdebstrap, the
|
||||||
# original value is stored in MMDEBSTRAP_APT_CONFIG.
|
# original value is stored in MMDEBSTRAP_APT_CONFIG.
|
||||||
if (defined $ENV{APT_CONFIG} && $ENV{APT_CONFIG} ne "") {
|
if (length $ENV{APT_CONFIG}) {
|
||||||
push @env_opts, '--unset=APT_CONFIG';
|
push @env_opts, '--unset=APT_CONFIG';
|
||||||
}
|
}
|
||||||
if (defined $ENV{APT_CONFIG} && $ENV{APT_CONFIG} ne "") {
|
if (length $ENV{APT_CONFIG}) {
|
||||||
push @env_opts, "MMDEBSTRAP_APT_CONFIG=$ENV{APT_CONFIG}";
|
push @env_opts, "MMDEBSTRAP_APT_CONFIG=$ENV{APT_CONFIG}";
|
||||||
}
|
}
|
||||||
# Storing the mode is important for hook scripts to potentially change
|
# Storing the mode is important for hook scripts to potentially change
|
||||||
|
@ -1871,7 +1871,7 @@ sub run_setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# setting PATH for chroot, ldconfig, start-stop-daemon...
|
# setting PATH for chroot, ldconfig, start-stop-daemon...
|
||||||
if (defined $ENV{PATH} && $ENV{PATH} ne "") {
|
if (length $ENV{PATH}) {
|
||||||
## no critic (Variables::RequireLocalizedPunctuationVars)
|
## no critic (Variables::RequireLocalizedPunctuationVars)
|
||||||
$ENV{PATH} = "$ENV{PATH}:/usr/sbin:/usr/bin:/sbin:/bin";
|
$ENV{PATH} = "$ENV{PATH}:/usr/sbin:/usr/bin:/sbin:/bin";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue