Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
Signed-off-by: leleliu008 <[email protected]>
  • Loading branch information
leleliu008 committed Dec 24, 2023
1 parent 2b4795c commit ccf987c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ A package manager for [Xcode](https://developer.apple.com/xcode) to build C/C++/

- Please do NOT place your own files under `~/.xcpkg` directory, as `xcpkg` will change files under `~/.xcpkg` directory without notice.

- Please do NOT run `xcpkg` command in parallell to avoid generating dirty data.
- Please do NOT run `xcpkg` command in parallel to avoid generating dirty data.

## Manually build packages using this software via GitHub Actions

In this way, you will be liberated from the rut of setting up the build environemt.
In this way, you will be liberated from the rut of setting up the build environment.

In this way, all you need to do is just clicking the buttons and waiting for finishing. After finishing, a url refers to a zip archive will be provided to download.

Expand Down Expand Up @@ -73,7 +73,7 @@ all relevant directories and files are located under `~/.xcpkg` directory.
xcpkg sysinfo
```

- **show your current actived [Xcode](https://developer.apple.com/xcode) information**
- **show your current activated [Xcode](https://developer.apple.com/xcode) information**

```bash
xcpkg xcinfo
Expand Down Expand Up @@ -264,7 +264,7 @@ all relevant directories and files are located under `~/.xcpkg` directory.
xcpkg upgrade-self -v
```
- **list all avaliable formula repositories**
- **list all available formula repositories**
```bash
xcpkg formula-repo-list
Expand Down Expand Up @@ -418,7 +418,7 @@ all relevant directories and files are located under `~/.xcpkg` directory.

- **XCPKG_DEFAULT_TARGET**

some commands need `<PACKAGE-SPEC>` to be specified. `<PACKAGE-SPEC>` has the form `<TARGET>/<PACKAGE-NAME>`. To simplify the usage, `xcpkg` allows omitting `<TARGET>/`. If `<TARGET>/` is omitted, this environment variable will be used, if this environment variable is not set, then will retrive your current running os's information.
some commands need `<PACKAGE-SPEC>` to be specified. `<PACKAGE-SPEC>` has the form `<TARGET>/<PACKAGE-NAME>`. To simplify the usage, `xcpkg` allows omitting `<TARGET>/`. If `<TARGET>/` is omitted, this environment variable will be used, if this environment variable is not set, then will retrieve your current running os's information.
`<TARGET>` has the form `<TARGET-PLATFORM-NAME>-<TARGET-PLATFORM-VERSION>-<TARGET-PLATFORM-ARCH>`
Expand Down Expand Up @@ -487,7 +487,7 @@ a uppm formula's file content only has one level mapping and shall has following
|command|usage-example|
|-|-|
|`echo`|`echo 'your message.'`|
|`info`|`info 'your infomation.'`|
|`info`|`info 'your information.'`|
|`warn`|`warn "no package manager found."`|
|`error`|`error 'error message.'`|
|`abort`|`abort 1 "please specify a package name."`|
Expand Down Expand Up @@ -572,7 +572,7 @@ After a xcpkg formula repository is successfully fetched from server to local, a
a typical xcpkg formula repository's config as following:
```yaml
url: https://github.com/leleliu008/xcpkg-formula-repository-offical-core
url: https://github.com/leleliu008/xcpkg-formula-repository-official-core
branch: master
pinned: 0
enabled: 1
Expand All @@ -584,15 +584,15 @@ If a xcpkg formula repository is `pinned`, which means it would not be updated.
If a xcpkg formula repository is `disabled`, which means xcpkg would not search formulas in this formula repository.
## xcpkg offical formula repository
## xcpkg official formula repository
xcpkg offical formula repository's url: <https://github.com/leleliu008/xcpkg-formula-repository-offical-core>
xcpkg official formula repository's url: <https://github.com/leleliu008/xcpkg-formula-repository-official-core>
xcpkg offical formula repository would be automatically fetched to local cache as name `offical-core` when you run `xcpkg update` command.
xcpkg official formula repository would be automatically fetched to local cache as name `official-core` when you run `xcpkg update` command.
**Note:** If you find that a package is not in xcpkg offical formula repository yet, PR is welcomed.
**Note:** If you find that a package is not in xcpkg official formula repository yet, PR is welcomed.
## xcpkg offical prebuild package repository
## xcpkg official prebuild package repository
I have built and packed some commonly used packages using this software:
Expand Down
52 changes: 26 additions & 26 deletions xcpkg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# 4. all utilities are GNU-style
######################################################################################

# If IFS is not set, the deault value will be <space><tab><newline>
# If IFS is not set, the default value will be <space><tab><newline>
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03
unset IFS

Expand Down Expand Up @@ -191,9 +191,9 @@ version_match() {

# wfetch <URL> [--uri=<URL-MIRROR>] [--sha256=<SHA256>] [-o <OUTPUT-PATH>] [-q] [--no-buffer]
#
# If -o <OUTPUT-PATH> option is specified, the result will be written to file, otherwize, the result will be written to stdout.
# If -o <OUTPUT-PATH> option is specified, the result will be written to file, otherwise, the result will be written to stdout.
#
# If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it will be treated as a directory, otherwize, it will be treated as a filepath.
# If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it will be treated as a directory, otherwise, it will be treated as a filepath.
#
# If <OUTPUT-PATH> is treated as a directory, then it will be expanded to <OUTPUT-PATH>/$(basename <URL>)
#
Expand Down Expand Up @@ -605,7 +605,7 @@ EOF
__delete_a_formula_repository() {
[ -z "$1" ] && abort 1 "please specify a repository name."

[ "$1" = 'offical-core' ] && abort 1 "'offical-core' formula repository is not allowed to delete."
[ "$1" = 'official-core' ] && abort 1 "'official-core' formula repository is not allowed to delete."

if [ -d "$XCPKG_FORMULA_REPO_ROOT/$1" ] ; then
rm -rf "$XCPKG_FORMULA_REPO_ROOT/$1"
Expand Down Expand Up @@ -784,8 +784,8 @@ __sync_available_formula_repositories() {
done
}

[ -d "$XCPKG_FORMULA_REPO_ROOT/offical-core" ] || {
__create_a_formula_repository_then_sync_it offical-core "$XCPKG_OFFICAL_FORMULA_REPO_URL"
[ -d "$XCPKG_FORMULA_REPO_ROOT/official-core" ] || {
__create_a_formula_repository_then_sync_it official-core "$XCPKG_OFFICIAL_FORMULA_REPO_URL"
}
}

Expand Down Expand Up @@ -4036,7 +4036,7 @@ $DOT_CONTENT
# https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
# https://git.savannah.gnu.org/cgit/config.git/tree/

step "replace config.sub and config.guess with the lastest version"
step "replace config.sub and config.guess with the latest version"

{
[ "$PACKAGE_BUILD_SYSTEM_AUTOGENSH" = 1 ] ||
Expand Down Expand Up @@ -4660,10 +4660,10 @@ EOF
# https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_LIBRARY_SUFFIXES.html

case $LINK_TYPE in
static-only) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
static-prefered) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dylib")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
shared-only) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
shared-prefered) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
static-only) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
static-most) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dylib")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
shared-only) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
shared-most) printf 'set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")\n' > "$CMAKE_PROJECT_INCLUDE" ;;
esac

if [ "$LOG_LEVEL" -gt 0 ] ; then
Expand Down Expand Up @@ -4850,10 +4850,10 @@ EOF
unset libFileNameSuffix

case $LINK_TYPE in
static-only|static-prefered)
static-only|static-most)
libFileNameSuffix='.a'
;;
shared-only|shared-prefered)
shared-only|shared-most)
libFileNameSuffix='.dylib'
;;
*) abort 1 "unrecognized link type: $LINK_TYPE"
Expand Down Expand Up @@ -5695,7 +5695,7 @@ EOF
esac

case $LINK_TYPE in
static-only|static-prefered) MESON_SETUP_ARGS="$MESON_SETUP_ARGS --prefer-static"
static-only|static-most) MESON_SETUP_ARGS="$MESON_SETUP_ARGS --prefer-static"
esac

MESON_COMPILE_ARGS="-C $PACKAGE_BCACHED_DIR -j $BUILD_NJOBS"
Expand Down Expand Up @@ -6223,7 +6223,7 @@ inspect_install_arguments() {

BUILD_TYPE=release

LINK_TYPE=static-prefered
LINK_TYPE=static-most

INSTALL_LIB=static

Expand Down Expand Up @@ -6286,9 +6286,9 @@ inspect_install_arguments() {
--link-type=*)
LINK_TYPE="${1#*=}"
case $LINK_TYPE in
static-only|shared-only|static-prefered|shared-prefered) ;;
static-only|shared-only|static-most|shared-most) ;;
'') abort 1 "--link-type=<VALUE>, VALUE must be non-empty." ;;
*) abort 1 "--link-type=<VALUE>, VALUE must be one of static-only|shared-only|static-prefered|shared-prefered"
*) abort 1 "--link-type=<VALUE>, VALUE must be one of static-only|shared-only|static-most|shared-most"
esac
;;
--jobs=*)
Expand Down Expand Up @@ -7575,13 +7575,13 @@ ${COLOR_GREEN}xcpkg depends <PACKAGE-NAME> [-t <dot|box|svg|png>] [-o <OUTPUT-PA

<OUTPUT-PATH> can be either the filepath or directory.

If -o <OUTPUT-PATH> option is specified, the result will be written to file, otherwize, the result will be written to stdout.
If -o <OUTPUT-PATH> option is specified, the result will be written to file, otherwise, the result will be written to stdout.

If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it will be treated as a directory, otherwize, it will be treated as a filepath.
If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it will be treated as a directory, otherwise, it will be treated as a filepath.

If <OUTPUT-PATH> is treated as a directory, then it will be expanded to <OUTPUT-PATH>/<PACKAGE-NAME>-dependencies.<OUTPUT-TYPE>

If <OUTPUT-PATH> is treated as a filepath, and if -t <OUTPUT-TYPE> option is not given, if <OUTPUT-PATH> ends with one of .dot|.box|.svg|.png, <OUTPUT-TYPE> will be the <OUTPUT-PATH> suffix, otherwize, <OUTPUT-TYPE> will be box.
If <OUTPUT-PATH> is treated as a filepath, and if -t <OUTPUT-TYPE> option is not given, if <OUTPUT-PATH> ends with one of .dot|.box|.svg|.png, <OUTPUT-TYPE> will be the <OUTPUT-PATH> suffix, otherwise, <OUTPUT-TYPE> will be box.

If -t <OUTPUT-TYPE> and -o <OUTPUT-PATH> options both are not given, <OUTPU-TYPE> will be box and output to stdout.

Expand Down Expand Up @@ -7638,7 +7638,7 @@ ${COLOR_GREEN}xcpkg install <PACKAGE-NAME|PACKAGE-SPEC>... [INSTALL-OPTIONS]${CO
${COLOR_BLUE}--build-type=<debug|release>${COLOR_OFF}
specify the build type.

${COLOR_BLUE}--link-type=<shared-only|static-prefered|shared-prefered>${COLOR_OFF}
${COLOR_BLUE}--link-type=<shared-only|static-most|shared-most>${COLOR_OFF}
specify the link strategy.

${COLOR_BLUE}--disable-ccache${COLOR_OFF}
Expand All @@ -7648,7 +7648,7 @@ ${COLOR_GREEN}xcpkg install <PACKAGE-NAME|PACKAGE-SPEC>... [INSTALL-OPTIONS]${CO
generates compile_commands.json

${COLOR_BLUE}--upgrade${COLOR_OFF}
If this package has been alreadly intsalled, then it will be upgrated if it could be.
If this package has been already installed, then it will be upgraded if it could be.

${COLOR_BLUE}--dry-run${COLOR_OFF}
do not actually install the package.
Expand Down Expand Up @@ -7679,7 +7679,7 @@ ${COLOR_GREEN}xcpkg pack <PACKAGE-SPEC> [--keep-session-dir] [-t <OUTPUT-TYPE>]

<OUTPUT-PATH> can be either the filepath or directory which indicates where the packed archive file would be written to.

If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it would be treated as a directory, otherwize, it would be treated as a filepath.
If <OUTPUT-PATH> is . .. ./ ../ or ends with slash(/), then it would be treated as a directory, otherwise, it would be treated as a filepath.

If <OUTPUT-PATH> is treated as a filepath, then it must ends with one of .tar.gz .tar.xz .tar.lz .tar.bz2 .tgz .txz .tlz .tbz2 .zip , in this case, -t <OUTPUT-TYPE> option would be ignored if it also is specified.

Expand Down Expand Up @@ -7717,7 +7717,7 @@ main() {

XCPKG_VERSION=0.15.10

XCPKG_OFFICAL_FORMULA_REPO_URL='https://github.com/leleliu008/xcpkg-formula-repository-offical-core'
XCPKG_OFFICIAL_FORMULA_REPO_URL='https://github.com/leleliu008/xcpkg-formula-repository-official-core'

XCPKG_UPGRAGE_URL='https://raw.githubusercontent.com/leleliu008/xcpkg/master/xcpkg'

Expand Down Expand Up @@ -7885,7 +7885,7 @@ EOF
shift

case $1 in
offical-*) abort 1 "xcpkg formula repository name that starts with 'offical-' is reserved for xcpkg offical formula repository, please use other name."
official-*) abort 1 "xcpkg formula repository name that starts with 'official-' is reserved for xcpkg official formula repository, please use other name."
esac

__create_a_formula_repository "$@"
Expand All @@ -7895,7 +7895,7 @@ EOF
shift

case $1 in
offical-*) abort 1 "xcpkg formula repository name that starts with 'offical-' is reserved for xcpkg offical formula repository, please use other name."
official-*) abort 1 "xcpkg formula repository name that starts with 'official-' is reserved for xcpkg official formula repository, please use other name."
esac

__create_a_formula_repository_then_sync_it "$@"
Expand Down
14 changes: 7 additions & 7 deletions xcpkg-zsh-completion
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ _xcpkg_actions=(
'--version:show version of this command.'
'gen-url-transform-sample:generate url-transform sample.'
'setup:install essential tools.'
'env:show system and current actived xcode information.'
'env:show system and current activated xcode information.'
'sysinfo:show your system information.'
'xcinfo:show your current actived xcode information.'
'xcinfo:show your current activated xcode information.'
'integrate:integrate zsh completions.'
'cleanup:delete the unused cached files.'
'ls-available:list the available packages.'
Expand All @@ -23,10 +23,10 @@ _xcpkg_actions=(
'formula-repo-del:delete the given formula repository from your local cache.'
'formula-repo-sync:sync the given formula repository.'
'formula-repo-conf:change the config of the given formula repository.'
'formula-repo-info:show infomation of the given formula repository.'
'formula-repo-info:show information of the given formula repository.'
'formula-repo-list:list all available formula repositories.'
'search:search packages can be installed.'
'info:show infomation of the given package or all available packages.'
'info:show information of the given package or all available packages.'
'depends:show depends of the given package.'
'fetch:download formula resources of the given package to the cache.'
'install:install packages.'
Expand Down Expand Up @@ -168,7 +168,7 @@ function _xcpkg() {
'--dry-run[dry-run]' \
'--keep-session-dir[do not delete the session directory even if successfully installed]' \
'--build-type=-[specify build type]:build-type:(debug release)' \
'--link-type=-[link static or shared library]:link-type:(static-only shared-only static-prefered shared-prefered)' \
'--link-type=-[link static or shared library]:link-type:(shared-only static-most shared-most)' \
'--export-compile-commands-json[generates compile_commands.json]' \
'--disable-ccache[do not use ccache]' \
+ '(verbose_level)' \
Expand All @@ -184,7 +184,7 @@ function _xcpkg() {
'--dry-run[dry-run]' \
'--keep-session-dir[do not delete the session directory even if successfully installed]' \
'--build-type=-[specify build type]:build-type:(debug release)' \
'--link-type=-[link static or shared library]:link-type:(static-only shared-only static-prefered shared-prefered)' \
'--link-type=-[link static or shared library]:link-type:(shared-only static-most shared-most)' \
'--export-compile-commands-json[generates compile_commands.json]' \
'--disable-ccache[do not use ccache]' \
+ '(verbose_level)' \
Expand All @@ -200,7 +200,7 @@ function _xcpkg() {
'--dry-run[dry-run]' \
'--keep-session-dir[do not delete the session directory even if successfully installed]' \
'--build-type=-[specify build type]:build-type:(debug release)' \
'--link-type=-[link static or shared library]:link-type:(static-only shared-only static-prefered shared-prefered)' \
'--link-type=-[link static or shared library]:link-type:(shared-only static-most shared-most)' \
'--export-compile-commands-json[generates compile_commands.json]' \
'--disable-ccache[do not use ccache]' \
+ '(verbose_level)' \
Expand Down

0 comments on commit ccf987c

Please sign in to comment.