Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for a centos-based distro#202

Open
jhfrontz wants to merge 1 commit into
devrandom:master from
jhfrontz:add_centos_support
Open

Add support for a centos-based distro #202
jhfrontz wants to merge 1 commit into
devrandom:master from
jhfrontz:add_centos_support

Conversation

@jhfrontz

@jhfrontz jhfrontz commented Oct 4, 2018
edited
Loading

Copy link
Copy Markdown

This updates gbuild to be compatible with Centos's package manager (yum). It also adds a few robustness improvements (redirecting cd executions to /dev/null, preventing any shell-prompt-related output from causing confusion).

I've successfully tested/used this with Docker running against an image created with $ bin/make-base-vm --docker --distro centos --suite 7 --arch amd64.

charlesrocket reacted with thumbs up emoji

Copy link
Copy Markdown
Author

@achow101 can you review this?

Comment thread bin/gbuild
dir = sanitize(remote["dir"], remote["dir"])

author_date = `cd inputs/#{dir} && git log --format=@%at -1 | date +"%F %T" -u -f -`.strip
author_date = `cd inputs/#{dir} > /dev/null && git log --format=@%at -1 | date +"%F %T" -u -f -`.strip

@devrandom devrandom Oct 17, 2018

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

what is the output that this is suppressing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

From what I could figure out, the cd was spitting out information about the new directory -- I think in the case where you/your-distro have your shell configured to update the "window title" to reflect the current working directory. Apparently this isn't an issue on the non-Centos invocations?

@devrandom devrandom Jan 21, 2019

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This shouldn't happen in non-interactive shells. Perhaps your personal setup has some interactive shell setup or an alias to cd in the wrong shell startup file?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tracked it down -- it's because I have CDPATH set: https://unix.stackexchange.com/questions/245453/how-to-not-show-path-after-cd-command-with-cdpath-set (note the workaround).

Copy link
Copy Markdown
Author

Note -- I somehow forgot earlier to include the corresponding changes in make-base-vm in my previous commit. I just updated/squashed.

Copy link
Copy Markdown
Contributor

utACK 25630b7

I don't have a CentOS system and am not particularly familiar with them, but this looks correct. At the very least, the debian/ubuntu parts seem to be exactly the same as before.

jhfrontz reacted with thumbs up emoji

Copy link
Copy Markdown
Author

Updated to improve compatibility with newer versions of docker.

Comment thread bin/gbuild
end

if ENV["USE_DOCKER"] and build_desc["distro"].eql? "centos"
ontarget_root_extra = "-w /root"

@devrandom devrandom Jan 21, 2019

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

what happens if we don't supply this argument?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

On newer versions of docker there appears to be some sort of security setting that causes the command (without the -w root) to fail because of bad permissions on /home/centos (which is weird, of course, since the login is root). This showed up on a coworker's Arch system -- but only when using a centos-based container.

Similar reports:

wtogami commented Aug 27, 2019

Copy link
Copy Markdown
Contributor

needs rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@devrandom devrandom devrandom left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /