OPAM-ADMIN-UPDATE-EXTRAFILES(1)
π OPAM-ADMIN-UPDATE-EXTRAFILES(1) π
okay so before anything else: this is from the Opam admin Manual, it's the page for opam admin update-extrafiles, and it is long, so we're doing this in parts. This is part 1. Buckle in, bestie π
β¨ NAME β¨
opam admin-update-extrafiles β adds extra-files to an opam repository. that's the whole vibe. short, sweet, does exactly what it says on the tin π
π¦ SYNOPSIS π¦
so the way you actually call this is:
opam admin update-extrafiles [--hash=HASH_ALGO] [--packages=PACKAGES]
[OPTION]β¦
like yes, there's an [OPTION]β¦ at the end, there are so many options, we'll get to them, breathe π
πΈ DESCRIPTION πΈ
so picture this: the command scans through package definitions, and then adds the extrafiles field as requested. that's it. that's the job. it goes looking, it writes the field, it moves on. main character energy, honestly π¦
π OPTIONS π
these are the ones that belong to this command specifically, not the shared girlies:
--hash=HASH_ALGOβ the hash, or hashes, that are gonna be added. plural hashes, because why be normal π-p PACKAGES,--packages=PACKAGESβ only add extra files for the packages you name here. so if you only care about some of them, this is your girl β¨
π COMMON OPTIONS π
okay so these are common to all commands, not just this one. every single one of them, in order, no skips, no cap:
--best-effortβ don't fail just because all the requested packages can't be installed: try to install as many as possible instead. but heads up β not all external solvers support this (recent versions ofaspcudormccsshould, tho). this is equivalent to setting the$OPAMBESTEFFORTenvironment variable π--cli=MAJOR.MINOR(absent=2.6) β use the command-line interface syntax and semantics ofMAJOR.MINOR. this is for any persistent use of opam (scripts, blog posts, etc.) β any version of opam in the sameMAJORseries will behave as for the specifiedMINORrelease. and here's the tea: the flag wasn't even available in opam 2.0, so if you wanna select the 2.0 CLI, set theOPAMCLIenvironment variable to2.0instead of using this parameter. iykyk π--color=WHENβ colorize the output.WHENmust be one ofalways,neverorauto. give me the rainbow or give me nothing π--confirm-level=LEVELβ confirmation level, andLEVELmust be one ofask,no,yesorunsafe-yes. can be specified more than once. if--yesor--noare also given, the value of the last--confirm-levelis taken into account. this is equivalent to setting$OPAMCONFIRMLEVELβ¨--criteria=CRITERIAβ specify user preferences for dependency solving for this run. overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. for the details on the supported language, and the external solvers available, seehttp://opam.ocaml.org/doc/External_solvers.html. a general guide to using solver preferences can be found athttp://www.dicosmo.org/Articles/usercriteria.pdfπ--cudf=FILENAMEβ debug option: save the CUDF requests sent to the solver toFILENAME-<n>.cudfwhere<n>is the n-th call to the solver during the opam run π--debugβ print debug message tostderr. this is equivalent to setting$OPAMDEBUGto"true"π--debug-level=LEVELβ like--debug, but it lets you specify the debug level (--debugsets it to1). equivalent to setting$OPAMDEBUGto a positive integer π₯--git-versionβ print the git version of opam, if set (i.e. you are using a development version), and exit π--help[=FMT](default=auto) β show this help in formatFMT. the valueFMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined π«Ά--ignore-pin-dependsβ ignore extra pins required by packages that get pinned, either manually throughopam pinor throughopam install DIR. this is equivalent to settingIGNOREPINDEPENDS=trueπ--json=FILENAMEβ save the results of the opam run in a computer-readable file. if the filename contains the character%, it will be replaced by an index that doesn't overwrite an existing file. similar to setting the$OPAMJSONvariable πΎ--noβ answer no to all opam yes/no questions without prompting. see also--confirm-level. this is equivalent to setting$OPAMNOto"true"π«--no-aspcudβ removed in 2.1. she's gone, bestie, don't reach for her π--no-auto-upgradeβ when configuring or updating a repository that is written for an earlier opam version (1.2), opam internally converts it to the current format. this disables that behaviour. note that repositories should define their format version in arepofile at their root, or they will be assumed to be in the older format. it is, in any case, preferable to upgrade the repositories manually usingopam admin upgrade [--mirror URL]when possible π±-q,--quietβ disables--verbose. the shush button π€«--root=ROOTβ useROOTas the current root path. this is equivalent to setting$OPAMROOTtoROOTπ--safe,--readonlyβ make sure nothing will be automatically updated or rewritten. useful for calling from completion scripts, for example. will fail whenever such an operation is needed; also avoids waiting for locks, skips interactive questions and overrides the$OPAMDEBUGvariable. this is equivalent to set environment variable$OPAMSAFEπ--solver=CMDβ specify the CUDF solver to use for resolving package installation problems. this is either a predefined solver β this version of opam supportsbuiltin-mccs+lp(),builtin-mccs+glpk,builtin-dummy-z3-solver,builtin-0install,aspcud,mccs,aspcud-old,packupβ or a custom command that should contain the variables%{input}%,%{output}%,%{criteria}%, and optionally%{timeout}%. this is equivalent to setting$OPAMEXTERNALSOLVERπ§--strictβ fail whenever an error is found in a package definition or a configuration file. the default is to continue silently if possible. (so by default she's chill. with--strictshe is NOT chill.) π€--switch=SWITCHβ useSWITCHas the current compiler switch. this is equivalent to setting$OPAMSWITCHtoSWITCHπ--use-internal-solverβ disable any external solver, and use the built-in one (this requires that opam has been compiled with a built-in solver). this is equivalent to setting$OPAMNOASPCUDor$OPAMUSEINTERNALSOLVERπ οΈ-v,--verboseβ be more verbose. one-vshows all package commands, repeat to also display commands called internally (e.g.tar,curl,patchetc.) repeating n times is equivalent to setting$OPAMVERBOSEto"n"π’--versionβ show version information π·οΈ-w,--working-dirβ whenever updating packages that are bound to a local, version-controlled directory, update to the current working state of their source instead of the last committed state, or the ref they are pointing to. as source directory is copied as it is, if it isn't clean it may result on a opam build failure. this only affects packages explicitly listed on the command-line. it can also be set with$OPAMWORKINGDIRβ οΈ-y,--yesβ answer yes to all opam yes/no questions without prompting. see also--confirm-level. this is equivalent to setting$OPAMYESto"true"β
okay that's the options situation handled, and there's still more page coming π¦ don't go anywhere π
β¨ ENVIRONMENT β¨
okay bestie so opam is very into environment variables, and here's the whole roster of them π«Ά. Quick rule first tho: any variable that's a boolean? set it to "0", "no", "false" or just the empty string to turn it off, and to "1", "yes" or "true" to turn it on. slay.
OPAMALLPARENSβ surrounds all filters with parenthesis. cute and tidy πOPAMASSUMEDEPEXTSβ see the option--assume-depexts.OPAMAUTOANSWERβ internal use only. not for you, bestie πOPAMAUTOREMOVEβ see the remove option--auto-remove.OPAMBESTEFFORTβ see the option--best-effort.OPAMBESTEFFORTPREFIXCRITERIAβ sets the string that must be prepended to the criteria when the--best-effortoption is set, and it's expected to maximise theopam-queryproperty in the solution.OPAMBUILDDOCβ Removed in 2.1. rip πOPAMBUILDTESTβ Removed in 2.1. also rip πOPAMCLIβ see the option--cli.OPAMCOLORβ when set toalwaysornever, it sets a default value for the--coloroption.OPAMCONFIRMLEVELβ see the option--confirm-level. heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO.OPAMCRITERIAβ specifies user preferences for dependency solving. the default value depends on the solver version, so runconfig reportto know the current setting. see also the option--criteria.OPAMCUDFFILEβ saves the cudf graph tofile-actions-explicit.dot.OPAMCUDFTRIMβ controls the filtering of unrelated packages during CUDF preprocessing.OPAMCURLβ can be used to select a givencurlprogram. seeOPAMFETCHfor more options.OPAMDEBUGβ see the options--debugand--debug-level.OPAMDEBUGSECTIONSβ if set, it limits debug messages to that space-separated list of sections. sections can optionally have a specific debug level (likeCLIENT:2orCLIENT CUDF:2), but otherwise use--debug-level.OPAMDIGDEPTHβ defines how aggressive the lookup for conflicts during CUDF preprocessing is.OPAMDOWNLOADJOBSβ sets the maximum number of simultaneous downloads.OPAMDROPWORKINGDIRβ overrides packages previously updated with--working-diron update. without this variable set, opam would keep them unchanged unless they were explicitly named on the command-line.OPAMDRYRUNβ see the option--dry-run.OPAMEDITORβ sets the editor to use for opam file editing, and it overrides$EDITORand$VISUAL.OPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails.0prints all of them.OPAMEXTERNALSOLVERβ see the option--solver.OPAMFAKEβ see the option--fake.OPAMFETCHβ specifies how to download files: eitherwget,curl, or a custom command where the variables%{url}%,%{out}%,%{retry}%,%{compress}%and%{checksum}%will be replaced. this overrides thedownload-commandvalue from the main config file.OPAMFIXUPCRITERIAβ same asOPAMUPGRADECRITERIA, but specific to fixup and reinstall.OPAMIGNOREAVAILABLEβ see the install option--ignore-available-on.OPAMIGNORECONSTRAINTSβ see the install option--ignore-constraints-on.OPAMIGNOREPINDEPENDSβ see the option--ignore-pin-depends.OPAMINPLACEBUILDβ see the option--inplace-build.OPAMJOBSβ sets the maximum number of parallel workers to run.OPAMJSONβ logs json output to the given file (use the character%to index the files).OPAMKEEPBUILDDIRβ see the install option--keep-build-dir.OPAMKEEPLOGSβ tells opam to not remove some temporary command logs and some backups. this skips some finalisers and may also help to get more reliable backtraces.OPAMLOCKEDβ a combination of the--lockedand--lock-suffixoptions.OPAMLOGSβ logdir sets the log directory, and the default is a temporary directory in/tmp.OPAMMAKECMDβ sets the system make command to use.OPAMMERGEOUTβ merges process outputs, so stderr goes on stdout.OPAMNOβ answers no to any question asked, see the options--noand--confirm-level.OPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set.OPAMNOAGGREGATEβ withopam admin check, don't aggregate packages.OPAMNOASPCUDβ Deprecated.OPAMNOAUTOUPGRADEβ disables the automatic internal upgrade of repositories in an earlier format to the current one, onupdateorinit.OPAMNOCHECKSUMSβ enables the option--no-checksumswhen available.OPAMNODEPEXTSβ disables system dependencies handling, see the option--no-depexts.OPAMNOENVNOTICEβ Internal.OPAMNOSELFUPGRADEβ see the option--no-self-upgrade.OPAMPINKINDAUTOβ sets whether version control systems should be detected when pinning to a local path. enabled by default since 1.3.0 β¨.OPAMPRECISETRACKINGβ fine grain tracking of directories.OPAMPREPROβ set this tofalseto disable CUDF preprocessing. less efficient, but it might help when you're debugging a solver issue.OPAMREPOSITORYTARRINGβ internally stores all non-vcs repositories astar.gzfiles (by default, http repositories are stored as archive). this can be much faster on filesystems that don't cope well with scanning large trees. all operations are done in-memory, so there's no I/O for scanning the repository. obsessed π₯OPAMREQUIRECHECKSUMSβ enables the option--require-checksumswhen available (e.g. foropam install).OPAMRETRIESβ sets the number of tries before failing downloads.OPAMREUSEBUILDDIRβ see the option--reuse-build-dir.OPAMROOTβ see the option--root. this is automatically set byopam env --root=DIR --set-root.OPAMROOTISOKβ don't complain when running as root.OPAMSAFEβ see the option--safe.OPAMSHOWβ see the option--show.OPAMSKIPUPDATEβ see the option--skip-updates.OPAMSKIPVERSIONCHECKSβ bypasses some version checks. Unsafe, for compatibility testing only β οΈ.OPAMSOLVERALLOWSUBOPTIMALβ (defaulttrue) allows some solvers to still return a solution when they reach timeout; while the solution remains assured to be consistent, there's no guarantee in this case that it fits the expected optimisation criteria. iftrue, opam will continue with a warning; iffalse, a timeout is an error. currently only the builtin-z3 backend handles this degraded case.OPAMSOLVERTIMEOUTβ change the time allowance of the solver. default is60.0, and set it to0for unlimited. note that not all solvers may support this option.OPAMSOLVERTOLERANCEβ changes the tolerance towards the solver choosing an unoptimized solution (i.e. it might pull outdated packages π). typical values range from0.0(best solution known to the solver) to1.0(unoptimized solution). default is0.0. this option is useful in case the solver can't find a solution in a reasonable time (see$OPAMSOLVERTIMEOUT). note that not all solvers may support this option.OPAMSTATSβ Removed in 2.4. gone gone πOPAMSTATUSLINEβ displays a dynamic status line showing what's currently going on on the terminal. (one ofalways,neverorauto)OPAMSTRICTβ fail on inconsistencies (file reading, switch import, etc.).OPAMSWITCHβ see the option--switch. automatically set byopam env --switch=SWITCH --set-switch.OPAMUNLOCKBASEβ see the install option--unlock-base.OPAMUPGRADECRITERIAβ specifies user preferences for dependency solving when performing an upgrade. overridesOPAMCRITERIAin upgrades if both are set. see also the option--criteria.OPAMUSEINTERNALSOLVERβ see the option--use-internal-solver.OPAMUSEOPENSSLβ Removed in 2.2. bye πOPAMUTF8β use UTF8 characters in output (one ofalways,neverorauto). by default it'sauto, which is determined from the locale.OPAMUTF8MSGSβ use extended UTF8 characters (camels πͺ) in opam messages. impliesOPAMUTF8. this is set by default on macOS only.OPAMVALIDATIONHOOKβ if set, uses the%{hook}%command to validate an opam repository update.OPAMVERBOSEβ see the option--verbose.OPAMVERBOSEONβ see the option--verbose-on.OPAMVERSIONLAGPOWERβ do not use. like literally don't π«OPAMWITHDEVSETUPβ see the install option--with-dev-setup.OPAMWITHDOCβ see the install option--with-doc.OPAMWITHTESTβ see the install option--with-test.OPAMWORKINGDIRβ see the option--working-dir.OPAMYESβ see the options--yesand--confirm-level.OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVELis set.OPAMVAR_varβ overrides the contents of the variable var when substituting%{var}%strings inopamfiles.OPAMVAR_package_varβ overrides the contents of the variable package:var when substituting%{package:var}%strings inopamfiles.
π CLI VERSION π
okay so listen, this part is lowkey the most important glow-up in opam's whole story β¨. all scripts and programmatic invocations of opam should use --cli so that they keep working seamlessly with future versions of the opam client. and it's not just for scripts either β blog posts and other documentation benefit too, because it stops information from going stale. main character energy for your docs, fr fr π.
although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. bestie is looking out for you π«Ά.
since CLI version support was only added in opam 2.1, you use OPAMCLI to select 2.0 support (as opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions β because an environment variable controlling the parsing of syntax is brittle. to this end, opam displays a warning if OPAMCLI specifies a valid version other than 2.0, and also if --cli=2.0 is specified. so yeah, you'll know π.
the command-line version is selected by using the --cli option or the OPAMCLI environment variable. --cli may be specified morethan once, where the last instance takes precedence. OPAMCLI is only inspected if --cli is not given.
π EXIT STATUS π
Okay bestie, listen up β this part is important because exit codes are how scripts know if you're slaying or spiraling. π
EXCEPTION ALERT: theexeccommand is not like the others. It returns127if the command wasn't found or couldn't be executed, and otherwise it just returns the command's own exit value. No cap, that's the one exception to everything below.
0β Success! Ortruefor boolean queries. We love a win. β¨1β False. Comes back when a boolean return value is expected, like when you run with--check, or for queries likeopam lint.2β Bad command-line arguments, or args that point at an invalid context (e.g. a file that isn't following the expected format). Rookie move, respectfully. π«Ά5β Not found. You asked for something (package, version, repository, etc.) and it literally could not be found. It's giving missing.10β Aborted. The operation needed confirmation and you didn't give it. You ghosted it. π»15β Could not acquire the locks required for the operation. Someone else has the vibe checked out, bestie.20β There is no solution to the user request. Like, this can happen when you ask to install two incompatible packages. The math isn't mathing. π30β Error in package definition, or other metadata files. Using--strictraises this error more often. (Strict mode is that friend who notices everything.)31β Package script error. Some package operations were unsuccessful. Could be an error in the packages, could be an incompatibility with your system. This can be a partial error β so not everything died, just some of it. π40β Sync error. Could not fetch some remotes from the network. Also can be a partial error. Wifi said no. π‘50β Configuration error. Opam or your system configuration doesn't allow this operation and it needs fixing. It's not you, it's the setup.60β Solver failure. The solver failed to return a sound answer. Could be a broken external solver, or an error in solver configuration. Not its fault, but also not your problem to fix at 3am.99β Internal error. Something went wrong, likely due to a bug in opam itself. Not you. Never you. Report it. π130β User interrupt.SIGINTwas received, generally because the user pressed Ctrl+C. You did this. We all do this.0β on success.123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs).
π FURTHER DOCUMENTATION π
See https://opam.ocaml.org/doc.
That's the lore drop. Go read it. π¦
π AUTHORS π
These are the icons who built this. Show some respect, bestie. π
- David Allsopp <david@tarides.com>
- Vincent Bernardoff <vb@luminar.eu.org>
- Raja Boujbel <raja.boujbel@ocamlpro.com>
- Kate Deplaix <kit-ty-kate@exn.st>
- Roberto Di Cosmo <roberto@dicosmo.org>
- Thomas Gazagnaire <thomas@gazagnaire.org>
- Louis Gesbert <louis.gesbert@ocamlpro.com>
- Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
- Anil Madhavapeddy <anil@recoil.org>
- Guillem Rieu <guillem.rieu@ocamlpro.com>
- Ralf Treinen <ralf.treinen@pps.jussieu.fr>
- Frederic Tuong <tuong@users.gforge.inria.fr>
π SEE ALSO π
opam admin(1)β the main character. Go read that one too, fr fr.
π BUGS π
Check bug reports at https://github.com/ocaml/opam/issues.
Found something cursed? Say it with your chest, in the issue tracker. β¨
And that's a wrap on the whole page, mwah π β this was Opam admin 2.6.1, page OPAM ADMIN-Uβ¦E-EXTRAFILES(1), and now you're officially educated. Go forth and update those extra-files, diva. ππ«Ά
π¦ where this page comes from
- arch rolling: opam 2.6.1-1 Β· LGPL-2.1-only
- fedora 44: opam 2.6.1-1.fc44 Β· LGPL-2.1-only WITH OCaml-LGPL-linking-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms