[PR #198] Fault-tolerant package installation with bash for loop #343

Open
opened 2026-02-26 04:31:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LionSec/katoolin/pull/198
Author: @mkrupczak3
Created: 6/2/2019
Status: 🔄 Open

Base: masterHead: master


📝 Commits (3)

  • f349def changed apt install from list of pkgs to for loop of pkgs
  • 6fc1c83 fix syntax error by removing && after for loop done
  • 26f1d68 fix typo

📊 Changes

1 file changed (+65 additions, -65 deletions)

View changed files

📝 katoolin.py (+65 -65)

📄 Description

Scenario:
In the current version, if any singular package to be installed is missing or can't be found, the entire installation (including all other packages) will fail. This is because if apt-get is given a list of packages and one can't be installed, it assumes the entire command is invalid and shuts down.

Fix:
Instead of passing apt-get a list of packages to be installed, instead use a for loop to iterate over a list, installing each package by itself individually. This is much more robust, and if any individual install fails it has no effect on any other package installs. I've used this technique in my own install scripts to great success: https://github.com/mkrupczak3/gettools

Note:
Due to my IDE settings a bunch of whitespace has been mangled. My first change is on line 302, and any further changes are on any lines that have "opcion 2 == "0"" on them.

@LionSec Really like this tool, thanks!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LionSec/katoolin/pull/198 **Author:** [@mkrupczak3](https://github.com/mkrupczak3) **Created:** 6/2/2019 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`f349def`](https://github.com/LionSec/katoolin/commit/f349def3427fce64b511b5dc3be73fab07de475c) changed apt install from list of pkgs to for loop of pkgs - [`6fc1c83`](https://github.com/LionSec/katoolin/commit/6fc1c83ca01b4c1037eca9287818594a7d612ac5) fix syntax error by removing && after for loop done - [`26f1d68`](https://github.com/LionSec/katoolin/commit/26f1d68b4f04c065954517dc0d131e0a321e7d46) fix typo ### 📊 Changes **1 file changed** (+65 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `katoolin.py` (+65 -65) </details> ### 📄 Description Scenario: In the current version, if any singular package to be installed is missing or can't be found, the entire installation (including all other packages) will fail. This is because if apt-get is given a list of packages and one can't be installed, it assumes the entire command is invalid and shuts down. Fix: Instead of passing apt-get a list of packages to be installed, instead use a for loop to iterate over a list, installing each package by itself individually. This is much more robust, and if any individual install fails it has no effect on any other package installs. I've used this technique in my own install scripts to great success: [https://github.com/mkrupczak3/gettools](https://github.com/mkrupczak3/gettools) Note: Due to my IDE settings a bunch of whitespace has been mangled. My first change is on line 302, and any further changes are on any lines that have "opcion 2 == "0"" on them. @LionSec Really like this tool, thanks! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/katoolin-LionSec#343
No description provided.