rev |
line source |
al@822
|
1 README file for TazPkg developers
|
al@822
|
2 =================================
|
al@822
|
3
|
al@822
|
4
|
al@822
|
5 Desktop integration
|
al@822
|
6 -------------------
|
al@822
|
7
|
al@822
|
8 mimeapps.list: this file deprecated and not installed
|
al@822
|
9 https://wiki.archlinux.org/index.php/Default_applications
|
al@822
|
10 (Also, defaults.list deprecated.)
|
al@822
|
11
|
al@822
|
12 MIME-type "x-scheme-handler/tazpkg" already listed in the tazpkg-url.desktop
|
al@822
|
13
|
al@822
|
14
|
al@822
|
15 Categories for .desktop files are listed here:
|
al@822
|
16 http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html
|
al@822
|
17
|
al@822
|
18 tazpanel-pkgs.desktop: sub-category PackageManager -> category Settings
|
al@822
|
19
|
al@822
|
20
|
al@822
|
21 TazPkg modules
|
al@822
|
22 --------------
|
al@822
|
23
|
al@822
|
24 About 4,000 lines of code is too big to effectively maintain it in single file.
|
al@822
|
25
|
al@822
|
26 Linux way [https://en.wikibooks.org/wiki/Linux_Guide/How_Linux_Works]:
|
al@822
|
27 > The Linux Way can be summarized as:
|
al@822
|
28 > * Use programs that do only one task, but do it well.
|
al@822
|
29 > * To accomplish complex tasks, use several programs linked together.
|
al@822
|
30 > * Store information in human-readable plain text files whenever it is
|
al@822
|
31 > possible.
|
al@822
|
32 > * There is no "one true way" to do anything.
|
al@822
|
33 > * Prefer commandline tools over graphical tools.
|
al@822
|
34
|
al@822
|
35 It decided to split single tazpkg code into few independent modules.
|
al@822
|
36
|
al@822
|
37 Goals: not to scroll thousand of lines to move forth and back to the internal
|
al@822
|
38 tazpkg functions and to the main tazpkg code; knowledge that single code
|
al@822
|
39 changing in the one place will not have side effect in the other place; reduce
|
al@822
|
40 the barrier to entry for new developers.
|
al@822
|
41
|
al@822
|
42
|
al@822
|
43 Place best fit tazpkg modules is /usr/libexec directory.
|
al@822
|
44 http://www.linuxbase.org/betaspecs/fhs/fhs/ch04s07.html
|
al@822
|
45
|
al@822
|
46 > /usr/libexec includes internal binaries that are not intended to be executed
|
al@822
|
47 > directly by users or shell scripts. Applications may use a single subdirectory
|
al@822
|
48 > under /usr/libexec.
|
al@822
|
49
|
al@822
|
50 > Applications which use /usr/libexec in this way must not also use /usr/lib to
|
al@822
|
51 > store internal binaries, though they may use /usr/lib for the other purposes
|
al@822
|
52 > documented here.
|
al@822
|
53
|
al@822
|
54 So, directory for tazpkg modules is /usr/libexec/tazpkg/.
|
al@822
|
55 It is out of the PATH, so modules will not interfere with original Linux
|
al@822
|
56 commands and will not autocomplete in the terminal. Nothing changed with the
|
al@822
|
57 user experience: it is still single tazpkg.
|
al@822
|
58
|
al@822
|
59
|
al@822
|
60 To execute module we need to know full path to the module.
|
al@822
|
61 We can use simple names for modules such as "help", "convert", "list", etc.
|
al@822
|
62
|
al@822
|
63
|
al@822
|
64 Directory variables
|
al@822
|
65 -------------------
|
al@822
|
66
|
al@822
|
67 Many programs can be configured using variables such as prefix, docdir, etc.:
|
al@822
|
68 make prefix=/usr install
|
al@822
|
69
|
al@822
|
70 All variables are in lower case (only DESTDIR is in upper case). See more here:
|
al@822
|
71 https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
al@822
|
72
|
al@822
|
73 Makefile contains variables support with default values.
|
al@822
|
74 Default prefix=/usr, all other variables are defaults to values described
|
al@822
|
75 at the given link.
|
al@822
|
76
|
al@822
|
77
|
al@822
|
78 Code commenting
|
al@822
|
79 ---------------
|
al@822
|
80
|
al@822
|
81 Developer comments are very important to understand how program works.
|
al@822
|
82 But that comments are useless to the end user and they just increase the size
|
al@822
|
83 of the scripts without making any changes to the script business logic. It also
|
al@822
|
84 increase the size of the scripts that includes shared "libs" such as libtaz.sh.
|
al@822
|
85
|
al@822
|
86 We can strip all the comments from installed scripts, leaving that comments
|
al@822
|
87 for developers in the SliTaz Hg repositories.
|
al@822
|
88
|
al@822
|
89 We need only to leave "#!/bin/sh" line and one-two lines of comments described
|
al@822
|
90 what it is and where you can find the original scripts if you want to develop
|
al@822
|
91 them.
|
al@822
|
92
|
al@822
|
93
|
al@822
|
94 Tests
|
al@822
|
95 -----
|
al@822
|
96
|
al@822
|
97 Tests are the important part of the development process. TazPkg development is
|
al@822
|
98 not easy. We have no automated tests at the moment. Only we can do manual tests,
|
al@822
|
99 but we even have no check-list.
|
al@822
|
100
|
al@822
|
101 To test tazpkg effectively we need two sorts of the tests. One set of the tests
|
al@822
|
102 we can reproduce in the local file system (inside special prepared chroot
|
al@822
|
103 environment). For other tests we need special test-server that provide special
|
al@822
|
104 test cases (emulate package database changes), also provide both main and few
|
al@822
|
105 undigest repositories. We can set up special scripts and test repository on the
|
al@822
|
106 existing server (cook.slitaz.org).
|
al@822
|
107
|