Skip to content

Commit b76f268

Browse files
committed
fixup
1 parent 40ca249 commit b76f268

File tree

1 file changed

+9
-38
lines changed

1 file changed

+9
-38
lines changed

utils/kernel-upgrade.sh

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -245,41 +245,14 @@ update_changelog() {
245245
return 0
246246
fi
247247

248-
# Check if the latest release is UNRELEASED, if not create one
248+
# Check if the latest release is UNRELEASED
249249
if ! grep -q "^\[.*\]\[UNRELEASED\]" doc/ChangeLog.md; then
250-
log_info "No UNRELEASED section found, creating new one"
251-
# Extract current version and increment it
252-
CURRENT_VER=$(grep -m1 "^\[v" doc/ChangeLog.md | grep -oP 'v\d+\.\d+\.\d+' | head -1)
253-
if [ -n "$CURRENT_VER" ]; then
254-
# Parse version (e.g., v25.10.0 = year.month.patch)
255-
YEAR=$(echo "$CURRENT_VER" | cut -d'.' -f1 | sed 's/v//')
256-
MONTH=$(echo "$CURRENT_VER" | cut -d'.' -f2)
257-
PATCH=$(echo "$CURRENT_VER" | cut -d'.' -f3)
258-
259-
# Increment month, roll over to next year if needed
260-
NEXT_MONTH=$((10#$MONTH + 1))
261-
NEXT_YEAR=$YEAR
262-
if [ $NEXT_MONTH -gt 12 ]; then
263-
NEXT_MONTH=1
264-
NEXT_YEAR=$((YEAR + 1))
265-
fi
266-
NEXT_VER=$(printf "v%d.%02d.0" $NEXT_YEAR $NEXT_MONTH)
267-
268-
log_info "Creating new section for $NEXT_VER"
269-
# Insert new unreleased header at the top
270-
sed -i "1a\\
271-
[$NEXT_VER][UNRELEASED] - TBD\\
272-
-----------------------------\\
273-
\\
274-
### Changes" doc/ChangeLog.md
275-
log_info "Created new UNRELEASED header"
276-
else
277-
log_error "Could not determine current version from ChangeLog.md"
278-
exit 1
279-
fi
250+
log_error "No UNRELEASED section found in ChangeLog.md"
251+
log_error "Please create an UNRELEASED section first before running this script"
252+
exit 1
280253
fi
281254

282-
# Now add or update the kernel upgrade entry in the UNRELEASED section
255+
# Add or update the kernel upgrade entry in the UNRELEASED section
283256
if grep -q "^- Upgrade Linux kernel to" doc/ChangeLog.md | head -20; then
284257
# Update existing kernel upgrade line
285258
sed -i "0,/^- Upgrade Linux kernel to.*/{s/^- Upgrade Linux kernel to.*/- Upgrade Linux kernel to $NEW_VERSION (LTS)/}" doc/ChangeLog.md
@@ -314,20 +287,18 @@ check_clean_working_tree() {
314287
log_info "Working tree is clean"
315288
}
316289

317-
# Push changes to remotes
290+
# Push changes to both repositories
318291
push_changes() {
319-
log_info "Pushing changes to remotes..."
320-
321-
# Push rebased linux branch to kkit remote
322-
log_info "Pushing rebased linux branch to $KKIT_REMOTE..."
292+
# Push rebased linux branch
293+
log_info "Pushing linux branch to $KKIT_REMOTE..."
323294
if git -C "$LINUX_DIR" push "$KKIT_REMOTE" "$LINUX_BRANCH" --force-with-lease; then
324295
log_info "Successfully pushed linux branch to $KKIT_REMOTE"
325296
else
326297
log_error "Push to linux remote failed"
327298
exit 1
328299
fi
329300

330-
# Push infix branch to origin
301+
# Push infix changes
331302
log_info "Pushing infix branch to origin..."
332303
if git -C "$INFIX_DIR" push origin "$INFIX_BRANCH"; then
333304
log_info "Successfully pushed infix branch to origin"

0 commit comments

Comments
 (0)