RE: update rpm DB from a text file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Option One:
create a script that extracts the dpkg meta data then creates an empty archive with $NAME-$VERSION.tar.gz which contains nothing, or more scripts or config or text files and then writes a spec file, which it uses for running the command rpmbuild
Step 1. extract metadata
if /var/lib/dpkg/status change
[name$ = getfromstatus "/Name:'/ all characters to the write stop at return
[ version$= same but "/Version:']
etc.
etc.
Step 2. create empty tar
tar -createnewletters $name-$version.tar.gz
Step 3. write .spec file
 cat "blazay.spec" >> "EOF"
name$<br>
Version$
provides$
requires$
etc. etc.
no prep
no setup
no configure
no build
no make
no make install
%files
$provides
EOF
Step 4. build dummy rpm
rpmbuild -v -bb SPECS/blazay.spec
rpm -i RPMS/%{_arch}/New*pkg.rpm$
*****Most of the syntax is incorrect but you should understand the idea.
It creates an empty rpm that does nothing but add to the database.
Option Two:
 you can just build an rpm that is a replica of the .deb and install with
rpm -i debcopy.rpm --justdb
Option Three:
1. download alien
2. alien --help, alien --to-rpm
3. rpm -i newrpm.rpm --justdb

I think Step one is the most difficult, but is probably what you want, similar to update-initramfs, when dpkg is installing a debian it should automatically execute converting the new status entry to rpm db format and add it to the db. So, extract the new metainfo from status, then learn how to use said to insert the new data into the db files. For refrences in $prefix/lib/rpm there should be the script they use to add new installs to the database make copy of the script, modify the script to use the new dpkg status data then run the script without installing anything. Hope that helps.

Regards,
 
Bobby G. Smith Jr.



Date: Fri, 27 Jan 2012 16:27:54 +0530
Subject: update rpm DB from a text file
From: ravisankar.g@xxxxxxxxx
To: rpm-list@xxxxxxxxxxxxx

Hi list, 

I have a situation where, the (rpm & deb) packages installed in my Linux system are updated manually without using rpm or dpkg provided tools.  
However, after the update we need to sync the respective DB of rpm or dpkg to reflect the latest version, maintainer tags etc. 

I know how to achieve this using dpkg for deb files.  

Can someone give a pointers on how to achieve this for rpm files? 

I was thinking in the lines of,
1. extract the metadata from each upgraded rpm files to a text file. ( probably rpm -qip <.rpm> ?? )
2. modify the rpm DB data using the consolidated text file. 

Is this possible with existing tools?

--
BR,
Ravi Sankar Guntur.
http://www.ravisankar.org.in/

_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxxxxx http://lists.rpm.org/mailman/listinfo/rpm-list
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux