README (4356B)
1 mor 2 === 3 .--. 4 / \ 5 ==( )-( ) 6 ( ._) 7 |(-=) | 8 9 mor(pheus) is tool that simplifies dependency management the right way. 10 Some might even say it is a red-pill way of dependency management. 11 12 mor searches for requirements.ini file in the current folder, and uses it's 13 content to download files. 14 15 Goals 16 ----- 17 * Should work standalone 18 * Cross-platform 19 * Tiny - mor.cmd for windows, mor.sh for *NIX 20 21 Note 22 ---- 23 - Read the FAQ section 24 - Check the Windows section below if you're using mor.cmd 25 26 Config File 27 ------------ 28 mor uses .ini files as config files and can be given to mor with -c flag. 29 When no flags are given, it searches for requirements.ini in the current 30 working directory. 31 32 In a mor config file, the [sections] represent a directory or target. 33 The key=value pair under the [section] are the files to download in that 34 current directory. 35 36 [$] is a special section that is discussed in 'Variables' below. 37 38 ; requirements.ini 39 [$] 40 /=out 41 42 [precompiled] 43 libfoo-2.7=https://example.com/awavauatush/libfoo.zip 44 libbar-3.5=https://example.com/awavauatush/libbar.zip 45 ... 46 47 $ mor precompiled 48 $ tree out/ 49 precompile 50 |--libbar-3.5.zip 51 |--libbar-3.5/ 52 |--libfoo-2.7.zip 53 |--libfoo-2.7/ 54 55 Targets 56 ------- 57 58 Not all sections create sub-directoies mind you! 59 60 Sections that have a '@' or '#' as the starting letter are treated as target(@) 61 and target query(#). 62 63 Previously we have created [precompiled] section and invoked the mor command to 64 download it. Real life is seldom this simple. 65 66 Usually we are in a situation where the pre-compiled binaries are different for 67 different architectures and platforms. 68 69 ; packages.ini 70 [precompiled-macos] 71 libfoo-2.7=https://example.com/macos/precompiled.zip 72 73 [precompiled-linux] 74 libfoo-2.7=https://example.com/linux/precompiled.zip 75 76 In that case we can define a target query with '#', 77 78 ; packages.ini 79 [#lib] 80 match=k-v 81 paths=precompiled-$platform download 82 83 ; requirements.ini 84 [@lib] 85 libfoo=2.7 86 87 The $platform in the above can be passed to mor as, 88 89 mor -Dplatform=linux @lib 90 91 Variables 92 --------- 93 94 mor treats any word that starts with '$' as variable and tries to expand it. 95 96 Variables in mor has a specific rule and follows the following regex, 97 98 ([a-z][A-z])*[0-9][a-z] 99 100 [$] 101 ; the output folder 102 /=outfolder 103 ; arbitrary variables 104 git=https://git.example.com 105 106 Status Messages 107 --------------- 108 Mor uses the following symbols to denote the status to the user, 109 110 v - Download 111 | - Archive Extraction 112 g - Git 113 > - Info 114 ! - Error 115 116 Example 117 ------- 118 ; requirements.ini 119 [$] 120 >[]=packages.ini 121 @[]=@lib @build 122 123 [@lib] 124 libfoo=2.7 125 126 # when using apple-darwin, use @lib 127 [@lib:x86_64-apple-darwin] 128 libfoo-git=2.7 129 130 ; packages.ini 131 [$] 132 git=https://git.example.com 133 match=k-v 134 /=out/.sysroot 135 136 [folder/] 137 libfoo-2.7=$git/releases/libfoo/releases/v26.1/foo-26.1-osx-universal.zip 138 libfoo-git-2.7=$github/foo/libfoo.git@master 139 140 Windows 141 ------- 142 - curl is the preferred downloader for windows, but if it is missing, mor 143 defaults to bitsadmin.exe which is available in older versions of Windows. 144 145 If you face extreme slowness in downloads when using bitsadmin, it's probably 146 because some other application is using it to download 147 something (like Windows Update).If you are on a hurry, you can do 148 149 C:\Users\Admin> bitsadmin /reset 150 151 to clear all downloads and try running mor again. 152 153 Bugs 154 ---- 155 - Currently it is not possible to null a variable with -D in Windows. 156 157 mor -Dvar= download 158 159 The above will silently assign 'download' to $var. 160 This is a bug with how the cmd process arguments. Use -Dvar="" instead. 161 162 - It is currently not possible to use a '$something' directly in a URL if a 163 variable named 'something' is defined in '$' section 164 165 - The varable expansion is not really ([a-z][A-z])*[0-9][a-z]. 166 167 FAQ 168 --- 169 > Why the weird symbols ($/, $<, $>) instead of simple clean $root, $include, 170 etc in [$]? 171 I wanted mor to be as language agnostic as possible and I wanted the core 172 variables to be ASCII clean. This is also the reason why the status messages 173 are mostly made up of symbols. 174 175 > Why no 'clean' command? 176 To keep things simple. 177 Just do `rm -rf 'directory` or `rmdir /s/q directory` if using cmd 178 179 > Where are the damn CHANGELOGs? 180 For the complete changelog, 181 git notes show v0.2~1.. 182 183 For a specific version, 184 git notes show v0.2 185 186 Credits 187 ------- 188 The graphics is a derivative of "butler" by jgs.