Skip to content

Commit 2eae682

Browse files
committed
fix(main/perl): force cpan to never interactively prompt to use local::lib, just always default to it
Gets rid of this infinite loop that can permanently freeze many noninteractive scripts which need to run `cpan`: ``` What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use 'sudo' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use 'sudo' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use 'sudo' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] ```
1 parent a5dbad0 commit 2eae682

7 files changed

Lines changed: 21 additions & 1 deletion

File tree

packages/dpkg/dpkg-perl.subpackage.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ termux_step_create_subpkg_debscripts() {
88
#!$TERMUX_PREFIX/bin/bash
99
set -e
1010
11+
export PERL_MM_USE_DEFAULT=1
12+
1113
echo "Sideloading Perl Locale::gettext ..."
1214
cpan -Ti Locale::gettext
1315

packages/intltool/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ termux_step_create_debscripts() {
1414
#!$TERMUX_PREFIX/bin/bash
1515
set -e
1616
17+
export PERL_MM_USE_DEFAULT=1
18+
1719
echo "Sideloading Perl XML::Parser..."
1820
cpan -Ti XML::Parser
1921

packages/perl/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TERMUX_PKG_MAINTAINER="@termux"
1111
# - subversion
1212
TERMUX_PKG_VERSION=(5.40.3
1313
1.6.2)
14-
TERMUX_PKG_REVISION=1
14+
TERMUX_PKG_REVISION=2
1515
TERMUX_PKG_SHA256=(65f63b4763ab6cb9bb3d5731dd10369e1705be3c59be9847d453eb60b349ab43
1616
f74ab2a6cacc574c98398ae9d36660b4cc0ba0e3d34e87b24d27b9cd2a27787d)
1717
TERMUX_PKG_SRCURL=(https://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION[0]}.tar.xz
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
2+
+++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
3+
@@ -904,7 +904,6 @@ sub init {
4+
unless ( $matcher
5+
|| _can_write_to_libdirs() || _using_installbase() || _using_sudo()
6+
) {
7+
- local $auto_config = 0; # We *must* ask, even under autoconfig
8+
local *_real_prompt; # We *must* show prompt
9+
my_prompt_loop(install_help => 'local::lib', $matcher,
10+
'local::lib|sudo|manual');

packages/sendxmpp/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ termux_step_create_debscripts() {
1919
#!$TERMUX_PREFIX/bin/bash
2020
set -e
2121
22+
export PERL_MM_USE_DEFAULT=1
23+
2224
echo "Sideloading Perl Authen::SASL and Net::XMPP ..."
2325
cpan -Ti Authen::SASL Net::XMPP
2426

x11-packages/xdg-menu/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ termux_step_create_debscripts() {
3838
#!$TERMUX_PREFIX/bin/bash
3939
set -e
4040
41+
export PERL_MM_USE_DEFAULT=1
42+
4143
echo "Sideloading Perl XML::Parser..."
4244
cpan -Ti XML::Parser
4345

x11-packages/xdg-utils/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ termux_step_create_debscripts() {
3434
#!$TERMUX_PREFIX/bin/bash
3535
set -e
3636
37+
export PERL_MM_USE_DEFAULT=1
38+
3739
echo "Sideloading Perl File::MimeInfo ..."
3840
cpan -Ti File::MimeInfo
3941

0 commit comments

Comments
 (0)