Skip to content

Add Ghostscript 10.07.1 configuration and update bundle release#24

Merged
jwaisner merged 5 commits into
mainfrom
10.07.1
Jul 2, 2026
Merged

Add Ghostscript 10.07.1 configuration and update bundle release#24
jwaisner merged 5 commits into
mainfrom
10.07.1

Conversation

@N6REJ

@N6REJ N6REJ commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@qodo-code-review

qodo-code-review Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Add Ghostscript 10.07.1 bundle config, CIDF map script, and bump release

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add Ghostscript 10.07.1 configuration for bundled executables.
• Add a Windows script to regenerate CID font map using gswin64c.
• Bump bundle release version to 2026.7.1 for the new bundle cut.
Diagram

graph TD
  A["build.properties"] --> B["Bundle build"] --> C["ghostscript10.07.1/bearsampp.conf"] --> D["Ghostscript 10.07.1 bin"] --> E["update_cidfmap.bat"] --> F["lib/cidfmap"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize per-version config via templating
  • ➕ Avoid duplicating near-identical bearsampp.conf files across versions
  • ➕ Single source of truth for common executable paths and placeholders
  • ➖ Requires build-time template rendering and changes to current packaging conventions
  • ➖ Slightly higher complexity for a simple version bump workflow
2. Share a single CIDFMap update script across versions
  • ➕ Prevents script drift between version directories
  • ➕ Easier to update arguments/paths once
  • ➖ Needs a stable contract for locating the correct versioned gswin64c.exe
  • ➖ May reduce portability if future versions require different flags/paths

Recommendation: Keep the current per-version directory approach since it matches existing repository structure (10.05.1/10.06.0/10.07.0). Consider consolidating update scripts only if multiple versions start needing different CIDFMap invocation behavior; otherwise, the added script is low-risk and pragmatic.

Files changed (3) +17 / -1

Other (3) +17 / -1
bearsampp.confAdd Ghostscript 10.07.1 bundle configuration +5/-0

Add Ghostscript 10.07.1 bundle configuration

• Introduces a new versioned bearsampp.conf specifying Ghostscript 10.07.1 and the GUI/console executable paths. Keeps bundleRelease as a placeholder for the build to substitute.

bin/ghostscript10.07.1/bearsampp.conf

update_cidfmap.batAdd CIDFMap regeneration script for Windows bundles +11/-0

Add CIDFMap regeneration script for Windows bundles

• Adds a batch script that validates gswin64c.exe exists and runs mkcidfm.ps to regenerate lib/cidfmap. Preserves and returns Ghostscript’s exit code for automation-friendly usage.

bin/ghostscript10.07.1/update_cidfmap.bat

build.propertiesBump bundle release to 2026.7.1 +1/-1

Bump bundle release to 2026.7.1

• Updates the bundle.release property to reflect a new bundle cut aligned with the 10.07.1 configuration addition.

build.properties

@qodo-code-review

qodo-code-review Bot commented Jul 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Missing popd on error 🐞 Bug ☼ Reliability
Description
update_cidfmap.bat calls pushd "%~dp0" but exits on the missing-exe error path without running popd,
leaving the caller’s working directory changed and the directory stack unbalanced. This can break
subsequent steps when the script is invoked from other batch scripts or a long-lived cmd session.
Code

bin/ghostscript10.07.1/update_cidfmap.bat[R3-7]

+pushd "%~dp0"
+if not exist "%~dp0bin\gswin64c.exe" (
+    echo ERROR: gswin64c.exe not found in "%~dp0bin"
+    exit /b 1
+)
Evidence
The script pushes the batch directory onto the directory stack, but its error branch exits before
the later popd, so the original directory is never restored when the exe is missing. The build
copies this script into the distributed bundle, indicating it is intended to be executed as a helper
script.

bin/ghostscript10.07.1/update_cidfmap.bat[3-7]
build.gradle[689-697]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`update_cidfmap.bat` does `pushd "%~dp0"` but on the error branch (`gswin64c.exe` missing) it does `exit /b 1` before `popd`, leaving the current directory changed for the caller.

### Issue Context
This script is shipped into the Ghostscript bundle and may be invoked by users or other scripts; it should always restore CWD regardless of success/failure.

### Fix Focus Areas
- bin/ghostscript10.07.1/update_cidfmap.bat[3-7]

### Suggested change
Restructure to ensure cleanup always runs, e.g.:
- Add `popd` before `exit /b 1`, or
- Use a `:cleanup` label and `goto cleanup` on failures so `popd` always executes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. EXITCODE variable leaks 🐞 Bug ⚙ Maintainability
Description
update_cidfmap.bat sets EXITCODE without setlocal/endlocal, so when run from another batch file in
the same cmd.exe process it can overwrite the caller’s environment variable. This can cause subtle
downstream script logic errors if the caller uses EXITCODE for its own flow.
Code

bin/ghostscript10.07.1/update_cidfmap.bat[R9-11]

+set EXITCODE=%ERRORLEVEL%
+popd
+exit /b %EXITCODE%
Evidence
The script explicitly assigns EXITCODE and exits with it, but there is no local scoping
(setlocal/endlocal), so the variable can remain set for the calling context.

bin/ghostscript10.07.1/update_cidfmap.bat[8-11]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The script assigns `EXITCODE` globally (`set EXITCODE=%ERRORLEVEL%`) and later uses it to exit. Without `setlocal/endlocal`, this variable persists into the caller environment when invoked from another batch script.

### Issue Context
This is a helper script shipped with the bundle; avoiding environment pollution makes it safer to compose into other scripts.

### Fix Focus Areas
- bin/ghostscript10.07.1/update_cidfmap.bat[9-11]

### Suggested change
Either:
- Wrap the script in `setlocal` / `endlocal` (e.g., `setlocal EnableExtensions` at top, and `endlocal & exit /b %EXITCODE%` at end), or
- Avoid the temporary variable entirely by carefully preserving errorlevel while still running `popd` (e.g., store it in a locally-scoped variable via `setlocal`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit b723ced

Results up to commit 6691aa7


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Qodo Logo

N6REJ added 2 commits July 1, 2026 20:10
- Add bearsampp.conf with version 10.07.1 settings and executables
- Add update_cidfmap.bat script for CID font map generation
Comment on lines +3 to +7
pushd "%~dp0"
if not exist "%~dp0bin\gswin64c.exe" (
echo ERROR: gswin64c.exe not found in "%~dp0bin"
exit /b 1
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Missing popd on error 🐞 Bug ☼ Reliability

update_cidfmap.bat calls pushd "%~dp0" but exits on the missing-exe error path without running popd,
leaving the caller’s working directory changed and the directory stack unbalanced. This can break
subsequent steps when the script is invoked from other batch scripts or a long-lived cmd session.
Agent Prompt
### Issue description
`update_cidfmap.bat` does `pushd "%~dp0"` but on the error branch (`gswin64c.exe` missing) it does `exit /b 1` before `popd`, leaving the current directory changed for the caller.

### Issue Context
This script is shipped into the Ghostscript bundle and may be invoked by users or other scripts; it should always restore CWD regardless of success/failure.

### Fix Focus Areas
- bin/ghostscript10.07.1/update_cidfmap.bat[3-7]

### Suggested change
Restructure to ensure cleanup always runs, e.g.:
- Add `popd` before `exit /b 1`, or
- Use a `:cleanup` label and `goto cleanup` on failures so `popd` always executes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +9 to +11
set EXITCODE=%ERRORLEVEL%
popd
exit /b %EXITCODE%

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

2. Exitcode variable leaks 🐞 Bug ⚙ Maintainability

update_cidfmap.bat sets EXITCODE without setlocal/endlocal, so when run from another batch file in
the same cmd.exe process it can overwrite the caller’s environment variable. This can cause subtle
downstream script logic errors if the caller uses EXITCODE for its own flow.
Agent Prompt
### Issue description
The script assigns `EXITCODE` globally (`set EXITCODE=%ERRORLEVEL%`) and later uses it to exit. Without `setlocal/endlocal`, this variable persists into the caller environment when invoked from another batch script.

### Issue Context
This is a helper script shipped with the bundle; avoiding environment pollution makes it safer to compose into other scripts.

### Fix Focus Areas
- bin/ghostscript10.07.1/update_cidfmap.bat[9-11]

### Suggested change
Either:
- Wrap the script in `setlocal` / `endlocal` (e.g., `setlocal EnableExtensions` at top, and `endlocal & exit /b %EXITCODE%` at end), or
- Avoid the temporary variable entirely by carefully preserving errorlevel while still running `popd` (e.g., store it in a locally-scoped variable via `setlocal`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b723ced

@jwaisner jwaisner merged commit 4cb1164 into main Jul 2, 2026
3 checks passed
@jwaisner jwaisner deleted the 10.07.1 branch July 2, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants