This file is indexed.

/usr/bin/cvs-inject is in cvs-buildpackage 5.26.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
#! /bin/bash
#                               -*- Mode: Sh -*- 
# cvs-inject --- 
# Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
# Created On       : Mon May 26 14:23:17 1997
# Created On Node  : tiamat.datasync.com
# Last Modified By : Manoj Srivastava
# Last Modified On : Sun Jun  6 12:11:36 2004
# Last Machine Used: glaurung.internal.golden-gryphon.com
# Update Count     : 327
# Status           : Unknown, Use with caution!
# HISTORY          : 
# Description      : 
# $Id: cvs-inject,v 1.41 2003/08/26 08:04:46 srivasta Exp $
# 

# Make sure we abort on error
set -e

declare -a argv

progname="`basename \"$0\"`"
pversion='$Revision: 1.41 $'

setq() {
    # Variable Value Doc string
    if [ "x$2" = "x" ]; then
	echo >&2 "$progname: Unable to determine $3"
	exit 1;
    else
	if [ ! "x$Verbose" = "x" ]; then
	    echo "$progname: $3 is $2";
	fi
	eval "$1=\"\$2\"";
    fi
}

withecho () {
        echo " $@" >&2
        "$@"
}

usageversion () {
        cat >&2 <<END
Usage: $progname  [options] <package>.dsc
Options: 
  -h           print this message
  -F           Force removal of CVS directories and symbolic links
               before import. This should be used with caution!!
  -m           Add a cvs message based on the changelog
  -M<module>   CVS module name.
  -R<root dir> Root directory.
  -T<tag>      CVS Tag to use
  -U<tag>      Upstream tag to use
  -W<work dir> Working directory.
  -d<digit>    Set Debug Level
  -n           "Dry-run" mode - No action taken, only print commands.
  -v           Make the command verbose
  -ctp         Include <package>_ at start of CVS tag.
  -x<prefix>   CVS default module prefix.

Note that the current behaviour of cvs-inject is to ignore any files
that match the default list of file name patterns to be ignored (this
is built into cvs); and that any .cvsignore files in the upstream
sources shall be honoured.

END
}

# We need a debian source control file
if [ $# = 0 ]; then
    usageversion; 
    exit 1;
fi

# The defaults
rootdir='/usr/local/src/Packages'
tmpdir="temp-$progname"

docmd='YES'
action='withecho'


DEBUG=0
VERBOSE=0

# parse Command line
# Note that we use `"$@"' to let each command-line parameter expand to a 
# separate word. The quotes around `$@' are essential!
# We need TEMP as the `eval set --' would nuke the return value of getopt.
TEMP=$(getopt -a -s bash -o hFmM:R:T:U:W:nvcd:x:c --long ctp,help \
       -n 'cvs-inject' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi

# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"

while true ; do
    case "$1" in
        -h|--help) usageversion; exit 0   ; shift   ;;
	-F)	 opt_forceclean=1         ; shift   ;;
	-m)	 opt_use_changelog=1      ; shift   ;;
        -M)	 opt_cvsmodule="$2"       ; shift 2 ;;
        -R)	 opt_rootdir="$2"         ; shift 2 ;;
	-T)	 opt_tag="$2"             ; shift 2 ;;
	-U)	 opt_utag="$2"            ; shift 2 ;;
        -W)	 opt_workdir="$2"         ; shift 2 ;;
	-n)	 action='echo';docmd='NO' ; shift   ;;
	-v)	 VERBOSE=1                ; shift   ;;
	-d)	 opt_DEBUG="$2"           ; shift 2 ;;
	-x)	 opt_prefix="$2"          ; shift 2 ;;
       -c|--ctp) opt_packageintag=1       ; shift   ;;
        --)      shift ; break ;;
	*) echo >&2 "Internal error!($i)"
	    usageversion; exit 1           ;;
    esac
done

for arg in ${1+"$@"}; do
    case "$arg" in
	*.dsc)
	    if [ "X$opt_dsc" = "X" ]; then
		opt_dsc="$arg";
	    else
		echo >&2 "I can only deal with one Debian Source Control"
		echo >&2 "file at a time. I think I already have one "
		echo >&2 "in $opt_dsc. So, whats this $arg ?"
		exit 1
	    fi	
	;;
	*)  echo >&2 "Unknown argument $arg. I understand only a"
	    echo >&2 "Debian Source Control file name as an argument"
	    usageversion; exit 1 ;;
    esac
done

CVS_QUIET="-Q"
TAR_QUIET=""

if [ $VERBOSE -gt 0 ]; then
    echo "Initializing ..."
    CVS_QUIET="-q"
    TAR_QUIET="v"
