Commit a9f57b44 authored by Brian White's avatar Brian White

git-debimport mime-support_2.12-1.tar.gz

parent 231863df
mime-support (2.12-1) frozen unstable; urgency=low
* added more descriptive error for incorrectly formatted mailcap file
* removed "test" hack added to help netscape (slowed lynx) (bug#7294)
-- Brian White <bcwhite@verisim.com> Wed, 2 Apr 1997 14:29:49 -0500
mime-support (2.11-1) unstable; urgency=low
* added hack to work around Netscape's test bug (Bug#7030)
-- Brian White <bcwhite@verisim.com> Wed, 5 Feb 1997 16:00:48 -0500
mime-support (2.10-1) unstable; urgency=low
* added new application/dsptype to mime.types
* added new application/rtf to mime.types
* added new application/png to mime.types (Bug#6611)
-- Brian White <bcwhite@verisim.com> Wed, 11 Dec 1996 21:42:10 -0500
mime-support (2.09-1) unstable; urgency=low
* removed use of perl extensions so no postinst/prerm errors
* added check to make sure /etc/mailcap is valid (Bug#5848)
-- Brian White <bcwhite@verisim.com> Wed, 11 Dec 1996 21:42:10 -0500
mime-support (2.08-2) frozen unstable; urgency=low
* added dependancy on perl
......
......@@ -6,7 +6,7 @@ Standards-Version: 2.1.1.0
Package: mime-support
Architecture: all
Depends: perl (>=5.003.07)
Depends: perl | perl-base
Description: MIME files 'mime.types' & 'mailcap', and support programs
As these files can be used by all MIME compliant programs, they
have been moved into their own package that others can depend upon.
......
mime-support_2.08-2_all.deb net standard
#! /bin/sh
#! /bin/sh -e
###############################################################################
#
# Postinst for mime-support to add useful MIME utility programs
......@@ -10,11 +10,14 @@
install-mime --install --package=mime-support --content=application/x-debian-package \
--description="Debian GNU/Linux Package" --nametemplate="%s.deb" \
--view="/usr/lib/mime/debian-view %s" --needsterminal=t \
--comment="This entry should appear after any entries with test conditions."
--comment="This entry should probably appear after any entries with test conditions."
# Support basic audio files
install-mime --install --package=mime-support --content=audio/basic \
--description="Basic uLaw Audio" --nametemplate="%s.au" \
--view="/usr/lib/mime/playaudio %s" \
--comment="This entry should appear after any entries with test conditions."
--view="/usr/lib/mime/playaudio %s"
# Remove test-hack directory
rm -rf /var/lib/mime/tests
#! /bin/sh -e
###############################################################################
#
# Postrm for mime-support to remove MIME utility programs
#
###############################################################################
if [ "$1" = "purge" ]; then
rm -f /var/lib/mime/tests/*
fi
......@@ -6,4 +6,6 @@
###############################################################################
# Ignore any errors on this remove. Otherwise, trying to reinstall because
# of a bad /etc/mailcap file will fail.
install-mime --remove --package=mime-support
......@@ -14,6 +14,7 @@ default:
clean:
test -f debian/rules
rm -f debian/substvars debian/files
-rm -rf debian/tmp debian/*~ *~
build:
......@@ -24,31 +25,38 @@ binary:
test root = "`whoami`"
-rm -rf debian/tmp
mkdir -p debian/tmp/DEBIAN debian/tmp/etc debian/tmp/var/lib/mime debian/tmp/usr/lib/mime
mkdir -p debian/tmp/usr/doc/$(package) debian/tmp/usr/sbin debian/tmp/usr/man/man8
mkdir -p debian/tmp/usr/doc/$(package) debian/tmp/usr/sbin debian/tmp/usr/bin
mkdir -p debian/tmp/usr/man/man1 debian/tmp/usr/man/man8
# mkdir -p debian/tmp/var/lib/mime/tests
chmod -R 755 debian/tmp
cp mime.types debian/tmp/etc/
cp mailcap debian/tmp/etc/
cp debian/README debian/tmp/usr/doc/$(package)/Copyright
cp install-mime debian/tmp/usr/sbin/
cp install-mime.8 debian/tmp/usr/man/man8/
cp rfc1521.txt debian/tmp/usr/doc/$(package)/
cp rfc1522.txt debian/tmp/usr/doc/$(package)/
cp rfc1524.txt debian/tmp/usr/doc/$(package)/
cp basic-mime debian/tmp/usr/doc/$(package)/mime-install.HOWTO
cp mime-db debian/tmp/var/lib/mime/
install -m 644 mime.types debian/tmp/etc/
install -m 644 mailcap debian/tmp/etc/
install -m 644 debian/README debian/tmp/usr/doc/$(package)/copyright
install -m 644 debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
install -m 755 install-mime debian/tmp/usr/sbin/
install -m 644 install-mime.8 debian/tmp/usr/man/man8/
install -m 755 run-mailcap debian/tmp/usr/bin/
install -m 644 run-mailcap.1 debian/tmp/usr/man/man1/
install -m 644 rfc1521.txt debian/tmp/usr/doc/$(package)/
install -m 644 rfc1522.txt debian/tmp/usr/doc/$(package)/
install -m 644 rfc1524.txt debian/tmp/usr/doc/$(package)/
install -m 644 basic-mime debian/tmp/usr/doc/$(package)/mime-install.HOWTO
install -m 644 mime-db debian/tmp/var/lib/mime/
install -m 755 debian-view debian/tmp/usr/lib/mime/
install -m 755 playaudio debian/tmp/usr/lib/mime/
install -m 755 playdsp debian/tmp/usr/lib/mime/
install -m 755 debian/postinst debian/tmp/DEBIAN/postinst
install -m 755 debian/prerm debian/tmp/DEBIAN/prerm
install -m 755 debian/postrm debian/tmp/DEBIAN/postrm
install -m 755 debian/conffiles debian/tmp/DEBIAN/conffiles
gzip -9fv debian/tmp/usr/man/man8/* debian/tmp/usr/doc/$(package)/*
cd debian/tmp/usr/man; gzip -9fv */*
cd debian/tmp/usr/doc/$(package); gzip -9v *
cd debian/tmp/usr/doc/$(package); ln -s rfc1521.txt.gz mime-1.txt.gz
cd debian/tmp/usr/doc/$(package); ln -s rfc1522.txt.gz mime-2.txt.gz
cd debian/tmp/usr/doc/$(package); ln -s rfc1524.txt.gz mailcap.txt.gz
dpkg-gencontrol -is -ip
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
dpkg-gencontrol -is -ip
dpkg --build debian/tmp
dpkg-name -o -s .. debian/tmp.deb
......@@ -43,13 +43,6 @@
#
# Required perl extensions
#
require IO::Handle;
#
# Program Constants
#
......@@ -123,6 +116,35 @@ sub Reformat {
#
# Subroutine to work around netscape's test bug
#
sub TestHack {
my($test) = @_;
my $file = $test;
$file =~ s/!=/ne/g;
$file =~ s/=/eq/g;
$file =~ s/&&/and/g;
$file =~ s/\|\|/or/g;
$file =~ s/\W+//g;
$file = "/var/lib/mime/tests/".lc($file);
unless (-x $file) {
open(TESTFILE,">$file") || die "$0: could not write '$file' -- $!\n";
print TESTFILE '#! /bin/sh',"\n";
print TESTFILE $test,"\n";
print TESTFILE 'exit $?',"\n";
close(TESTFILE);
chmod 0755,$file;
}
return $file;
}
###############################################################################
......@@ -177,15 +199,15 @@ sub Change {
print "Resolving redefined '$field'...\n" if $debug;
return if ($1 eq $value);
print "\nThis package recommends changing the value of '$field'\n";
print "in the 'mailcap' file.\n\n";
print " old: $1\n";
print " new: $value\n\n";
print "Do you wish to accept the new value? [y] ";
my $resp = <STDIN>;
print "\n";
return if ($resp =~ m/n/i);
# print "\nThis package recommends changing the value of '$field'\n";
# print "in the 'mailcap' file.\n\n";
# print " old: $1\n";
# print " new: $value\n\n";
# print "Do you wish to accept the new value? [y] ";
# my $resp = <STDIN>;
# print "\n";
#
# return if ($resp =~ m/n/i);
}
$D{$content} =~ s|$field=.*?\t||g;
......@@ -259,7 +281,7 @@ sub Insert {
my $index;
my @list;
die "$0: semicolons are not allowed in commands, use || or &&\n" if $prg=~m/;/ || $tst=~m/;/;
die "$0: semicolons are not allowed in commands -- use || or &&\n" if $prg=~m/;/ || $tst=~m/;/;
$value .= "; test=$tst" if $tst;
$value .= "; $flg" if $flg;
......@@ -317,6 +339,8 @@ sub GenMailcap {
my @values = split(/\n/,$P{$pkg});
my $value = $values[$idx];
$value =~ s|package=.*?\tcontent=.*?\t||;
# print " * Fixing test for package '$_'... ($value)\n" if $debug;
# $value =~ s/test=(.*?)(;|$)/"test=".TestHack($1).$2/e; # Hack to fix Netscape's test bug
print " * Printing package '$_'... ($value)\n" if $debug;
if ($value =~ /^view=/) {
$value =~ s|view=||;
......@@ -388,6 +412,7 @@ sub Install {
my $val = shift @list;
if ($arg =~ m/^(view|compose|composetyped|edit|print)$/ && $val) {
# die "Error: action '$arg' ($val) cannot be backgrounded within mailcap\n" if $val=~m/\&\s*$/;
Insert($A{package},$A{content},$arg,$val,$A{test},$flags);
$changed=1;
}
......@@ -442,7 +467,7 @@ sub List {
#
# Initialization
#
autoflush STDOUT, 1;
print STDOUT ""; $| = 1; # No 'autoflush' because perl may not be configured
......@@ -592,14 +617,19 @@ while (<PATH>) {
close PATH;
open(PATH,">$mailcap") || die "$0: could not write '$mailcap' -- $!\n";
print PATH @above;
print PATH @user;
print PATH @below;
print PATH "\n###############################################################################\n\n";
GenMailcap(PATH);
close PATH;
if ($state == 3) {
open(PATH,">$mailcap") || die "$0: could not write '$mailcap' -- $!\n";
print PATH @above;
print PATH @user;
print PATH @below;
print PATH "\n###############################################################################\n\n";
GenMailcap(PATH);
close PATH;
} else {
print STDERR "Error: '$mailcap' is not in required format -- not updated\n";
print STDERR " Restore from backup or delete and reinstall mime-support package";
}
#
......
......@@ -236,10 +236,10 @@ scripts.
\& fi
.ft R
.SH "SEE ALSO"
RFC-1524 (/usr/doc/mime-support/rfc-1542)
RFC-1524 (/usr/doc/mime-support/rfc1524.txt)
.SH AUTHOR
.B install\-mime
was written by Brian C. White <bcwhite@verisim.com>
was written by Brian C. White <bcwhite@pobox.com>
.SH COPYRIGHT
.B install\-mime
is in the public domain.
......@@ -16,6 +16,7 @@ application/atomicmail
application/cu-seeme csm cu
application/dca-rft
application/dec-dx
application/dsptype tsp
application/excel xls
application/ghostview
application/mac-binhex40
......@@ -30,6 +31,7 @@ application/pgp-signature pgp
application/postscript ps ai eps
application/powerpoint ppt
application/remote-printing
application/rtf rtf
application/slate
application/wita
application/wordperfect5.1 wp5
......@@ -68,6 +70,7 @@ application/x-wais-source src
application/zip zip
audio/basic au snd
audio/midi mid midi
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ra ram
audio/x-wav wav
......@@ -75,6 +78,7 @@ audio/x-wav wav
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/png png
image/tiff tiff tif
image/x-cmu-raster ras
image/x-portable-anymap pnm
......@@ -99,7 +103,7 @@ multipart/parallel
text/html html htm
text/plain txt c h cc hh cpp hpp
text/richtext rtx rtf
text/richtext rtx
text/tab-separated-values tsv
text/x-setext etx
text/x-vCalendar vcs
......
#! /usr/bin/perl -w
###############################################################################
#
# Run-Mailcap: Run a program specified in the mailcap file based on a mime
# type.
#
# Written by Brian C. White <bcwhite@pobox.com>
# This file has been placed in the public domain (the only true "free").
#
$debug=0;
$etcmailcap="/etc/mailcap";
$usrmailcap="$ENV{HOME}/.mailcap";
sub Usage {
my($error) = @_;
print STDERR $error,"\n\n" if $error;
print STDERR "Use: $0 <--options=values> [...] <mime-type:filename> [...]\n\n";
print STDERR "Options:\n";
print STDERR " action specify what action to do on these files (manditory)\n";
print STDERR " debug be verbose about what's going on (any non-zero value)\n";
print STDERR "\n";
exit ($error ? 1 : 0);
}
sub SaveStdin {
my($match) = @_;
my $tmpfile;
$tmpfile = $ENV{TMPDIR};
$tmpfile = "/tmp" unless $tmpfile;
$tmpfile.= "/run-mailcap-$$";
if ($match =~ m/nametemplate=(.*?)\s*($|;)/) {
my $tmp = $1;
$tmp =~ s|%s|$tmpfile|;
$tmpfile = $tmp;
}
open(TMPFILE,">$tmpfile") || die "Error: could not write '$tmpfile' -- $!\n";
while (<STDIN>) {
print TMPFILE $_;
}
close(TMPFILE);
return $tmpfile;
}
foreach (@ARGV) {
if (m/^--(.*?)=(.*)$/) {
print STDERR "Warning: definition of '$1=$2' overrides value '${$1}'\n" if $ {$1};
$ {$1}=$2;
} elsif (m/:/) {
push @files,$_;
} else {
Usage "Error: unrecognized option '$_'";
}
}
Usage "Error: no action specified" unless $action;
if (open(MAILCAP,"<$usrmailcap")) {
while (<MAILCAP>) {
chomp;
next unless $_;
next if m/^#/;
push @mailcap,$_;
}
close MAILCAP;
}
open(MAILCAP,"<$etcmailcap") || die "Error: could not read '$etcmailcap' -- $!\n";
while (<MAILCAP>) {
chomp;
next unless $_;
next if m/^#/;
push @mailcap,$_;
}
close MAILCAP;
foreach (@files) {
my($type,$file) = m/^(.*?):(.*)$/;
print "Processing file '$file' of type '$type'...\n" if $debug;
my @matches;
@matches = grep(/^\Q$type\E;/,@mailcap);
@matches = grep(/\Q$action\E=/,@matches) unless $action eq "view";
my $done=0;
foreach $match (@matches) {
my $comm;
if ($action eq "view") {
($comm) = ($match =~ m/^.*?;\s*(.*?)\s*($|;)/);
} else {
($comm) = ($match =~ m/\Q$action\E=(.*?)\s*($|;)/);
}
next unless $comm;
print " - program to execute: $comm\n" if $debug;
if ($match =~ m/;\s*test=(.*?)\s*;/) {
print " - running test: $1\n" if $debug;
next if (system $1);
}
my $tmpfile;
if ($match =~ m/;\s*needsterminal\s*($|;)/ && ! -t STDOUT) {
if ($file eq "-") {
$tmpfile = SaveStdin($match);
$file = $tmpfile;
}
$comm = "/usr/bin/X11/xterm -T '$file ($type)' -e $0 --action=$action ${type}:${file}";
# exec "/usr/bin/X11/xterm", "-T" ,"$0 @ARGV", "-e", $0, @ARGV;
# $comm = "/usr/bin/X11/xterm -T '$file ($type)' -e /bin/sh -c ".'"'.$comm.'"';
# system "/usr/bin/X11/xterm","-T","$file ($type)","-e",$0,"--action=$action","${type}:${file}";
#
# unlink $tmpfile if $tmpfile;
# last;
}
if ($file ne "-") {
if ($comm =~ m/%s/) {
$comm =~ s/%s/$file/g;
} else {
$comm.= " <$file";
}
} else {
if ($comm =~ m/%s/) {
$tmpfile = SaveStdin($match);
$comm =~ s/%s/$tmpfile/g;
} else {
# no name means same as "-"... read from stdin
}
}
print " - executing: $comm\n" if $debug;
system $comm;
$done=1;
unlink $tmpfile if $tmpfile;
last;
}
print STDERR "Error: no mailcap rule for action '$action' for type '$type'\n" unless ($done);
}
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Run-mailcap and this manpage were written by Brian White and
.\" have been placed in the public domain.
.\"
.TH RUN-MAILCAP 1 "8th Feb 1997" "Debian Project" "Run Mailcap Programs"
.SH NAME
run\-mailcap \- execute programs via entries in the mailcap file
.SH SYNOPSIS
.B run\-mailcap
\-\-action=<action> [\-\-debug=<value>]
<mime-type>:<filename> [...]
.SH DESCRIPTION
.PP
.B run-mailcap
will use the given action to process each mime-type/file in turn.
Each file is is specified as its mime-type and filename together,
separated by a colon.
.SS OPTIONS
All options are in the form --<opt>=<value>.
.TP
.BI \-\-action=<action>
Performs the specified action on the files. Valid actions are
.I view
,
.I compose
,
.I composetyped
,
.I edit
, and
.I print
.
.TP
.BI \-\-debug=<value>
Turns on extra information to find out what is happening. Any value
other than zero (0) will turn on debugging output.
.SH "SEE ALSO"
RFC-1524 (/usr/doc/mime-support/rfc1524.txt)
.SH AUTHOR
.B run\-mailcap
was written by Brian C. White <bcwhite@pobox.com>
.SH COPYRIGHT
.B run\-mailcap
is in the public domain.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment