Commit a7865a06 authored by Sandro Tosi's avatar Sandro Tosi

Imported Upstream version 0.8.4

parent c7bc7b53
This diff is collapsed.
==============================================================================
Q: Can mp3check scan whole directories for mp3 files and check/list/correct
them?
------------------------------------------------------------------------------
A: Of course. This is what I use most of the time:
mp3check -re3GTo /space/mp3
This will check all files with extension 'mp3' or 'MP3' (-3) recursively
under directory '/space/mp3' for errors. The output will be colorized and
ID3 tags and truncated last frames are ignored.
==============================================================================
Q: Can you add a feature to mp3check to add CRC to mp3 files which don not
have a CRC?
------------------------------------------------------------------------------
A: That's not possible, sorry. The CRC takes two bytes of extra space in every
frame. One would have to re-encode each frame to make room for those two
bytes which would result in loss of quality of course. But this is not what
you want.
==============================================================================
Q: I have an mp3 file which makes certain mp3 players (like xmms) crash, but
mp3check does not find any errors in this file. Why is that?
------------------------------------------------------------------------------
A: mp3check does only check the 'frame header' of each frame in the mp3 file
for consistency. Additionally it checks the CRC checksum over the side
information of each frame (which is only a small but important part of each
frame). All other data is ignored, although also this data has an inner
structure which can be corrupted in which case some mp3 players crash
(although there is no excuse for such a behavior ;-) )
==============================================================================
Q: Why can't mp3check fix all those errors in my mp3 files?
------------------------------------------------------------------------------
A: mp3check was never meant to fix anything. All those fixing options are
useful by-products and are becoming more and more powerful, but mp3check is
not meant as a tool to fix errors in mp3 in the first line, but to _check_
for errors.
==============================================================================
Q: Could you add feature X and option Y to mp3check? It would be so useful!
------------------------------------------------------------------------------
A: I am very busy and mp3check is only one of the tools I am maintaining. If
you can report a bug, I would be happy to fix it. If is is a small, well
defined feature you're requesting I will be happy to implement it. But I
am even happier if you can send me a patch. ;-)
==============================================================================
Q: I am disappointed: About 0.1% to 10% of all mp3 files I downloaded from the
internet had at least minor errors. How can this be?
------------------------------------------------------------------------------
A: Ask me an easier question, please. It seems that hundreds of copying
generations of a file through UDP connections (FTP), hard disks and local
Ethernet cables leave their traces on the mp3 files. ;-) Use mp3check to
filter the bad ones out and only use the good ones. That way we might get
rid of the problem.
==============================================================================
Q: I have files with the .wav filename extension but mp3checks claims they are
mp3 files. And I have files with the .mp3 filename extension but mp3check
claims that no mp3 streams. How can that be?
------------------------------------------------------------------------------
A: A filename extension has not necessarily something to do with it contents.
mp3check totally ignores the filename extension. I have seen mp3 streams
encapsulated in a wav file and I have seen mp3 files containing a RealAudio
stream. This shouldn't be a problem for the tools dealing with such files.
==============================================================================
Q: Can you send me a list of mp3 servers?
------------------------------------------------------------------------------
A: What is that? I use mp3check only for my own recordings. ;-)
==============================================================================
Q: I looked at the source and it seems that tstring.* and tappconfig.* are
pure overhead and that all the functionality of mp3check is implemented in
mp3check.cc.
------------------------------------------------------------------------------
A: You are right.
1998:
20 Jan: mp3check started and first header seek check (v0.0)
21 Jan: v0.1 colorization, error and anomaly check implen, crc started
23 Jan: v0.2 advanced formatting
24 Jan: v0.3 disable errors/anomalies
27 Jan: v0.3a -c only first frame bug fixed, --dump-header added
27 Jan: v0.3b starting mpeg 2.0 support, cut-junk-start added
28 Jan: v0.3c added some data for mpeg 2.0
09 Jul: v0.3e mpeg2.5 does not work :(
18 Sep: 0.3.1 prepare for sunsite
22 Oct: 0.4.1 prepare for use with printcdcover (raw output format)
1999:
25 Aug: 0.4.2 cerr changed to cerror (conflict with c++ libs with gcc2.95.1)
15 Sep 19:21 0.4.3 cut-junk-end added (thanks to Pollyanna Lindgren <jtlindgr@cs.helsinki.fi>)
19 Sep 18:13 0.4.4 fix-headers added (no succes on trying to fix madonna-mix)
2000:
31 May 20:00 0.5.0 avoid creating temporary file on cut-junk-start/end (thanks to Michael Stefaniuc <mstefani@redhat.de>)
no color by default, spurious color on no color removed, --cut-junk-end will not touch files with TAG trailers (thanks to Chris Pimlott <pimlottc@null.net>)
avoid endless loop on dummy+cut-junk-end
21:35 max-errors added (thanks to Preston.F.Crow.Adv94@Alum.Dartmouth.ORG (Preston F. Crow Adv94))
padding/framelength for layer 1+2 fixed (thanks to Dieter Baron <dillo@danbala.ifoer.tuwien.ac.at>)
18 Jun 15:30 0.5.1 crc check for mpg1.0/layer1 added, untested. frame length padding fixed for layer 1
10 Jul 01:00 0.5.2 tappframe simplified
13 Jul 22:00 0.5.2 --fix-crc added, endian support
2001:
26 Feb 00:00 0.6.0 Khalis (Jean Delvare) big patch applied. Lots of new features and options.
26 Feb 00:00 0.6.1 experimental big-endian support added (has to be tested)
27 Feb 00:00 0.6.2 big-endian works, --no-summary option added for batch processing, testsuite started, --show-valid files added
28 Feb 00:00 0.6.3 first frame not checked error fixed, --fix-header improved, --edit-frame-b added
19 Mar 00:15 0.6.4 applied Khalis 'cygwin' patch, runtime endianess checking removed
25 Jun 21:55 0.6.5 applied Khalis 'epmtyfiles' patch
07 Nov 20:00 0.6.6 applied Fredrik Roubert 64-bit patch
13 Nov 22:30 0.7.0 --recursive, --accept, --reject, --xdev, --only-mp3, --filelist, --print-files added, --ascii-only added
19 Nov 00:30 0.7.1 cleaner code for filename filtering, avoid use of values.h and MAXDOUBLE (thanks to Khali for both fixes)
19 Nov 23:00 0.7.2 -c fixed: hide unprintable chars in name
22 Nov 23:00 0.7.3 --xdev fixed by Khali (recursion under Win32 was broken)
2002:
03 Apr 00:15 0.7.4 spec file updated (Thanks to Gerald Schnabel <Gerri@studserv.uni-stuttgart.de>)
26 Nov 22:00 0.7.5 use automake/autoconf (initial autoconf script thanks to James A. Morrison <ja2morri@student.math.uwaterloo.ca>)
27 Nov 00:10 0.8.0 VBR support added and other improvements (thanks to Jean Delvare)
2003:
12 May 23:00 0.8.1 the 'frame too long' error seems to confuse some users: now its 'sync error (frame too long)' instead
12 May 23:30 0.8.2 --no-mmap added
2005:
21 Nov 0.8.3 --add-tag added: automatically add an ID3v1.1 tag to file which do not have any ID3v1.x or v2.x tag, lots of handcrafted algorithms converted 2300 files rather successfully in 37 seconds, the code is obscure though
Installation:
=============
Type:
./configure
make
make install
./configure
make
make install
If you want to debug use:
make CXXFLAGS="-Wall -W -g"
instead of
make
If you start from a fresh CVS checkout do:
make -f Makefile.cvs
./configure
make
make install
# Copyright (C) 2008 by Johannes Overmann <Johannes.Overmann@gmx.de>
# Please see COPYING for license.
# --- config ----------------------------------------------------------------
WARN = -Wall -W -g
#OPT = -O2
OPT =
CPPFLAGS = $(ADDITIONAL_CPPFLAGS)
CXXFLAGS = $(WARN) $(OPT)
CXX = g++
CC = $(CXX)
# --- default target
default: all
# --- target definition -----------------------------------------------------
-include Makefile.init # indirectly include TARGET
include TARGET
SRC := $(wildcard *.cc) $(ADDITIONAL_SOURCES)
VERSION := $(shell grep '\#define VERSION' $(TARGET).cc | sed 's/.*"\([^"]*\)".*/\1/g')
DISTFILES := $(SRC) $(wildcard *.h) TARGET INSTALL COPYING Makefile configure $(wildcard $(TARGET).1)
# --- common rules ----------------------------------------------------------
OBJ := $(SRC:.cc=.o)
all: $(TARGET)
$(TARGET): $(OBJ)
strip:
strip $(TARGET)
install: all strip
cp $(TARGET) /usr/local/bin
PACKAGE = $(TARGET)-$(VERSION)
dist:
rm -rf $(PACKAGE)
mkdir $(PACKAGE)
cp $(DISTFILES) $(PACKAGE)
tar czvhf $(PACKAGE).tgz $(PACKAGE)
clean:
rm -f $(OBJ) $(DEP) $(TARGET) *~ $(PACKAGE).tgz
rm -rf $(PACKAGE) $(ADDITIONAL_CLEANFILES)
svnclean: clean
.PHONY: default all clean strip dist
# --- meta object compiler for qt -------------------------------------------
moc_%.cc: %.h
moc -o $@ $<
# --- dependency generation -------------------------------------------------
.dep.%: %.cc
$(CXX) $(CPPFLAGS) -MM -MT "$@ $(<:%.cc=%.o)" $< -o $@
DEP := $(SRC:%.cc=.dep.%)
ifeq ($(findstring $(MAKECMDGOALS),clean),)
ifeq ($(findstring $(MAKECMDGOALS),svnclean),)
-include $(DEP)
endif
endif
B="b c"
a:
sh -c "ln -s a $(B)"
include Makefile.common
bin_PROGRAMS = mp3check
TAPPFRAME_SRC += tfiletools.h tfiletools.cc
mp3check_SOURCES = mp3check.cc crc16.cc crc16.h id3tag.cc id3tag.h $(TAPPFRAME_SRC)
man_MANS = mp3check.1
EXTRA_DIST += mp3check.spec FAQ HISTORY selftest
dist-hook:
sed -e "s/^\(Version:\).*/\1 $(VERSION)/" $(srcdir)/mp3check.spec > $(srcdir)/mp3check.spec.new
mv -f $(srcdir)/mp3check.spec.new $(srcdir)/mp3check.spec
TESTS = selftest
.PHONY: test
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = $(man_MANS) Makefile.init Makefile.common ChangeLog
CLEANFILES = *~
TAPPFRAME_SRC = tappconfig.cc tappconfig.h tstring.cc tstring.h texception.h tmap.h tvector.h
svnclean: distclean
rm -f $(distdir).tar.gz $(distdir).lsm stamp-h.in mkinstalldirs missing libtapp install-sh configure config.h.in autoscan.log aclocal.m4 Makefile.in .dep.*
rm -f $(TAPPFRAME_SRC) COPYING Makefile.common config.guess config.sub
rm -rf autom4te.cache
TARNAME = $(distdir).tar.gz
LSMNAME = $(distdir).lsm
mdist: dist
cp LSM_ENTRY $(LSMNAME)
streplace -q "__VERSION__=$(VERSION)" $(LSMNAME)
streplace -q "__DATE__=`date -R`" $(LSMNAME)
streplace -q "__LSM_NAME__=`ls $(LSMNAME) -l -s |awk '{printf "%3sk %s\n",$$1,$$10}'`" $(LSMNAME)
streplace -q "__TAR_NAME__=`ls $(TARNAME) -l -s |awk '{printf "%3sk %s\n",$$1,$$10}'`" $(LSMNAME)
streplace -qx '(md5sum not available)=md5sum: '`md5sum $(TARNAME)|awk '{print $$1}'` $(LSMNAME)
.PHONY: mdist svnclean cl
# meta object compiler for qt
moc_%.cc: %.h
moc -o $@ $<
cl:
touch ChangeLog
svn2cl
dist: cl
This diff is collapsed.
all: linkit
aclocal
autoconf
autoheader
automake -a
@echo
@echo Now type
@echo " ./configure"
FILES = ../libtapp ../libtapp/COPYING ../libtapp/Makefile.common ../libtapp/tappconfig.cc ../libtapp/tappconfig.h ../libtapp/tstring.cc ../libtapp/tstring.h ../libtapp/texception.h ../libtapp/tmap.h ../libtapp/tvector.h
linkit:
test \! -d ../libtapp || ln -sf $(FILES) `grep '^TAPPFRAME_SRC' Makefile.am| sed 's/\([a-zA-Z0-9_.-][a-zA-Z0-9_.-]*\)/..\/libtapp\/\1/g'|cut -d= -f2-` .
.PHONY: all linkit
TARGET=mp3check
SHARED_FILES=INSTALL COPYING Makefile configure tappconfig.cc tappconfig.h tstring.cc tstring.h texception.h tmap.h tvector.h tregex.cc tregex.h tfiletools.h tfiletools.cc
=========================================================================
Thanks go to the following people who contributed directly to this source
code: (in chronological order)
(If you are missing in this list please let me know!)
=========================================================================
Pollyanna Lindgren <jtlindgr@cs.helsinki.fi>
(0.4.3 cut-junk-end added)
Michael Stefaniuc <mstefani@redhat.de>
(0.5.0 avoid creating tempoary file on cut-junk-start/end)
(0.5.3 --fix-crc added)
Dieter Baron <dillo@danbala.ifoer.tuwien.ac.at>
(0.5.0 padding/framelength for layer 1+2 fixed)
Jean 'Khali' Delvare <delvare@ensicaen.ismra.fr>
(0.6.0 Fixed lots of bugs, added lots of features, big patch (1113 lines)
many thanks for all the work Khali!)
(0.6.4 CygWin patch to make mp3check work under Win32 environments)
(0.6.5 Correct handling of empty files)
(0.7.1 CygWin again, cleaner code for filename filtering, lot of testing)
(0.7.2 -c fixed)
(0.7.3 --xdev fixed)
(0.8.0 VBR support added and other improvements)
Jeff Squyres <jsquyres@lsc.nd.edu>
(0.5.0-0.6.0 Great help in improving portability.)
Michael Uemminghaus <uemmingh@mail.rmc.de>
(<future> cut truncated frames)
Fredrik Roubert <roubert@df.lth.se>
(0.6.6 64-bit fixes, testing on DEC Alpha)
Gerald Schnabel <Gerri@studserv.uni-stuttgart.de>
(0.7.4 mp3check.spec file and RedHat packages updated)
Anna Michalska <anngpo@polbox.com>
(0.8.0 CygWin build)
------------------------------------------------------------------
Thanks also go to the following people who contributed indirectly:
------------------------------------------------------------------
Chris Pimlott <pimlottc@null.net>
(0.5.0 useful commentes and bug reports)
Preston F. Crow <Adv94Preston.F.Crow.Adv94@Alum.Dartmouth.org>
(0.5.0 suggested max-errors)
Honza Fikar <jan.fikar@epfl.ch>
(0.6.2 testing on big endian (PPC) and i386)
- mpeg1.0 layer 2 and mpeg2.0 layer 1 and 2: add crc check support
- add mpeg 2.5 support
- improve manpage
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if `lstat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_LSTAT_EMPTY_STRING_BUG
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
This diff is collapsed.
This diff is collapsed.
# Process this file with autoconf to produce a configure script.
AC_INIT(streplace)
AM_INIT_AUTOMAKE(mp3check,0.8.3)
AC_CONFIG_SRCDIR(mp3check.cc)
AM_CONFIG_HEADER(config.h)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
# Checks for libraries.
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h float.h limits.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_C_BIGENDIAN
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_STAT
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([asprintf ftruncate memmove memset munmap strchr strdup strerror strrchr strtol strtoul])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "========================================================================"
echo "Now type"
echo " make"
echo or
echo ' make CXXFLAGS="-Wall -W -g"'
echo ' make CXXFLAGS="-Wall -W -Woverloaded-virtual -Wsynth -Wsign-promo -g"'
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]