fi

# did the user specify a dsc file?
if [ "X$opt_dsc" = "X" ]; then
    echo "package descscription file needs to be specified" 1>&2
    usageversion; 
    exit 1
fi

if [ "X$CVSROOT" = "X" ]; then
    echo "You should have set the CVSROOT env variable."  1>&2
    usageversion; 
    exit 1
fi

# can we read the dsc file?
if [ ! -r $opt_dsc ]; then
    echo "package descscription file $opt_dsc is not available" 1>&2
    usageversion; 
    exit 1
fi

# Load site defaults and over rides.
if [ -f /etc/cvsdeb.conf ]; then
    . /etc/cvsdeb.conf
fi

# Load user defaults and over rides.
if [ -f ~/.cvsdeb.conf ]; then
    . ~/.cvsdeb.conf
fi

# If asked to debug on command line, that's what we get
if [ ! "x$opt_DEBUG" = "x" ]; then
    DEBUG="$opt_DEBUG"
fi

if [ "$DEBUG" -gt 0 ]; then
    CVS_QUIET=""
    TAR_QUIET="vv"
fi



# Command line, env variable, config file, or default
if [ ! "x$opt_rootdir" = "x" ]; then
    rootdir="$opt_rootdir"
elif [ ! "x$CVSDEB_ROOTDIR" = "x" ]; then
    rootdir="$CVSDEB_ROOTDIR"
elif [ ! "x$conf_rootdir" = "x" ]; then
    rootdir="$conf_rootdir"
fi

# Command line, env variable, config file, or default
if [ ! "x$opt_prefix" = "x" ]; then
    prefix="$opt_prefix"
elif [ ! "x$CVSDEB_PREFIX" = "x" ]; then
    prefix="$CVSDEB_PREFIX"
elif [ ! "x$conf_prefix" = "x" ]; then
    prefix="$conf_prefix"
else
    prefix=""
fi

# Command line, env variable, config file, or default
if [ ! "x$opt_packageintag" = "x" ]; then
    packageintag="$opt_packageintag"
elif [ ! "x$CVSDEB_PACKAGEINTAG" = "x" ]; then
    packageintag="$CVSDEB_PACKAGEINTAG"
elif [ ! "x$conf_packageintag" = "x" ]; then
    packageintag="$conf_packageintag"
else
    packageintag=""
fi



# put a slash at the end of the prefix
if [ "X$prefix" != "X" ]; then
    prefix="$prefix/";
    prefix=`echo $prefix | sed 's://:/:g'`;
fi


filename=`basename $opt_dsc .dsc`
package=`cat $opt_dsc | perl -wnle 'm/^\s*Source\s*:\s*(\S+)/io && print $1;'`
version=`cat $opt_dsc | perl -wnle 'm/^\s*Version\s*:\s*(\S+)/io && print $1;' | head -n 1`

# Command line, env variable, or default
if [ ! "x$opt_cvsmodule" = "x" ]; then
    cvsmodule="$opt_cvsmodule"
elif [ ! "x$CVSDEB_MODULE" = "x" ]; then
    cvsmodule="$CVSDEB_MODULE"
else
    cvsmodule="${prefix}$package"
fi

non_epoch_version=$(echo -n "$version" | perl -pe 's/^\d+://')
upstream_version=$(echo -n "$non_epoch_version" | sed  -e 's/-[^-]*$//')

if [ "x$opt_tag" != "x" ]; then
    cvstag="$opt_tag"
else
    cvstag=$(echo -n "debian_version_$non_epoch_version" | \
	tr -c -- "-_a-zA-Z0-9" "_")
fi

if [ "X$opt_utag" != "X" ]; then
    cvs_upstream_tag="$opt_utag"
else
    cvs_upstream_tag=$(echo -n "upstream_version_$upstream_version" | \
	tr -c -- "-_a-zA-Z0-9" "_")
fi

if [ "x$packageintag" != x ]; then
    cvstag=$(echo -n "${package}_$cvstag"| tr -c -- "-_a-zA-Z0-9" "_") 
    cvs_upstream_tag=$(echo -n "${package}_$cvs_upstream_tag"| \
	tr -c -- "-_a-zA-Z0-9" "_")
fi

if [ "X$version" != "X$upstream_version" ]; then
   debian_version=$(echo $non_epoch_version | \
       perl -nle 'm/-([^-]*)$/ && print $1')
   DEB_ONLY='FALSE'
else
    DEB_ONLY='TRUE'
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "Debian only package"
    fi
fi

