Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37400621
en ru br
ALT Linux repos
S:5.45-alt1
D:4.20-alt5.1
5.0: 4.26-alt2
4.1: 4.20-alt5
4.0: 4.20-alt5
3.0: 4.13-alt1

Other repositories
Upstream:4.23

Group :: File tools
RPM: file

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: file-4.13-deb-4.12-1-alt.patch
Download


diff -uprk.orig file-4.13.orig/doc/file.man file-4.13/doc/file.man
--- file-4.13.orig/doc/file.man	2005-02-09 22:07:30 +0300
+++ file-4.13/doc/file.man	2005-02-12 17:57:30 +0300
@@ -1,4 +1,4 @@
-.TH FILE __CSECTION__ "Copyright but distributable"
+.TH FILE __CSECTION__ "February 2004" "ALT Linux" "Copyrighted but distributable"
 .\" $Id: file.man,v 1.55 2005/02/09 19:07:30 christos Exp $
 .SH NAME
 file
@@ -56,10 +56,9 @@ or
 meaning anything else (data is usually `binary' or non-printable).
 Exceptions are well-known file formats (core files, tar archives)
 that are known to contain binary data.
-When modifying the file
-.I __MAGIC__
-or the program itself, 
-.B "preserve these keywords" .
+When adding local definitions to
+.IR /etc/magic ,
+.BR "preserve these keywords" .
 People depend on knowing that all the readable files in a directory
 have the word ``text'' printed.
 Don't do as Berkeley did and change ``shell commands text''
@@ -98,7 +97,9 @@ that the file is a binary executable, an
 The concept of `magic number' has been applied by extension to data files.
 Any file with some invariant identifier at a small fixed
 offset into the file can usually be described in this way.
-The information identifying these files is read from the compiled
+The information identifying these files is read from
+.I /etc/magic
+and the compiled
 magic file
 .I __MAGIC__.mgc ,
 or 
@@ -349,12 +350,6 @@ will be distributed periodically.
 The order of entries in the magic file is significant.
 Depending on what system you are using, the order that
 they are put together may be incorrect.
-If your old
-.B file
-command uses a magic file,
-keep the old magic file around for comparison purposes
-(rename it to 
-.IR __MAGIC__.orig ).
 .SH EXAMPLES
 .nf
 $ file file.c file /dev/{wd0a,hda}
@@ -502,9 +497,19 @@ This program is slower than some vendors
 The new support for multiple character codes makes it even slower.
 .PP
 This manual page, and particularly this section, is too long.
+.SH RETURN CODE
+.B file
+almost always returns 0. It returns a different if it cannot open a file.
 .SH AVAILABILITY
 You can obtain the original author's latest version by anonymous FTP
 on
 .B ftp.astron.com
 in the directory
 .I /pub/file/file-X.YZ.tar.gz
+.PP
+This
+.B ALT Linux
+version adds a number of new magix entries. It can be
+obtained from every site carrying a
+.B ALT Linux
+distribution (ftp.altlinux.org and mirrors).
diff -uprk.orig file-4.13.orig/magic/Header file-4.13/magic/Header
--- file-4.13.orig/magic/Header	2000-08-05 21:36:46 +0400
+++ file-4.13/magic/Header	2005-02-12 17:56:36 +0300
@@ -1,5 +1,5 @@
-# Magic
 # Magic data for file(1) command.
-# Machine-generated from src/cmd/file/magdir/*; edit there only!
-# Format is described in magic(files), where:
-# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
+# Format is described in magic(5).
+# Don't edit this file, edit /etc/magic or send your suggested inclusions to
+# this file as a wishlist bug against file (using the reportbug utility).
+
diff -uprk.orig file-4.13.orig/magic/Magdir/revision file-4.13/magic/Magdir/revision
--- file-4.13.orig/magic/Magdir/revision	2003-05-26 03:04:55 +0400
+++ file-4.13/magic/Magdir/revision	2005-02-12 17:56:36 +0300
@@ -3,3 +3,9 @@
 # file(1) magic for revision control files
 # From Hendrik Scholz <hendrik@scholz.net>
 0   string /1\ :pserver:    cvs password text file
+
+
+# Subversion (SVN) dumps
+# Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
+0       string  SVN-fs-dump-format-version:     Subversion dumpfile
+>28     string  >\0                             (version: %s)
diff -uprk.orig file-4.13.orig/magic/magic.local file-4.13/magic/magic.local
--- file-4.13.orig/magic/magic.local	1970-01-01 03:00:00 +0300
+++ file-4.13/magic/magic.local	2005-02-12 17:56:36 +0300
@@ -0,0 +1,3 @@
+# Magic local data for file(1) command.
+# Insert here your local magic data. Format is described in magic(5).
+
diff -uprk.orig file-4.13.orig/magic/magic.mime file-4.13/magic/magic.mime
--- file-4.13.orig/magic/magic.mime	2005-02-09 22:25:38 +0300
+++ file-4.13/magic/magic.mime	2005-02-12 17:56:36 +0300
@@ -195,7 +195,7 @@
 0       beshort         0x4DE1          audio/MP4A-LATM
 
 # MPEG Layer 3 sound files
-0       beshort		&0xffe0		audio/mpeg
+0       beshort&0xfffe  =0xfffa         audio/mpeg
 #MP3 with ID3 tag
 0	string		ID3		audio/mpeg
 # Ogg/Vorbis
@@ -210,7 +210,7 @@
 0	string		/*\ XPM		image/x-xpmi 7bit
 
 # 3DS (3d Studio files)
-16	beshort		0x3d3d		image/x-3ds
+#16	beshort		0x3d3d		image/x-3ds
 
 # this first will upset you if you're a PL/1 shop... (are there any left?)
 # in which case rm it; ascmagic will catch real C programs
@@ -398,19 +398,14 @@
 #
 # from Daniel Quinlan <quinlan@yggdrasil.com>
 #
-0	string		\<HEAD	text/html
-0	string		\<head	text/html
-0	string		\<TITLE	text/html
-0	string		\<title	text/html
-0       string          \<html	text/html
-0       string          \<HTML	text/html
+0	string/cB	\<!doctype\ html	text/html
+0	string/cb	\<head	text/html
+0	string/cb	\<title	text/html
+0	string/cb	\<html	text/html
 0	string		\<!--	text/html
-0	string		\<h1	text/html
-0	string		\<H1	text/html
-0	string		\<!doctype\ HTML	text/html
-0	string		\<!DOCTYPE\ HTML	text/html
-0	string		\<!doctype\ html	text/html
-0	string		\<!doctype\ HTML	text/html
+0	string/c	\<h1	text/html
+
+0	string		\<?xml			text/xml
 
 #------------------------------------------------------------------------------
 # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
@@ -473,7 +468,7 @@
 0	beshort		0xffd8		image/jpeg
 
 # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
-0	string		BM		image/bmp
+0	string		BM		image/x-ms-bmp
 #>14	byte		12		(OS/2 1.x format)
 #>14	byte		64		(OS/2 2.x format)
 #>14	byte		40		(Windows 3.x format)
@@ -916,3 +911,10 @@
 # (made the mimetype up) 
 0	string	\0\0MMXPR3\0	application/x-quark-xpress-3
 
+0	string		CWS		application/x-shockwave-flash
+
+# Gnumeric spreadsheet
+# This entry is only semi-helpful, as Gnumeric compresses its files, so
+# they will ordinarily reported as "compressed", but at least -z helps
+39      string          =<gmr:Workbook           application/x-gnumeric
+
diff -uprk.orig file-4.13.orig/src/file.c file-4.13/src/file.c
--- file-4.13.orig/src/file.c	2004-09-27 19:28:37 +0400
+++ file-4.13/src/file.c	2005-02-12 17:56:36 +0300
@@ -249,9 +249,8 @@ main(int argc, char *argv[])
 			flags |= MAGIC_DEVICES;
 			break;
 		case 'v':
-			(void) fprintf(stdout, "%s-%d.%.2d\n", progname,
-				       FILE_VERSION_MAJOR, patchlevel);
-			(void) fprintf(stdout, "magic file from %s\n",
+			(void) fprintf(stdout, "%s-"VERSION"\n", progname);
+			(void) fprintf(stdout, "magic data from %s\n",
 				       magicfile);
 			return 1;
 		case 'z':
@@ -311,7 +310,7 @@ main(int argc, char *argv[])
 	}
 
 	magic_close(magic);
-	return 0;
+	return magic->haderr ? -1 : 0;
 }
 
 
@@ -362,7 +361,8 @@ unwrap(char *fn)
 	}
 
 	while (fgets(buf, MAXPATHLEN, f) != NULL) {
-		buf[file_mbswidth(buf)-1] = '\0';
+	        // cut off CR, we _need_ bytes here, not characters
+		buf[strlen(buf)-1] = '\0';
 		process(buf, wid);
 		if(nobuffer)
 			(void) fflush(stdout);
diff -uprk.orig file-4.13.orig/src/fsmagic.c file-4.13/src/fsmagic.c
--- file-4.13.orig/src/fsmagic.c	2004-11-13 13:19:48 +0300
+++ file-4.13/src/fsmagic.c	2005-02-12 17:56:36 +0300
@@ -92,7 +92,8 @@ file_fsmagic(struct magic_set *ms, const
 		if (file_printf(ms, "cannot open `%s' (%s)",
 		    fn, strerror(errno)) == -1)
 			return -1;
-		return 1;
+		ms->haderr++;
+		return -1;
 	}
 
 	if ((ms->flags & MAGIC_MIME) != 0) {
diff -uprk.orig file-4.13.orig/src/Makefile.am file-4.13/src/Makefile.am
--- file-4.13.orig/src/Makefile.am	2004-11-24 22:19:16 +0300
+++ file-4.13/src/Makefile.am	2005-02-12 17:56:36 +0300
@@ -5,7 +5,7 @@ EXTRA_DIST = test.c
 
 bin_PROGRAMS = file
 
-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
 
 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
 	compress.c is_tar.c readelf.c print.c fsmagic.c \
diff -uprk.orig file-4.13.orig/src/Makefile.in file-4.13/src/Makefile.in
--- file-4.13.orig/src/Makefile.in	2005-01-07 22:17:26 +0300
+++ file-4.13/src/Makefile.in	2005-02-12 17:56:36 +0300
@@ -91,7 +91,7 @@ EXTRA_DIST = test.c
 
 bin_PROGRAMS = file
 
-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
 
 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
 	compress.c is_tar.c readelf.c print.c fsmagic.c \
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin