xref: /AOO41X/main/solenv/bin/modules/installer/patch/Tools.pm (revision c9b362f6b4b94fc79a706186f718dbfbc8ea72b0)
1*c9b362f6SAndre Fischer#**************************************************************
2*c9b362f6SAndre Fischer#
3*c9b362f6SAndre Fischer#  Licensed to the Apache Software Foundation (ASF) under one
4*c9b362f6SAndre Fischer#  or more contributor license agreements.  See the NOTICE file
5*c9b362f6SAndre Fischer#  distributed with this work for additional information
6*c9b362f6SAndre Fischer#  regarding copyright ownership.  The ASF licenses this file
7*c9b362f6SAndre Fischer#  to you under the Apache License, Version 2.0 (the
8*c9b362f6SAndre Fischer#  "License"); you may not use this file except in compliance
9*c9b362f6SAndre Fischer#  with the License.  You may obtain a copy of the License at
10*c9b362f6SAndre Fischer#
11*c9b362f6SAndre Fischer#    http://www.apache.org/licenses/LICENSE-2.0
12*c9b362f6SAndre Fischer#
13*c9b362f6SAndre Fischer#  Unless required by applicable law or agreed to in writing,
14*c9b362f6SAndre Fischer#  software distributed under the License is distributed on an
15*c9b362f6SAndre Fischer#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c9b362f6SAndre Fischer#  KIND, either express or implied.  See the License for the
17*c9b362f6SAndre Fischer#  specific language governing permissions and limitations
18*c9b362f6SAndre Fischer#  under the License.
19*c9b362f6SAndre Fischer#
20*c9b362f6SAndre Fischer#**************************************************************
21*c9b362f6SAndre Fischer
22*c9b362f6SAndre Fischerpackage installer::patch::Tools;
23*c9b362f6SAndre Fischer
24*c9b362f6SAndre Fischer=head1 NAME
25*c9b362f6SAndre Fischer
26*c9b362f6SAndre Fischer    package installer::patch::Tools - Collection of functions that don't fit anywhere else
27*c9b362f6SAndre Fischer
28*c9b362f6SAndre Fischer=cut
29*c9b362f6SAndre Fischer
30*c9b362f6SAndre Fischer
31*c9b362f6SAndre Fischer
32*c9b362f6SAndre Fischer
33*c9b362f6SAndre Fischer=head2 CygpathToWindows ($path)
34*c9b362f6SAndre Fischer
35*c9b362f6SAndre Fischer    Convert the given path with the 'cygpath' command into Windows format.  Quote backslashes.
36*c9b362f6SAndre Fischer
37*c9b362f6SAndre Fischer=cut
38*c9b362f6SAndre Fischersub CygpathToWindows($)
39*c9b362f6SAndre Fischer{
40*c9b362f6SAndre Fischer    my ($path) = @_;
41*c9b362f6SAndre Fischer    my $windows_path = qx(cygpath -w "$path");
42*c9b362f6SAndre Fischer    $windows_path =~ s/(^\s+|\s+$)//g;
43*c9b362f6SAndre Fischer    $windows_path =~ s/\\/\\\\/g;
44*c9b362f6SAndre Fischer    return $windows_path;
45*c9b362f6SAndre Fischer}
46*c9b362f6SAndre Fischer
47*c9b362f6SAndre Fischer1;
48