X-Git-Url: https://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=blobdiff_plain;f=rediff-patches.py;h=beba06da881d2c0ba896385c51cc2efc9fbfe17e;hp=2fb1986ce03be9292d6771b8e875a0e156e49805;hb=4c36d1897211469da80eebfe98e49626eb3463de;hpb=3cc64e8924c53b076783e44eab554c0829712a3b diff --git a/rediff-patches.py b/rediff-patches.py index 2fb1986..beba06d 100755 --- a/rediff-patches.py +++ b/rediff-patches.py @@ -66,12 +66,14 @@ def unpack(spec, appsourcedir, builddir): def patch_comment_get(patch): patch_comment = "" + patch_got = False with open(patch, 'rt') as f: for line in f: if line.startswith('diff ') or line.startswith('--- '): + patch_got = True break patch_comment += line - return patch_comment + return patch_comment if patch_got else "" def diff(diffdir_org, diffdir, builddir, patch_comment, output): diffdir_org = os.path.basename(diffdir_org)