Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint W59 with a local path that is not an archive #6219

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Oct 1, 2024

fix #6218

backported to 2.3 in #6220

@rjbou rjbou added the KIND: BUG label Oct 1, 2024
@rjbou rjbou added this to the 2.3.0~alpha2 milestone Oct 1, 2024
@rjbou rjbou requested a review from kit-ty-kate October 1, 2024 09:48
@rjbou rjbou changed the title Fiw lint W59 Fix lint W59 with a local path that is not an archive Oct 1, 2024
tests/reftests/lint.test Outdated Show resolved Hide resolved
tests/reftests/lint.test Show resolved Hide resolved
tests/reftests/lint.test Outdated Show resolved Hide resolved
src/state/opamFileTools.ml Outdated Show resolved Hide resolved
master_changes.md Outdated Show resolved Hide resolved
src/core/opamSystem.ml Outdated Show resolved Hide resolved
src/core/opamSystem.ml Outdated Show resolved Hide resolved
src/core/opamSystem.mli Outdated Show resolved Hide resolved
dev-repo: "hg+https://to@li.nt"
bug-reports: "https://nobug"
### <add-url.sh>
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
Copy link
Member

Choose a reason for hiding this comment

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

you used single quotes here instead of double-quotes and only halved the left part of the sed, not the right part.

Suggested change
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\/g'`

Copy link
Member

Choose a reason for hiding this comment

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

actually what is the goal of this sed? Is it just to escape every backslashes? If so, then the solution might be instead:

Suggested change
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
basedir=`echo "$BASEDIR" | sed 's/\\/\\\\/g'`

I know is everywhere in the reftests in its double-quoted form but i’ve never really understood it ^^"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the different levels of escape that are needed to end with s/\\/\\\\/g launched.

dev-repo: "hg+https://to@li.nt"
bug-reports: "https://nobug"
### <add-url.sh>
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
Copy link
Member

Choose a reason for hiding this comment

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

same here

Suggested change
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\/g'`

@kit-ty-kate
Copy link
Member

Thanks!

@kit-ty-kate kit-ty-kate merged commit f892a2e into ocaml:master Oct 14, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint W59 warn for missing checksum on local directory source url
3 participants