Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Remove extracted php src#256
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
e180396cd0d7b7e1267b311d7384File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/sh | ||
| set -e | ||
| dir=/usr/src/php | ||
| usage() { | ||
| echo "usage: $0 COMMAND" | ||
| echo | ||
| echo "Manage php source tarball lifecycle." | ||
| echo | ||
| echo "Commands:" | ||
| echo " extract extract php source tarball into directory $dir if not already done." | ||
| echo " delete delete extracted php source located into $dir if not already done." | ||
| echo | ||
| } | ||
| case "$1" in | ||
| extract) | ||
| if [ -e "$dir" -a ! -d "$dir" ] ; then | ||
| echo >&2 "$dir exists and is not a directory" | ||
| exit 1 | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure you should use the same exit code than when an unsupported command (≠extract,delete) is passed. | ||
| fi | ||
| if [ ! -d "$dir" ]; then | ||
| mkdir -p "$dir" | ||
| tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1 | ||
| if [ ! -f /usr/src/php-available-exts ]; then | ||
| find "$dir/ext" \ | ||
| -mindepth 2 \ | ||
| -maxdepth 2 \ | ||
| -type f \ | ||
| -name 'config.m4' \ | ||
| | xargs -n1 dirname | xargs -n1 basename | sort \ | ||
| > /usr/src/php-available-exts | ||
| fi | ||
| fi | ||
| ;; | ||
| delete) | ||
| rm -rf "$dir" | ||
| ;; | ||
| *) | ||
| usage | ||
| exit 1 | ||
| ;; | ||
| esac | ||
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.
👍