Package: cpio Version: 2.11+dfsg-1 Severity: wishlist Tags: patch This is an idea for a mailcap for cpio to list the archive contents. tar and unzip have similar for tar and zip files.
The "debian/cpio.mime" file below is installed by the rules.diff below to /usr/lib/mime/packages/cpio and the mime-support package does the rest. With this it's then possible to "see" a cpio file, echo /usr/share/base-files/motd | cpio -o >/tmp/foo.cpio see /tmp/foo.cpio => -rw-r--r-- 1 root root 286 May 6 22:45 /usr/share/base-files/motd 1 block (The filename cpio.mime is per debhelper dh_installmime, which is not used now of course, but if it ever was then it would suit.)
--- rules.orig 2013-06-01 11:12:17.000000000 +1000 +++ rules 2013-10-24 09:27:37.000000000 +1100 @@ -104,11 +104,13 @@ # Install directories $(INSTALL_DIR) \ debian/tmp/bin \ + debian/tmp/usr/lib/mime/packages \ debian/tmp/usr/share/man/man1 \ debian/tmp/usr/share/info # Install files $(MAKE) -C obj install DESTDIR=$(CURDIR)/debian/tmp rm -rf debian/tmp/usr/libexec + install -m 644 debian/cpio.mime debian/tmp/usr/lib/mime/packages/cpio mv debian/tmp/bin/mt debian/tmp/bin/mt-gnu mv debian/tmp/usr/share/man/man1/mt.1 \ debian/tmp/usr/share/man/man1/mt-gnu.1
# priority=1 so that an interactive archive viewer or browser can have # precedence over simple contents listing (eg. file-roller). # # priority=0 for the tar handlers so as to prefer a native tar program # over the support in cpio. # # No '%s' so receive content on stdin which suits cpio's normal # operation and means run-mailcap or similar can give a pipe rather # than a temp file. --list is one-pass so the input doesn't need to # be seekable etc. # application/x-cpio; /bin/cpio --list --verbose; copiousoutput; priority=1 application/x-bcpio; /bin/cpio --list --verbose; copiousoutput; priority=1 application/x-sv4cpio; /bin/cpio --list --verbose; copiousoutput; priority=1 application/x-tar; /bin/cpio --list --verbose; copiousoutput; priority=0 application/x-gtar; /bin/cpio --list --verbose; copiousoutput; priority=0 application/x-ustar; /bin/cpio --list --verbose; copiousoutput; priority=0
-- System Information: Debian Release: jessie/sid Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core) Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/dash Versions of packages cpio depends on: ii libc6 2.17-93 cpio recommends no packages. Versions of packages cpio suggests: ii libarchive1 2.8.4.forreal-1+squeeze2 -- no debconf information