-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix rsync #13
Fix rsync #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rsync.php.net/build-*.sh
scripts are ancient and unused. Suggest just deleting them to avoid confusion.
The update-docs-sources
script is only used on euk2, so shouldn't be part of this PR.
696b724
to
1ebb365
Compare
This removes some outdated commands that are by now obsolete as well as moving a part of the script ionto a function to make it more readable
git clone https://git.php.net/repository/doc/$2.git $BASE_DIR/$1 | ||
fi | ||
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old svn up
output used to get logged to /tmp/log-svn
. No logging happens for these git commands; I suggest logging the output somewhere (e.g. /tmp/log-git
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this PR is missing corresponding changes to build-docs-lang-rsync
.
build-docs-rsync
Outdated
# All translations depend on english being up2date | ||
assertUpToDateRepo en en | ||
|
||
cd /home/docbuilder/phpdoc-git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong directory, should be cd $BASE_DIR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
build-docs-rsync
Outdated
if [ ! -d $BASE_DIR/$1 ]; then | ||
git clone https://git.php.net/repository/doc/$2.git $BASE_DIR/$1 | ||
fi | ||
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master > /tmp/log-git 2>&1 | |
git -C $BASE_DIR/$1 fetch origin && git -C $BASE_DIR/$1 reset --hard origin/master >> /tmp/log-git 2>&1 |
To avoid emptying the log for each assertUpToDateRepo call? Though then we probably should also explicitly clear the log at the start of the script...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I was thinking of using logger
to append the messages to the system log and also make use of log turnover etc. but refrained from it to make it as close to the previous version as possible but didn't take into account that it will clear the log every time it runs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, clearing the log on each run was the old behaviour so you're not doing anything worse here.
That way the output of the git reset command will be output into one file per repo instead of only containing the output of the last assertion. And it avoids a cleanup at the begining of the script. An alternative would be using `logger` instead but that would then preserve the output completely and lead to an increased size of the syslog. Not sure that makes sense.
This PR should fix that after moving to git the documentation on php.net is still built from SVN.
All references of SVN checkouts have been replaced by the appropriate GIT commands. Additionally it should not be necessary to create the git repositories on the selected boxes by hand when a new language will be added to the
$ACTIVE_ONLINE_LANGUAGES
array ininclude/languages.inc
– as long as the appropriate repo already exists ongit.php.net