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