Skip to content

Commit

Permalink
add commit hash for checkout specify with code
Browse files Browse the repository at this point in the history
  • Loading branch information
zqinking committed Oct 21, 2024
1 parent 3d885fb commit b723e03
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ read_ini_by_key() {

REPO_URL=$(read_ini_by_key "REPO_URL")
REPO_BRANCH=$(read_ini_by_key "REPO_BRANCH")
BUILD_DIR=$(read_ini_by_key "BUILD_DIR")
REPO_BRANCH=${REPO_BRANCH:-main}
BUILD_DIR=$(read_ini_by_key "BUILD_DIR")
COMMIT_HASH=$(read_ini_by_key "COMMIT_HASH")
COMMIT_HASH=${COMMIT_HASH:-none}

$BASE_PATH/update.sh "$REPO_URL" "$REPO_BRANCH" "$BASE_PATH/$BUILD_DIR"
$BASE_PATH/update.sh "$REPO_URL" "$REPO_BRANCH" "$BASE_PATH/$BUILD_DIR" "$COMMIT_HASH"

\cp -f "$CONFIG_FILE" "$BASE_PATH/$BUILD_DIR/.config"

Expand Down
1 change: 1 addition & 0 deletions compilecfg/jdc_ax1800pro-ax6600_libwrt.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REPO_URL=https://github.com/LiBwrt-op/openwrt-6.x.git
REPO_BRANCH=main
BUILD_DIR=libwrt
COMMIT_HASH=b6483625a7cf563e9be966a849a78c939dd52cd4
8 changes: 6 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BASE_PATH=$(cd $(dirname $0) && pwd)
REPO_URL=$1
REPO_BRANCH=$2
BUILD_DIR=$3
COMMIT_HASH=$4

FEEDS_CONF="feeds.conf.default"
GOLANG_REPO="https://github.com/sbwml/packages_lang_golang"
Expand Down Expand Up @@ -36,10 +37,13 @@ clean_up() {
}

reset_feeds_conf() {
git checkout $REPO_BRANCH
git reset --hard origin/$REPO_BRANCH
git clean -fd
git checkout .
git pull
git pull origin $REPO_BRANCH
if [[ $COMMIT_HASH != "none" ]]; then
git checkout $COMMIT_HASH
fi
#if git status | grep -qE "$FEEDS_CONF$"; then
# git reset HEAD $FEEDS_CONF
# git checkout $FEEDS_CONF
Expand Down

0 comments on commit b723e03

Please sign in to comment.