-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ayufan:master' into feat/fallback-for-o_tmpfile
- Loading branch information
Showing
64 changed files
with
2,857 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
tmp/ | ||
release/ | ||
**/Dockerfile | ||
**/Dockerfile.client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ko_fi: ayufan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## My own release procedure | ||
|
||
```bash | ||
# Fork the build | ||
make fork-version NEW_VERSION=2.3.2 NEW_SHA=e6120a8f6ff36f627a4da3a1a51a1e47231f5cc8 | ||
|
||
# Try to naively apply patches | ||
make tmp-env | ||
make tmp-env-client | ||
|
||
# Try to naively compile first | ||
cd tmp/v2.3.2/proxmox-backup | ||
cargo build | ||
|
||
# Try to compile first locally | ||
make amd64-docker-build | ||
make amd64-client | ||
|
||
# Create release package | ||
make github-pre-release | ||
|
||
# Mark the current version as latest | ||
make github-latest-release | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
## My own release procedure | ||
## Buy me a Coffee | ||
|
||
```bash | ||
# Create release package | ||
make github-pre-release | ||
<a href='https://ko-fi.com/ayufan' target='_blank'><img height='30' style='border:0px;height:40px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' alt='Buy Me a Coffee at ko-fi.com' /></a> | ||
|
||
# Mark the current version as latest | ||
make github-latest-release | ||
``` | ||
If you found it useful :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
for package in *; do | ||
[[ ! -d "$package" ]] && continue | ||
|
||
# enable experimental features | ||
for cargo in $(find "$package/" -name Cargo.toml); do | ||
echo "Changing $cargo..." | ||
sed -i '1s/^/cargo-features = ["workspace-inheritance"]\n\n/' "$cargo" | ||
git -C "$package" add "$(realpath "$cargo")" | ||
done | ||
|
||
if ! git -C "$package" diff --cached --exit-code --quiet; then | ||
git -C "$package" diff --cached | cat | ||
git -C "$package" commit -m "experimental-cargo.bash" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
replace_patch_crates_io() { | ||
sed -i -e '/^\[patch\.crates-io\]/,/^\[/{//!d}' -e '/^\[patch\.crates-io\]/d' "$1" | ||
echo "[patch.crates-io]" >> "$1" | ||
} | ||
|
||
get_deps() { | ||
local all=$(sed -n -e '/^\[dependencies\]/,/^\[/{//!p}' "$1") | ||
echo "$all" | grep git | sed -n -e 's/^\([a-z0-9_-]*\)\(\.workspace\)*\s*=.*$/\1 git/p' | ||
echo "$all" | grep -v git | sed -n -e 's/^\([a-z0-9_-]*\)\(\.workspace\)*\s*=.*$/\1/p' | ||
|
||
local all=$(sed -n -e '/^\[workspace\.dependencies\]/,/^\[/{//!p}' "$1") | ||
echo "$all" | grep git | sed -n -e 's/^\([a-z0-9_-]*\)\(\.workspace\)*\s*=.*$/\1 git/p' | ||
echo "$all" | grep -v git | sed -n -e 's/^\([a-z0-9_-]*\)\(\.workspace\)*\s*=.*$/\1/p' | ||
} | ||
|
||
get_deps_with_path() { | ||
local parent_dep_path="$1" | ||
local parent_dep="$2" | ||
local parent_dep_git="$3" | ||
|
||
local cargo_dep | ||
local cargo_git | ||
|
||
while read cargo_dep cargo_git; do | ||
local cargo_dep_path="${found_deps["$cargo_dep"]}" | ||
[[ -z "$cargo_dep_path" ]] && cargo_dep_path="${found_deps["$cargo_dep-rs"]}" | ||
[[ -z "$cargo_dep_path" ]] && continue | ||
|
||
if [[ -n "$parent_dep_git" ]] && [[ "${git_deps["$parent_dep"]}" == "${git_deps["$cargo_dep"]}" ]]; then | ||
get_deps_with_path "$cargo_dep_path/Cargo.toml" "$cargo_dep" "$parent_dep_git" | ||
elif [[ "${git_deps["$parent_dep"]}" == "${git_deps["$cargo_dep"]}" ]]; then | ||
get_deps_with_path "$cargo_dep_path/Cargo.toml" "$cargo_dep" "$parent_dep_git" | ||
else | ||
echo "$cargo_dep $cargo_dep_path" | ||
get_deps_with_path "$cargo_dep_path/Cargo.toml" "$cargo_dep" "$cargo_git" | ||
fi | ||
done < <(get_deps "$parent_dep_path") | ||
} | ||
|
||
update_deps() { | ||
local cargo_toml="$1" | ||
local cargo_package=$(basename $(dirname "$cargo_toml")) | ||
|
||
replace_patch_crates_io "$cargo_toml" | ||
|
||
while read cargo_dep cargo_dep_path; do | ||
echo "$cargo_dep => $cargo_dep_path" | ||
grep -q "$cargo_dep.*git" "$cargo_toml" && continue # TODO: this is not fully working | ||
|
||
echo "$cargo_package: Cargo dep: $cargo_dep => found => $cargo_dep_path" | ||
echo "$cargo_dep = { path = \"$cargo_dep_path\" }" >> "$cargo_toml" | ||
done < <(get_deps_with_path "$cargo_toml" "$cargo_package" "" | sort -u) | ||
} | ||
|
||
search_dir="${1:-.}" | ||
|
||
declare -A found_deps | ||
declare -A git_deps | ||
|
||
while read cargo_path; do | ||
cargo_path=$(dirname "$cargo_path") | ||
cargo_dep=$(basename "$cargo_path") | ||
git_repo=$(git -C "$cargo_path" rev-parse --show-toplevel) | ||
found_deps[$cargo_dep]="$cargo_path" | ||
git_deps[$cargo_dep]="$git_repo" | ||
done < <(find "$PWD" -wholename "*/Cargo.toml" | sort) | ||
|
||
while read CARGO_TOML; do | ||
update_deps "$CARGO_TOML" | ||
|
||
git_repo=$(git -C "$(dirname "$CARGO_TOML")" rev-parse --show-toplevel) | ||
git -C "$git_repo" add "$(realpath "$CARGO_TOML")" | ||
if ! git -C "$git_repo" diff --cached --exit-code --quiet; then | ||
git -C "$git_repo" diff --cached | cat | ||
git -C "$git_repo" commit -m "resolve-dependencies.bash" | ||
fi | ||
done < <(find $1 -name Cargo.toml) | ||
|
||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.