# HG changeset patch # User Aleksej Bobylev # Date 1549107414 -7200 # Node ID 6867a12b73aa01833b3c02e4cfca09b74c374e63 # Parent 4f2ea8b43594d6dd9c7b342b981af340d5e2ee0e modules/pack: introduce *-lang packages: to make it just append SPLIT="..." by "$PACKAGE-lang" The list of supported locales you can find still in the $WOK/slitaz-i18n/stuff/locale-pack.conf diff -r 4f2ea8b43594 -r 6867a12b73aa doc/general-questions.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/general-questions.md Sat Feb 02 13:36:54 2019 +0200 @@ -0,0 +1,43 @@ +# General questions + +## `sed` or patches? + +Sometimes I come across cases where `sed` is used to change some values in the +source code, or to add / remove / change some parts of the source code. +It may look like a good idea for a one-time job, but you will encounter +problems in the future when you upgrade the package. + +`sed` works quietly, and it is impossible to understand whether it found what +was needed to be found, whether he replaced what we wanted? Maybe this change +is already in the new sources, and we no longer need `sed` command? + +If we consider only the updated sources, sometimes it is impossible +to understand the essence of the `sed` changes. And then you have to download +and analyze the old sources. + +Feel free to use patches. The `patch` is smart enough to find the necessary +lines in the new sources, and also it will signal to you if your changes have +already been made in the sources, or if the sources has changed so much that +your intervention is required. + +Go from `sed` to `patch` is easy. You must use the `-o.backup` option (value +after the `-o` you can change). For example, you used this code: + +```bash +sed -i '/debug/ s|true|false|' config +``` + +Now apply the changes saving the original file: + +```bash +sed -i.orig '/debug/ s|true|false|' config +``` + +Create a patch using the original and modified files: + +```bash +diff ./config.orig ./config > ../../stuff/patches/config.patch +``` + +Now you can use the created patch and remove the `sed` command. + diff -r 4f2ea8b43594 -r 6867a12b73aa modules/pack --- a/modules/pack Wed Jan 30 23:26:44 2019 +0200 +++ b/modules/pack Sat Feb 02 13:36:54 2019 +0200 @@ -576,6 +576,7 @@ $basepkg) COPY='@std @rm';; *-dev) COPY='@dev @rm';; lib$basepkg) COPY='*.so.*'; [ -n "$CAT" ] || CAT="libs|shared library";; + *-lang) COPY='*.mo'; [ -n "$CAT" ] || CAT="localization|translations";; esac fi