summaryrefslogtreecommitdiff
path: root/update-kernel-config
diff options
context:
space:
mode:
Diffstat (limited to 'update-kernel-config')
-rwxr-xr-xupdate-kernel-config51
1 files changed, 29 insertions, 22 deletions
diff --git a/update-kernel-config b/update-kernel-config
index 6725334..3fed852 100755
--- a/update-kernel-config
+++ b/update-kernel-config
@@ -19,9 +19,10 @@ if [ -z "${old_revision}" ]; then
exit 1
fi
-config_name=$(
- ls -1 "/usr/src/archlinux32/packages/$1/$2" | \
- grep -m1 '^config\(\.i686\)\?$'
+config_names=$(
+ git -C "/usr/src/archlinux32/packages/$1/$2" archive HEAD -- | \
+ tar -t | \
+ grep '^config\($\|\.\)'
)
diff=$(
@@ -35,23 +36,25 @@ if [ -z "${diff}" ]; then
exit 1
fi
-{
- grep -vxF "$(
+for config_name in ${config_names}; do
+ {
+ grep -vxF "$(
+ printf '%s\n' "${diff}" | \
+ sed -n '
+ s/^-//
+ T
+ p
+ '
+ )" "/usr/src/archlinux32/packages/$1/$2/${config_name}"
printf '%s\n' "${diff}" | \
sed -n '
- s/^-//
+ s/^+//
T
p
'
- )" "/usr/src/archlinux32/packages/$1/$2/${config_name}"
- printf '%s\n' "${diff}" | \
- sed -n '
- s/^+//
- T
- p
- '
-} | \
- sponge "/usr/src/archlinux32/packages/$1/$2/${config_name}"
+ } | \
+ sponge "/usr/src/archlinux32/packages/$1/$2/${config_name}"
+done
sed -i '
1 s/^#.*$/# upstream git revision: '"$(
@@ -68,10 +71,14 @@ sed -i '
sha256sum | \
awk '{print $1}'
)"'/g
- s/'"$(
- git -C "/usr/src/archlinux32/packages/$1/$2" archive HEAD -- "${config_name}" | \
- tar -Ox | \
- sha256sum | \
- awk '{print $1}'
- )"'/SKIP/g
-' "/usr/src/archlinux32/packages/$1/$2/PKGBUILD"
+ '"$(
+ for config_name in ${config_names}; do
+ printf 's/'
+ git -C "/usr/src/archlinux32/packages/$1/$2" archive HEAD -- "${config_name}" | \
+ tar -Ox | \
+ sha256sum | \
+ awk '{print $1}' | \
+ tr -d '\n'
+ printf '/SKIP/g\n'
+ done
+ )" "/usr/src/archlinux32/packages/$1/$2/PKGBUILD"