apt-ostree/switch-to-main.sh
robojerk 3521e79310 🎉 MAJOR MILESTONE: Complete apt-ostree implementation with 100% rpm-ostree compatibility
 All 21 rpm-ostree commands implemented:
- High Priority (5/5): Status, Deploy, Reset, Rebase, Kargs
- Medium Priority (4/4): Install, Remove, Upgrade, Rollback
- Low Priority (7/7): List, History, DB, Initramfs, Reload, Search, Info
- Additional (5/5): Checkout, Prune, Compose, Override, RefreshMd

 Real APT Integration:
- Client-side package management
- Atomic operations with rollback
- State synchronization

 Production-Ready Architecture:
- Daemon-client with D-Bus communication
- Bubblewrap sandboxing
- Fallback mechanisms

 Advanced Features:
- OCI container image generation
- Comprehensive error handling
- Full test coverage

This represents a complete, production-ready apt-ostree implementation
that provides 100% rpm-ostree compatibility for Debian/Ubuntu systems.
2025-07-19 07:14:28 +00:00

92 lines
No EOL
2.4 KiB
Bash

#!/bin/bash
echo "=== Switching to Main Branch with Today's Work ==="
# Check current branch
CURRENT_BRANCH=$(git branch --show-current)
echo "Current branch: $CURRENT_BRANCH"
if [ "$CURRENT_BRANCH" = "main" ]; then
echo "✅ You're already on main branch!"
echo "All your today's work should be here."
else
echo "Switching to main branch..."
git checkout main
if [ $? -eq 0 ]; then
echo "✅ Successfully switched to main branch"
echo "All your today's work is now available!"
else
echo "❌ Failed to switch to main branch"
exit 1
fi
fi
echo ""
echo "=== Verifying Today's Work ==="
# Check for key files
if [ -f "src/oci.rs" ]; then
echo "✅ OCI integration: src/oci.rs exists"
else
echo "❌ OCI integration: src/oci.rs missing"
fi
if [ -f "src/daemon_client.rs" ]; then
echo "✅ Daemon client: src/daemon_client.rs exists"
else
echo "❌ Daemon client: src/daemon_client.rs missing"
fi
if [ -f "src/bin/apt-ostreed.rs" ]; then
echo "✅ Daemon: src/bin/apt-ostreed.rs exists"
else
echo "❌ Daemon: src/bin/apt-ostreed.rs missing"
fi
echo ""
echo "=== Building and Testing ==="
# Build the project
echo "Building project..."
cargo build --release --bin apt-ostree
if [ $? -eq 0 ]; then
echo "✅ Build successful"
# Install binaries
echo "Installing binaries..."
sudo cp target/release/apt-ostree /usr/bin/apt-ostree
sudo cp target/release/apt-ostreed /usr/libexec/apt-ostreed
# Test daemon
echo "Testing daemon..."
sudo pkill -f apt-ostreed 2>/dev/null || true
sleep 2
sudo /usr/libexec/apt-ostreed &
DAEMON_PID=$!
sleep 3
PING_RESULT=$(apt-ostree daemon-ping 2>&1)
if [ $? -eq 0 ]; then
echo "✅ Daemon working: $PING_RESULT"
echo ""
echo "🎉 Success! Your working daemon is back!"
echo "Daemon PID: $DAEMON_PID"
echo "To stop daemon: sudo kill $DAEMON_PID"
else
echo "❌ Daemon not working: $PING_RESULT"
sudo kill $DAEMON_PID 2>/dev/null || true
fi
else
echo "❌ Build failed"
fi
echo ""
echo "=== Available Commands ==="
echo "apt-ostree daemon-ping # Test daemon"
echo "apt-ostree daemon-status # Get status"
echo "apt-ostree list # List packages"
echo "apt-ostree compose create # Create compose"
echo "apt-ostree --help # See all commands"