From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnout Vandecappelle Date: Sun, 13 Mar 2016 22:48:52 +0100 Subject: [Buildroot] [PATCH] apply-patches.sh: handle any file name as *.patch In-Reply-To: <20160312232208.GO3745@free.fr> References: <1457608789-32336-1-git-send-email-yegorslists@googlemail.com> <20160310143725.7a1ac7aa@free-electrons.com> <20160312232208.GO3745@free.fr> Message-ID: <56E5E044.1040001@mind.be> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On 03/13/16 00:22, Yann E. MORIN wrote: > Yegor, Thomas, All, > > On 2016-03-10 14:37 +0100, Thomas Petazzoni spake thusly: >> On Thu, 10 Mar 2016 12:19:49 +0100, yegorslists at googlemail.com wrote: >>> From: Yegor Yefremov >>> >>> Handle both *.patch and default cases as *.patch. This is needed >>> in order to handle downloaded patches generated by for example >>> cgit, that have no file name extension. >>> >>> Signed-off-by: Yegor Yefremov >>> --- >>> support/scripts/apply-patches.sh | 6 +----- >>> 1 file changed, 1 insertion(+), 5 deletions(-) >>> >>> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh >>> index 201278d..e4cccf5 100755 >>> --- a/support/scripts/apply-patches.sh >>> +++ b/support/scripts/apply-patches.sh >>> @@ -83,12 +83,8 @@ function apply_patch { >>> type="compress"; uncomp="uncompress -c"; ;; >>> *.diff*) >>> type="diff"; uncomp="cat"; ;; >>> - *.patch*) >>> + *.patch*|*) >>> type="patch"; uncomp="cat"; ;; >>> - *) >>> - echo "Unsupported file type for ${path}/${patch}, skipping"; >>> - return 0 >>> - ;; >> >> Unfortunately, this might break some existing use cases. Today, you can >> point to a directory of patches, and only the *.patch* or *.diff* files >> will be applied, other files will be ignored and not applied. > > And that's especially usefull for our conditional patches, like, say, > for gcc, for which we manual apply condiotnal patches depending on our > configuration. As I wrote in my reply to Thomas: since a pattern is always passed (except for explicit _PATCH files), this is not a problem. Just to be sure, I tested it with gcc. However, it is a problem when the patches are in a tarball. Take any package that uses the debian patch tarball. I think the pattern should be passed when scanning subdirectories as well. Regards, Arnout > > Regards, > Yann E. MORIN. > >> With your change, if there is any other file in the directory, it will >> also attempt to apply it. >> >> Maybe we need to have a different behavior depending on whether we pass >> a directory to apply-patches.sh, or a file. If we specify a file, then >> we really want that file to be applied, regardless of its extension. >> However, if it's a directory, then we don't want to apply all files. >> >> Best regards, >> >> Thomas >> -- >> Thomas Petazzoni, CTO, Free Electrons >> Embedded Linux, Kernel and Android engineering >> http://free-electrons.com >> _______________________________________________ >> buildroot mailing list >> buildroot at busybox.net >> http://lists.busybox.net/mailman/listinfo/buildroot > -- Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF