343 | | (cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found" |
| 343 | # (cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found" |
| 344 | withcvs=true |
| 345 | cvs -v >/dev/null 2>&1 |
| 346 | if test $? -ne 0; then |
| 347 | echo "cvs program not found. it could be possible that we still continue." |
| 348 | echo "when you are a translator you are MAYBE better off using csv and" |
| 349 | echo "the purposed version of gettext (as this 'autopoint' script checks" |
| 350 | echo "out a specific version of gettext.)" |
| 351 | echo "when your distribution is nice it should be possible to copy" |
| 352 | echo "with the installed version of your files." |
| 353 | echo "this will pollute your source directory with some trash" |
| 354 | echo "when things fail:" |
| 355 | echo "install cvs and/or a version of autopoint" |
| 356 | echo "when you modified po/intl/m4 you should stop here" |
| 357 | echo "press return to continue anyway or ctrl+c and install cvs" |
| 358 | read |
| 359 | withcvs=false |
| 360 | fi |
420 | | cvs -d "$CVSROOT" init |
421 | | gzip -d -c < "$gettext_dir/archive.tar.gz" | (cd "$cvs_dir" && tar xf -) |
422 | | |
423 | | cd "$work_dir" |
424 | | cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'` |
425 | | (cvs checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating' |
426 | | find archive -name CVS -type d -print | xargs rm -rf |
427 | | # Check that really all CVS directories are gone, otherwise we would overwrite |
428 | | # the contents of the user's CVS directories. |
429 | | if test `find archive -name CVS -type d -print | wc -l` != 0; then |
430 | | cd .. |
431 | | rm -rf "$cvs_dir" "$work_dir" |
432 | | func_fatal_error "failed to remove all CVS subdirectories" |
433 | | fi |
434 | | if test `find archive -type f -print | wc -l` = 0; then |
435 | | cd .. |
436 | | rm -rf "$cvs_dir" "$work_dir" |
437 | | func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version" |
| 437 | if test "${withcvs}" = "true"; then |
| 438 | # the original code that untars the 'archive' in /usr/share/gettext |
| 439 | # and detects local modifications |
| 440 | # the result is a copy of m4,po,intl,ABOUT_NLS and config.rpath |
| 441 | # this files are available in the /usr/share/gettext directory |
| 442 | # and the cvs is only needed when a translator modifies the files |
| 443 | cvs -d "$CVSROOT" init |
| 444 | gzip -d -c < "$gettext_dir/archive.tar.gz" | (cd "$cvs_dir" && tar xf -) |
| 445 | |
| 446 | cd "$work_dir" |
| 447 | cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'` |
| 448 | (cvs checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating' |
| 449 | find archive -name CVS -type d -print | xargs rm -rf |
| 450 | # Check that really all CVS directories are gone, otherwise we would overwrite |
| 451 | # the contents of the user's CVS directories. |
| 452 | if test `find archive -name CVS -type d -print | wc -l` != 0; then |
| 453 | cd .. |
| 454 | rm -rf "$cvs_dir" "$work_dir" |
| 455 | func_fatal_error "failed to remove all CVS subdirectories" |
| 456 | fi |
| 457 | if test `find archive -type f -print | wc -l` = 0; then |
| 458 | cd .. |
| 459 | rm -rf "$cvs_dir" "$work_dir" |
| 460 | func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version" |
| 461 | fi |
| 462 | else |
| 463 | # workarround for missing cvs |
| 464 | # does overwrite any development changes, but as we checked out from git this might be ok |
| 465 | cd "$work_dir" |
| 466 | mkdir archive |
| 467 | cp -r ${gettext_dir}/* ./archive |