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

bashrc: re-include $PS1 priority #651

Merged
merged 1 commit into from Jul 12, 2016
Merged

Conversation

PhilipOakley
Copy link
Contributor

6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01)
introduced the MSYS2_PS1 prompt script proriority to allow multiple
device configurations.

Unfortunately it overwrote the $PS1, even when specifically set by the
users configuration, such as the Git-for-Windows SDK
see git-for-windows/git#794 (comment)
and the monkey patch fix
git-for-windows/build-extra#122.

Introduce a priority order so that the user's $PS1 (if set) has an
intermediate priority between the MSYS2_PS1 and the default PS1.

Signed-off-by: Philip Oakley philipoakley@iee.org

@PhilipOakley
Copy link
Contributor Author

@Alexpux I was not sure if the sha256sums and the package vers are to be updated by the maintainers (you?, @elieux ..? ), or whether I should have done that.
The MSYS2 wiki on contributing https://sourceforge.net/p/msys2/wiki/Contributing%20to%20MSYS2/ doesn't break out those little details.

@renatosilva - does this change releflect your intitial intentions?
Philip

@ghost
Copy link

ghost commented Jul 5, 2016

Yes, please update shasum and pkgrel, thanks!

@PhilipOakley
Copy link
Contributor Author

Yes, please update shasum and pkgrel, thanks!

Could you clarify a couple of points?

  1. What is the sha256sum computed over? Is it just its (the bash.bashrc)
    file contents, in the same way Git does, or is it some larger entity (in
    some given format), and is there an easy to use (recommended) tool to do
    that checksum?

  2. When do the pkgver and pkgrel values change - i.e. is there a
    particular workflow that decides which one increments when? - I'm presuming

    you would expect an increment to pkgrel=2 ?

    this is my first dip into the pacman world...
    Philip

@ghost
Copy link

ghost commented Jul 5, 2016

  1. What is the sha256sum computed over? Is it just its (the bash.bashrc)
    file contents, in the same way Git does, or is it some larger entity (in
    some given format), and is there an easy to use (recommended) tool to do
    that checksum?

There is a builtin tool called sha256sum.exe:

$ which sha256sum.exe
/usr/bin/sha256sum.exe

$ pacman -Qo /usr/bin/sha256sum.exe
/usr/bin/sha256sum.exe is owned by coreutils 8.25-1

You just need to calculate the checksum of the file in source array:

$ sha256sum.exe bash.bashrc
b985a05176a940bfd46c33ac1a1f78b3b09508d8b7c28f8e23e542975e09e0e2 *bash.bashrc
  1. When do the pkgver and pkgrel values change - i.e. is there a
    particular workflow that decides which one increments when? - I'm presuming
    you would expect an increment to pkgrel=2 ?

Increase pkgrel whenever there is any non trivial change in the patch. If you fix a typo in a comment, it might not be worth to increase pkgrel, but if there is any functional change, it is considered as non trivial, so we increase pkgrel and trigger a real CI build. pkgver is usually matching upstream package version, but in the filesystem package case, Msys2 itself is the upstream, so it's just decided by Msys2 maintainers like Alexpux or others.

If you see "[MSYS2 CI] SUCCESS: No changes in package recipes." that means no change in PKGBUILD file was detected so the CI server did nothing.

I typed too slow and found you just made it ;)

@PhilipOakley
Copy link
Contributor Author

Thanks for the feedback. It's good to know I made reasonable guesses ;-)

Feedback on the patch itself is welcomed. I currently only have a lttle XP Sp3 netbook for home/mobile hacking, so the patching was tested there.

@mati865
Copy link
Collaborator

mati865 commented Jul 5, 2016

@fracting There is an easier way.

cd <PKGBUILD/dir>
updpkgsums

It will automatically calculate sha256 for files contained in source() and update PKGBUILD.

6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01)
introduced the MSYS2_PS1 prompt script priority to allow multiple
device configurations.

Unfortunately, if MSYS2_PS1 was not set it overwrote the $PS1, even
when specifically set by the users configuration, such as provided in the
Git-for-Windows SDK (see git-for-windows/git#794 (comment))
and the monkey patch fix (git-for-windows/build-extra#122).

Introduce a priority order so that the user's $PS1 (if set) has an
intermediate priority between the MSYS2_PS1 and the default PS1.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
@PhilipOakley
Copy link
Contributor Author

I have updated the commit message (only) to correct a spelling mistake and clarify the wording.

@PhilipOakley
Copy link
Contributor Author

@Alexpux Is there anything I need to do to help move this forward? What is the typical process time for changes like this (Summer holidays may have an impact)?, regards Philip

@Alexpux Alexpux merged commit 685ad98 into msys2:master Jul 12, 2016
@PhilipOakley
Copy link
Contributor Author

Many Thanks!

@Karlson2k
Copy link
Contributor

After updating to new bash and filesystem-2016.02-2 my default prompt changed to bash-4.3$
Before this update my unmodified prompt includes current path.

bash-4.3$ declare -p PS1
declare -x PS1="\\s-\\v\\\$ "

@Alexpux
Copy link
Member

Alexpux commented Jul 13, 2016

I think this is problem of new filesystem package. See commit:
#651

@PhilipOakley
Copy link
Contributor Author

@Karlson2k when was your previous update the Filesystem? was it before 6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script proriority to allow multiple device configurations? i.e. did you ever install 2016.02-1 - maybe re-install that and see if it fixes it, or not.

That patch 6e6310d had a bug in that it overwrote the users PS1 (as decribed above). This meant that the Git for Windows SDK's bash prompt was corrupted, and my patch was a minimal fix for the G4W SDK case. As a mainly windows person, I'm not sure what the fix for you would be. I'll have a google about, given your description to see if I can understand what happened, but if you can try a few debug things that would be great.

@PhilipOakley
Copy link
Contributor Author

Angelo Graziosi wrote:

Wrong prompt with your patches. Upgrading to filesystem-2016.06-2 gives:
bash-4.3$
which is very bad!
Before I had:
the_user@MY_PC MSYS ~/work
To see it newly I had to downgrade to filesystem-2016.06-1

Angelo

Thank you for the confirmation.
I'm not sure of all the processing sequences surrounding how the PS1 can be set in many places.
The filesystem-2016.06-1 is broken for me (using the Git SDK install, https://git-for-windows.github.io/#contribute https://github.com/git-for-windows/build-extra/releases/tag/git-sdk-1.0.3).

So at the moment I'm at a loss as to the appropriate fix that accepts everybodies differing ways of setting the PS1 for the different purposes (both bash window title, and bash prompt).

The very original source of the PS1 setting in G4W (and the SDK, which is different) is detailed in git-for-windows/build-extra#122 (comment)

It all looks a bit of a mess.

Also, jsut seen (but not read) #653

@Karlson2k
Copy link
Contributor

@Alexpux See #654 for fix.

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

6 participants