+ if [ -d "$ASSUMED_NAME" -a -s "$ASSUMED_NAME/CVS/Root" ]; then
+ cvsup "$ASSUMED_NAME/$SPECFILE" || Exit_error err_no_spec_in_repo
+ elif [ "$ADD_PACKAGE_CVS" = "yes" ]; then
+ if [ ! -r "$ASSUMED_NAME/$SPECFILE" ]; then
+ echo "ERROR: No package to add ($ASSUMED_NAME/$SPECFILE)" >&2
+ exit 101
+ fi
+ if [ ! -s "$ASSUMED_NAME/CVS/Root" ]; then
+ cvsup -a $ASSUMED_NAME || Exit_error err_cvs_add_failed
+ fi
+ cvsup -a "$ASSUMED_NAME/$SPECFILE" || Exit_error err_cvs_add_failed
+ else
+ cvsup -c -d $ASSUMED_NAME "packages/$ASSUMED_NAME/$SPECFILE" || {
+ # softfail if new package, i.e not yet added to cvs
+ [ ! -f "$ASSUMED_NAME/$SPECFILE" ] && Exit_error err_no_spec_in_repo
+ echo "Warning: package not in CVS - assuming new package"
+ NOCVSSPEC="yes"
+ NOCVS="yes"
+ }
+
+ # remove Entries.Static -- so 'cvs up' would update all files in a repo
+ rm -f "$ASSUMED_NAME/CVS/Entries.Static"
+ fi
+
+ cvsignore_df .cvsignore
+
+ # add default log format to .cvsignore if it is relative to package dir
+ if [ -n "$LOGFILE" -a "$LOGFILE" = "${LOGFILE##*/}" ]; then
+ # substitute known "macros" to glob
+ local logfile=$(echo "$LOGFILE" | sed -e 's,\$\(PACKAGE_NAME\|DATE\),*,g')
+ if [ "$logfile" ]; then
+ cvsignore_df "$logfile"
+ fi
+ fi
+
+ # create symlinks for tools
+ if [ "$SYMLINK_TOOLS" != "no" ]; then
+ for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh pldnotify.awk; do
+ # skip tools that don't exist in top dir
+ [ -f $a ] || continue
+ # skip tools that already exist
+ [ -f $ASSUMED_NAME/$a ] && continue
+ ln -s ../$a $ASSUMED_NAME
+ cvsignore_df $a
+ done
+ fi