Enhance build-upload script to temporarily move README files during build process and restore them afterward; add README for uconsole-rotate package.

This commit is contained in:
2025-08-08 21:08:48 -03:00
parent 18ddff2167
commit 1ce2ddddc4
4 changed files with 48 additions and 0 deletions
+21
View File
@@ -29,7 +29,28 @@ read -s -p "Enter your password: " pass
echo echo
mkdir -p builds mkdir -p builds
# Temporarily move top-level README files out during build, then restore
backup_dir=$(mktemp -d)
moved_readmes=()
restore_readmes() {
for f in "${moved_readmes[@]}"; do
[ -f "$backup_dir/$f" ] && mv "$backup_dir/$f" "$pkg_path/$f"
done
}
# Always clean up backup dir; README files are restored immediately after build
trap 'rm -rf "$backup_dir"' EXIT
for f in README.md readme.md README Readme.md; do
if [ -f "$pkg_path/$f" ]; then
mv "$pkg_path/$f" "$backup_dir/$f"
moved_readmes+=("$f")
fi
done
dpkg-deb --build "$pkg_path" "$output_path" dpkg-deb --build "$pkg_path" "$output_path"
# Restore README files now so the repo looks unchanged for the rest of the script
restore_readmes
response=$(curl --silent --show-error --user "$user:$pass" --upload-file "$output_path" "$remote_url" 2>&1) response=$(curl --silent --show-error --user "$user:$pass" --upload-file "$output_path" "$remote_url" 2>&1)
if echo "$response" | grep -q "package file already exists"; then if echo "$response" | grep -q "package file already exists"; then
echo "Upload skipped: package file already exists on the server. You might have forgot to update the version number in the control file" echo "Upload skipped: package file already exists on the server. You might have forgot to update the version number in the control file"
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
# uconsole-rotate
Command-line helper to rotate the uConsole display on Wayland (sway/wayfire) using wlr-randr.
## Important
This rotation is not persisted across reboots. Re-run the command after login or add it to your session autostart if you want it applied automatically.
I use this to quickly rotate the display to play games in other orientations.
## Usage
```
uconsole-rotate [right|left|0|90|180|270]
```
- No argument: rotate 90° clockwise from current orientation
- right/left: rotate relative to current orientation
- 0/90/180/270: set rotation (device-specific mapping handled internally)
## Notes
- Automatically detects the DSI output
- Requires a Wayland session with `wlr-randr` available
- Exits with non-zero status if no DSI output is found or transform cannot be resolved