Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inability to enter Gentoo container after adding --ask to EMERGE_DEFAULT_OPTS #1079

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

btwotwo
Copy link
Contributor

@btwotwo btwotwo commented Nov 27, 2023

This PR fixes the error during the initialization of a Gentoo container.
If user adds an --ask option to the EMERGE_DEFAULT_OPTS then they can not enter the Gentoo container anymore:

>>> Jobs: 0 of 0 complete                           Load avg: 0.04, 0.10, 0.12

+ deps='
                        zsh
                        app-crypt/gnupg
                        bash-completion
                        diffutils
                        findutils
                        less
                        ncurses
                        net-misc/curl
                        app-crypt/pinentry
                        procps
                        shadow
                        sudo
                        sys-devel/bc
                        sys-process/lsof
                        util-linux
                        wget
                '
+ install_pkg=
+ for dep in ${deps}
++ emerge --search zsh
++ grep -Eo '[0-9]'
++ grep 'Applications found'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search app-crypt/gnupg
++ grep -Eo '[0-9]'
++ grep 'Applications found'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search bash-completion
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search diffutils
++ grep -Eo '[0-9]'
++ grep 'Applications found'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search findutils
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search less
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search ncurses
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search net-misc/curl
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search app-crypt/pinentry
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search procps
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search shadow
++ grep -Eo '[0-9]'
++ grep 'Applications found'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search sudo
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search sys-devel/bc
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search sys-process/lsof
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search util-linux
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ for dep in ${deps}
++ emerge --search wget
++ grep 'Applications found'
++ grep -Eo '[0-9]'
!!! "--ask" should only be used in a terminal. Exiting.
+ '[' '' -gt 0 ']'
/usr/bin/entrypoint: line 738: [: : integer expression expected
+ emerge --ask=n --autounmask-continue --noreplace --quiet-build
emerge: command-line interface to the Portage system
Usage:
   emerge [ options ] [ action ] [ ebuild | tbz2 | file | @set | atom ] [ ... ]
   emerge [ options ] [ action ] < @system | @world >
   emerge < --sync | --metadata | --info >
   emerge --resume [ --pretend | --ask | --skipfirst ]
   emerge --help
Options: -[abBcCdDefgGhjkKlnNoOpPqrsStuUvVwW]
          [ --color < y | n >            ] [ --columns    ]
          [ --complete-graph             ] [ --deep       ]
          [ --jobs JOBS ] [ --keep-going ] [ --load-average LOAD            ]
          [ --newrepo   ] [ --newuse     ] [ --noconfmem  ] [ --nospinner   ]
          [ --oneshot   ] [ --onlydeps   ] [ --quiet-build [ y | n ]        ]
          [ --reinstall changed-use      ] [ --with-bdeps < y | n >         ]
Actions:  [ --depclean | --list-sets | --search | --sync | --version        ]

   For more help consult the man page.
Error: An error occurred
+ '[' 1 -ne 0 ']'
+ printf 'Error: An error occurred\n'

…_OPTS

If one adds '--ask' to EMERGE_DEFAULT_OPTS then they can not enter the Gentoo container anymore, because --ask doesn't work on the non-interactive tty
@btwotwo btwotwo changed the title Fix inability to enter Gentoo container after changing EMERGE_DEFAULT_OPTS Fix inability to enter Gentoo container after adding --ask to EMERGE_DEFAULT_OPTS Nov 27, 2023
@89luca89
Copy link
Owner

89luca89 commented Feb 1, 2024

Thanks a lot @btwotwo !

@89luca89 89luca89 merged commit 202f13f into 89luca89:main Feb 1, 2024
mrnerdhair pushed a commit to mrnerdhair/distrobox that referenced this pull request Feb 2, 2024
…EFAULT_OPTS (89luca89#1079)

If one adds '--ask' to EMERGE_DEFAULT_OPTS then they can not enter the Gentoo container anymore, because --ask doesn't work on the non-interactive tty
@btwotwo btwotwo deleted the patch-1 branch February 23, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants