Mark H Weaver <m...@netris.org> skribis: >> Mark H Weaver <m...@netris.org> skribis: >>> + (upgrade (if (null? upgrade-regexps) >>> + '() >>> + (filter-map (match-lambda >>> + ((name _ _ _ _) >>> + (and (any (cut regexp-exec <> >>> name) >>> + upgrade-regexps) >>> + (find-package name))) >>> + (_ #f)) >>> + installed))) >> >> It’s actually slightly more complex: you need to select those packages >> that are installed and for which either a newer version is available >> (per ‘version-string>?’, see gnu-maintenance.scm; should be moved to >> utils.scm), or the version is identical and the output path differs (for >> instance because one of its dependencies has changed.) > > Okay. I was relying on the fact that attempts to install a derivation > that's already installed will ultimately be ignored, and my (admittedly > simple) tests seem to suggest that it works properly, but perhaps this > approach will be too inefficient when the profile contains a large > number of packages.
More importantly, you don’t want upgrade to downgrade. For instance, if guile-1.8.8 turns out to be before guile-2.0.7 in the package list, users who’ve installed the latter shouldn’t suddenly downgrade to the former. >> There are tests in guix-package.sh, but this one is going to be >> difficult to test without building the world. > > Would you be willing to write the tests? I think that my knowledge of > Guix is still too weak to do this job properly. (For that matter, it > was probably foolish of me to try to implement --upgrade at this early > stage in my explorations :) Well, you’re brave! :-) I’ll take care of the tests and -e. Thanks! Ludo’.