if [ $DEBUG ]; then
    echo "package=${package} cvsmodule=$cvsmodule"
    echo "upstream_version=${upstream_version} "
    echo "cvs_upstream_tag=${cvs_upstream_tag} "
    if [ "X$DEB_ONLY" = "XTRUE" ]; then
	echo "Debian only package"
    else
	echo "debian_version=${debian_version} cvstag=${cvstag}"
    fi
fi

# Command line, env variable, config file, or default
if [ ! "x$opt_workdir" = "x" ]; then
    workdir="$opt_workdir"
elif [ ! "x$CVSDEB_WORKDIR" = "x" ]; then
    workdir="$CVSDEB_WORKDIR"
elif [ ! "x$conf_workdir" = "x" ]; then
    workdir="$conf_workdir"
else
    workdir="$rootdir/$package"
fi

# Command line, env variable, config file, or default
if [ ! "x$opt_forceclean" = "x" ]; then
    forceclean="$opt_forceclean"
elif [ ! "x$CVSDEB_FORCECLEAN" = "x" ]; then
    forceclean="$CVSDEB_FORCECLEAN"
elif [ ! "x$conf_forceclean" = "x" ]; then
    forceclean="$conf_forceclean"
else
    forceclean=""
fi

# Command line, env variable, config file, or default
if [ ! "x$opt_use_changelog" = "x" ]; then
    use_changelog="$opt_use_changelog"
elif [ ! "x$CVSDEB_USE_CHANGELOG" = "x" ]; then
    use_changelog="$CVSDEB_USE_CHANGELOG"
elif [ ! "x$conf_use_changelog" = "x" ]; then
    use_changelog="$conf_use_changelog"
else
    use_changelog=""
fi

# env variable, or default
if [ ! "x$CVSDEB_IMPORTSUBSTMODE" = "x" ]; then
    importsubstmode="$CVSDEB_IMPORTSUBSTMODE"
else
    importsubstmode="-ko -d"
fi


sourcedir=`dirname $opt_dsc`
srcfile=`basename  $opt_dsc`



#set the absolute path name to the dsc file
if [ $VERBOSE -gt 0 ]; then
    echo ""
    echo "# Getting the absolute path name to the dsc file"
fi
cd "$sourcedir"
sourcedir=`pwd`
opt_dsc="$sourcedir/$srcfile"


######################################################################
######################################################################
######################################################################
######################################################################
######################################################################

# clean up the temporary locations
clean_up() {
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Cleaning up"
    fi
    $action cd "${workdir}"
    if [ "X$docmd" = "XYES"  ]; then
	if [ -d "$tmpdir" ]; then
	    $action rm -rf "$tmpdir"
	    if [ -d "${tmpdir}" ]; then
		echo "Hmm. Something went wrong trying to remove the temp dir"
		echo "Retrying."
		$action chmod -r u+w "${tmpdir}"
		$action rm -rf "${tmpdir}"
	    fi
	fi
    else
	$action rm -rf "$tmpdir"
    fi
}

# check for symbolic links in the upstream sources
check_symlinks() {
    if [ $VERBOSE -gt 0 ]; then
	echo "# Check Symlinks in" $(pwd)
    fi
    symbolic_links=$(find . -type l -print)
    if [ "X$symbolic_links" != "X" ]; then
	if [ "X$forceclean" != "X" ]; then
	    echo >&2 "You have asked me to remove symbolic links I find."
	    echo >&2 "since cvs import chokes on them. I have found"
	    echo >&2 "the following symbolic links:"
	    echo >&2 "$symbolic_links"
	    echo >&2 ""
	    ans=""
	    while [ "X$ans" = "X" ]; do
		echo -n >&2 "Shall I remove the links?[y/n]"
		read ans;
		case $ans in
		    y*|Y*)
			$action rm -f $symbolic_links
			;;
		    *)
			echo >&2 "Please delete the following"
			echo >&2 "links and try again."
			echo >&2 "$symbolic_links"
			clean_up;
			exit 1
		esac
	    done
	else
	    echo >&2 "The upstream sources contain symbolic links."
	    echo >&2 "CVS ignores symblic links, you have to handle link "
	    echo >&2 "creation in the modules file (-e and -o args)"
	    echo >&2 "Since this causes an error on import, I can't."
	    echo >&2 "handle this. Please delete the following"
	    echo >&2 "links and try again."
	    echo >&2 "$symbolic_links"
	    clean_up;
	    exit 1
	fi
    fi
}

