[oi-dev] elegant way to get leaf packages?
stes@PANDORA.BE
stes at telenet.be
Sun Dec 26 13:58:01 UTC 2021
I am not sure I understand your question. Please clarify.
However I can add that I once used "pkg exact-install"
for something that sounds a little bit like what you are asking.
Perhaps this can be used in combination with -n -v dry run verbose.
pkg install <somepackage> installs a package
pkg exact-install <somepackage> installs a package but removes all "leaf packages" (?) that are not a dependency of the given package.
Check the pkg manpage for exact-install.
WARNING: always first make a backup BE before testing exact-install because it will remove packages that are not a dependency.
I am using (sometimes) exact-install in an attempt to uninstall "recursively" although that's probably the wrong terminology.
Regards,
David Stes
----- Op 26 dec 2021 om 4:36 schreef oi-dev oi-dev at openindiana.org:
> All-
>
> Is there an elegant way using pkg (or some other method) to get all
> OpenIndiana "leaf" packages, i.e. packages that are not a dependency of
> some other package?
>
> I know how to get this using a brute-force method that is essentially
>
> all_packages=`pkg list -a | some filtering here`
> for p in `echo $all_packages`
> do
> pkg search -r -o pkg.name "depend:require:$p" > depends-upon-$p
> done
>
> I'm just wondering if there is a more clever, or perhaps less intensive
> on the publisher server, way to get the same info?
>
> Thanks,
>
> Tim
> --
> Tim Mooney Tim.Mooney at ndsu.edu
> Enterprise Computing & Infrastructure /
> Division of Information Technology / 701-231-1076 (Voice)
> North Dakota State University, Fargo, ND 58105-5164
>
> _______________________________________________
> oi-dev mailing list
> oi-dev at openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
More information about the oi-dev
mailing list