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

Work on Show PKGBUILD diff when updating a package issue #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LilyCathelineau
Copy link

#41

@restyled-io
Copy link

restyled-io bot commented Nov 16, 2018

Hey there-

I'm a bot, here to let you know that some code in this PR might not
match the team's automated styling. I ran the team's auto-reformatting tools on
the files changed in this PR and found some differences. Those differences can
be seen in #63.

NOTE: Since this PR was opened from a fork, we're not able to open our PR
with yours as the base branch. Therefore, the PR linked above was opened
directly against master. It includes your changes and another commit to
adjust styling.

If you're interested in incorporating the style fixes in this PR, you can do
that locally with something like:

git remote add upstream https://github.com/pbrisbin/aurget.git
git fetch upstream pull/63/head
git merge --ff-only FETCH_HEAD
git push

Fixing the styling (through the above or any other means) will cause the linked
PR to be closed and this comment delete.

Sorry if this was unexpected. To disable it, see our documentation.

Copy link
Owner

@pbrisbin pbrisbin left a comment

Choose a reason for hiding this comment

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

Thanks for getting started on this!

aurget Outdated
@@ -331,7 +342,7 @@ set_defaults() {
silent=false
sort_mode='name'
sync_mode='install'
temp_directory='/tmp/aurget'
pkgbuild_directory='~/.cache/aurget'
Copy link
Owner

Choose a reason for hiding this comment

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

  • I would call this cache_directory
  • It should follow XDG, cache_directory=${XDG_CACHE_HOME:-$HOME/.cache}/aurget

aurget Outdated
@@ -554,7 +565,7 @@ setup_targets() {
version="${versions[$name]}"

if [[ -z "$version" ]]; then
pkgbuild="$temp_directory/${name}_PKGBUILD"
pkgbuild="$pkgbuild_directory/${name}_PKGBUILD"
Copy link
Owner

Choose a reason for hiding this comment

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

I would place the file at $cache/$name/$version/PKGBUILD -- You're going to need $version in the filename to find it later for diffing. But... you don't actually know the version yet, so you might still have to download it to some temporary location and move it after processing. I'm open to ideas here.

Copy link
Author

Choose a reason for hiding this comment

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

That was my thought as well, maybe there is a way to hold it in a folder and parse it and then moving it into it's own directory in name/version before continuing?

aurget Outdated

if clean; then
clean_package_directory
fi
if searching; then
Copy link
Owner

Choose a reason for hiding this comment

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

Do you intend for the behavior of --clean to be that you clean and can proceed with other operations, or do you want --clean to be something that has to be used by itself?

If it's the former, that shouldn't be represented by opmode=clean it should a boolean variable like clean=true. Then you can just do clean && clean_... here.

If it's the latter, this should be if; clean; then; elif searching; then; else -- or maybe a case?

Copy link
Author

Choose a reason for hiding this comment

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

Which would be more preferable to you?

Copy link
Owner

Choose a reason for hiding this comment

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

I don't have a a strong opinion about it. I'd probably do the former if it were up to me, but that's a bigger change from the code you have here now.

then
else
mkdir "$pkgbuild_directory" || die 'unable to create package directory'
fi
Copy link
Owner

Choose a reason for hiding this comment

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

This is not formatted correctly. Please use the other if expressions in the file as examples.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I will take a look.

Pull request conversation: pbrisbin#62

main issue: pbrisbin#41
@LilyCathelineau
Copy link
Author

Hey, sorry, I made an issue I should have noticed. $cache should be should cache_directory.

@pbrisbin pbrisbin added the restyle-ignore Ignore PR in Restyled label Sep 3, 2019
@aragon999
Copy link
Contributor

@LilyCathelineau are you still interested in finishing this pull request? Otherwise I would look into that.

Base automatically changed from master to main February 3, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
restyle-ignore Ignore PR in Restyled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants