Jelajahi Sumber

When using SUDO=doas environment variable may get lost

If the setting sudo_make_clean is set in the configuration and
SUDO=doas is set in /etc/mk.conf the environment variables may
get lost depending on the seting in /etc/doas.conf. To prevent
this move doas in the make repackage clean command in front of
the env command setting up the environment variables.
Markus Hennecke 6 tahun lalu
induk
melakukan
f4e42fa532
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      autoupdate.pl

+ 3 - 2
autoupdate.pl

@@ -601,12 +601,13 @@ sub build_pkg {
 	my $build_result = $?;
 	my $update_result = 1;
 	if ($build_result == 0) {
-		$cmd = 'env FORCE_UPDATE=Yes CLEANDEPENDS=No ';
+		$cmd = '';
+		$cmd .= $sudo if ($sudo_make_clean);
+		$cmd = ' env FORCE_UPDATE=Yes CLEANDEPENDS=No ';
 		$cmd .= "FLAVOR=\"$info->{flavor}\" "
 		    if ($info->{flavor} ne '');
 		$cmd .= "SUBPACKAGE=$info->{subpkg} "
 		    if ($info->{subpkg} ne '');
-		$cmd .= $sudo if ($sudo_make_clean);
 		$cmd .= ' make repackage update clean';
 		open($in, "$cmd 2>&1 |")
 		    or die "Unable to update \"$port\"\n";