summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-12-12 16:35:02 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-12-12 16:35:02 +0000
commitf627889b721d74c936e531115871310afbb8a1d8 (patch)
tree21cbc19e5c658e8a6976fb16f41f42828c31b1ea /bin
parent4cd31b9fd41ec21e1bad0807aba116d68ad83cde (diff)
downloadfedora-doc-utils-f627889b721d74c936e531115871310afbb8a1d8.tar.gz
fedora-doc-utils-f627889b721d74c936e531115871310afbb8a1d8.tar.xz
fedora-doc-utils-f627889b721d74c936e531115871310afbb8a1d8.zip
Always copy files with multiple dashes, as a courtesy to legacy files.
Added check for a "figs/Manifest-${LANG}" file. If found, get the filenames to copy from that, else search the source tree by name.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/copy-figs49
1 files changed, 40 insertions, 9 deletions
diff --git a/bin/copy-figs b/bin/copy-figs
index fe066ec..a3063aa 100755
--- a/bin/copy-figs
+++ b/bin/copy-figs
@@ -114,20 +114,47 @@ fi
leadin=$(/usr/bin/dirname "${SRC}")
[ "${DEBUG}" ] || echo >&2 "leadin=|${leadin}|"
-find "${SRC}" -print |
+haveManifest=$(
+ [ "${DEBUG}" ] || echo >&2 "Checking ${SRC}/Manifest-${targetLang}"
+ if [ -f "${SRC}/Manifest-${targetLang}" ]; then
+ echo yes
+ else
+ echo no
+ fi
+)
+[ "${DEBUG}" ] || echo >&2 "haveManifest=|${haveManifest}|"
+
+(
+ if [ "${haveManifest}" = "yes" ]; then
+ # We have a manifest file, so get the list of
+ # RELATIVE filenames from there. Generate the
+ # "Manifest-${targetLang}" file like this:
+ # cd figs; find * -print >"Manifest-${targetLang}"
+ # or something similar
+ cat "${SRC}/Manifest-${targetLang}"
+ else
+ # No manifest, resort to a search
+ find "${SRC}" -print
+ fi
+) |
while read fn
do
# Skip anything that even looks like CVS or SVN
case "${fn}" in
- *CVS* | *svn* )
+ *CVS* | *.svn* )
continue
;;
esac
# Figure out the relative path for this pathname chunk
- rp=$(
- echo $(/usr/bin/dirname "${fn}")/$(/bin/basename "${fn}") |
- /bin/sed "s;^${leadin}/*;;"
- )
+ if [ "${haveManifest}" = "yes" ]; then
+ rp="${fn}"
+ fn="${SRC}/${rp}"
+ else
+ rp=$(
+ echo $(/usr/bin/dirname "${fn}")/$(/bin/basename "${fn}") |
+ /bin/sed "s;^${leadin}/*;;"
+ )
+ fi
[ "${DEBUG}" ] || echo >&2 "rp=|${rp}|"
# Copy directories, even if they are going to be empty.
# Inodes are cheap, as long as you have enough.
@@ -139,18 +166,22 @@ do
# May not want this file under any circumstances
bn=$(/bin/basename "${rp}")
filteredBn=$(echo "${bn}" | sed -n ${bnFilter})
- if [ -z "${filteredBn}" ]; then
+ if [ "${haveManifest}" = "no" -a -z "${filteredBn}" ]; then
[ "${DEBUG}" ] || echo >&2 "Filter rejects |${fn}|"
continue
fi
# We want this file if the language matches or if it is
# language neutral
- copyIt=no
+ copyIt=${haveManifest}
case "${bn}" in
- *-${LANG}.* )
+ *-${targetLang}.* )
# Has matching language
copyIt=yes
;;
+ *-*-* )
+ # Multiple dashes imply ambiguous filename
+ copyIt=yes
+ ;;
*-* )
# Doesn't match target language
;;