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

omf doctor checks for fish & git versions #280

Merged
merged 1 commit into from
Mar 24, 2016

Conversation

oranja
Copy link
Contributor

@oranja oranja commented Mar 19, 2016

Minimum fish version: 2.2.0

  • OMF uses function -V (--inherit-variable) in omf.repo

Minimum git version: 1.9.5

  • OMF uses git -C in omf.repo
  • OMF uses git --depth 1 in installer
  • OMF intends to use git --depth 1 for package install

@@ -0,0 +1,3 @@
function omf.check.version -a min_version -a current_version
test (echo "$min_version"\n"$current_version" | sort -V | head -n1) = "$min_version"
Copy link
Member

Choose a reason for hiding this comment

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

sort -V isn't portable. BSD and OS X sort doesn't have it.

Copy link
Member

Choose a reason for hiding this comment

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

 function omf.check.version -a min_version -a current_version
  set -l IFS .
  echo $min_version | read -la min_chunks
  echo $current_version | read -la current_chunks
  set -l current_chunks_count (count $current_chunks)
  for i in (seq (count $min_chunks))
    set -l chunk 0
    math "$i <= $current_chunks_count" >/dev/null ^&1
      and set chunk $current_chunks[$i]
    math "$min_chunks[$i] <= $chunk" >/dev/null ^&1
      or return 1
  end
end

Copy link
Member

Choose a reason for hiding this comment

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

the current chunk count thing was because i couldn't figure out a way to make the array stuff happy when comparing, for example, min version 1.2.3 with current version 1.2.

any better ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh... Right. So I need to add something like

uname -a | grep -qEv "os x|bsd"; or echo "goddammit" >&2

j/k. alternate version coming in a second

Copy link
Member

Choose a reason for hiding this comment

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

my version comes up with the right answer when checking omf.check.version 3.11.0 3.11 … but i guess that's an edge case that'll probably never be needed :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I was just checking my changes when you posted your version, so I only saw it when the PR was already updated. Otherwise I might have used your code.
On the upside, after (/ if) my edge-case-failing code is merged, you can override it with yours and get proper credits.

Copy link
Member

Choose a reason for hiding this comment

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

:) I'm not worried about credit.

@bobthecow
Copy link
Member

👍

@bobthecow
Copy link
Member

Everyone OK with these minimum versions?

@scorphus
Copy link
Member

Git 1.9.5 is more than 1 year old. Latest Fish release, 2.2, is 9.5 months old. So, yeah 👍 I think we're good to go.

Minimum fish version: 2.2.0
Minimum git version: 1.9.5
@bobthecow bobthecow merged commit 6323844 into oh-my-fish:master Mar 24, 2016
@oranja oranja deleted the doctor-versions branch March 24, 2016 07:18
@derekstavis derekstavis mentioned this pull request Mar 28, 2016
2 tasks
@sagebind sagebind added this to the v1 milestone Apr 3, 2016
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.

None yet

4 participants