]> git.sur5r.net Git - kconfig-frontends/blobdiff - scripts/ksync.sh
scripts/ksync.sh: prefix each change with its upstream shortened sha1
[kconfig-frontends] / scripts / ksync.sh
index e45b38ea2be5617ce7df65b9f7463a30d6de41ad..0e3e9a88745862b1508c73ed0b887b7c7ee4f1ef 100755 (executable)
@@ -15,9 +15,12 @@ if [ ! \( -n "${k_dir}" -a -d "${k_dir}/kernel" \) ]; then
     exit 1
 fi
 
+# Save current version
+k_cset_old=$( head -n 1 .version |awk '{ print $(2); }' )
+
 # Get the kernel version
 eval $( head -n 5 "${k_dir}/Makefile"                       \
-        |sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;'   \
+        |sed -e 's/^/K_/; s/"//g; s/ = \{0,1\}/="/; s/$/"/;'  \
       )
 k_cset="$( cd "${k_dir}";                   \
            git log -n 1 --pretty='format:%H' \
@@ -37,11 +40,23 @@ printf "%d.%d.%d%s %s %s\n%s\n"             \
        "${kf_version}"                      \
        >.version
 
-exec <misc/kernel2kfrontends.list
+# Sync-up the files
+k_files=""
 while read k_file trash kf_file; do
+    k_files="${k_files} ${k_file}"
     mkdir -p "${kf_file%/*}"
     cp -v "${k_dir}/${k_file}" "${kf_file}"
     if [ -f "${kf_file}.patch" ]; then
         patch --no-backup-if-mismatch -g0 -F1 -p1 -f <"${kf_file}.patch"
     fi
-done
+done <scripts/ksync.list
+
+# Save the changelog between the old cset and now
+printf "Synced-up these changes:\n"
+( cd "${k_dir}"
+  git log --no-merges --pretty='tformat:%h %s'  \
+    "${k_cset_old}..${k_cset}"                  \
+    ${k_files}                                  \
+)|tac                                           \
+ |tee -a "scripts/ksync.log"                    \
+ |sed -e 's/^/    /;'