Skip to content

fix: handle -Sy, -Sp, -Sh edge cases in buildsPackages - #37

Merged
manticore-projects merged 1 commit into
manticore-projects:mainfrom
musqz:fix/syay-edge-cases
Jun 24, 2026
Merged

manticore-projects merged 1 commit into
manticore-projects:mainfrom
musqz:fix/syay-edge-cases

Conversation

@musqz

@musqz musqz commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

You noted in #27 that -Sy/-Syy, -Sp/--print, and -Sh still incorrectly gate — this fixes all three.

What was wrong

buildsPackages had no handling for:

  • -y / --refresh: database refresh without -u or package targets doesn't build anything, but was classified as gate=true
  • -p / --print: print mode (outputs URLs, no build) — same
  • -Sh: sync help — h only set hasOp, leaving isSync && !syncQuery true

Changes

-Sy / -Syy: added syncYOnly, syncUpgrade, and hasTarget tracking. A database-only refresh (-Sy with no -u and no package args) returns false. -Syu and -Sy firefox still gate correctly.

-Sp / --print: p added to the syncQuery short-flag set; "print" added to the long-opt switch.

-Sh: h now sets both hasOp=true and syncQuery=true, so help in any context is non-building. Bare -h and --help behaviour unchanged.

Tests

7 new cases in the table-driven suite; go vet + full suite pass.

{"sync refresh only",             []string{"-Sy"},              false},
{"sync double refresh",           []string{"-Syy"},             false},
{"sync refresh with target builds", []string{"-Sy", "firefox"}, true},
{"sync print",                    []string{"-Sp", "foo"},       false},
{"sync print long",               []string{"--sync", "--print", "foo"}, false},
{"sync help",                     []string{"-Sh"},              false},

@manticore-projects

Copy link
Copy Markdown
Owner

Thank you, please resolve conflicts first. I am sorry for the mismatch.

@musqz
musqz force-pushed the fix/syay-edge-cases branch from fee10e3 to 509daf1 Compare June 24, 2026 11:07
@musqz

musqz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Thank you, please resolve conflicts first. I am sorry for the mismatch.

Thanks! Conflicts resolved and branch rebased — both PRs should be clean now.

@manticore-projects manticore-projects left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The functional improvement looks good but you change URLS and packaging, why?

Comment thread packaging/PKGBUILD Outdated
pkgdesc="LLM-powered pre-build malware scanner for AUR packages"
arch=('x86_64' 'aarch64')
url="https://github.com/manticore-projects/aurscan"
url="https://github.com/musqz/aurscan"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't. And is wrong. Will clean it. Thanks.

Comment thread README.md Outdated

### Catch malicious AUR packages *before* they build.

> **Fork:** [musqz/aurscan](https://github.com/musqz/aurscan) — see [FORK.md](FORK.md) for changes from upstream.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

why do we need this?

Comment thread FORK.md Outdated
@@ -0,0 +1,30 @@
# musqz/aurscan — fork notes

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do we need this?

Comment thread packaging/PKGBUILD Outdated
'xdg-utils: open mail client for mailing-list reports')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('SKIP') # replace with the real checksum on release
sha256sums=('695452b46cfcb8d71ea2acc82fabc2af4ef64fe8d22693e423e422731969a996')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do we need this?

@musqz

musqz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your patience — cleaned up the commit, now contains only the relevant fix with no unrelated edits.

-Sy/-Syy with no targets or -u only refreshes databases, nothing builds.
-Sp/--print prints what would be done without building.
-Sh shows sync help. All three incorrectly gated in the upstream-merged PR.

Tracked with syncYOnly/syncUpgrade/hasTarget so -Syu and -Sy <pkg> still
correctly fire the gate. Adds 7 new test cases; go vet + full suite pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@musqz
musqz force-pushed the fix/syay-edge-cases branch from 509daf1 to a8f6cb4 Compare June 24, 2026 11:34
@musqz

musqz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Apologies for the noise. Rebased onto upstream/main — now a single clean commit with only the relevant fix. No packaging, URL, or doc changes.

@manticore-projects

Copy link
Copy Markdown
Owner

Apologies for the noise. Rebased onto upstream/main — now a single clean commit with only the relevant fix. No packaging, URL, or doc changes.

Happens to the best and no harm done.
Thank you for working on this!

@manticore-projects
manticore-projects merged commit 354567d into manticore-projects:main Jun 24, 2026
4 checks passed
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