mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 19:31:55 +00:00
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
Signed-off-by: John Crispin <john@phrozen.org>
110 lines
1.7 KiB
Bash
Executable File
110 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
BASE=$1; shift
|
|
|
|
usage() {
|
|
echo "Usage: $0 NNN <file>..."
|
|
exit 1
|
|
}
|
|
|
|
check_number() {
|
|
case "$1" in
|
|
[0-9][0-9][0-9]) return 0;;
|
|
esac
|
|
return 1;
|
|
}
|
|
|
|
patch_header()
|
|
{
|
|
awk '
|
|
/^(---|\*\*\*|Index:)[ \t][^ \t]|^diff -/ \
|
|
{ exit }
|
|
{ print }
|
|
'
|
|
}
|
|
|
|
strip_diffstat()
|
|
{
|
|
awk '
|
|
/#? .* \| / \
|
|
{ eat = eat $0 "\n"
|
|
next }
|
|
/^#? .* files? changed(, .* insertions?\(\+\))?(, .* deletions?\(-\))?/ \
|
|
{ eat = ""
|
|
next }
|
|
{ print eat $0
|
|
eat = "" }
|
|
'
|
|
}
|
|
|
|
strip_trailing_whitespace() {
|
|
sed -e 's:[ '$'\t'']*$::'
|
|
}
|
|
|
|
fixup_header() {
|
|
awk '
|
|
/^From / { next }
|
|
/^Subject: / {
|
|
sub("Subject: \\[[^\]]*\\]", "Subject: [PATCH]")
|
|
}
|
|
{ print }
|
|
'
|
|
}
|
|
|
|
check_number "$BASE" || usage
|
|
|
|
quilt series > /dev/null || {
|
|
echo "Not in quilt directory"
|
|
exit 2
|
|
}
|
|
|
|
get_next() {
|
|
NEW=$BASE
|
|
quilt series | while read CUR; do
|
|
[ -n "$CUR" ] || break
|
|
CUR=${CUR%%-*}
|
|
check_number "$CUR" || continue
|
|
[ "$CUR" -lt "$NEW" ] && continue
|
|
[ "$CUR" -ge "$(($BASE + 100))" ] && continue
|
|
NEW="$(($CUR + 1))"
|
|
echo $NEW
|
|
done | tail -n1
|
|
}
|
|
|
|
CUR=$(get_next)
|
|
CUR="${CUR:-$BASE}"
|
|
|
|
while [ -n "$1" ]; do
|
|
FILE="$1"; shift
|
|
NAME="$(basename $FILE)"
|
|
NAME="${NAME#[0-9]*-}"
|
|
echo -n "Processing patch $NAME: "
|
|
|
|
[ -e "$FILE" ] || {
|
|
echo "file $FILE not found"
|
|
exit 1
|
|
}
|
|
|
|
grep -qE "$NAME$" patches/series && {
|
|
echo "already applied"
|
|
continue
|
|
}
|
|
|
|
quilt new "$CUR-$NAME" || exit 1
|
|
patch_header < "$FILE" |
|
|
strip_diffstat |
|
|
strip_trailing_whitespace |
|
|
fixup_header > "patches/$CUR-$NAME"
|
|
|
|
quilt fold < "$FILE" || {
|
|
cp "$FILE" ./cur_patch
|
|
echo "patch $FILE failed to apply, copied to ./cur_patch"
|
|
exit 1
|
|
}
|
|
|
|
quilt refresh -p ab --no-index --no-timestamps
|
|
|
|
CUR="$(($CUR + 1))"
|
|
done
|
|
|
|
exit 0
|