summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authormarc <devnull@localhost>1995-12-18 20:31:09 +0000
committermarc <devnull@localhost>1995-12-18 20:31:09 +0000
commita0caa9c79cfc7cd170b317a6eca3475c52af814c (patch)
treec077d8293540501fba157f83dbce8c37c2ac70bb /tools
parentd5b37d3e38a91a11f3a95da5fbc4154dbc643f5e (diff)
downloadrpm-a0caa9c79cfc7cd170b317a6eca3475c52af814c.tar.gz
rpm-a0caa9c79cfc7cd170b317a6eca3475c52af814c.tar.bz2
rpm-a0caa9c79cfc7cd170b317a6eca3475c52af814c.zip
Initial revision
CVS patchset: 57 CVS date: 1995/12/18 20:31:09
Diffstat (limited to 'tools')
-rw-r--r--tools/rpmarchive.c32
-rw-r--r--tools/rpmheader.c27
-rw-r--r--tools/rpmlead.c24
3 files changed, 83 insertions, 0 deletions
diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c
new file mode 100644
index 000000000..f0abec9cf
--- /dev/null
+++ b/tools/rpmarchive.c
@@ -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
index 000000000..8e37387c3
--- /dev/null
+++ b/tools/rpmheader.c
@@ -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
index 000000000..a71a2ea12
--- /dev/null
+++ b/tools/rpmlead.c
@@ -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;
+}