Commit aee4ed6e authored by Brian White's avatar Brian White

git-debimport mime-support_3.28-1.tar.gz

parent 70449531
......@@ -4,26 +4,44 @@ dpkg="dpkg"
echo "Info for debian package '$1':"
dpkg-deb --info $1
echo " "
echo -n "Do you wish to install this package now? (y/n) -->"
read yn
if [ "$yn" = "y" -o "$yn" = "Y" ]
then
if [ `id --user` -ne 0 ]
echo " "
echo "Do you wish to:"
echo " - I)nstall the package now,"
echo " - S)ave it to a file, or"
echo " - Q)uit now"
echo -n "Your choice (I/S/Q)? "
read choice
case "$choice" in
[iI])
if [ `id --user` -ne 0 ]
then
echo "Installation of Debian packages needs to be done as root."
echo -n "Enter command used to become root (eg. "sudo"): "
read sudo
dpkg="$sudo $dpkg"
echo "Installation of Debian packages needs to be done as root."
echo -n "Enter command used to become root (default=sudo): "
read sudo
if [ -z "$sudo" ]; then
sudo="sudo"
fi
dpkg="$sudo $dpkg"
fi
echo " "
echo "Installing package..."
eval "$dpkg --install '$1'"
;;
[sS])
echo -n "Save as? "
read filename
echo "Saving '$filename'..."
cat "$1" >$filename
;;
echo " "
echo "Installing package..."
eval "$dpkg --install $1"
fi
esac
echo " "
echo -n "Done. Press <return> to continue: "
read
read dummy
echo " "
......@@ -3,5 +3,5 @@ This is the Debian Linux "Mime-Support" package.
This package was written by Brian White <bcwhite@pobox.com> and contains
public information compiled from around the 'net and many people.
The "install-mime" program was written by Brian White and has been
The "update-mime" program was written by Brian White and has been
placed in the public domain.
mime-support (3.18-1.3) stable-security; urgency=high
mime-support (3.28-1) unstable; urgency=medium
* Non-maintainer upload by the Security Team
* Added patch by Florian Zumbiehl <florz@gmx.de> to fix shell character
expansion finally.
* added more mime types (closes: #259706)
-- Martin Schulze <joey@infodrom.org> Fri, 25 Apr 2003 16:17:48 +0200
-- Brian White <bcwhite@pobox.com> Fri, 16 Jul 2004 08:28:42 -0400
mime-support (3.18-1.2) stable-security; urgency=high
* Non-maintainer upload by the Security Team
* Corrected the patch against shell character expansion bugs by copying
the contents into a temporary file
mime-support (3.27-1) unstable; urgency=medium
-- Martin Schulze <joey@infodrom.org> Wed, 23 Apr 2003 15:17:09 +0200
* added more mime types (closes: #241908, #250692, #258236)
* made "sudo" the default for debian-view (closes: #248357)
* added examples to run-mailcap man page (closes: #249062)
mime-support (3.18-1.1) stable-security; urgency=high
-- Brian White <bcwhite@pobox.com> Wed, 14 Jul 2004 20:48:53 -0400
* Non-maintainer upload by the Security Team
* Fixed insecure temporary file usage when decoding a file (patch by
Colin Phipps)
* Added workaround against shell character expansion bugs by copying the
contents into a temporary file (patch by myself)
-- Martin Schulze <joey@infodrom.org> Mon, 7 Apr 2003 19:17:34 +0200
mime-support (3.26-1) unstable; urgency=medium
* added more mime types (closes: #235663, #235222)
-- Brian White <bcwhite@pobox.com> Wed, 3 Mar 2004 07:47:41 -0500
mime-support (3.25-1) unstable; urgency=medium
* added more mime types (closes: #230186)
* changed .pl files to "text/x-perl" (closes: #229148)
* removed comment about "#pplication/x-tex" (closes: #229244)
-- Brian White <bcwhite@pobox.com> Mon, 16 Feb 2004 20:47:03 -0500
mime-support (3.24-1) unstable; urgency=high
* removed RFCs -- stupid DFSG "non-free" argument (closes: #199818)
* added more mime types (closes: #215440, #201481, #204942)
* improvements to debian-view (closes: #183192)
* write new mailcap to different file then move over old (closes: #207875)
* fixed listed mailcap.order manpage section (closes: #189663)
* removed duplicate "rpm" extension (closes: #197536)
* changed .bmp files to "image/x-ms-bmp" (closes: #226741)
-- Brian White <bcwhite@pobox.com> Sat, 17 Jan 2004 22:32:05 -0500
mime-support (3.23-1) unstable; urgency=high
* added more mime types (closes: #190782, #190783)
* fixed /tmp race creating symlink over unlinked tmpfile (not practical to exploit)
-- Brian White <bcwhite@pobox.com> Fri, 25 Apr 2003 22:51:06 -0400
mime-support (3.22-1) unstable; urgency=high
* added new mime types
* allow reading files not in current directory without creating temp file (closes: #187773)
* fixed last of the /tmp races (I hope) (closes: #187637)
-- Brian White <bcwhite@pobox.com> Tue, 15 Apr 2003 20:24:09 -0400
mime-support (3.21-1) unstable; urgency=medium
* added new mime types (closes: #180650, #168828, #170734, #172198)
* return error code if couldn't find program to run (closes: #173639)
* fixed problem passing spaced filenames to xterm (closes: 173640)
* fixed mention of "install-mime" to "update-mime" (closes: #178547)
-- Brian White <bcwhite@pobox.com> Sun, 23 Feb 2003 12:39:36 -0500
mime-support (3.20-1) unstable; urgency=medium
* fixed problem skipping mime.types comment lines (closes: #159896)
* added ability to save files from debian-view (closes: #150713)
* fixed problem skipping backup files from mimedir (closes: #153637)
* added numerous new mime types
-- Brian White <bcwhite@pobox.com> Mon, 4 Nov 2002 23:07:16 -0500
mime-support (3.19-1) unstable; urgency=medium
* changed un-quoting of mailcap rules to be more consistent with other RFC interpretations (closes: #142506)
* added a new mime-type for "vnd.cinderella"
-- Brian White <bcwhite@pobox.com> Sat, 4 May 2002 08:47:30 -0400
mime-support (3.18-1) unstable; urgency=high
......
#! /bin/sh -e
if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/mime-support -a -d /usr/share/doc/mime-support ]; then
ln -sf ../share/doc/mime-support /usr/doc/mime-support
fi
fi
#if [ "$1" = "configure" ]; then
#fi
# Remove the old status directory (and any orphaned install-mime program)
......
......@@ -39,7 +39,7 @@ binary-indep:
install -m 644 update-mime.man debian/tmp/usr/share/man/man8/update-mime.8
install -m 755 run-mailcap debian/tmp/usr/bin/
install -m 644 run-mailcap.man debian/tmp/usr/share/man/man1/run-mailcap.1
install -m 644 rfcs/* debian/tmp/usr/share/doc/$(package)/
# install -m 644 rfcs/* debian/tmp/usr/share/doc/$(package)/
install -m 644 debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
install -m 644 debian/README debian/tmp/usr/share/doc/$(package)/copyright
install -m 755 debian-view debian/tmp/usr/lib/mime/
......
......@@ -5,6 +5,10 @@
# Much of this file is generated automatically by the program "update-mime".
# Please see the "update-mime" man page for more information.
#
# Users can add their own rules if they wish by creating a ".mailcap"
# file in their home directory. Entries included there will take
# precedence over those listed here.
#
###############################################################################
......
......@@ -2,7 +2,7 @@
.\" Update-mime and this manpage were written by Brian White and
.\" have been placed in the public domain (the only true "free").
.\"
.TH MAILCAP.ORDER 8 "16th Aug 1998" "Debian Project" "Order Mailcap Entries"
.TH MAILCAP.ORDER 5 "16th Aug 1998" "Debian Project" "Order Mailcap Entries"
.SH NAME
/etc/mailcap.order \- the mailcap ordering specifications
.SH DESCRIPTION
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,11 +41,11 @@ sub Usage {
print STDERR "\n";
print STDERR "Mime-Type:\n";
print STDERR " any standard mime type designation in the form <class>/<subtype> -- if\n";
print STDERR " not specified will be determined from the filename extension\n\n";
print STDERR " not specified, it will be determined from the filename extension\n\n";
print STDERR "Encoding:\n";
print STDERR " how the file (and type) has been encoded (only \"gzip\", \"bzip\", \"bzip2\"\n";
print STDERR " and \"compress\" are supported) -- if not specified will be determined from\n";
print STDERR " the filename extension\n\n";
print STDERR " and \"compress\" are supported) -- if not specified, it will be determined\n";
print STDERR " from the filename extension\n\n";
exit ($error ? 1 : 0);
}
......@@ -61,7 +61,7 @@ sub EncodingForFile {
if ($file =~ m/\.bz2$/) { $encoding = "bzip2"; }
if ($file =~ m/\.Z$/) { $encoding = "compress"; }
print " - file \"$file\" has encoding \"$encoding\"\n" if $debug && $encoding;
print STDERR " - file \"$file\" has encoding \"$encoding\"\n" if $debug && $encoding;
return $encoding;
}
......@@ -73,10 +73,12 @@ sub ReadMimetypes {
return unless -r $file;
print " - Reading mime.types file \"$file\"...\n" if $debug;
print STDERR " - Reading mime.types file \"$file\"...\n" if $debug;
open(MIMETYPES,"<$file") || die "Error: could not read \"$file\" -- $!\n";
while (<MIMETYPES>) {
chomp; lc;
chomp; lc; s/\#.*$//;
next if (m/^\s*$/);
my($type,@exts) = split;
foreach (@exts) {
......@@ -94,7 +96,7 @@ sub ReadMailcap {
return unless -r $file;
print " - Reading mailcap file \"$file\"...\n" if $debug;
print STDERR " - Reading mailcap file \"$file\"...\n" if $debug;
open(MAILCAP,"<$file") || die "Error: could not read \"$file\" -- $!\n";
while (<MAILCAP>) {
chomp;
......@@ -108,8 +110,8 @@ sub ReadMailcap {
if ($line =~ m/\\$/) {
$line =~ s/\\$//;
} else {
$line =~ s/\\;/$quotedsemi/g;
$line =~ s/\\%/$quotedprct/g;
$line =~ s/\\;/$quotedsemi/go;
$line =~ s/\\%/$quotedprct/go;
push @mailcap,$line;
$line = "";
}
......@@ -174,12 +176,10 @@ sub DecodeFile {
$file = undef if ($efile eq '-');
my $tmpfile = TempFile($file);
print " - decoding \"$efile\" as \"$tmpfile\"\n" if $debug;
print STDERR " - decoding \"$efile\" as \"$tmpfile\"\n" if $debug;
if (($efile ne '-' && ! -e $efile) || $action eq 'compose') {
unlink($tmpfile);
return $tmpfile;
}
# unlink($tmpfile); # should still be acceptable for "compose" output even if exists
return $tmpfile if (($efile ne '-' && ! -e $efile) || $action eq 'compose');
if ($encoding eq "gzip") {
if ($efile eq '-') {
......@@ -216,7 +216,7 @@ sub DecodeFile {
return;
}
chmod 0600,$tmpfile;
# chmod 0600,$tmpfile; # done already by TempFile
return $tmpfile;
}
......@@ -226,7 +226,7 @@ sub EncodeFile {
my($dfile,$efile,$encoding) = @_;
my($res);
print " - encoding \"$dfile\" as \"$efile\"\n";
print STDERR " - encoding \"$dfile\" as \"$efile\"\n";
if ($encoding eq "gzip") {
if ($efile eq '-') {
......@@ -269,7 +269,7 @@ sub ExtensionMimetype {
$typ = $mimetypes{lc($ext)};
print " - extension \"$ext\" maps to mime-type \"$typ\"\n" if $debug;
print STDERR " - extension \"$ext\" maps to mime-type \"$typ\"\n" if $debug;
return $typ;
}
......@@ -281,12 +281,12 @@ sub PatternMimetype {
while (($key,$val) = each %patterntypes) {
if ($file =~ m!$key!i) {
print " - file \"$file\" maps to mime-type \"$val\"\n" if $debug;
print STDERR " - file \"$file\" maps to mime-type \"$val\"\n" if $debug;
return $val;
}
}
print " - file \"$file\" does not conform to any known pattern\n" if $debug;
print STDERR " - file \"$file\" does not conform to any known pattern\n" if $debug;
return;
}
......@@ -307,7 +307,7 @@ sub FileMimetype {
foreach (@ARGV) {
print " - parsing parameter \"$_\"\n" if $debug;
print STDERR " - parsing parameter \"$_\"\n" if $debug;
if (m!^(-h|--help)$!) {
Usage();
exit(0);
......@@ -362,7 +362,7 @@ foreach (split(/:/,$mailcaps)) {
$retcode = 0;
foreach (@files) {
my($type,$code,$file) = m/^(.*?):(.*?):(.*)$/;
print "Processing file \"$file\" of type \"$type\" (encoding=",$code?$code:"none",")...\n" if $debug;
print STDERR "Processing file \"$file\" of type \"$type\" (encoding=",$code?$code:"none",")...\n" if $debug;
if ($file ne '-') {
if ($action eq 'compose' || $action eq 'edit') {
......@@ -410,21 +410,21 @@ foreach (@files) {
my $fail=0;
foreach $match (@matches) {
my $comm;
print " - checking mailcap entry \"$match\"\n" if $debug;
print STDERR " - checking mailcap entry \"$match\"\n" if $debug;
if ($action eq "view") {
($comm) = ($match =~ m/^.*?;\s*(.*?)\s*($|;)/);
} else {
($comm) = ($match =~ m/\Q$action\E=(.*?)\s*($|;)/);
}
next if (!$comm || $comm =~ m!(^|/)false$!i);
print " - program to execute: $comm\n" if $debug;
print STDERR " - program to execute: $comm\n" if $debug;
if ($match =~ m/;\s*test=(.*?)\s*($|;)/) {
my $test;
print " - running test: $1 " if $debug;
print STDERR " - running test: $1 " if $debug;
$test = system "$1 >/dev/null 2>&1";
$test >>= 8;
print " (result=$test=",($test!=0?"false":"true"),")\n" if $debug;
print STDERR " (result=$test=",($test!=0?"false":"true"),")\n" if $debug;
if ($test) {
$fail++;
next;
......@@ -433,33 +433,34 @@ foreach (@files) {
my($tmpfile,$tmplink);
if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/ && ! -t STDOUT) {
if (!$ENV{DISPLAY}) {
print " - no terminal available for rule (needsterminal)\n" if $debug;
if ($ENV{DISPLAY}) {
$comm = "$xtermprgrm -T '$file ($type)' -e $0 --action=$action '${type}:%s'";
} else {
print STDERR " - no terminal available for rule (needsterminal)\n" if $debug;
$fail++;
next;
}
if ($file eq "-") {
$tmpfile = SaveStdin($match);
$file = $tmpfile;
}
$comm = "$xtermprgrm -T '$file ($type)' -e $0 --action=$action ${type}:${file}";
} elsif ($action eq 'view' && $match =~ m/;\s*copiousoutput\s*($|;)/) {
$comm .= " | $0 --action=$action text/plain:-";
}
if ($file ne "-") {
if ($comm =~ m/[^%]%s/) {
if ($file ne "\Q$file\E") {
my ($amt,$buf);
$tmplink = TempFile("");
open(TMPFILE,"<$file") || die "Error: could not read \"$file\" -- $!\n";
open(TMPLINK,">$tmplink") || die "Error: could not write \"$tmplink\" -- $!\n";
do {
$amt = read(TMPFILE,$buf,102400);
print TMPLINK $buf if $amt;
} while ($amt != 0);
close(TMPFILE);
close(TMPLINK);
if ($file =~ m![^ a-z0-9,.:/@%^+=_-]!i) {
$match =~ m/nametemplate=(.*?)\s*($|;)/;
my $prefix = $1;
my $linked = 0;
while (!$linked) {
$tmplink = TempFile($prefix);
unlink($tmplink);
if ($file =~ m!^/!) {
$linked = symlink($file,$tmplink);
} else {
my $pwd = `/bin/pwd`;
chomp($pwd);
$linked = symlink("$pwd/$file",$tmplink);
}
}
$comm =~ s/([^%])%s/$1$tmplink/g;
} else {
$comm =~ s/([^%])%s/$1$file/g;
......@@ -486,11 +487,12 @@ foreach (@files) {
$comm =~ s!([^%])%t!$1$type!g;
$comm =~ s!([^%])%F!$1!g;
$comm =~ s!%{(.*?)}!$_="'$ENV{$1}'";s/\`//g;$_!ge;
$comm =~ s!\\(.)!$1!g;
$comm =~ s!\'\'!\'!g;
$comm =~ s!$quotedsemi!;!g;
$comm =~ s!$quotedprct!%!g;
$comm =~ s!$quotedsemi!;!go;
$comm =~ s!$quotedprct!%!go;
print " - executing: $comm\n" if $debug;
print STDERR " - executing: $comm\n" if $debug;
$res = system $comm;
$res = int($res/256);
if ($res != 0) {
......@@ -511,6 +513,7 @@ foreach (@files) {
print STDERR "Error: no \"$action\" mailcap rules found for type \"$type\"\n";
}
unlink $file if $code;
$retcode = 1 unless $retcode;
next;
}
......
......@@ -52,6 +52,10 @@ be specied.
Both the user's files (~/.mailcap; ~/.mime.types) and the system files
(/etc/mailcap; /etc/mime.types) are searched in turn for information.
.SS EXAMPLES
see picture.jpg
print output.ps.gz
compose text/html:index.html
.SS OPTIONS
All options are in the form --<opt>=<value>.
.TP
......
......@@ -47,7 +47,7 @@ sub ReadEntries
$counter=1;
foreach $file (glob "$mimedir/*") {
next if ($file =~ m/^(\.|\#)|(\~)$/);
next if ($file =~ m!(^|/)(\.|\#)|(\~)$!);
($package) = ($file =~ m|/([^/]*)$|);
print STDERR "$package:\n" if $debug;
......@@ -209,7 +209,7 @@ sub UpdateMailcap
close PATH;
if ($state == 3) {
open(PATH,">$mailcap") || die "Error: could not write '$mailcap' -- $!\n";
open(PATH,">$mailcap.new") || die "Error: could not write '$mailcap.new' -- $!\n";
print PATH @above;
print PATH @user;
print PATH @below;
......@@ -221,6 +221,7 @@ sub UpdateMailcap
print PATH $entry,"\n";
}
close PATH;
rename "$mailcap.new","$mailcap";
} else {
print STDERR "Error: '$mailcap' is not in required format -- not updated\n";
print STDERR " Restore from backup or delete and re-install mime-support package";
......
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