Skip to content

Commit 99731eb

Browse files
authored
Merge pull request #35 from Vladush/fix/ir-emitter-fallback
fix(install): enforce custom IR emitter branch and improve fallback logic
2 parents de15496 + 0108132 commit 99731eb

3 files changed

Lines changed: 66 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- **Faster First Login**: AI models are now pre-loaded when the service starts, rather than waiting for the first user to walk by.
1414
- **Hardened Validation**: Switched input validation from regex to a strict character-allowlist loop. This isn't visible to users, but it removes a potential ReDoS attack vector and makes path traversal protection bulletproof.
1515

16+
## [0.9.7.2-2] - 2026-03-29
17+
18+
### Dependencies & Scripts
19+
20+
- **Specialized IR Emitter**: Switched to `feat/tweak-controls` branch of the `linux-enable-ir-emitter` fork for better hardware control management.
21+
- **Robustness**: Improved the IR emitter installation script to intelligently skip pre-built binary checks when using feature branches, avoiding unnecessary API errors.
22+
1623
## [0.9.7.2] - 2026-02-19
1724

1825
### Improved in 0.9.7.2

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
linuxcampam (0.9.7.2-2) unstable; urgency=medium
2+
3+
* Feature: Switch to specialized 'feat/tweak-controls' branch of linux-enable-ir-emitter
4+
* Fix: Improved install_ir_emitter.sh logic to skip binary download for branches
5+
6+
-- Vladimir Orlinski <contact.github.submerge594@slmails.com> Sun, 29 Mar 2026 11:32:00 +0200
7+
18
linuxcampam (0.9.7.2-1) unstable; urgency=medium
29

310
* Fix: Correctly parse [Auth] and [Capture] configuration sections

scripts/install_ir_emitter.sh

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ set -e
44
# Default version used to be 6.1.2. Using PR branch for tweaked controls.
55
DEFAULT_VERSION="feat/tweak-controls"
66

7+
# Check for root privileges
8+
if [ "$EUID" -ne 0 ]; then
9+
echo "Error: This script must be run with sudo or as root."
10+
echo "Please try: sudo $0 $@"
11+
exit 1
12+
fi
13+
714
echo "=== Installing Dependencies ==="
815
export DEBIAN_FRONTEND=noninteractive
916
apt-get update
@@ -42,35 +49,41 @@ if [ -f "Cargo.toml" ]; then
4249
exit 0
4350
}
4451

45-
# Try pre-built binary first
46-
echo "Checking for pre-built binary..."
47-
if ! command -v curl &> /dev/null; then
48-
apt-get update && apt-get install -y curl
49-
fi
52+
# Try pre-built binary first for release tags
53+
IS_TAG=$(git rev-parse --verify --quiet "refs/tags/${LATEST_TAG}" || true)
5054

51-
# NOTE: since we are on a custom branch/fork, a release tag might not exist for it.
52-
API_URL="https://api.github.com/repos/Vladush/linux-enable-ir-emitter/releases/tags/${LATEST_TAG}"
53-
DOWNLOAD_URL=$(curl -s "$API_URL" | grep "browser_download_url" | grep "linux-enable-ir-emitter" | grep "x86-64" | head -n 1 | cut -d '"' -f 4)
55+
if [ -n "$IS_TAG" ]; then
56+
echo "Checking for pre-built binary..."
57+
if ! command -v curl &> /dev/null; then
58+
apt-get update && apt-get install -y curl
59+
fi
5460

55-
if [ -n "$DOWNLOAD_URL" ]; then
56-
echo "Found binary at: $DOWNLOAD_URL"
57-
echo "Downloading..."
58-
curl -L -o ir-emitter.tar.gz "$DOWNLOAD_URL"
59-
60-
echo "Extracting..."
61-
tar -xzf ir-emitter.tar.gz
62-
63-
FOUND_BIN=$(find . -name "linux-enable-ir-emitter" -type f | head -n 1)
64-
if [ -n "$FOUND_BIN" ]; then
65-
if [ "$FOUND_BIN" != "./linux-enable-ir-emitter" ]; then
66-
mv "$FOUND_BIN" .
61+
# NOTE: since we are on a custom branch/fork, a release tag might not exist for it.
62+
API_URL="https://api.github.com/repos/Vladush/linux-enable-ir-emitter/releases/tags/${LATEST_TAG}"
63+
DOWNLOAD_URL=$(curl -s "$API_URL" | grep "browser_download_url" | grep "linux-enable-ir-emitter" | grep "x86-64" | head -n 1 | cut -d '"' -f 4)
64+
65+
if [ -n "$DOWNLOAD_URL" ]; then
66+
echo "Found binary at: $DOWNLOAD_URL"
67+
echo "Downloading..."
68+
curl -L -o ir-emitter.tar.gz "$DOWNLOAD_URL"
69+
70+
echo "Extracting..."
71+
tar -xzf ir-emitter.tar.gz
72+
73+
FOUND_BIN=$(find . -name "linux-enable-ir-emitter" -type f | head -n 1)
74+
if [ -n "$FOUND_BIN" ]; then
75+
if [ "$FOUND_BIN" != "./linux-enable-ir-emitter" ]; then
76+
mv "$FOUND_BIN" .
77+
fi
78+
install_binary
79+
else
80+
echo "Binary not found in archive."
6781
fi
68-
install_binary
6982
else
70-
echo "Binary not found in archive."
83+
echo "No pre-built binary found for this tag."
7184
fi
7285
else
73-
echo "No pre-built binary found for this tag."
86+
echo "Branch or non-tag version detected ($LATEST_TAG). Skipping binary download and building from source."
7487
fi
7588

7689
# No pre-built binary - check for Rust toolchain
@@ -108,7 +121,7 @@ if [ -f "Cargo.toml" ]; then
108121
echo ""
109122
echo "Version/Branch $LATEST_TAG requires Rust/Cargo to build from source."
110123
echo ""
111-
echo "Auto-installing stable version 6.1.2 instead (no Rust required)..."
124+
echo "Auto-installing fallback version 6.1.2 instead (no Rust required)..."
112125
echo ""
113126

114127
# Switch to stable 6.1.2 repository
@@ -120,13 +133,24 @@ if [ -f "Cargo.toml" ]; then
120133

121134
echo "=== Building and Installing 6.1.2 (Meson) ==="
122135
rm -rf build
123-
meson setup build --prefix=/usr/local
124-
ninja -C build
125-
ninja -C build install
136+
if ! meson setup build --prefix=/usr/local; then
137+
echo "ERROR: Failed to configure Meson build for fallback 6.1.2."
138+
exit 1
139+
fi
140+
141+
if ! ninja -C build; then
142+
echo "ERROR: Failed to compile fallback 6.1.2."
143+
exit 1
144+
fi
145+
146+
if ! ninja -C build install; then
147+
echo "ERROR: Failed to install fallback 6.1.2."
148+
exit 1
149+
fi
126150

127151
echo ""
128152
echo "=============================================="
129-
echo "Installed version 6.1.2 (stable, Meson-based)"
153+
echo "Installed fallback version 6.1.2 (stable, Meson-based)"
130154
echo "=============================================="
131155
echo ""
132156
echo "If you want version $LATEST_TAG, install Rust first:"

0 commit comments

Comments
 (0)