RepoRevision.pm (27a447d8) RepoRevision.pm (8403f704)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 61 unchanged lines hidden (view full) ---

70}
71
72
73sub DetectRevisionId ($)
74{
75 my $path = shift;
76 my $id = undef;
77
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 61 unchanged lines hidden (view full) ---

70}
71
72
73sub DetectRevisionId ($)
74{
75 my $path = shift;
76 my $id = undef;
77
78 #NOTE: Magic cookie file 'reporevision.lst' created by aoo_srcrelease
79 $id = DetectRevisionIdFromFile ("$ENV{'SOLARENV'}/inc/reporevision.lst");
80 if ($id) { return $id };
81
78 my $NotGit = `cd $path && git rev-parse --git-dir > /dev/null 2>&1`;
79 if (!$NotGit || -d ".git" || -d "$path/.git")
80 {
81 $id = DetectRevisionIdFromGit ($path);
82 }
83 else
84 {
85 $id = DetectRevisionIdFromSVN ($path);
86 }
87
82 my $NotGit = `cd $path && git rev-parse --git-dir > /dev/null 2>&1`;
83 if (!$NotGit || -d ".git" || -d "$path/.git")
84 {
85 $id = DetectRevisionIdFromGit ($path);
86 }
87 else
88 {
89 $id = DetectRevisionIdFromSVN ($path);
90 }
91
88 if (!$id)
89 {
90 #NOTE: Magic cookie file 'reporevision.lst' created by aoo_srcrelease
91 $id = DetectRevisionIdFromFile ("$ENV{'SOLARENV'}/inc/reporevision.lst");
92 if (!$id) { $id = "unknown-rev" };
93 }
92 if (!$id) { $id = "unknown-rev" };
94 return $id;
95}
96
971;
93 return $id;
94}
95
961;