compat-drivers: prevent mixing patches from different directories in refresh
authorHauke Mehrtens <hauke@hauke-m.de>
Thu, 29 Nov 2012 15:24:39 +0000 (16:24 +0100)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 29 Nov 2012 21:20:58 +0000 (13:20 -0800)
The refresh script is able to take an already existing quilt run and
just refresh the further needed patches. This is needed to make it
possible to manually fix a patch which is not applying any more and
then automatically integrate it into the patches directory again. With
the integration of drm it could happen that quilt is running on two
different source directories like patches/network and patches/drm in one
call of admin-update.sh. If some of the drm patches did not apply and
needed a manual fix, quilt moved the patch in the second run into the
patches/network directory, because it was taken in the network refresh
run. This patch does not run quilt if there is still an unfinished
quilt job for a different patch directory.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
scripts/admin-update.sh

index 48c1070e0f5f7092bdfdb41feaaa8aa680149e00..10a2598e045700e07f3981bc7ca31411ad0752a8 100755 (executable)
@@ -36,6 +36,14 @@ GIT_COMPAT_URL="git://github.com/mcgrof/compat.git"
 
 # Refresh patches using quilt
 patchRefresh() {
+       if [ -d .pc ] ; then
+               OLD_PATCH_DIR=$(cat .pc/.quilt_patches)
+               if [ "$OLD_PATCH_DIR" != "$1" ] ; then
+                       echo "found old quilt run for ${OLD_PATCH_DIR}, will skip it for ${1}"
+                       return;
+               fi
+       fi
+
        if [ -d patches.orig ] ; then
                rm -rf .pc patches/series
        else