Skip to content

Usage RpmReaderNet

Alexcei edited this page Oct 2, 2019 · 14 revisions

Examples

  • Read information from package via properties of the class

      using (RpmReader reader = new RpmReader("<file>"))
      {
            string name = reader.Name; // read name package
            string version = reader.Version; // read version package
            string commonInfo = reader.ToString(); // override method ToString() for getting a common information about package
      }
    

    All supporting properties:

    • Name - a name of the package
    • Version - a version of the package
    • Release - a release number of the package
    • Serial - a serial number of the package
    • Summary - a summary information about the package
    • Description - a description of the package
    • BuildTime - a build time of the package
    • BuildHost - a host hame where was build package
    • Distribution - a group name of packages, of which this package is a part
    • Vendor - a name of the entity that is responsible for a package
    • License - a license of the package
    • Packager - a name and contact information for the person or persons who built the package
    • Changelog - a log or record of all or all notable changes made to a package
    • Source - a original source files name
    • SourceRpm - a name of the source package from which this binary package was builtChecking a file that it has a rpm format.
    • Arch - a architecture for which the package was built
    • PreinScripts - get content of the package's pre-install script
    • PostinScripts - get content of the package's post-install script
    • PreunScripts - get content of the package's pre-uninstall script
    • PostunScripts - get content of the package's post-uninstall script
    • Size - a total size, in bytes, of every file installed by a package
    • BaseFileNames - a list of all base names files in package
    • DirNames - a list of all dirs in package
    • RequiresNames - a list of capabilities the package requires
    • DirIndexes - indexes of dir for link between the file name and directory
    • FileUserNames - a owner, in alphanumeric form, of each of the files that comprise the package
    • FileGroupNames - a group, in alphanumeric form, of each of the files that comprise the package
    • FileSize - a size, in bytes, of each of the files that comprise the package
    • MD5Files - a MD5 checksum for each of the files that comprise the package
    • MD5Signature - MD5 signatures of files from package
    • GPGSignature - a GPG signature of package
    • PGPSignature - a PGP signature of package
    • SHA1Signature - a SHA hash of package
    • DSASignature - a DSA signature of package
    • RSASignature - a RSA signature of package
  • Checking the file that it has valid rpm format

      using (RpmReader reader = new RpmReader("<file>"))
      {
          bool isRpm = reader.Validate();
      }
    

The method Validate returns true if the file is matched rpm format else false.

  • Extracting all files from package

      using (RpmReader reader = new RpmReader("<file>"))
      {
          reader.ExtractPackage("<destfolder>");
      }
    

The method ExtractPackage takes one argument - a root destinition folder where to extract files.

Clone this wiki locally