Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/archival/rpm2cpio.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 815 by niro, Sat Sep 1 22:45:15 2007 UTC revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC
# Line 6  Line 6 
6   *   *
7   * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.   * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8   */   */
9  #include "busybox.h"  #include "libbb.h"
10  #include "unarchive.h"  #include "unarchive.h"
11    
12  #define RPM_MAGIC "\355\253\356\333"  #define RPM_MAGIC "\355\253\356\333"
13  #define RPM_HEADER_MAGIC "\216\255\350"  #define RPM_HEADER_MAGIC "\216\255\350"
14    
15  struct rpm_lead {  struct rpm_lead {
16      unsigned char magic[4];   unsigned char magic[4];
17      uint8_t major, minor;   uint8_t major, minor;
18      uint16_t type;   uint16_t type;
19      uint16_t archnum;   uint16_t archnum;
20      char name[66];   char name[66];
21      uint16_t osnum;   uint16_t osnum;
22      uint16_t signature_type;   uint16_t signature_type;
23      char reserved[16];   char reserved[16];
24  };  };
25    
26  struct rpm_header {  struct rpm_header {
# Line 49  static void skip_header(int rpm_fd) Line 49  static void skip_header(int rpm_fd)
49  }  }
50    
51  /* No getopt required */  /* No getopt required */
52    int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
53  int rpm2cpio_main(int argc, char **argv)  int rpm2cpio_main(int argc, char **argv)
54  {  {
55   struct rpm_lead lead;   struct rpm_lead lead;
# Line 78  int rpm2cpio_main(int argc, char **argv) Line 79  int rpm2cpio_main(int argc, char **argv)
79   bb_error_msg_and_die("invalid gzip magic");   bb_error_msg_and_die("invalid gzip magic");
80   }   }
81    
82   check_header_gzip(rpm_fd);   if (unpack_gz_stream(rpm_fd, STDOUT_FILENO) < 0) {
  if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {  
83   bb_error_msg("error inflating");   bb_error_msg("error inflating");
84   }   }
85    

Legend:
Removed from v.815  
changed lines
  Added in v.816