From: Jeff Johnson <jbj@redhat.com>
Reply-To: rpm-list@redhat.com
To: rpm-list@redhat.com
Subject: rh-rpm] Re: FDW: another rpm tool : rpmrebuild

On Wed, Jul 31, 2002 at 02:30:54PM -0400, R P Herrold quoted Eric Gerbier:
>
> rpmrebuild is a tool to build an RPM file from a package that has
> already been installed
> I know there is an "repackage" option in recent rpm releases, but itis
> not convenient, as you have to uninstall the package

Just for the record:
rpm --repackage is an entirely different beastie than rpmrebuild. For starters, --repackage puts modified files (with failing MD5 sums) in the payload, skips missing files entirely, and appends a RPMTAG_REMOVETID tag to the header when attempting to recreate the original package. That means that the recreated package is *NOT* the same as the original package, nor will a repackaged package install like the original package. Please don't even think about distributing packages that were recreated using rpm --repackage.
73 de Jeff


And the thread continued:
> yep ... (nods) -- I have never futz'd with repackage in RPM,
> and really do not see why I would, so long as sources are
> available to me -- easier to just rpmbuild a new copy, and get
> all the other benefits.
>
> Does rpm --repackage make any guesses as to pre- and post-
> scripting based on the rpm database; when is: rpm --repackage
> _sensibly_ used?

The --repackage option can provide archival/disaster recovery for packages, by putting the old bits into a package before erasing from the file system.

The --repackage option is also the starting point for --rollback, which recreates transactions in reverse, reinstalling previously installed, erasing newly installed, packages, transaction by transaction.

What's still tricky with --repackage is that, under common conditions, like having locale files, there's simply no way to recreate the original package. rpm can't repackage bits it does not have. So reinstalling the previous binary package, or rebuilding from a src.rpm, is probably more reliable package management than --rollback. Of course you may have to deal with *.rpmnew et al changes, not the case with --rollback, but not hard.