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

Support custom rz-pm-db URL #53

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Support custom rz-pm-db URL #53

merged 1 commit into from
Mar 26, 2024

Conversation

afjoseph
Copy link
Contributor

@afjoseph afjoseph commented Mar 21, 2024

Hey guys. This PR adds an environment variable to support a custom rz-pm-db.

It also adds a new flag to disable DB updatesa

Finally, I also added a log line to tell the user the package is downloading. This is purely for sanity purposes since I thought multiple times the binary hanged when it was just downloading a large repo.

I've added an explanation for this in the README

@afjoseph afjoseph changed the title Add flag to disable DB update Support custom rz-pm-db URL Mar 21, 2024
@wargio wargio requested a review from ret2libc March 21, 2024 12:46
Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

Nice addition, thank you!

README.md Outdated Show resolved Hide resolved
Copy link
Member

@ret2libc ret2libc left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

README.md Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@afjoseph
Copy link
Contributor Author

All changes addressed. Thanks, guys ❤️

main.go Outdated Show resolved Hide resolved
pkg/site.go Outdated Show resolved Hide resolved
Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

Apart from that nitpick LGTM

pkg/database.go Outdated
@@ -24,12 +24,14 @@ var ErrRizinPackageWrongHash = errors.New("wrong hash")

const dbPath string = "db"

func InitDatabase(path string, rizinVersion string) (Database, error) {
func InitDatabase(path string, rizinVersion string, shouldUpdateDB bool) (Database, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Missed this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Damn. I thought I got them all. Fixed!

And add a log line when downloading a package which is very useful to
tell the user the project didn't hang: it's just downloading slowly.
@ret2libc ret2libc merged commit d31b330 into rizinorg:main Mar 26, 2024
3 checks passed
@ret2libc
Copy link
Member

Thanks a lot!

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.

3 participants