Repository: Openverse-iiitk/Ferrari-OS
Pull request #95: 35 configure pacman color parallel downloads custom repo support
Author: login: manvith12
Created: 2025-05-05T12:00:45Z | Merged: 2025-05-05T12:11:03Z

Created Pit , the package manager for Ferrari-OS (wrapper for Pacman)

updated pacman.conf

```shell
Color
ILoveCandy
CheckSpace
VerbosePkgLists
ParallelDownloads = 10
UseFerrariWrapper = true


```


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
	- Introduced the Ferrari Package Manager (`pit`) as a user-friendly wrapper for package management tasks.
	- Added convenient command aliases for common package operations.
	- Enabled bash auto-completion for the `pit` command, matching the behavior of `pacman`.

- **Improvements**
	- Enhanced package manager output with color, animation, and more detailed package lists.
	- Increased the number of parallel package downloads for faster updates.

- **Chores**
	- Improved build process to ensure required files and permissions are correctly set before ISO creation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/configs/airootfs/etc/profile.d/pit-aliases.sh b/configs/airootfs/etc/profile.d/pit-aliases.sh
new file mode 100644
index 0000000..8e5f178
--- /dev/null
+++ b/configs/airootfs/etc/profile.d/pit-aliases.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Ferrari OS package manager aliases
+# System update
+alias pit-update='pit -Syu'
+# Package installation
+alias pit-install='pit -S'
+# Package removal
+alias pit-remove='pit -R'
+# Package search
+alias pit-search='pit -Ss'
+# Clean package cache
+alias pit-clean='pit -Sc'
+# Package information
+alias pit-info='pit -Si'
+# List installed packages
+alias pit-list='pit -Q'
diff --git a/configs/airootfs/usr/local/bin/pit b/configs/airootfs/usr/local/bin/pit
new file mode 100755
index 0000000..30c3d7e
--- /dev/null
+++ b/configs/airootfs/usr/local/bin/pit
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Check for TTY and set colors accordingly
+if [ -t 1 ] && command -v tput >/dev/null; then
+    RED="$(tput bold)$(tput setaf 1)"
+    GREEN="$(tput bold)$(tput setaf 2)"
+    YELLOW="$(tput bold)$(tput setaf 3)"
+    NC="$(tput sgr0)"
+else
+    RED=""
+    GREEN=""
+    YELLOW=""
+    NC=""
+fi
+
+# TTY-friendly messages without emoji
+declare -A MESSAGES=(
+    ["Syu"]="[PIT STOP] Starting full system upgrade..."
+    ["S"]="[INSTALL] Installing new components..."
+    ["R"]="[REMOVE] Removing components..."
+    ["Ss"]="[SEARCH] Searching package catalog..."
+    ["Q"]="[LIST] Checking installed components..."
+    ["Sc"]="[CLEAN] Cleaning package cache..."
+    ["Si"]="[INFO] Getting package details..."
+)
+
+# TTY-friendly header using simple ASCII
+show_header() {
+    echo "${RED}+--------------------------------+"
+    echo "|     Ferrari Package Manager      |"
+    echo "+--------------------------------+${NC}"
+}
+
+# Show appropriate message based on operation
+show_message() {
+    local op=${1#-}
+
+    # Try exact match first
+    if [[ -n "${MESSAGES[$op]}" ]]; then
+        echo "${YELLOW}${MESSAGES[$op]}${NC}"
+        return
+    fi
+
+    # Fall back to partial match if needed
+    for key in "${!MESSAGES[@]}"; do
+        if [[ $op == "$key"* ]]; then
+            echo "${YELLOW}${MESSAGES[$key]}${NC}"
+            return
+        fi
+    done
+
+    echo "${YELLOW}[PIT] Executing operation...${NC}"
+}
+
+# Show usage if no arguments provided
+if [ $# -eq 0 ]; then
+    show_header
+    echo "${GREEN}Usage: pit <operation> [options] [targets]${NC}"
+    echo ""
+    echo "Operations:"
+    echo "  -Syu         Full system upgrade"
+    echo "  -S package   Install a package"
+    echo "  -R package   Remove a package"
+    echo "  -Ss name     Search for packages"
+    echo "  -Sc         Clean package cache"
+    echo "  -Si package  Show package info"
+    echo "  -Q          List installed packages"
+    exit 1
+fi
+
+show_header
+show_message "$1"
+
+# Execute pacman with all arguments
+exec pacman "$@"
\ No newline at end of file
diff --git a/configs/airootfs/usr/share/bash-completion/completions/pit b/configs/airootfs/usr/share/bash-completion/completions/pit
new file mode 100644
index 0000000..64e0528
--- /dev/null
+++ b/configs/airootfs/usr/share/bash-completion/completions/pit
@@ -0,0 +1,2 @@
+source /usr/share/bash-completion/completions/pacman
+complete -F _pacman pit
\ No newline at end of file
diff --git a/configs/pacman.conf b/configs/pacman.conf
index e7e6497..67aee95 100644
--- a/configs/pacman.conf
+++ b/configs/pacman.conf
@@ -30,15 +30,17 @@ Architecture = auto
 
 # Misc options
 #UseSyslog
-#Color
-#NoProgressBar
+Color
+ILoveCandy
 # We cannot check disk space from within a chroot environment
-#CheckSpace
-#VerbosePkgLists
-ParallelDownloads = 5
+CheckSpace
+VerbosePkgLists
+ParallelDownloads = 10
 #DownloadUser = alpm
 #DisableSandbox
 
+UseFerrariWrapper = true
+
 # By default, pacman accepts packages signed by keys that its local keyring
 # trusts (see pacman-key and its man page), as well as unsigned packages.
 SigLevel    = Required DatabaseOptional
diff --git a/scripts/build_iso.sh b/scripts/build_iso.sh
index 9fdcf3a..1697842 100755
--- a/scripts/build_iso.sh
+++ b/scripts/build_iso.sh
@@ -1,5 +1,5 @@
-+#!/usr/bin/env bash
-+set -euo pipefail
+#!/usr/bin/env bash
+set -euo pipefail
 # Colors for output
 RED='\033[0;31m'
 GREEN='\033[0;32m'
@@ -18,6 +18,27 @@ OUT_DIR="$ROOT_DIR/out"
 # Create package directory if it doesn't exist
 mkdir -p "$PACKAGE_DIR"
 
+# Create required directories
+mkdir -p configs/airootfs/usr/local/bin
+mkdir -p configs/airootfs/usr/share/bash-completion/completions
+mkdir -p configs/airootfs/etc/profile.d
+
+# Create Ferrari OS aliases file
+cat > "$CONFIG_DIR/airootfs/etc/profile.d/pit-aliases.sh" << 'EOL'
+# Ferrari OS package manager aliases
+alias update='pit -Syu'
+alias install='pit -S'
+alias remove='pit -R'
+alias search='pit -Ss'
+alias clean='pit -Sc'
+alias info='pit -Si'
+alias packages='pit -Q'
+EOL
+
+# Set permissions
+chmod +x configs/airootfs/usr/local/bin/pit
+chmod 644 configs/airootfs/usr/share/bash-completion/completions/pit
+chmod 644 configs/airootfs/etc/profile.d/pit-aliases.sh
 # Check for required package files
 REQUIRED_FILES=("base.txt" "desktop.txt" "development.txt" "multimedia.txt")
 MISSING_FILES=()
@@ -53,6 +74,22 @@ if [ -d "$WORK_DIR" ]; then
     rm -rf "$WORK_DIR"
 fi
 
+if [ ! -f "$CONFIG_DIR/airootfs/usr/local/bin/pit" ]; then
+    echo -e "${RED}Error: pit wrapper not created successfully${NC}"
+    exit 1
+fi
+
+if [ ! -f "$CONFIG_DIR/airootfs/usr/share/bash-completion/completions/pit" ]; then
+    echo -e "${RED}Error: pit completion not created successfully${NC}"
+    exit 1
+fi
+
+# Verify permissions
+if [ ! -x "$CONFIG_DIR/airootfs/usr/local/bin/pit" ]; then
+    echo -e "${RED}Error: pit wrapper is not executable${NC}"
+    exit 1
+fi
+
 # Build ISO
 echo -e "${GREEN}Building Ferrari OS ISO...${NC}"
 echo -e "${BLUE}Total packages to be installed: $(echo $PACKAGES | wc -w)${NC}"


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 4**

<details>
<summary>🧹 Nitpick comments (8)</summary><blockquote>

<details>
<summary>configs/pacman.conf (1)</summary><blockquote>

`42-42`: **Document the custom `UseFerrariWrapper` option**

The `UseFerrariWrapper` option appears to be a custom setting for Ferrari OS that's not part of standard pacman. Consider adding a comment explaining its purpose and how it's used by the pit wrapper.


```diff
-UseFerrariWrapper = true
+# Custom Ferrari OS option to enable the pit wrapper functionality
+UseFerrariWrapper = true
```

</blockquote></details>
<details>
<summary>scripts/build_iso.sh (4)</summary><blockquote>

`21-25`: **Use $CONFIG_DIR variable consistently for paths**

You're using hardcoded paths here, but using $CONFIG_DIR elsewhere in the script. Maintain consistency to improve readability and maintainability.


```diff
-mkdir -p configs/airootfs/usr/local/bin
-mkdir -p configs/airootfs/usr/share/bash-completion/completions
-mkdir -p configs/airootfs/etc/profile.d
+mkdir -p "$CONFIG_DIR/airootfs/usr/local/bin"
+mkdir -p "$CONFIG_DIR/airootfs/usr/share/bash-completion/completions"
+mkdir -p "$CONFIG_DIR/airootfs/etc/profile.d"
```

---

`39-41`: **Use $CONFIG_DIR variable consistently for paths**

For consistency with the rest of the script, use the $CONFIG_DIR variable for paths.


```diff
-chmod +x configs/airootfs/usr/local/bin/pit
-chmod 644 configs/airootfs/usr/share/bash-completion/completions/pit
-chmod 644 configs/airootfs/etc/profile.d/pit-aliases.sh
+chmod +x "$CONFIG_DIR/airootfs/usr/local/bin/pit"
+chmod 644 "$CONFIG_DIR/airootfs/usr/share/bash-completion/completions/pit"
+chmod 644 "$CONFIG_DIR/airootfs/etc/profile.d/pit-aliases.sh"
```

---

`77-91`: **Add verification for the aliases file**

You're verifying the pit wrapper and completion files, but not the aliases file. Add a similar check for the aliases file for completeness.


```diff
 # Verify permissions
 if [ ! -x "$CONFIG_DIR/airootfs/usr/local/bin/pit" ]; then
     echo -e "${RED}Error: pit wrapper is not executable${NC}"
     exit 1
 fi
+
+if [ ! -f "$CONFIG_DIR/airootfs/etc/profile.d/pit-aliases.sh" ]; then
+    echo -e "${RED}Error: pit aliases file not created successfully${NC}"
+    exit 1
+fi
```

---

`104-106`: **Remove redundant exit status check**

Since you're using `set -e` at the top of the script (line 2), the script will automatically exit if any command fails. This explicit check of `$?` is redundant.


```diff
-if [ $? -eq 0 ]; then
-    echo -e "${GREEN}Build completed successfully!${NC}"
-    echo -e "ISO location: $OUT_DIR"
-else
-    echo -e "${RED}Build failed!${NC}"
-    exit 1
-fi
+echo -e "${GREEN}Build completed successfully!${NC}"
+echo -e "ISO location: $OUT_DIR"
```

</blockquote></details>
<details>
<summary>configs/airootfs/usr/local/bin/pit (3)</summary><blockquote>

`16-25`: **Consider adding more pacman operations.**

The message array covers common operations but might not include all possible pacman operations. Consider adding support for other operations like `-Qs` (search in installed packages), `-Qi` (detailed info on installed packages), or `-Rns` (remove packages with dependencies and config files).

---

`46-60`: **Fix formatting inconsistency in usage display.**

There's a small formatting inconsistency in the `-Sc` line (one less space than other options).


```diff
-    echo "  -Sc         Clean package cache"
+    echo "  -Sc          Clean package cache"
```

---

`1-66`: **Consider adding root permission check for system operations.**

Many pacman operations require root privileges. Consider adding a privilege check for operations that modify the system.


```diff
#!/bin/bash

+# Check for root privileges for system-modifying operations
+check_root() {
+    local op=${1#-}
+    if [[ "$op" == S* || "$op" == R* || "$op" == "Syu" || "$op" == "Sc" ]] && [ "$(id -u)" -ne 0 ]; then
+        echo "${RED}Error: This operation requires root privileges${NC}"
+        echo "Try running with sudo: sudo pit $*"
+        exit 1
+    fi
+}

# Check for TTY and set colors accordingly
# ... [rest of the script] ...

show_header
show_message "$1"
+check_root "$@"

# Execute pacman with all arguments
exec pacman "$@"
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between d52028b80e57993540273d079660bc86f78b7330 and 695e2b974a11b1a7a10d39c9dda722a4a1d9791b.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `configs/airootfs/etc/profile.d/pit-aliases.sh` (1 hunks)
* `configs/airootfs/usr/local/bin/pit` (1 hunks)
* `configs/airootfs/usr/share/bash-completion/completions/pit` (1 hunks)
* `configs/pacman.conf` (1 hunks)
* `scripts/build_iso.sh` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

<details>
<summary>configs/airootfs/etc/profile.d/pit-aliases.sh</summary>

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (3)</summary><blockquote>

<details>
<summary>configs/pacman.conf (1)</summary>

`33-38`: **Excellent optimization of the pacman configuration!**

Enabling Color, ILoveCandy, CheckSpace, and VerbosePkgLists improves both functionality and user experience. Increasing ParallelDownloads to 10 will speed up package retrieval, which is particularly beneficial for Ferrari OS users.

</details>
<details>
<summary>configs/airootfs/usr/share/bash-completion/completions/pit (1)</summary>

`1-2`: **Well-implemented completion reuse!**

Nicely done. Reusing pacman's completion functionality for pit ensures consistent behavior and reduces maintenance overhead.

</details>
<details>
<summary>configs/airootfs/usr/local/bin/pit (1)</summary>

`4-14`: **Well-implemented color detection.**

The script correctly checks for TTY availability and the presence of `tput` before setting up color variables. Providing empty fallbacks ensures the script works correctly even in environments without color support.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-05T12:02:42Z
user: login: copilot-pull-request-reviewer[bot]
body: 

Copilot reviewed 1 out of 5 changed files in this pull request and generated no comments.

<details>
<summary>Files not reviewed (4)</summary>

* **configs/airootfs/etc/profile.d/pit-aliases.sh**: Language not supported
* **configs/airootfs/usr/share/bash-completion/completions/pit**: Language not supported
* **configs/pacman.conf**: Language not supported
* **scripts/build_iso.sh**: Language not supported
</details>



state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-05T12:03:08Z

Review comments:
diff_hunk: @@ -0,0 +1,8 @@
+# Ferrari OS package manager aliases
+alias update='pit -Syu'
+alias install='pit -S'
+alias remove='pit -R'
+alias search='pit -Ss'
+alias clean='pit -Sc'
+alias info='pit -Si'
+alias packages='pit -Q'
path: configs/airootfs/etc/profile.d/pit-aliases.sh
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add a shebang and more specific alias names**

The static analysis correctly points out that there's no shebang. Additionally, the very generic alias names like "update", "install", etc. could potentially conflict with other tools or user-defined aliases.


Consider these improvements:
1. Add a shebang to indicate the shell type
2. Use more specific alias names to avoid conflicts
3. Add comments explaining each alias

```diff
+#!/bin/bash
 # Ferrari OS package manager aliases
-alias update='pit -Syu'
-alias install='pit -S'
-alias remove='pit -R'
-alias search='pit -Ss'
-alias clean='pit -Sc'
-alias info='pit -Si'
-alias packages='pit -Q'
+# System update
+alias pit-update='pit -Syu'
+# Package installation
+alias pit-install='pit -S'
+# Package removal
+alias pit-remove='pit -R'
+# Package search
+alias pit-search='pit -Ss'
+# Clean package cache
+alias pit-clean='pit -Sc'
+# Package information
+alias pit-info='pit -Si'
+# List installed packages
+alias pit-list='pit -Q'
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
#!/bin/bash
# Ferrari OS package manager aliases
# System update
alias pit-update='pit -Syu'
# Package installation
alias pit-install='pit -S'
# Package removal
alias pit-remove='pit -R'
# Package search
alias pit-search='pit -Ss'
# Clean package cache
alias pit-clean='pit -Sc'
# Package information
alias pit-info='pit -Si'
# List installed packages
alias pit-list='pit -Q'
`````

</details>

<!-- suggestion_end -->

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-05T12:02:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,6 +18,27 @@ OUT_DIR="$ROOT_DIR/out"
 # Create package directory if it doesn't exist
 mkdir -p "$PACKAGE_DIR"
 
+# Create required directories
+mkdir -p configs/airootfs/usr/local/bin
+mkdir -p configs/airootfs/usr/share/bash-completion/completions
+mkdir -p configs/airootfs/etc/profile.d
+
+# Create Ferrari OS aliases file
+cat > "$CONFIG_DIR/airootfs/etc/profile.d/pit-aliases.sh" << 'EOL'
+# Ferrari OS package manager aliases
+alias update='pit -Syu'
+alias install='pit -S'
+alias remove='pit -R'
+alias search='pit -Ss'
+alias clean='pit -Sc'
+alias info='pit -Si'
+alias packages='pit -Q'
+EOL
+
+# Set permissions
+chmod +x configs/airootfs/usr/local/bin/pit
+chmod 644 configs/airootfs/usr/share/bash-completion/completions/pit
+chmod 644 configs/airootfs/etc/profile.d/pit-aliases.sh
path: scripts/build_iso.sh
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Missing creation of pit wrapper script**

The script sets permissions on the pit wrapper but doesn't create it. Where is the pit wrapper script created? It should be created in this script or checked for existence before setting permissions.

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if the pit wrapper script exists in the repository
if [ -f "$ROOT_DIR/configs/airootfs/usr/local/bin/pit" ]; then
  echo "Pit wrapper exists in the repository"
  head -n 5 "$ROOT_DIR/configs/airootfs/usr/local/bin/pit"
else
  echo "ERROR: Pit wrapper script not found in the repository!"
  # List files in the directory to help diagnose
  ls -la "$ROOT_DIR/configs/airootfs/usr/local/bin/" 2>/dev/null || echo "Directory doesn't exist"
fi
```

Length of output: 269

---



</details>

**Ensure the pit wrapper script is created before setting permissions**

The pit wrapper at `configs/airootfs/usr/local/bin/pit` is missing, so the subsequent `chmod` commands will fail. You need to generate or copy the wrapper into that location (or at least verify its existence) before adjusting its permissions.

• File: `scripts/build_iso.sh`  
  Lines: 39–41  
• Add logic to create or install `configs/airootfs/usr/local/bin/pit` (for example, copy from a template or build it in-line)  
• Then apply:

```bash
chmod +x configs/airootfs/usr/local/bin/pit
chmod 644 configs/airootfs/usr/share/bash-completion/completions/pit
chmod 644 configs/airootfs/etc/profile.d/pit-aliases.sh
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-05T12:02:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Check for TTY and set colors accordingly
+if [ -t 1 ] && command -v tput >/dev/null; then
+    RED="$(tput bold)$(tput setaf 1)"
+    GREEN="$(tput bold)$(tput setaf 2)"
+    YELLOW="$(tput bold)$(tput setaf 3)"
+    NC="$(tput sgr0)"
+else
+    RED=""
+    GREEN=""
+    YELLOW=""
+    NC=""
+fi
+
+# TTY-friendly messages without emoji
+declare -A MESSAGES=(
+    ["Syu"]="[PIT STOP] Starting full system upgrade..."
+    ["S"]="[INSTALL] Installing new components..."
+    ["R"]="[REMOVE] Removing components..."
+    ["Ss"]="[SEARCH] Searching package catalog..."
+    ["Q"]="[LIST] Checking installed components..."
+    ["Sc"]="[CLEAN] Cleaning package cache..."
+    ["Si"]="[INFO] Getting package details..."
+)
+
+# TTY-friendly header using simple ASCII
+show_header() {
+    echo "${RED}+--------------------------------+"
+    echo "|     Ferrari Package Manager      |"
+    echo "+--------------------------------+${NC}"
+}
+
+# Show appropriate message based on operation
+show_message() {
+    local op=${1#-}
+    for key in "${!MESSAGES[@]}"; do
+        if [[ $op == *"$key"* ]]; then
+            echo "${YELLOW}${MESSAGES[$key]}${NC}"
+            return
+        fi
+    done
+    echo "${YELLOW}[PIT] Executing operation...${NC}"
+}
+
+# Show usage if no arguments provided
+if [ $# -eq 0 ]; then
+    show_header
+    echo "${GREEN}Usage: pit <operation> [options] [targets]${NC}"
+    echo ""
+    echo "Operations:"
+    echo "  -Syu         Full system upgrade"
+    echo "  -S package   Install a package"
+    echo "  -R package   Remove a package"
+    echo "  -Ss name     Search for packages"
+    echo "  -Sc         Clean package cache"
+    echo "  -Si package  Show package info"
+    echo "  -Q          List installed packages"
+    exit 1
+fi
+
+show_header
+show_message "$1"
+
+# Execute pacman with all arguments
+exec pacman "$@"
path: configs/airootfs/usr/local/bin/pit
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add error handling for pacman command.**

The script assumes pacman is installed and executable without verification. Consider adding a check before execution.


```diff
show_header
show_message "$1"

+# Check if pacman is available
+if ! command -v pacman >/dev/null; then
+    echo "${RED}Error: pacman command not found${NC}"
+    exit 1
+fi
+
# Execute pacman with all arguments
exec pacman "$@"
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-05T12:02:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Check for TTY and set colors accordingly
+if [ -t 1 ] && command -v tput >/dev/null; then
+    RED="$(tput bold)$(tput setaf 1)"
+    GREEN="$(tput bold)$(tput setaf 2)"
+    YELLOW="$(tput bold)$(tput setaf 3)"
+    NC="$(tput sgr0)"
+else
+    RED=""
+    GREEN=""
+    YELLOW=""
+    NC=""
+fi
+
+# TTY-friendly messages without emoji
+declare -A MESSAGES=(
+    ["Syu"]="[PIT STOP] Starting full system upgrade..."
+    ["S"]="[INSTALL] Installing new components..."
+    ["R"]="[REMOVE] Removing components..."
+    ["Ss"]="[SEARCH] Searching package catalog..."
+    ["Q"]="[LIST] Checking installed components..."
+    ["Sc"]="[CLEAN] Cleaning package cache..."
+    ["Si"]="[INFO] Getting package details..."
+)
+
+# TTY-friendly header using simple ASCII
+show_header() {
+    echo "${RED}+--------------------------------+"
+    echo "|     Ferrari Package Manager      |"
+    echo "+--------------------------------+${NC}"
+}
+
+# Show appropriate message based on operation
+show_message() {
+    local op=${1#-}
+    for key in "${!MESSAGES[@]}"; do
+        if [[ $op == *"$key"* ]]; then
+            echo "${YELLOW}${MESSAGES[$key]}${NC}"
+            return
+        fi
+    done
+    echo "${YELLOW}[PIT] Executing operation...${NC}"
+}
path: configs/airootfs/usr/local/bin/pit
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Improve operation matching logic.**

The current matching could lead to incorrect message selection. For example, if `$op` is `Sy`, it will match both `S` and `Syu` operations depending on array iteration order.


```diff
show_message() {
    local op=${1#-}
-    for key in "${!MESSAGES[@]}"; do
-        if [[ $op == *"$key"* ]]; then
-            echo "${YELLOW}${MESSAGES[$key]}${NC}"
-            return
-        fi
-    done
+    # Try exact match first
+    if [[ -n "${MESSAGES[$op]}" ]]; then
+        echo "${YELLOW}${MESSAGES[$op]}${NC}"
+        return
+    fi
+    
+    # Fall back to partial match if needed
+    for key in "${!MESSAGES[@]}"; do
+        if [[ $op == "$key"* ]]; then
+            echo "${YELLOW}${MESSAGES[$key]}${NC}"
+            return
+        fi
+    done
    echo "${YELLOW}[PIT] Executing operation...${NC}"
}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
# Show appropriate message based on operation
show_message() {
    local op=${1#-}

    # Try exact match first
    if [[ -n "${MESSAGES[$op]}" ]]; then
        echo "${YELLOW}${MESSAGES[$op]}${NC}"
        return
    fi

    # Fall back to partial match if needed
    for key in "${!MESSAGES[@]}"; do
        if [[ $op == "$key"* ]]; then
            echo "${YELLOW}${MESSAGES[$key]}${NC}"
            return
        fi
    done

    echo "${YELLOW}[PIT] Executing operation...${NC}"
}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-05T12:02:41Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-05T12:00:52Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

This update introduces the "pit" package manager wrapper for Ferrari OS, including its supporting infrastructure. It adds the `pit` Bash script as a user-friendly wrapper for `pacman`, a set of shell aliases for common package management tasks, and bash completion for the new command. The build script is updated to ensure necessary directories and permissions are set, and to verify the presence and executability of the new files. The `pacman.conf` configuration is modified to enable enhanced output, increase parallel downloads, and introduce a new `UseFerrariWrapper` option.

## Changes

| File(s)                                                                                           | Change Summary                                                                                                    |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| configs/airootfs/usr/local/bin/pit                                                              | Added a Bash script wrapper for `pacman` with colored output and user-friendly messages for Ferrari OS.           |
| configs/airootfs/etc/profile.d/pit-aliases.sh                                                   | Added shell aliases mapping common package management tasks to `pit` commands.                                    |
| configs/airootfs/usr/share/bash-completion/completions/pit                                      | Added bash completion for `pit` by reusing `pacman`'s completion definitions.                                     |
| configs/pacman.conf                                                                             | Enabled color, animation, verbose output, increased parallel downloads, and added `UseFerrariWrapper` option.     |
| scripts/build_iso.sh                                                                            | Updated to create directories, install new files, set permissions, and verify file existence and executability.   |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Shell
    participant pit (wrapper)
    participant pacman

    User->>Shell: types 'pit install foo'
    Shell->>pit (wrapper): executes with args ('install foo')
    pit (wrapper)->>pit (wrapper): prints header and operation message
    pit (wrapper)->>pacman: execs 'pacman install foo'
    pacman-->>User: outputs result
```

## Poem

> In Ferrari fields where commands now sit,  
> A wrapper appears, they call it "pit."  
> With color and care, it manages the flow,  
> Aliases and completions ready to go.  
> The build script checks, the configs shine bright—  
> Package management’s never felt so light!  
> 🐰✨

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 704c25c04b9f3f08f95af3bb88b7162c35e84d19 and ae7b98f338c900c339905239636dccff0c41a43f.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `configs/airootfs/etc/profile.d/pit-aliases.sh` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* configs/airootfs/etc/profile.d/pit-aliases.sh

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgBmAFYFDAAzeCJsfx40BmZMBS98Pm5nNB8SX1p8AHcMIrRaZAZsRAJmPxJufHtsbm6KMNjIGrRkBwFmdRp6OQjYEkhWykh8jAl1WABGACYIntwFyAAxSioKeDAAeQBlTu7EdWLZDRgj/PgsJgxcC4E8eD4LCoQ6LBj+aiArD4VJxKzqULDNA5BgAazQpFWmAxK1SxROZ2cl1u82o6DEyDG6BGVH6K2c+GwGHoVlya1ecEWthQGAYXmwSmQfVo1Gk+3mi1KeU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o4Qg0Aaz+CLzfwKTFDMH3ZOYUbfzLThS9TIzAbALlDgYqzkzAZ0b+AMaZRMbyZQhsb1bZbLi9TAG9RrSxT3wJS9T+INonzUg3wtS4yKZxTFaDTfTpSZRfpzTZF3zRB5EpBB52bkRI62a0LVGOYlj946B3QXL5wrDVbMjN5WCUBTCeZDYLyhIfKwAeEKHSBcA+bqBQaMJtjIDUEZhxotBPrRDAF6gWahZpGPLdF1piqLG8oPy6IfgQi0DY71AvD1SpBwyMDRBQHkR6hI4o42paFeD0CAT+BiDPDRrnGvpFG26og1xrjA7yB6imY0C8ju6iIhy+Yb7sSDKHH4LHFzJxTz7OhATkTQZHg9zIT4jA49ybArCoCTFtpEAFFfTG6QAwnSGkjX6omrGsQYmoAPq7GmL4mEm5jEkFBnDkkcqhR76jiiBQkXoODZC7R4T+BBBeG573wGQBgTFICPDTHZBUoKRHwuJTgzi3ygbWK0q5gfh/HYaLClg3BXDrrIE9Ykp9a7oYH7pDbYGtyjYdyMFEH9xzbxSS5kGH7oBwFiD8CPEVZjJmjLoUCTpxb4Burdw9r3x4wEwdAe4lLQY45SGyCL4YDyB0F4E+kTbsEqj4hCFpIDbVwLYkbcQGA6QXoCSwhGQiT7ZMQY5WR+BoDNTmEORzBMDOQqBqBuRaSeQNm8QvTqC6FNCpb+AbC0R0CpbziDAeReSNkABsAAnIkCQDsAIFuQAOwAAsaAWwWwAgWwaAh5Z5X4tA8QW5DAW5AE15OwOwaAp5WwtAR5W5F5a5E5EAkAh5X4x5DAOwiQDAIFB5qQ8QqQX4AAHKkDubzvEKoPBfBQIIeVsBuTsAwEkCQPBcebQFsFuf+Y2WgCQIeQeYhfEPEPBU+V+F+HhQ+VuV+IkDsA+RufEBubQAwAwHzkxceVecebBf+QBVAAjNOS2nOcjh6KzjofxGuUAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Openverse-iiitk/Ferrari-OS&utm_content=95):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: manvith12
created_at: 2025-05-05T12:09:19Z
body: ![image](https://github.com/user-attachments/assets/c9a92d8f-92ba-4ea5-81eb-4d5e6fd5233d)

author_association: CONTRIBUTOR