docs-common/bin copy-figs,1.1,1.2
Tommy Reynolds (jtr)
fedora-docs-commits at redhat.com
Mon Dec 12 16:35:09 UTC 2005
Author: jtr
Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3253
Modified Files:
copy-figs
Log Message:
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.
Index: copy-figs
===================================================================
RCS file: /cvs/docs/docs-common/bin/copy-figs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- copy-figs 11 Dec 2005 03:26:16 -0000 1.1
+++ copy-figs 12 Dec 2005 16:35:02 -0000 1.2
@@ -114,20 +114,47 @@
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 @@
# 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
;;
More information about the Fedora-docs-commits
mailing list