Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed patch #2

Closed
zacofany opened this issue Jan 17, 2021 · 3 comments
Closed

Malformed patch #2

zacofany opened this issue Jan 17, 2021 · 3 comments

Comments

@zacofany
Copy link

Hi,
I'm getting:
[18:52:21] root@openHABianDevice:/etc/openhab/sitemaps# sudo patch /usr/share/mc/syntax/Syntax < /tmp/Syntax.patch
patching file /usr/share/mc/syntax/Syntax
Hunk #1 succeeded at 214 (offset 15 lines).
patch: **** malformed patch at line 30: +

Can you help me with that?

@CWempe
Copy link
Owner

CWempe commented Jan 17, 2021

I am not sure why it does not work.

Maybe the original file got changed and the patch is not compatible anymore.

Anyway:

You can just edit the file manually:

Remove rules| form the line file (rules|rocks)$ Debian\srules.

And add

file ..\*\\.(items)$ openHAB\sItems
include openhab-items.syntax  

file ..\*\\.(sitemap)$ openHAB\sSitemap
include openhab-sitemap.syntax

file ..\*\\.(persist)$ openHAB\sPersistence
include openhab-persist.syntax

file ..\*\\.(rules)$ openHAB\sRules
include openhab-rules.syntax

file ..\*\\.(script)$ openHAB\sScript
include openhab-rules.syntax

at the end of the file before the unknown lines.

Because I am using VScode to edit my openHAB files I think I will not try to fix this issue.

@zacofany
Copy link
Author

This way? I'm still getting errors.

I don't prefere Microsoft operating systems and I like mcedit for coding on linux,

`--- Syntax.backup<----->2017-01-23 20:52:19.358163297 +0100
+++ Syntax<---->2017-01-23 21:58:18.030164996 +0100
@@ -199,7 +199,7 @@
file control$ Debian\scontrol\sfile
include debian-control.syntax
.
-file (rocks)$ Debian\srules
+file (rocks)$ Debian\srules
include makefile.syntax
.
file .*changelog$ Debian\schangelog\sfile
@@ -256,5 +256,17 @@
file ..*\.([lL][kK][rR])$ PIC\slinker\sscript\sfile
include lkr.syntax

file ..*\.(items)$ openHAB\sItems
include openhab-items.syntax..

file ..*\.(sitemap)$ openHAB\sSitemap
include openhab-sitemap.syntax

file ..*\.(persist)$ openHAB\sPersistence
include openhab-persist.syntax

file ..*\.(rules)$ openHAB\sRules
include openhab-rules.syntax

file ..*\.(script)$ openHAB\sScript
include openhab-rules.syntax

file .* unknown
include unknown.syntax
`

error:
[21:15:51] root@openHABianDevice:/etc/openhab/sitemaps# sudo patch /usr/share/mc/syntax/Syntax < /tmp/Syntax.patch patching file /usr/share/mc/syntax/Syntax Hunk #1 FAILED at 199. patch: **** malformed patch at line 16: file ..\*\\.(items)$ openHAB\sItems

@CWempe
Copy link
Owner

CWempe commented Jan 17, 2021

I just tried to patch the file on on of my RaspberryPis (without openHAB) and got the same error.

patching file /usr/share/mc/syntax/Syntax
Hunk #1 succeeded at 214 (offset 15 lines).
patch: **** malformed patch at line 30: +

Looks like the original Syntax file was changed in a newer release.

So I updated the patch file and this repository.

If your Syntax file is not corrupted you should be able to just try again.

curl -L -o /tmp/Syntax.patch https://github.com/CWempe/openhab-mcedit/raw/master/Syntax.patch
sudo patch /usr/share/mc/syntax/Syntax < /tmp/Syntax.patch

If the original file is corrupted I hope you have a backup.
Otherwise un- and reinstalling mc might help.

Thanks for reporting this bug.

btw: VScode is an incredible open source tool and supported by many operating systems beside Windows. Give it a try sometime. ;)
There is even a Version with less "Microsoft features". https://vscodium.com/

@CWempe CWempe closed this as completed Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants