Initial revision
authormarc <devnull@localhost>
Mon, 18 Dec 1995 20:31:09 +0000 (20:31 +0000)
committermarc <devnull@localhost>
Mon, 18 Dec 1995 20:31:09 +0000 (20:31 +0000)
CVS patchset: 57
CVS date: 1995/12/18 20:31:09

tools/rpmarchive.c [new file with mode: 0644]
tools/rpmheader.c [new file with mode: 0644]
tools/rpmlead.c [new file with mode: 0644]

diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c
new file mode 100644 (file)
index 0000000..f0abec9
--- /dev/null
@@ -0,0 +1,32 @@
+/* rpmarchive: spit out the main archive portion of a package */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "spec.h"
+#include "pack.h"
+#include "header.h"
+
+int main(int argc, char **argv)
+{
+    int fd;
+    char buffer[1024];
+    Header hd;
+    int ct;
+    
+    if (argc == 1) {
+       fd = 0;
+    } else {
+       fd = open(argv[1], O_RDONLY, 0644);
+    }
+
+    read(fd, &buffer, RPM_LEAD_SIZE);
+    hd = readHeader(fd);
+
+    while ((ct = read(fd, &buffer, 1024))) {
+       write(1, &buffer, ct);
+    }
+    
+    return 0;
+}
diff --git a/tools/rpmheader.c b/tools/rpmheader.c
new file mode 100644 (file)
index 0000000..8e37387
--- /dev/null
@@ -0,0 +1,27 @@
+/* rpmheader: spit out the header portion of a package */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "header.h"
+#include "pack.h"
+
+int main(int argc, char **argv)
+{
+    int fd;
+    char buffer[1024];
+    Header hd;
+    
+    if (argc == 1) {
+       fd = 0;
+    } else {
+       fd = open(argv[1], O_RDONLY, 0644);
+    }
+
+    read(fd, &buffer, RPM_LEAD_SIZE);
+    hd = readHeader(fd);
+    writeHeader(1, hd);
+    
+    return 0;
+}
diff --git a/tools/rpmlead.c b/tools/rpmlead.c
new file mode 100644 (file)
index 0000000..a71a2ea
--- /dev/null
@@ -0,0 +1,24 @@
+/* rpmlead: spit out the lead portion of a package */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "pack.h"
+
+int main(int argc, char **argv)
+{
+    int fd;
+    char buffer[1024];
+    
+    if (argc == 1) {
+       fd = 0;
+    } else {
+       fd = open(argv[1], O_RDONLY, 0644);
+    }
+
+    read(fd, &buffer, RPM_LEAD_SIZE);
+    write(1, &buffer, RPM_LEAD_SIZE);
+    
+    return 0;
+}