//private readonly string fsPath = "fsNew"; public Package(Repository repository) { Repository = repository; Logger = LogManager.GetCurrentClassLogger(); downloader = new HttpRemoteDownloader(); elfReader = new ElfReader(); }
public async Task Info(InfoOptions opts) { Logger.Info($"Information about '{opts.FileOrPackageName}':"); var elfReader = new ElfReader(); if (File.Exists(opts.FileOrPackageName) && elfReader.TryProcessElfFile(opts.FileOrPackageName, out var soName, out var depends)) { Logger.Info($"SoName: {soName}"); Logger.Info($"Depends: {string.Join(", ", depends)}"); return; } await Browser.UpdatePackageCache(); var package = Browser.FindPackage(new Dependency(new Dependency.IndividualDependency { Package = opts.FileOrPackageName, Comparer = Comparer.NoOp, Version = "" })); if (package == null) { Logger.Error($"Could not find file or package '{opts.FileOrPackageName}'"); return; } Logger.Info($"Package: {package}"); var deps = new ConcurrentDictionary <string, Package>(); await RecursivelyFindDependencies(deps, Browser, package); Logger.Info($"Has {deps.Count} dependencies"); foreach (var dep in deps) { Logger.Info($"- {dep.Value}"); } var files = (await package.GetFileList()).ToList(); Logger.Info($"Installs the following {files.Count} files:"); foreach (var file in files) { Logger.Info($"- {file}"); } }