check_CVS_dirs() {
    if [ $VERBOSE -gt 0 ]; then
	echo "# Check CVS Dirs in" $(pwd)
    fi
    CVS_dirs=$(find . -type d -name CVS -print)
    if [ "X$CVS_dirs" != "X" ]; then
	if [ "X$forceclean" != "X" ]; then
	    echo >&2 "You have asked me to remove CVS dirs I find."
	    echo >&2 "since cvs import chokes on them. I have found"
	    echo >&2 "the following dirs:"
	    echo >&2 "$CVS_dirs"
	    echo >&2 ""
	    ans=""
	    while [ "X$ans" = "X" ]; do
		echo -n >&2 "Shall I remove the Directories?[y/n]"
		read ans;
		case $ans in
		    y*|Y*)
			$action rm -rf $CVS_dirs
			;;
		    *)
			echo >&2 "Please delete the following"
			echo >&2 "CVS directories and try again."
			echo >&2 "$CVS_dirs"
			clean_up;
			exit 1
		esac
	    done
	
	else
	    echo >&2 "The upstream sources contain CVS directories."
	    echo >&2 "This I can't handle. Please delete the following"
	    echo >&2 "directories and try again."
	    echo >&2 "$CVS_dirs"
	    clean_up;
	    exit 1
	fi
    fi
}
check_CVS_ignore() {
    if [ $VERBOSE -gt 0 ]; then
	echo "# Check CVS ignores in" $(pwd)
    fi
    CVS_ignores=$(find . -type f -name .cvsignore -print)
    if [ "X$CVS_ignores" != "X" ]; then
	if [ "X$forceclean" != "X" ]; then
	    echo >&2 "You have asked me to remove .cvsignore I find."
	    echo >&2 "since cvs import may be adversly affected.. "
	    echo >&2 "I have found the following dirfiles:"
	    echo >&2 "$CVS_ignores"
	    echo >&2 ""
	    ans=""
	    while [ "X$ans" = "X" ]; do
		echo -n >&2 "Shall I remove the files?[y/n]"
		read ans;
		case $ans in
		    y*|Y*)
			$action rm -f $CVS_ignores
			;;
		    *)
			echo >&2 "Please delete the following"
			echo >&2 "CVS .ignore files and try again."
			echo >&2 "$CVS_ignores"
			clean_up;
			exit 1
		esac
	    done
	fi
    fi
}

