On Saturday 19 March 2011 10:52:52 am Jean Delvare wrote:
> Make sure that a backup exists before attempting any action which
> reads the file list from it.

I will actually have to drop this patch, as it turns out that "quilt 
push" can legitimately call restore with no backup files. Restore is 
called for rollback when a patch fails to apply completely. If the 
failing file is the first one in the patch, the backup directory never 
gets a chance to be created.

> 
> Signed-off-by: Jean Delvare <[email protected]>
> Reviewed-by: Raphael Hertzog <[email protected]>
> ---
>  quilt/scripts/backup-files.in |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- a/quilt/scripts/backup-files.in
> +++ b/quilt/scripts/backup-files.in
> @@ -205,6 +205,11 @@ if [ "${OPT_PREFIX:(-1)}" != / ]; then
>       exit 1
>  fi
> 
> +if [ "$1" = - ] && [ ! -d "$OPT_PREFIX" ]; then
> +     echo "Backup is missing" >&2
> +     exit 1
> +fi
> +
>  if [ -n "$OPT_FILE" ]; then
>       cat "$OPT_FILE" \
> 
>       | while read nextfile; do
> 

-- 
Jean Delvare
Suse L3

_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to