quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] pop: Rearm consistency check if needed


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] pop: Rearm consistency check if needed
Date: Tue, 28 Oct 2014 21:40:58 +0100

If the series file is inconsistent, "quilt pop" will disable the
consistency check by updating the timestamp of the database file.
It's OK if all patches are popped. If not then the series file may
still be inconsistent. In that case, we want to update the timestamp
of the series file, to rearm the consistency check.
---
 quilt/pop.in             |    9 +++++++++
 test/altered-series.test |   23 +++++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

--- a/quilt/pop.in
+++ b/quilt/pop.in
@@ -237,6 +237,13 @@ then
        exit 2
 fi
 
+# We will update the list of applied patches, which in turn will disable the
+# consistency check. Enable it again if needed.
+if [ -z "$opt_all" -a ! "$DB" -nt "$SERIES" ] && ! consistency_check
+then
+       rearm_check=1
+fi
+
 for patch in $patches
 do
        if ! remove_patch "$patch"
@@ -257,6 +264,8 @@ else
        # corner cases such as files added to a patch but not modified.
        $QUILT_DIR/scripts/backup-files -L -s -B "$QUILT_PC/$patch/" -
        printf $"Now at patch %s\n" "$(print_patch "$patch")"
+
+       [ -z "$rearm_check" ] || touch "$SERIES"
 fi
 ### Local Variables:
 ### mode: shell-script
--- a/test/altered-series.test
+++ b/test/altered-series.test
@@ -6,22 +6,24 @@ $ cat > patches/series
 < 02.patch
 < 03.patch
 
-$ quilt push -q
+$ quilt push -q 2
 > Applying patch patches/01.patch
 > Patch patches/01.patch does not exist; applied empty patch
-> Now at patch patches/01.patch
+> Applying patch patches/02.patch
+> Patch patches/02.patch does not exist; applied empty patch
+> Now at patch patches/02.patch
 
 $ quilt series -v
-> = patches/01.patch
->   patches/02.patch
+> + patches/01.patch
+> = patches/02.patch
 >   patches/03.patch
 
 # Touch the series file but preserve the order -> OK
 $ touch patches/series
 
 $ quilt series -v
-> = patches/01.patch
->   patches/02.patch
+> + patches/01.patch
+> = patches/02.patch
 >   patches/03.patch
 
 # Change the order of the patch series -> complain
@@ -33,6 +35,15 @@ $ cat > patches/series
 $ quilt series -v
 > The series file no longer matches the applied patches. Please run 'quilt pop 
 > -a'.
 
+$ quilt pop
+> Patch patches/02.patch appears to be empty, removing
+>
+> Now at patch patches/01.patch
+
+# That wasn't enough, keep complaining
+$ quilt series -v
+> The series file no longer matches the applied patches. Please run 'quilt pop 
-a'.
+
 $ quilt pop -a
 > Patch patches/01.patch appears to be empty, removing
 >


-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]