07-26-2022 09:01 PM
Is it possible to run some command to validate if a feed URL is valid, that is a) can be reached, b) has suitable contents/configuration to be used as an NIPM feed?
(I'm fine with just 'b', but I don't see how you could get that without 'a', so I guess establishing 'b' requires 'a').
I see that "update" takes a(n optional) list of feed names, so perhaps that can be used and the response message parsed? Is that message designed to be stable?
e.g.
> nipkg update "validfeedname"
Updating validfeedname cache... done.
> nipkg update "nonsensename"
Updating nonsensename cache... failed.
Error -125951: Failed to update one or more feeds:
nonsensename
> $LASTEXITCODE
-125951
> $LASTEXITCODE.equals(-125951)
True
Whilst writing this I've become pretty sure that this will be fine, but still posting because a) it might help someone else, and b) someone else might have a better way 🙂
Solved! Go to Solution.
07-28-2022 07:40 AM
Hi cbutcher -
When NI Package Manager refreshes its feeds so that it can display the list of packages listed in each feed, it is effectively doing the same thing as "nipkg.exe update", which downloads the manifest file and reads the list of packages. What the command does not do is validate that the path to the package file is valid. There is no nipkg.exe command to validate paths to the packages other than trying to downloads say using "nipkg.exe download-feed".
07-28-2022 08:08 AM
07-29-2022 11:30 AM
cbutcher -
I dug a little deeper.
1) A call to "nipkg.exe update" will read the "Packages.gz" file and cache its "Packages" file in the "C:\ProgramData\National Instruments\NI Package Manager\raw" directory, but it does NOT validate the contents.
2) You can use the "nipkg.exe list" command to have parse all the cached Packages files, and this will report if anything is malformed within any of the Packages files.
What you use as a search criteria does not matter, all the files will be read, listed if matching and then the error is output:
C:\Users\scott>nipkg.exe list foobar
Error -125043: Attribute name 'Package' does not exist.