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

Check for updates when starting a new shell. #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laktek
Copy link
Contributor

@laktek laktek commented Jun 30, 2014

This reinstates the original behaviour of checking for updates (which is included in parts init) when starting a new shell.

@dqminh
Copy link
Contributor

dqminh commented Jun 30, 2014

We removed parts init for a reason c27b213

Can you make sure that we can auto-update with parts env instead of reusing parts init, maybe with parts env --update or something ?

@laktek
Copy link
Contributor Author

laktek commented Jun 30, 2014

But there's a following commit ca7839a, which prevents parts init - from auto-starting packages (reason stated in the commit that removed parts init -).

So I guess it's safe to use parts init - again.

@chuyeow
Copy link
Contributor

chuyeow commented Jun 30, 2014

I think this is fine except I'm not sure if we need to call parts init - inside script/setup_buildenv.

IMHO, the interface should be like this so that there are no surprises:

  • parts update: updates Autoparts
  • parts env: prints env vars only
  • parts init: not sure what this will do now

But we don't have to change this.

@laktek
Copy link
Contributor Author

laktek commented Jun 30, 2014

Before c27b213, script/setup_buildenv also called parts init -. So basically this reverts to the original behaviour (not really sure whether calling parts env there is fine).

@@ -26,7 +26,7 @@ def inject_parts_init(path)
file = File.read(path)
File.open(path, 'a') do |f|
export_path = "export PATH=\"$HOME/#{relative_autoparts_bin_path}:$PATH\"\n"
parts_init = "eval \"$(parts env)\"\n"
parts_init = "eval \"$(parts init -)\"\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Because parts_init var is changed here, line 32 file.include? parts_init condition will mean that the file can potentially have two lines, one for evalling parts env the other for evalling parts init.

Which I guess is fine, but something to watch out for in the future if we change it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm..but I guess it would be rare for someone to run the setup script, if they have Autoparts already installed?

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.

4 participants