# Importing the upstream sources
import_orig() {
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Import the original source tree"
    fi
    $action cd "$1"
    if [ "X$docmd" = "XYES" ]; then
	check_symlinks;
	check_CVS_dirs;
	check_CVS_ignore;
    else
    	echo "check_symlinks"
    	echo "check_CVS_dirs"
    	echo "check_CVS_ignore"
    fi
    if [ ! "X$use_changelog" = "X" -a -f debian/changelog ]; then
	changes=`dpkg-parsechangelog | grep '^  '`
    fi

    if [ -d ./debian/ ]; then
	HAVE_DEBIAN_DIR='YES';
    fi

    argv=(cvs $CVS_QUIET import ${importsubstmode} \
	-m"Imported upstream version $upstream_version. 
$changes"  "${cvsmodule}" source-dist "${cvs_upstream_tag}")
    $action "${argv[@]}"
    $action cd ..
}

#
co_import() {
    # For non debian only packages
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Extracting the imported files"
    fi

    $action cvs co "${cvsmodule}"
    # Where did it go?
    if [ ! -d "$package-${upstream_version}" ]; then
         if [ -d "${prefix}$package-${upstream_version}" ]; then
	            mv "${prefix}$package-${upstream_version}" \
		       "${package}-${upstream_version}";
	 fi
    fi
    $action cd "$package-${upstream_version}";
    
    # make sure that the debianized version does not have any problems
    # either. 
    if [ "X$docmd" = "XYES" ]; then
	check_symlinks;
	check_CVS_dirs;
	check_CVS_ignore;
    else
    	echo "check_symlinks"
    	echo "check_CVS_dirs"
    	echo "check_CVS_ignore"
    fi
    # these sources should be clean enough to overlay on top of what
    # we have exported.  
    if [ "X$docmd" = "XYES" ]; then
	if [ "X$action" = "Xwithecho" ]; then
	    echo "tar cf - . | (cd ../${cvsmodule}; tar ${TAR_QUIET}xf -)"
	fi
	tar cf - . | (cd "../${cvsmodule}"; tar "${TAR_QUIET}xf" -)
    else
	echo "tar cf - . | (cd ../${cvsmodule}; tar ${TAR_QUIET}xf -)"
    fi
    $action cd ..
}

# commit debianized tree (non debian only packages
commit_debianized() {
    # For non debian only packages
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Committing the Debianized version"
    fi
    $action cd "${cvsmodule}"

    if [ "X$HAVE_DEBIAN_DIR" != "XYES" ]; then
	 $action cvs add debian
    fi
   
    if [ "X$docmd" = "XYES" ]; then
	done=""
	while [ "X$done" != "X1" ]; do
	    dirs=$(cvs -n update | sed -n 's:^\? ::p')
	    if [ "X$dirs" = "X" ]; then
		done=1
		break
	    fi
#	    for item in $(cvs -n update | sed -n 's:^\? ::p'); do
#		dir=$(dirname $item)
#		file=$(basename $item)
#		(cd $dir; cvs add $file)
#	    done
	    if [ "X$action" = "Xwithecho" ]; then
		echo "cvs add <other files found dynamically>"
	    fi
	    cvs -n update | sed -n 's:^\? ::p' | sed 's/ /\\ /g' | \
               xargs -n1 -i! -e sh -c '
                       dir=$(dirname "!");
                       file=$(basename "!"); 
                       cd $dir;
                       cvs add "$file"
               '
	done
    else
	echo "cvs add <other files found dynamically>"
    fi
    if [ ! "X$use_changelog" = "X" -a -f debian/changelog ]; then
	changes=`dpkg-parsechangelog | grep '^  '`
    fi
    argv=(cvs commit -m"Added debian changes for version $version. 
$changes")
    $action "${argv[@]}"
    $action cvs $CVS_QUIET tag -d "${cvstag}"
    $action cvs $CVS_QUIET tag -F "${cvstag}"
    $action cd "${workdir}/$tmpdir"
}


######################################################################
######################################################################
######################################################################
######################################################################


if [ ! -d "$workdir" ]; then
    $action mkdir -p "$workdir"
fi

if [ "X$docmd" = "XYES" ]; then
    if [ ! -d "$workdir" ]; then
	echo "Could not create $workdir"
	exit 1;
    fi
fi

$action cd "$workdir"
if [ -e "$tmpdir" ]; then
    echo >&2 "$workdir/$tmpdir directory exists"
    echo >&2 "It shall be scribbled on if I continue"
    echo >&2 "Aborting"
    exit 1;
fi

$action mkdir "$tmpdir"
if [ "X$docmd" = "XYES" ]; then
    if [ ! -d "$tmpdir" ]; then
	echo >&2 "The working directory ($workdir) is not writable"
	exit 1
    fi
fi

$action cd "$tmpdir"

# extract the sources
if [ $VERBOSE -gt 0 ]; then
    echo ""
    echo "# Extracting the source"
fi
$action dpkg-source -su -x "$opt_dsc"
if [ $? != 0 ]; then
    echo "Error extracting package: exiting" 1>&2
    exit 1
fi


if [ "X$docmd" = "XYES" ]; then
    if [ ! -d "${package}-${upstream_version}" ]; then
	echo >&2 "No ${workdir}/$tmpdir/${package}-${upstream_version}"
	echo >&2 "Error extracting source"
	echo >&2 "Aborting"
	clean_up;
	exit 1
    fi
    
    if [ "X$DEB_ONLY" = "XFALSE" ]; then
	if [ ! -d "${package}-${upstream_version}.orig" ]; then
	    echo >&2 "Warning!!!!!!"
	    echo >&2 "No ${workdir}/$tmpdir/${package}-${upstream_version}"
	    echo >&2 "Though the version number indicates this is not a Debian"
	    echo >&2 "Native Package, it seems to be one. This is a policy"
	    echo >&2 "violation. This should be corrected."
	    ans=""
	    while [ "X$ans" = "X" ]; do
		echo -n >&2 "Do you wish to continue?[y/N]"
		read ans;
		case $ans in
		    y*|Y*)
			echo >&2 "OK. Continuing anyway."
			;;
		    *)
			echo >&2 "Aborting";
			clean_up;
			exit 1
		esac
	    done
	fi
    fi
fi


# import original source tree. 
if [ "X$DEB_ONLY" = "XFALSE" ]; then
    import_orig "${package}-${upstream_version}.orig";
    # extract the imported files, and add the debianized ones
    co_import;
    # And commit the debianized files
    commit_debianized;
else
    import_orig "${package}-${upstream_version}"
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Extracting imported files"
    fi
    $action cvs $CVS_QUIET co "${cvsmodule}"
    if [ $VERBOSE -gt 0 ]; then
	echo ""
	echo "# Tagging the files with debian version"
    fi
    $action cd  "${cvsmodule}"
    $action cvs $CVS_QUIET tag -F "${cvstag}"
    $action cd  "${workdir}/$tmpdir"
fi

clean_up

echo "$package registered under CVS"

exit 0