Преглед на файлове

support/gnuconfig: add update script

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Yann E. MORIN преди 4 години
родител
ревизия
ca7a6ef8aa
променени са 2 файла, в които са добавени 18 реда и са изтрити 10 реда
  1. 4 10
      support/gnuconfig/README.buildroot
  2. 14 0
      support/gnuconfig/update

+ 4 - 10
support/gnuconfig/README.buildroot

@@ -13,15 +13,9 @@ files of your package to be updated by using:
 <pkg>_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 --- UPDATE ---
-GNU config is now managed in git, so to update:
+Run the script 'update' in this directory, and commit the result.
 
-# git clone git://git.savannah.gnu.org/config.git
-# cp config/config.* .
-# for p in $(ls patches/*.patch); do patch -p1 < $p; done
-# rm -rf config
+The current Buildroot version is based on this commit of the config.git
+repository (leave alone on its own line, the script updates it):
 
-Currently no patches are needed, but they may be needed again in the
-future.
-
-The current Buildroot version is based on the Git commit
-104ee6463c4bfaac3f3029d9be9bdd6e93879323 of the config.git repository.
+104ee6463c4bfaac3f3029d9be9bdd6e93879323

+ 14 - 0
support/gnuconfig/update

@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "${0%/*}"
+
+git clone https://git.savannah.gnu.org/git/config.git
+sha="$(cd config; git log -1 --pretty=tformat:%H)"
+sed -r -i -e "\$s/.*/${sha}/" README.buildroot
+cp config/config.* .
+for p in $(ls patches/*.patch 2>/dev/null); do
+    patch -p1 < "${p}"
+done
+rm -rf config