Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions init-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ case $OSName in
Darwin)
OS=OSX
__DOTNET_PKG=dotnet-osx-x64
ulimit -n 2048

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that this is only going to apply to the current session.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does that mean that if this script calls in to another sh script, that one won't have this setting? If so then we need to apply this in the init-tools in buildtools as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That should be fine.

;;

Linux)
Expand Down
2 changes: 1 addition & 1 deletion sync.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $working_tree_root/init-tools.sh

if [ "$sync_src" == true ]; then
echo "Fetching git database from remote repos..."
git fetch --all -p -v &>> $sync_log
git fetch --all -p -v >> $sync_log

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure what the & was doing there to begin with, did you test if this works on Ubuntu?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Me neither.
Yes, I tested it in Ubuntu and OS X

@naamunds why do we have & there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@joperezr @maririos The & was there to redirect both stderr and stdout to the file. Most of the output from git fetch comes from stderr, so it's not sufficient to just redirect stdout to the file. This documentation has more info about I/O redirection in Bash.

According to that guide, the &> was added in Bash 4, so that would explain the issue running it on OS X, where Bash 2 is still used by default, I think. I had to make a fix for that reason in fe6ac97.

It looks like a workaround is to use >>filename 2>&1; I'll test that and then send out a PR if it works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've created #7312.

if [ $? -ne 0 ]; then
echo -e "\ngit fetch failed. Aborting sync." >> $sync_log
echo "ERROR: An error occurred while fetching remote source code; see $sync_log for more details."
Expand Down