Announcement

Collapse
No announcement yet.

folder comparison for linux *.rpm files

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • folder comparison for linux *.rpm files

    I'm using BC3 64bit windows 7, and wanted to compare files loaded on a server with the actual files delivered in an *.rpm file.
    Files/directory compare works fine if *.war files are used. (jar container)
    example: left side = "c:\somefile.war\opt\jar\"
    Right side for compare has
    "sftp://name@server.com//opt/jar/"
    BC in this case compares the contents of the *.war file with the matching directory on the server where the jar files have been unpacked.
    Using a script to do this requires:
    Load "folder_nodate"
    Load "C:\Baseline\disco.war\WEB-INF\lib\" "sftp://name@server1.local//opt/platform/java/lib/ncp_disco/"
    filter "ncp_disco.jar"
    compare CRC
    folder-report layout:side-by-side &
    options:display-no-orphans,column-crc &
    title:disco.jar &
    output-to:disco.jar_%date%.html output-options:html-color

    The compare looks at contents of lib/ncp_disco/disco.jar and disco.war\WEB-INF\lib\disco.jar

    This doesn't work for *.rpm files. I thought BC3 would open rpm files natively but it seems that it needs a plugin from Ghisler to achieve this. I used the totalzip plugin to open the rpm/cpio files.

    If a script run is attempted:
    Load "folder_nodate"
    Load "C:\Baseline\instal.rpm\instal.cpio\.\opt\app\ " "sftp://name@server1.local//opt/app/"
    filter "file.sh"
    compare CRC
    folder-report layout:side-by-side &
    options:display-no-orphans,column-crc &
    title:file.sh &
    output-to:file.sh_%date%.html output-options:html-color
    The dreaded "unable to load base directory" is received. The compare can be done using the BC3 gui. However if there is an attempt made to open in new view "C:\Baseline\instal.rpm\instal.cpio\.\opt\app\ " it fails with folder not available??
    I suspect the problem is that its opening 2 archives, one for rpm, and another for cpio and gets lost.
    Any ideas on how to solve the scripting case? Should Windows BC3 open *.rpm natively? Is there an association that needs to be added to the standard unpackers for it work properly rather than use the ghisler plugin?

  • #2
    Anyone know if it is possible to add rpm2cpio and cpio as external commands to BC3 so that the rpm file is extracted to some subfolder that BC3 will automatically follow?
    Using cpio from cygwin and rpm2cpio shell script under cygwin extracts the rpm to a subfolder easily, but I don't know how to trigger the script or bat file if an rpm is viewed in BC.
    command line: rpm2cpio myrpmfile.rpm | cpio -idmv will extract all folders to current directory.

    Comment


    • #3
      Which RPM plug-in would you be using? Is it one of those from this webpage?
      http://www.ghisler.com/plugins.htm

      The compare can be done using the BC3 gui. However if there is an attempt made to open in new view "C:\Baseline\instal.rpm\instal.cpio\.\opt\app\ " it fails with folder not available??
      Let's get this scenario working before we try to get script working. It is often easier to troubleshoot the GUI than scripting.

      Also, are you using the latest release of BC3 (3.3.5)? A 3.x user can update to any BC 3.x release for free from our website, or using the Help menu -> Check for Updates

      Would it be possible to email us a pair of trouble files (with the CPIO inside of an RPM) which we can then recreate this scenario with? If you email us at support@scootersoftware.com please include a link to this forum thread for our reference.
      Aaron P Scooter Software

      Comment


      • #4
        Thanks for the email and files. I was able to test this scenario and I think I've figured out what issue you are running into.


        The issue is not nested archives, but your directory that is just a ".". This is an Unix holdover for the current directory, and shouldn't be part of the archive. Handling this case is something we could try to work on as we upgrade our archive support, but is not something we would be able to do short term. The best solution would be to track down what during the creation process is adding this directory into the archive and updating it or changing the options so it does not place a "." into the archive.
        Aaron P Scooter Software

        Comment


        • #5
          Aaron
          thanks for the feedback.

          The "." is always part of the rpm when unpacked under windows.
          The rpm I forwarded to you was just a random one from the RedHat 6 install DVD. It is not something I packaged. So obviously I can't do anything about how RedHat package their files. The actual work I was doing is with rpm's supplied by IBM to our company, and they are packaged using the same tools as RedHat.

          I used 7zip manager to see what it does with rpm's and of course it shows the filename.cpio/./ , the ghisler plugin is based on the 7zip library. I also tried the rpm/cpio plugin from ghisler in BC3 but it does the same thing. I looked around to see if there were any other windows programs that can view rpm, but it looks like nearly all the windows programs use some version of the 7zip library.

          I tested with the Linux version of BC3 on Debian 64bit Testing (wheezy), and it works fine with the rpm packages. I looked through the linux binary file for BC and saw that it has text fields indicating it uses the rpm2cpio and cpio program from the installed linux base.

          As I asked in the forum, is there a way to use rpm2cpio as an external program in BC3 (rpm2cpio | cpio -idmv) ? I tested a shell script mimicking rpm2cpio and cpio from cygwin and it extracts the files to the correct directory without the "filename.cpio/./", so a batch file might be able to be constructed that will open any rpm to a temp directory that would allow BC3 to continue its compare inside the rpm? I don't know how BC3 works with the external programs, but it would need to append the unpacked directory onto the directory/filename in the directory list box.

          thanks

          /phil

          Comment


          • #6
            Aaron

            excellent, it works fine with scripting.
            Again, excellent work.

            thanks

            /Phil

            From: Scooter Support <support@scootersoftware.com>
            To:

            Subject: Re: rpm file directory comparison

            Hello Phil,

            I found a workaround for you. Use your current 7zip total commander plug-in for RPM, but use a different plugin for the CPIO extension: http://www.totalcmd.net/plugring/rpmcpio.html (and not the RPM)
            This should work and strip out the '.' from the Folder Compare view.

            Our Windows and Linux version do have some limitations based on the platform they run on, and we do not have the built-in support available for RPMs in the Windows version. Unfortunately, it is not something we can simply enable or have chosen to disable, hence the need for a Total Commander plug-in.

            Does this workaround get things working for you?
            -Aaron
            Last edited by psalty; 01-Feb-2013, 06:30 PM. Reason: remove email addresses in quote

            Comment

            Working...
            X