added aur packaging + adjusted the scripts to meet the new setup way#30
added aur packaging + adjusted the scripts to meet the new setup way#30
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBumps release to 1.4.2, adds an Arch PKGBUILD, adjusts shell script runtime/config paths and removes the update option, updates installer UX and deps, and adds .gitignore entries for Arch package artifacts. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.gitignore:
- Around line 12-13: The .gitignore currently only ignores package artifacts
matching the pattern "*-any.pkg.*", which misses architecture-specific outputs
like "*-x86_64.pkg.tar.zst"; update the ignore entry in .gitignore to a broader
pattern (e.g., "*-*.pkg.*") so any architecture suffix is covered and built
artifacts don't get committed, replacing the existing "*-any.pkg.*" entry with
the new pattern.
In `@OCR4Linux.sh`:
- Around line 38-40: The script defines OCR4Linux_CONFIG, TEXT_OUTPUT_FILE_NAME
and LOGS_FILE_NAME but never creates OCR4Linux_CONFIG; add a mkdir -p
"$OCR4Linux_CONFIG" (and check its exit status) immediately after those variable
assignments so the directory exists before any code in OCR4Linux.py or clipboard
handling opens TEXT_OUTPUT_FILE_NAME or LOGS_FILE_NAME; ensure you log or exit
on failure to create the directory so subsequent file operations don't silently
fail.
- Line 36: The script sets OCR4Linux_HOME using pwd which breaks resolution when
invoked from elsewhere; change OCR4Linux_HOME to the script's directory (resolve
the location of OCR4Linux.sh / the invoking script) so OCR4Linux.py is loaded
relative to the script, and ensure OCR4Linux_CONFIG is created/validated before
writing outputs (call mkdir -p on OCR4Linux_CONFIG and error out if creation
fails) so fresh installs from setup.sh or PKGBUILD work reliably.
In `@PKGBUILD`:
- Around line 28-30: The PKGBUILD declares pkgver=1.4.2 but the git source is
unpinned (source=("$pkgname-$pkgver::git+$url")), so builds will track the
moving default branch and falsely claim 1.4.2; fix by either setting
pkgver=1.4.1 and pinning the source to the v1.4.1 tag (add the tag ref to
source) or keep pkgver=1.4.2 and pin the git source to a specific commit hash
(append @<commit> to the git+$url ref) so the build is reproducible; update the
sha256sums accordingly.
In `@README.md`:
- Line 3: Update README documentation for the 1.4.2 release: change the version
line to 1.4.2 if not already, add a note about the new ocr4linux AUR package and
include installation instructions for it, remove any references to the
deprecated -u/--update CLI option and update examples that call setup.sh to
reflect the new CLI surface (adjust command examples and flags), and verify the
README’s setup.sh section matches current behavior of the installer and CLI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 031b9963-1023-4ab9-8b27-227310aca271
📒 Files selected for processing (6)
.gitignoreOCR4Linux.pyOCR4Linux.shPKGBUILDREADME.mdsetup.sh
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 3
♻️ Duplicate comments (2)
PKGBUILD (1)
2-3:⚠️ Potential issue | 🟠 MajorDon't ship a fixed
pkgverfrom a moving git checkout.
source=("$pkgname-$pkgver::git+$url")follows the default branch, so two builds ofpkgver=1.4.2can contain different commits. For a-gitpackage, derivepkgver()from the checkout, or pin the source to a specific tag/commit if this is meant to be a release snapshot.Also applies to: 29-30
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@PKGBUILD` around lines 2 - 3, The PKGBUILD currently hardcodes pkgver=1.4.2 for a git checkout (pkgname ocr4linux-git) which is incorrect for moving branches; either implement a pkgver() function that derives version from the checked-out commit/tag (e.g., using git describe --tags or git rev-parse --short) and remove the fixed pkgver assignment, or pin the source variable (source=...) to a specific tag/commit instead of using the default branch; update references to pkgver, pkgname and source accordingly so the package version always reflects the actual checkout.OCR4Linux.sh (1)
36-36:⚠️ Potential issue | 🔴 CriticalResolve
OCR4Linux.pyfrom the wrapper location, not the caller's cwd.
$(pwd)makes the packaged entrypoint fail whenever it is launched from another directory, because both the existence check and thepython "$OCR4Linux_HOME/$OCR4Linux_PYTHON_NAME"call look forOCR4Linux.pyunder the current working directory instead of beside the installed script.🛠️ Suggested fix
-OCR4Linux_HOME="$(pwd)" +OCR4Linux_HOME="$(cd -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P)"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@OCR4Linux.sh` at line 36, The wrapper sets OCR4Linux_HOME="$(pwd)" which breaks resolution when invoked from another CWD; change OCR4Linux_HOME in OCR4Linux.sh to the directory containing the wrapper script (resolve the script's own path via dirname of the script/source, falling back to $0 if needed) and use that OCR4Linux_HOME when checking for OCR4Linux_PYTHON_NAME and invoking python so the script always resolves OCR4Linux.py relative to the installed wrapper location rather than the caller's cwd.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@OCR4Linux.sh`:
- Around line 89-100: The -d and --lang option handlers currently read "$2" and
do "shift 2" unconditionally; update the case branches for "-d)" and "--lang)"
to validate that a non-empty argument exists and is not another option (e.g.
starts with "-") before assigning SCREENSHOT_DIRECTORY or SPECIFIED_LANGS and
doing "shift 2", otherwise print a clear usage/error message and exit non-zero;
keep the "-l)" branch unchanged and ensure you still set LANG_SPECIFIED=true
when a valid --lang value is provided.
- Around line 119-122: The script currently unconditionally checks for rofi and
exits, which breaks non-interactive flows where LANG_SPECIFIED is true (handled
by process_specified_langs()); change the rofi presence check so it only runs
when interactive selection is required (i.e., when LANG_SPECIFIED is false and
choose_lang will be called). Locate the rofi check block and wrap or gate it
behind a condition that tests LANG_SPECIFIED (or the same flag/logic used to
decide between process_specified_langs() and choose_lang()), so rofi is only
validated when choose_lang() will be executed.
- Around line 255-265: The script currently always logs success and deletes
"$TEXT_OUTPUT_FILE_NAME" even if the OCR (python
"$OCR4Linux_HOME/$OCR4Linux_PYTHON_NAME" ...) or clipboard commands (cliphist /
xclip) fail; update the flow to check each command's exit status and abort on
failure: after running the python OCR invocation check its exit code and call
log_message with an error and exit non-zero if it failed (do not proceed to
clipboard steps), then after attempting clipboard copy (the cliphist and xclip
invocations) check their exit codes and on failure log an error and exit
non-zero without deleting "$TEXT_OUTPUT_FILE_NAME"; only log "Text extraction
completed successfully" and remove "$TEXT_OUTPUT_FILE_NAME" when OCR and
clipboard operations both succeeded.
---
Duplicate comments:
In `@OCR4Linux.sh`:
- Line 36: The wrapper sets OCR4Linux_HOME="$(pwd)" which breaks resolution when
invoked from another CWD; change OCR4Linux_HOME in OCR4Linux.sh to the directory
containing the wrapper script (resolve the script's own path via dirname of the
script/source, falling back to $0 if needed) and use that OCR4Linux_HOME when
checking for OCR4Linux_PYTHON_NAME and invoking python so the script always
resolves OCR4Linux.py relative to the installed wrapper location rather than the
caller's cwd.
In `@PKGBUILD`:
- Around line 2-3: The PKGBUILD currently hardcodes pkgver=1.4.2 for a git
checkout (pkgname ocr4linux-git) which is incorrect for moving branches; either
implement a pkgver() function that derives version from the checked-out
commit/tag (e.g., using git describe --tags or git rev-parse --short) and remove
the fixed pkgver assignment, or pin the source variable (source=...) to a
specific tag/commit instead of using the default branch; update references to
pkgver, pkgname and source accordingly so the package version always reflects
the actual checkout.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 398976fd-0200-4109-801d-c0fa021d0742
📒 Files selected for processing (2)
OCR4Linux.shPKGBUILD
implements the issue #8