Unpack rpm in gradle

Viewed 151

I want to download an existing rpm then extract it to get a file and move the contents to somedestination. I know that you can tar -xvf rpm file, or use rpm2cpio .rpm on command line.

task downloadSomeRpm(type: Download) {
    src "this.rpm"
    dest "somedestination"
}

task extractItem(type: Copy) {
    dependsOn downloadSomeRpm
    from ("somedestination/this.rpm")
    into someDir
}

Above, this will copy the rpm to someDir, but I want to extract it then copy the contents, I have tried from (tarTree(resources.gzip - but obviously there is an error, and also tried looking into ospackage but it looks like that is for creating rpms, when I have an existing rpm, or maybe I just can't find the right documentation. Couldn't find anything from googling too. What's the best way to go about this? thanks

0 Answers
Related