Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- get_kernel_changelog() {
- [ -z "$1" ] && return 1
- U=https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-$1
- curl -qsI $U &>/dev/null || return 2
- curl -q $U \
- | sed -nre '/^commit/,/^ [^ ]/{s#^commit (.{,8}).*$#C|\1#;s#^ (.*)$#T|\1#;s#^Date: +(.+) +(.+) +(.+) +(.+) +(.+) +(.+)$#D|\3 \2 \5 \4 \6#;/^[CDT]\|(.*)$/{s##\1#;p}}' \
- | while readarray -n 3 -t; do
- [ ${#MAPFILE[@]} -ne 3 ] && break
- C=${MAPFILE[0]}
- D=$(LC_ALL=C date -u +%s -d "${MAPFILE[1]}")
- T=${MAPFILE[2]}
- printf '%s [%s] %s\n' $D $C "$T"
- done \
- | sed -re '1s#^([0-9]+)#9999999999#' \
- | sort -r -n \
- | sed -re '1{s#^[^ ]+ (.*)$#\1#};{s#^[^ ]+ (.*)$#\1#}'
- }
- get_kernel_changelog "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement