Skip to content

Patch binary distributions so we can use recommended /usr paths instead of /usr/local ones

viktor drobot requested to merge (removed):main into main

I've done patching for crucial binary executables and supplementary data (such as manpages) for all of available architectures of WXtoIMG. Now main config file is expected to be at /etc/wxtoimg.cfg (instead of /usr/local/etc/wxtoimg.cfg) and common data are in /usr/share/wx2img (instead of /usr/local/lib/wx). Patching was quite trivial - for /usr/local/lib/wx to /usr/share/wx2img the change is byte-to-byte in length equal so simple replacement was sufficient. For config file it was a bit trickier but since new path /etc/wxtoimg.cfg is shorter than the older one string literal constants were just filled with \0 symbols after the end so C strings should work fine. In documentation parts old extra characters were replaced with spaces. I've tested patched version on x86_64 architecture and it worked fine (as I was able to detect). As of now new file list consists of the following paths:

$ pacman -Ql wxtoimg-beta 
wxtoimg-beta /usr/
wxtoimg-beta /usr/bin/
wxtoimg-beta /usr/bin/wxbatch
wxtoimg-beta /usr/bin/wxmap
wxtoimg-beta /usr/bin/wxproj
wxtoimg-beta /usr/bin/wxrec
wxtoimg-beta /usr/bin/wxtoimg
wxtoimg-beta /usr/bin/xwxtoimg
wxtoimg-beta /usr/share/
wxtoimg-beta /usr/share/applications/
wxtoimg-beta /usr/share/applications/wxtoimg.desktop
wxtoimg-beta /usr/share/licenses/
wxtoimg-beta /usr/share/licenses/wxtoimg-beta/
wxtoimg-beta /usr/share/licenses/wxtoimg-beta/LICENSE
wxtoimg-beta /usr/share/man/
wxtoimg-beta /usr/share/man/de/
wxtoimg-beta /usr/share/man/de/man1/
wxtoimg-beta /usr/share/man/de/man1/wxcalibrate.1
wxtoimg-beta /usr/share/man/de/man1/wxfaq.1
wxtoimg-beta /usr/share/man/de/man1/wxrego.1
wxtoimg-beta /usr/share/man/de/man1/xwxtoimg.1
wxtoimg-beta /usr/share/man/es/
wxtoimg-beta /usr/share/man/es/man1/
wxtoimg-beta /usr/share/man/es/man1/wxcalibrate.1
wxtoimg-beta /usr/share/man/es/man1/wxfaq.1
wxtoimg-beta /usr/share/man/es/man1/wxrego.1
wxtoimg-beta /usr/share/man/es/man1/xwxtoimg.1
wxtoimg-beta /usr/share/man/fr/
wxtoimg-beta /usr/share/man/fr/man1/
wxtoimg-beta /usr/share/man/fr/man1/wxcalibrate.1
wxtoimg-beta /usr/share/man/fr/man1/wxfaq.1
wxtoimg-beta /usr/share/man/fr/man1/wxrego.1
wxtoimg-beta /usr/share/man/fr/man1/xwxtoimg.1
wxtoimg-beta /usr/share/man/ja/
wxtoimg-beta /usr/share/man/ja/man1/
wxtoimg-beta /usr/share/man/ja/man1/wxcalibrate.1
wxtoimg-beta /usr/share/man/ja/man1/wxfaq.1
wxtoimg-beta /usr/share/man/ja/man1/wxrego.1
wxtoimg-beta /usr/share/man/ja/man1/xwxtoimg.1
wxtoimg-beta /usr/share/man/man1/
wxtoimg-beta /usr/share/man/man1/wxbatch.1.gz
wxtoimg-beta /usr/share/man/man1/wxmap.1.gz
wxtoimg-beta /usr/share/man/man1/wxproj.1.gz
wxtoimg-beta /usr/share/man/man1/wxrec.1.gz
wxtoimg-beta /usr/share/man/man1/wxtoimg.1.gz
wxtoimg-beta /usr/share/man/pl/
wxtoimg-beta /usr/share/man/pl/man1/
wxtoimg-beta /usr/share/man/pl/man1/wxcalibrate.1
wxtoimg-beta /usr/share/man/pl/man1/wxfaq.1
wxtoimg-beta /usr/share/man/pl/man1/wxrego.1
wxtoimg-beta /usr/share/man/pl/man1/xwxtoimg.1
wxtoimg-beta /usr/share/pixmaps/
wxtoimg-beta /usr/share/pixmaps/wxtoimg.png
wxtoimg-beta /usr/share/wx2img/
wxtoimg-beta /usr/share/wx2img/man/
wxtoimg-beta /usr/share/wx2img/man/de_wxcalibrate.1
wxtoimg-beta /usr/share/wx2img/man/de_wxfaq.1
wxtoimg-beta /usr/share/wx2img/man/de_wxrego.1
wxtoimg-beta /usr/share/wx2img/man/de_xwxtoimg.1
wxtoimg-beta /usr/share/wx2img/man/es_wxcalibrate.1
wxtoimg-beta /usr/share/wx2img/man/es_wxfaq.1
wxtoimg-beta /usr/share/wx2img/man/es_wxrego.1
wxtoimg-beta /usr/share/wx2img/man/es_xwxtoimg.1
wxtoimg-beta /usr/share/wx2img/man/fr_wxcalibrate.1
wxtoimg-beta /usr/share/wx2img/man/fr_wxfaq.1
wxtoimg-beta /usr/share/wx2img/man/fr_wxrego.1
wxtoimg-beta /usr/share/wx2img/man/fr_xwxtoimg.1
wxtoimg-beta /usr/share/wx2img/man/ja_wxcalibrate.1
wxtoimg-beta /usr/share/wx2img/man/ja_wxfaq.1
wxtoimg-beta /usr/share/wx2img/man/ja_wxrego.1
wxtoimg-beta /usr/share/wx2img/man/ja_xwxtoimg.1
wxtoimg-beta /usr/share/wx2img/man/pl_wxcalibrate.1
wxtoimg-beta /usr/share/wx2img/man/pl_wxfaq.1
wxtoimg-beta /usr/share/wx2img/man/pl_wxrego.1
wxtoimg-beta /usr/share/wx2img/man/pl_xwxtoimg.1
wxtoimg-beta /usr/share/wx2img/template0.html
wxtoimg-beta /usr/share/wx2img/template1.html
wxtoimg-beta /usr/share/wx2img/template2.html
wxtoimg-beta /usr/share/wx2img/template3.html
wxtoimg-beta /usr/share/wx2img/template4.html
wxtoimg-beta /usr/share/wx2img/template5.html
wxtoimg-beta /usr/share/wx2img/template6.html
wxtoimg-beta /usr/share/wx2img/tkclscrd.ttf
wxtoimg-beta /usr/share/wx2img/tle/
wxtoimg-beta /usr/share/wx2img/tle/archive.txt
wxtoimg-beta /usr/share/wx2img/tle/met2-21h.txt
wxtoimg-beta /usr/share/wx2img/tle/met3-05h.txt
wxtoimg-beta /usr/share/wx2img/tle/noaa-12h.txt
wxtoimg-beta /usr/share/wx2img/tle/noaa-14h.txt
wxtoimg-beta /usr/share/wx2img/tle/noaa-15h.txt
wxtoimg-beta /usr/share/wx2img/tle/noaa-16h.txt
wxtoimg-beta /usr/share/wx2img/tle/noaa-17h.txt
wxtoimg-beta /usr/share/wx2img/tle/othertle.txt
wxtoimg-beta /usr/share/wx2img/tle/resource.txt
wxtoimg-beta /usr/share/wx2img/tle/weather.txt
wxtoimg-beta /usr/share/wx2img/wxland.png
wxtoimg-beta /usr/share/wx2img/wxmap.db
wxtoimg-beta /usr/share/wx2img/wxmap.png

To check patches by hand you can use the following steps:

  1. Patch original binary executable: bspatch ORIG.exec FIXED.exec ORIG-ARCH.patch
  2. Compare original and patched binaries with the following: cmp -l ORIG.exec FIXED.exec | gawk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}'. It will give you bitewise comparison of what has been changed - you can then re-check by hand in, e. g., bless or okteta

It would be great if you will be able to test my changes on other architectures as well. This will allow to comply to the Arch packaging standards without need of tinkering with /usr/local and similar stuff

Also I've fixed .desktop file a bit: added proper categories. proj should be in dependency list as well - I've found link to this executable while digging through binary executables

Edited by viktor drobot

Merge request reports

Loading