Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✍️ Description
Major Refactoring of
misc/tools.func
- DEB822 Support & Performance ImprovementsThis PR represents a comprehensive refactoring of the
misc/tools.func
file, modernizing the codebase and adding critical support for Debian's new DEB822 repository format. The changes improve performance, maintainability, and future-proof the scripts for Debian Trixie (13) and beyond.📊 Statistics:
misc/tools.func
🎯 Key Improvements
1. 🆕 DEB822 Repository Format Support
.sources
format (DEB822)2. ⚡ Performance Optimizations
apt update
calls (5-minute cache)is_package_installed()
usingdpkg-query
3. 🛡️ Enhanced Error Handling
4. 🏗️ New Helper Functions
Package Management:
cache_installed_version()
/get_cached_version()
- Version cachingupgrade_package()
- Unified package upgrade with APT cachingverify_repo_available()
- Repository availability checksensure_dependencies()
- Smart dependency installationis_package_installed()
- Fast package status checksVersion & Architecture:
version_gt()
- Smart semantic version comparisonget_system_arch()
- Normalized architecture detection (dpkg/uname)GitHub API:
github_api_call()
- Enhanced API calls with auth & rate limitingUtilities:
create_temp_dir()
- Auto-cleanup temporary directoriesdownload_with_progress()
- Progress indicators for large downloads5. 🔧 Refactored Setup Functions
All major setup functions have been modernized:
setup_nodejs()
- Now with DEB822 support, improved NodeSource handlingsetup_postgresql()
- DEB822 format, better version handlingsetup_mongodb()
- Modernized repository configurationsetup_mysql()
- DEB822 support for MySQL/MariaDB repossetup_php()
- Sury.org DEB822 format supportsetup_go()
- Improved binary downloads and version managementsetup_rust()
- Better rustup integrationsetup_java()
- Temurin OpenJDK with DEB822setup_uv()
- Modern Python package installer supportsetup_gs()
(Ghostscript) - Enhanced version handlingsetup_imagemagick()
- Multi-version support (ImageMagick 6/7)setup_clickhouse()
- Updated repository handlingsetup_ffmpeg()
- Improved codec support detection6. 📝 Better Documentation
7. 🔐 Security Improvements
🔗 Related PR / Issue
Link: N/A - Standalone refactoring initiative
Motivation: Debian Trixie (13) has transitioned to the DEB822
.sources
format, making it critical to update all repository management functions to support this new standard while maintaining backwards compatibility.✅ Prerequisites (X in brackets)
🛠️ Type of Change (X in brackets)
README
,AppName.md
,CONTRIBUTING.md
, or other docs.🧪 Testing Coverage
✅ Tested Environments:
.list
files).sources
files)✅ Tested Functions:
setup_*()
functions validated on multiple Debian versions🚀 Migration Path
No breaking changes - All modifications are backwards compatible:
📦 Benefits for Users
🔍 Code Quality
📋 Checklist for Reviewers
setup_*()
functions🙏 Acknowledgments
This refactoring builds upon the excellent foundation laid by @tteck and the community-scripts team. Special focus on ensuring zero disruption to existing workflows while modernizing the infrastructure for future Debian releases.
📌 Notes
tools.func
will continue to work🎯 TL;DR: Massive refactoring of
tools.func
adding DEB822 support, performance improvements, better error handling, and 70+ new helper functions. Fully backwards compatible. Ready for Debian Trixie.