| 1 | =============== |
|---|
| 2 | Getting Started |
|---|
| 3 | =============== |
|---|
| 4 | |
|---|
| 5 | Portage Differences |
|---|
| 6 | +++++++++++++++++++ |
|---|
| 7 | |
|---|
| 8 | Currently portage handles all actions primarily through one script; emerge. |
|---|
| 9 | pkgcore breaks this functionality down into 3 scripts: pmerge, pmaint, and |
|---|
| 10 | pquery. |
|---|
| 11 | |
|---|
| 12 | Pmerge |
|---|
| 13 | ====== |
|---|
| 14 | |
|---|
| 15 | pmerge is fairly similar to emerge in most usage instances: |
|---|
| 16 | |
|---|
| 17 | Basic Usage |
|---|
| 18 | ----------- |
|---|
| 19 | |
|---|
| 20 | ``pmerge -us world`` |
|---|
| 21 | Update world; don't try to update dependencies for already installed |
|---|
| 22 | packages. |
|---|
| 23 | ``pmerge -uDs world`` |
|---|
| 24 | Update world, trying to update all encountered dependencies/packages. |
|---|
| 25 | ``pmerge -p dev-util/bzrtools`` |
|---|
| 26 | Pretend to install bzrtools |
|---|
| 27 | ``pmerge -C \<sys-kernel/gentoo-sources-2.6.19`` |
|---|
| 28 | Remove gentoo-sources less than 2.6.19 |
|---|
| 29 | ``pmerge --clean`` |
|---|
| 30 | Remove unused packages. |
|---|
| 31 | |
|---|
| 32 | **Warning:** This can break your system if |
|---|
| 33 | incorrectly used. Check with --pretend before running it. |
|---|
| 34 | |
|---|
| 35 | Additionally, it currently defaults to identifying only whats |
|---|
| 36 | required for world/system; installed packages don't require their build |
|---|
| 37 | depends to be satisfied, as such --clean will identify them for removal if |
|---|
| 38 | they're not runtime depended upon. |
|---|
| 39 | |
|---|
| 40 | If you want --clean to preserve your build depends, use the -B option. |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | Sets |
|---|
| 44 | ---- |
|---|
| 45 | |
|---|
| 46 | Available sets are dependant upon your configuration- majority of users still |
|---|
| 47 | use make.conf configuration, which has five default sets: |
|---|
| 48 | |
|---|
| 49 | system, world, installed, version-installed, vuln |
|---|
| 50 | |
|---|
| 51 | system: |
|---|
| 52 | |
|---|
| 53 | world: |
|---|
| 54 | |
|---|
| 55 | These two are the same as in portage. |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | version-installed: |
|---|
| 59 | |
|---|
| 60 | versioned-installed is a set of all cpv's from the vdb. This is useful for |
|---|
| 61 | --emptytree. |
|---|
| 62 | |
|---|
| 63 | Example: |
|---|
| 64 | If you have app/foo-1 and bar/dar-2 installed (and just those), |
|---|
| 65 | versioned-installed would be a set containing -app/foo-1 and -bar/dar-2. |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | installed: |
|---|
| 69 | |
|---|
| 70 | installed is an unversioned set, but is slotted. Unlike version-installed, |
|---|
| 71 | installed can be used for "system update". Using ``pmerge -us installed`` |
|---|
| 72 | over ``pmerge -u -s system -s`` world also has the advantage that |
|---|
| 73 | dependency-orphaned packages are updated. |
|---|
| 74 | |
|---|
| 75 | Example: |
|---|
| 76 | If you had app/foo-1 slot 1, app/foo-2 slot 2, installed would be a set |
|---|
| 77 | containing would be app/foo:1 app/foo:2. |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | vuln: |
|---|
| 81 | |
|---|
| 82 | Packages that are vulnerable to security bugs. |
|---|
| 83 | |
|---|
| 84 | Custom Sets |
|---|
| 85 | ----------- |
|---|
| 86 | |
|---|
| 87 | Doing this for a make.conf configuration is pretty simple. Just add a file |
|---|
| 88 | to /etc/portage/sets, containing a list of atoms. The set name is the filename. |
|---|
| 89 | |
|---|
| 90 | Example: Making a kde set: |
|---|
| 91 | ``pquery 'kde-*/*' --no-version > /etc/portage/sets/kde-set`` |
|---|
| 92 | ``pmerge -uDs kde-set`` |
|---|
| 93 | |
|---|
| 94 | Portage Equivalents |
|---|
| 95 | ------------------- |
|---|
| 96 | |
|---|
| 97 | ~~~~~~~~~~~~~~~ |
|---|
| 98 | New in pkgcore: |
|---|
| 99 | ~~~~~~~~~~~~~~~ |
|---|
| 100 | |
|---|
| 101 | --ignore-failures: |
|---|
| 102 | |
|---|
| 103 | ignore resolution/build failures, skipping to the next step. Think of it |
|---|
| 104 | as the equiv of --skipfirst, just without the commandline interuption. |
|---|
| 105 | |
|---|
| 106 | Goes without saying, this feature should be used with care- primarily useful |
|---|
| 107 | for a long chain of non critical updates, where a failure is a non issue. |
|---|
| 108 | |
|---|
| 109 | Good example of usage is if you want to build mozilla-firefox and openoffice |
|---|
| 110 | during the night- both take a long while to build (including their deps), and |
|---|
| 111 | the user is after getting as many packages built for the targets as possible, |
|---|
| 112 | rather then having the 5th build out of 80 bail out even attempting the other |
|---|
| 113 | 75. |
|---|
| 114 | |
|---|
| 115 | Long term, this feature will likely be replaced with a more fine tuned option. |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | --preload-vdb-state: |
|---|
| 119 | |
|---|
| 120 | This preloads the installed packages database causing the resolver to work |
|---|
| 121 | with a complete graph, disallowing actions that confict with installed |
|---|
| 122 | packages. If it's disabled, it's possible for the requested action to |
|---|
| 123 | conflict with already installed dependencies that aren't involved in the |
|---|
| 124 | graph of the requested operation. |
|---|
| 125 | |
|---|
| 126 | ~~~~~~~~~~~~~~~~~ |
|---|
| 127 | Moved, in pmerge: |
|---|
| 128 | ~~~~~~~~~~~~~~~~~ |
|---|
| 129 | |
|---|
| 130 | --depclean: |
|---|
| 131 | |
|---|
| 132 | --clean |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | --with-bdeps: |
|---|
| 136 | |
|---|
| 137 | --with-built-depends |
|---|
| 138 | |
|---|
| 139 | ~~~~~~~~~~~~~~~~~~~~ |
|---|
| 140 | Moved out of pmerge: |
|---|
| 141 | ~~~~~~~~~~~~~~~~~~~~ |
|---|
| 142 | |
|---|
| 143 | --regen: |
|---|
| 144 | |
|---|
| 145 | See regen_ |
|---|
| 146 | |
|---|
| 147 | ~~~~~~~~~~~~~~~ |
|---|
| 148 | No equivalents: |
|---|
| 149 | ~~~~~~~~~~~~~~~ |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | --info: |
|---|
| 153 | |
|---|
| 154 | pconfig is the closest equivalent at the moment- rather verbose. |
|---|
| 155 | |
|---|
| 156 | --config: |
|---|
| 157 | |
|---|
| 158 | This may be implemented in pmaint in the future, possible 0.3. |
|---|
| 159 | |
|---|
| 160 | --prune: |
|---|
| 161 | |
|---|
| 162 | Currently not implemented; portages implementation of it ignores slots, |
|---|
| 163 | trying to force a max version for each package- this is problematic however |
|---|
| 164 | since it can remove needed slotted packages that are of a lesser version. |
|---|
| 165 | |
|---|
| 166 | Any package that requires slotting (automake for example) generally will |
|---|
| 167 | be screwed up by emerge --prunes behaviour. |
|---|
| 168 | |
|---|
| 169 | Long term intention is to implement this functionality safely- effectively |
|---|
| 170 | try to minimize the resolved dependency graph to minimal number of packages |
|---|
| 171 | involved. |
|---|
| 172 | |
|---|
| 173 | --resume: |
|---|
| 174 | |
|---|
| 175 | --skipfirst: |
|---|
| 176 | |
|---|
| 177 | Not yet implemented. |
|---|
| 178 | |
|---|
| 179 | --metadata: |
|---|
| 180 | |
|---|
| 181 | Not implemented- pkgcore doesn't need cache localization. |
|---|
| 182 | |
|---|
| 183 | If the user is after copying cache data around, pclone_cache can be used. |
|---|
| 184 | |
|---|
| 185 | --fetch-all-uri: |
|---|
| 186 | |
|---|
| 187 | Not yet implemented. |
|---|
| 188 | |
|---|
| 189 | --buildpkg: |
|---|
| 190 | |
|---|
| 191 | Not yet implemented. |
|---|
| 192 | |
|---|
| 193 | --getbinpkg: |
|---|
| 194 | |
|---|
| 195 | --getbinpkgonly: |
|---|
| 196 | |
|---|
| 197 | Remote Binhost v1 support will not be implemented in pkgcore, instead |
|---|
| 198 | favoring the genpkgindex approach Ned Ludd (solar) has created. |
|---|
| 199 | |
|---|
| 200 | Reasoning for this comes down to two main reasons- |
|---|
| 201 | |
|---|
| 202 | * design of v1 allows for collisions in the package namespace, category |
|---|
| 203 | is ignored. Further, this collision isn't easily detectable- pulling |
|---|
| 204 | mysql-5.0 from the server may get you virtual/mysql-5.0 or dev-db/mysql-5.0 |
|---|
| 205 | |
|---|
| 206 | * design is god awfully slow. To get the metadata for a binpkg from an HTTP |
|---|
| 207 | server, requires (roughly) a HEAD request (tbz2 length), ranged GET request |
|---|
| 208 | to grab the last 16 bytes for the XPAK segment start, another ranged |
|---|
| 209 | request to pull the metadata. |
|---|
| 210 | |
|---|
| 211 | That's per package. Can cache, but the roundtrips add up quickly. |
|---|
| 212 | |
|---|
| 213 | The package namespace collision issue is the main reason why v1 support will |
|---|
| 214 | not be added to pkgcore; v2 addresses both issues thus is the route we'll go. |
|---|
| 215 | |
|---|
| 216 | --tree: |
|---|
| 217 | |
|---|
| 218 | This is formatter dependant, it may be included in 0.3. |
|---|
| 219 | |
|---|
| 220 | --alphabetical: |
|---|
| 221 | |
|---|
| 222 | --columns: |
|---|
| 223 | |
|---|
| 224 | These won't be implemented in pkgcore. |
|---|
| 225 | |
|---|
| 226 | --changelog: |
|---|
| 227 | |
|---|
| 228 | At some point will be accessible via pquery. |
|---|
| 229 | |
|---|
| 230 | Regen |
|---|
| 231 | ----- |
|---|
| 232 | |
|---|
| 233 | To regenerate run ``pregen.py <repo-name> -j <# of processors>``, which scales |
|---|
| 234 | around .9x linear per proc, at least through 4x for testing. This will |
|---|
| 235 | probably be folded into pmaint by 0.3. |
|---|
| 236 | |
|---|
| 237 | Searching |
|---|
| 238 | ========= |
|---|
| 239 | |
|---|
| 240 | All search in pkgcore is done through pquery. See |
|---|
| 241 | pquery-usage_ for how to use pquery. |
|---|
| 242 | |
|---|
| 243 | Syncing |
|---|
| 244 | ======= |
|---|
| 245 | |
|---|
| 246 | ``pmaint sync <reponame>`` will sync a repository. See config doc for syncing |
|---|
| 247 | info. No reponame provided, tries to sync all repositories. |
|---|
| 248 | |
|---|
| 249 | Note: You should look at pmaint --help, because at some point, the 'commands' |
|---|
| 250 | for pmaint will be variable and dependant upon the repositories available, |
|---|
| 251 | akin to how bzr's command set changes dependant on what plugins you've enabled |
|---|
| 252 | (commonly bzrtools). |
|---|
| 253 | |
|---|
| 254 | Quickpkg |
|---|
| 255 | ======== |
|---|
| 256 | |
|---|
| 257 | ``pmaint copy -s vdb -t binpkg sys-apps/portage --force`` will make a binpkg |
|---|
| 258 | (like quickpkg). |
|---|
| 259 | |
|---|
| 260 | Note: this is not a --buildpkg equiv, as buildpkg grabs a package prior to |
|---|
| 261 | any preinst mangling, so a quickpkg'ed binpkg's contents can differ from a |
|---|
| 262 | binpkg built with --buildpkg. |
|---|
| 263 | |
|---|
| 264 | Handy backup of existing system- |
|---|
| 265 | ``pmaint copy -s vdb -t binpkg '*' --force`` |
|---|
| 266 | |
|---|
| 267 | Alternatively, generating binpkgs only if they don't exist- |
|---|
| 268 | ``pmaint copy -s vdb -t binpkg '*' --force --ignore-existing`` |
|---|
| 269 | |
|---|
| 270 | .. _pquery-usage: pquery-usage.rst |
|---|