@@ -521,124 +521,6 @@ func UpdateCoreLibrariesIndex(ctx context.Context, req *rpc.UpdateCoreLibrariesI
521521 return nil
522522}
523523
524- // Outdated returns a list struct containing both Core and Libraries that can be updated
525- func Outdated (ctx context.Context , req * rpc.OutdatedRequest ) (* rpc.OutdatedResponse , error ) {
526- id := req .GetInstance ().GetId ()
527-
528- lm := GetLibraryManager (id )
529- if lm == nil {
530- return nil , & arduino.InvalidInstanceError {}
531- }
532-
533- outdatedLibraries := []* rpc.InstalledLibrary {}
534- for _ , libAlternatives := range lm .Libraries {
535- for _ , library := range libAlternatives .Alternatives {
536- if library .Location != libraries .User {
537- continue
538- }
539- available := lm .Index .FindLibraryUpdate (library )
540- if available == nil {
541- continue
542- }
543-
544- outdatedLibraries = append (outdatedLibraries , & rpc.InstalledLibrary {
545- Library : getOutputLibrary (library ),
546- Release : getOutputRelease (available ),
547- })
548- }
549- }
550-
551- pm := GetPackageManager (id )
552- if pm == nil {
553- return nil , & arduino.InvalidInstanceError {}
554- }
555-
556- outdatedPlatforms := []* rpc.Platform {}
557- for _ , targetPackage := range pm .Packages {
558- for _ , installed := range targetPackage .Platforms {
559- if installedRelease := pm .GetInstalledPlatformRelease (installed ); installedRelease != nil {
560- latest := installed .GetLatestRelease ()
561- if latest == nil || latest == installedRelease {
562- continue
563- }
564- rpcPlatform := PlatformReleaseToRPC (latest )
565- rpcPlatform .Installed = installedRelease .Version .String ()
566-
567- outdatedPlatforms = append (
568- outdatedPlatforms ,
569- rpcPlatform ,
570- )
571- }
572- }
573- }
574-
575- return & rpc.OutdatedResponse {
576- OutdatedLibraries : outdatedLibraries ,
577- OutdatedPlatforms : outdatedPlatforms ,
578- }, nil
579- }
580-
581- func getOutputLibrary (lib * libraries.Library ) * rpc.Library {
582- insdir := ""
583- if lib .InstallDir != nil {
584- insdir = lib .InstallDir .String ()
585- }
586- srcdir := ""
587- if lib .SourceDir != nil {
588- srcdir = lib .SourceDir .String ()
589- }
590- utldir := ""
591- if lib .UtilityDir != nil {
592- utldir = lib .UtilityDir .String ()
593- }
594- cntplat := ""
595- if lib .ContainerPlatform != nil {
596- cntplat = lib .ContainerPlatform .String ()
597- }
598-
599- return & rpc.Library {
600- Name : lib .Name ,
601- Author : lib .Author ,
602- Maintainer : lib .Maintainer ,
603- Sentence : lib .Sentence ,
604- Paragraph : lib .Paragraph ,
605- Website : lib .Website ,
606- Category : lib .Category ,
607- Architectures : lib .Architectures ,
608- Types : lib .Types ,
609- InstallDir : insdir ,
610- SourceDir : srcdir ,
611- UtilityDir : utldir ,
612- Location : lib .Location .ToRPCLibraryLocation (),
613- ContainerPlatform : cntplat ,
614- Layout : lib .Layout .ToRPCLibraryLayout (),
615- RealName : lib .RealName ,
616- DotALinkage : lib .DotALinkage ,
617- Precompiled : lib .Precompiled ,
618- LdFlags : lib .LDflags ,
619- IsLegacy : lib .IsLegacy ,
620- Version : lib .Version .String (),
621- License : lib .License ,
622- }
623- }
624-
625- func getOutputRelease (lib * librariesindex.Release ) * rpc.LibraryRelease {
626- if lib != nil {
627- return & rpc.LibraryRelease {
628- Author : lib .Author ,
629- Version : lib .Version .String (),
630- Maintainer : lib .Maintainer ,
631- Sentence : lib .Sentence ,
632- Paragraph : lib .Paragraph ,
633- Website : lib .Website ,
634- Category : lib .Category ,
635- Architectures : lib .Architectures ,
636- Types : lib .Types ,
637- }
638- }
639- return & rpc.LibraryRelease {}
640- }
641-
642524// LoadSketch collects and returns all files composing a sketch
643525func LoadSketch (ctx context.Context , req * rpc.LoadSketchRequest ) (* rpc.LoadSketchResponse , error ) {
644526 // TODO: This should be a ToRpc function for the Sketch struct
0 commit comments