GithubHelp home page GithubHelp logo

ruby-arr-pm's Introduction

ARRRRRRRRRR PM

RPM reader/writer library written in Ruby.

It aims to provide fpm with a way to read and write rpms.

Why not use librpm?

The API is quite confusing in many places, poorly documented in most. I have reached out to some CentOS/rpm folks to see what we can do about improving that API.

Even still, librpm has dependencies of its own. I want fpm to be able to read and write RPMs without requiring and endless chain of dependencies and most especially without requiring root access to get things going.

Mainly, if I try to build librpm myself, I get this: "configure: error: missing required NSPR / NSS header" and I'm not the burden of dependency resolution on fpm users.

API ideas

It should be possible to do a read+modify+write on an RPM.

Creating an RPM (proposed API)

rpm = RPM.new

# requires and conflicts
rpm.requires("name") <= "version" # Something fun-dsl-likef
rpm.requires("name", :<=, "version") # Or maybe something like this

# provides
rpm.provides("name")

# Add some files
rpm.files << path
rpm.files << path2
rpm.files << path3

# Scripts?
rpm.scripts[:preinstall](path_or_script_string)
rpm.scripts[:postinstall](path_or_script_string)
rpm.scripts[:preuninstall](path_or_script_string)
rpm.scripts[:postuninstall](path_or_script_string)

rpm.write(output_file_name)

Reading an RPM (proposed API)

rpm = RPM.read(file)

rpm.requires   # Array of RPM::Requires ?
rpm.provides   # Array of 'Provides' strings?
rpm.conflicts  # Array of RPM::Conflicts ?
rpm.files      # Array of RPM::File ?

Maybe something like:

rpm.files.each do |file|
  # Tags that are defined in rpm header tags
  # fileclass filecolors filecontexts filedependsn filedependsx filedevices
  # filedigests fileflags filegroupname fileinodes filelangs filelinktos
  # filemodes filemtimes filerdevs filesizes fileusername fileverifyflags 
  #
  # frankly, we don't care about most of these. Meaningful ones:
  # username, groupname, size, mtime, mode, linkto

  # file.io could give a nice IO-like thing that let you read the file out
  # of the rpm
end

ruby-arr-pm's People

Contributors

jordansissel avatar rtucker11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.