[zypp-devel] Found bug in RPM... should I report? Plans for RPM 4.7?
Hi, I'm playing with rpmlib and it seems to me that headerRead() fails. I could open a bug report... upstream would not accept it, and not sure if it makes sense to open it for openSUSE. What are the plans for RPM 4.7 (or 5.x)? Will be used in 11.2? The problem is that in this simple code headerRead always returns NULL. Isn't easy to debug optimized code but it seems the HEADER_MAGIC_YES detection fails (with HEADER_MAGIC_NO fails in another header check). #include <rpm/rpmlib.h> int main(int argc, char ** argv) { Header h; FD_t fdi; fdi = Fopen(argv[1], "r"); if (Ferror(fdi)) { fprintf(stderr, "cannot open %s: %s\n", argv[1], Fstrerror(fdi)); exit(EXIT_FAILURE); } h = headerRead(fdi, HEADER_MAGIC_YES); if (!h) { fprintf(stderr, "headerRead error: %s\n", Fstrerror(fdi)); exit(EXIT_FAILURE); } Fclose(fdi); } -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wed, Jul 08, 2009 at 03:07:59PM +0200, Cristian Morales Vega wrote:
I'm playing with rpmlib and it seems to me that headerRead() fails. I could open a bug report... upstream would not accept it, and not sure if it makes sense to open it for openSUSE. What are the plans for RPM 4.7 (or 5.x)? Will be used in 11.2?
The plan is to go to 4.7 for 11.2.
The problem is that in this simple code headerRead always returns NULL. Isn't easy to debug optimized code but it seems the HEADER_MAGIC_YES detection fails (with HEADER_MAGIC_NO fails in another header check).
Shouldn't you skip the lead first, i.e. call readLead()? You probably also need to read the signarures with rpmReadSignature(). Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
2009/7/8 Michael Schroeder <mls@suse.de>:
On Wed, Jul 08, 2009 at 03:07:59PM +0200, Cristian Morales Vega wrote:
I'm playing with rpmlib and it seems to me that headerRead() fails. I could open a bug report... upstream would not accept it, and not sure if it makes sense to open it for openSUSE. What are the plans for RPM 4.7 (or 5.x)? Will be used in 11.2?
The plan is to go to 4.7 for 11.2.
There is any RPM 4.7 package available already to test?
The problem is that in this simple code headerRead always returns NULL. Isn't easy to debug optimized code but it seems the HEADER_MAGIC_YES detection fails (with HEADER_MAGIC_NO fails in another header check).
Shouldn't you skip the lead first, i.e. call readLead()? You probably also need to read the signarures with rpmReadSignature().
Now I have to go, but I will check. Makes sense, I just supposed it would skip them by itself. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Cristian Morales Vega
-
Michael Schroeder