version() if $opt_version;
# Figure out what kind of repo we are in.
-# TODO: we might also check svn/cvs more strict.
-if ( -d "CVS" ) {
- $vcs = "cvs";
-} elsif ( -d '.svn' ) {
- $vcs = "svn";
-} else {
- # Respect $PATH while looking for git
- if (getenv("PATH")) {
- foreach my $path ( split(":", getenv("PATH")) ) {
- if ( -X "$path/bzr" ) {
- open(BZR, '-|', "${path}/bzr root 2>/dev/null");
- $vcs = "bzr" if defined(<BZR>);
- close(BZR);
- last if $vcs;
- }
- if ( -X "$path/git" ) {
- open(GIT, '-|', "${path}/git rev-parse --git-dir 2>/dev/null");
- $vcs = "git" if defined(<GIT>);
- close(GIT);
- last if $vcs;
- }
- if ( -X "$path/hg" ) {
- open(HG, '-|', "${path}/hg root 2>/dev/null");
- $vcs = "hg" if defined(<HG>);
- close(HG);
- last if $vcs;
- }
+# Respect $PATH while looking for the VCS
+if (getenv("PATH")) {
+ foreach my $path ( split(":", getenv("PATH")) ) {
+ if ( -X "${path}/bzr" ) {
+ open(BZR, '-|', "${path}/bzr root 2>/dev/null");
+ $vcs = "bzr" if defined(<BZR>);
+ close(BZR);
+ last if $vcs;
+ }
+ if ( -X "${path}/cvs" ) {
+ $vcs = "cvs" if -d "CVS";
+ last if $vcs;
+ }
+ if ( -X "${path}/git" ) {
+ open(GIT, '-|', "${path}/git rev-parse --git-dir 2>/dev/null");
+ $vcs = "git" if defined(<GIT>);
+ close(GIT);
+ last if $vcs;
+ }
+ if ( -X "${path}/hg" ) {
+ open(HG, '-|', "${path}/hg root 2>/dev/null");
+ $vcs = "hg" if defined(<HG>);
+ close(HG);
+ last if $vcs;
+ }
+ if ( -X "${path}/svn" ) {
+ $vcs = "svn" if -d ".svn";
+ last if $vcs;
}
}
+}
- if ( ! $vcs ) {
- die "No CVS, .git, .svn directories found, what kind of repo is this?";
- }
+if ( ! $vcs ) {
+ print STDERR "Either no CVS, .git, .svn, ... directories found, the specific VCS has not been\n";
+ print STDERR "installed or you don't have execute rights!\n";
+ exit(1);
}
# Read the current ChangeLog