# Hmm... Looks like a unified diff to me...



## balanga (Dec 4, 2021)

Does anyone know how to stop this msg popping up when applying a diff?

According to Thread 42044/post-233763, the patch is being applied from the wrong directory, in which case, where should it be applied from.

Alternatively, could it be because the patch was created with FreeBSD diff and is being applied using GNU patch?


----------



## richardtoohey2 (Dec 5, 2021)

Looking at the source around line 187:









						freebsd-src/pch.c at main · freebsd/freebsd-src
					

FreeBSD src tree (read-only mirror). Contribute to freebsd/freebsd-src development by creating an account on GitHub.




					github.com
				





```
if (verbose)
        say("Hmm...");
...
    if (verbose)
        say("  %sooks like %s to me...\n",
            (p_base == 0 ? "L" : "The next patch l"),
            diff_type == UNI_DIFF ? "a unified diff" :
            diff_type == CONTEXT_DIFF ? "a context diff" :
        diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" :
            diff_type == NORMAL_DIFF ? "a normal diff" :
            "an ed script");
```

So it's looking for a verbose flag, man patch says:


```
-s, --quiet, --silent
             Makes patch do its work silently, unless an error occurs.
```

And if you look in patch.c, c. line 642

```
case 's':
            verbose = false;
```
I'm not entirely sure it answers your question - the topic title seems to be about suppressing the message, but the topic body seems to be more about paths and things.


----------



## balanga (Dec 6, 2021)

I think I phrased the question wrongly. I'm attempting to apply two patches to two different files. One just comes up with the 'looks like .... ' msg but does the patch and carries on. The other reports and requires a response about a previously applied patch has been detected, which I don't believe is the case, as I don't see the changes included and am mystified why patch has reached this conclusion.




> Hmm...  Looks like a unified diff to me...
> The text leading up to this was:
> --------------------------
> |--- include/prereq-build.mk    2021-12-03 21:03:44.406974000 +0000
> ...


----------



## SirDice (Dec 6, 2021)

```
make clean
make extract
make patch
```

If you don't clean the work directory then previously applied patches are going to get in the way. Test your patches on a 'clean' environment. Also note that patches could be applied through the port's Makefile (`post-patch`, `pre-patch` and `patch` targets). And I suggest using `make makepatch` to create your patches, so they're in the correct format and have the correct naming convention.


----------



## T-Daemon (Dec 6, 2021)

SirDice, you mistakenly assumed balanga is applying the patch on a port, but he is applying on OpenWRT.

balanga, if you paste the patches it would be easier to check what the cause may be.


----------



## balanga (Dec 7, 2021)

T-Daemon said:


> SirDice, you mistakenly assumed balanga is applying the patch on a port, but he is applying on OpenWRT.
> 
> balanga, if you paste the patches it would be easier to check what the cause may be.



I mistakenly believed that mkhash.c needed to be patched to work on FreeBSD as per reported bug 









						FS#971 - mkhash on freebsd · Issue #7981 · openwrt/openwrt
					

onborodin: Path for build mkhash on freebsd.




					bugs.openwrt.org
				




It turns out that this patch is no longer required because it has now been applied into the mainline code, and I've only just realised that this is what the warning msgs meant. ie I was trying to apply a patch to code which had already been patched. Yeah I know - kinda dumb of me not to figure this out earlier.

So as it stand now the OpenWrt Build system should work out of the box once the path to the getopt port is included.

Unfortunately, mkhash does not get built for some, as yet unidentified reason and this cause errors such as:-



> Prerequisite check failed. Use FORCE=1 to override.
> gmake: *** [/root/OpenWrt-BuildSystem/openwrt/include/toplevel.mk:180: staging_dir/host/.prereq-build] Error 1
> bash: line 3: /root/OpenWrt-BuildSystem/openwrt/staging_dir/host/bin/mkhash: No such file or directory


----------

