1 Index: com/sun/star/deployment/makefile.mk
2 ===================================================================
3 RCS file: /cvs/api/offapi/com/sun/star/deployment/makefile.mk,v
4 retrieving revision 1.15
5 diff -u -r1.15 makefile.mk
6 --- offapi/com/sun/star/deployment/makefile.mk 6 Jul 2007 14:32:11 -0000 1.15
7 +++ offapi/com/sun/star/deployment/makefile.mk 22 Nov 2007 14:43:47 -0000
10 VersionException.idl \
11 InstallException.idl \
13 UpdateInformationEntry.idl \
14 XUpdateInformationProvider.idl \
15 UpdateInformationProvider.idl \
16 --- /dev/null 2007-10-09 17:51:18.611015998 +0100
17 +++ offapi/com/sun/star/deployment/LinkException.idl 2007-11-22 13:45:04.000000000 +0000
19 +/*************************************************************************
21 + * OpenOffice.org - a multi-platform office productivity suite
27 + * last change: $Author$ $Date$
29 + * The Contents of this file are made available subject to
30 + * the terms of GNU Lesser General Public License Version 2.1.
33 + * GNU Lesser General Public License Version 2.1
34 + * =============================================
35 + * Copyright 2006 by Sun Microsystems, Inc.
36 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
38 + * This library is free software; you can redistribute it and/or
39 + * modify it under the terms of the GNU Lesser General Public
40 + * License version 2.1, as published by the Free Software Foundation.
42 + * This library is distributed in the hope that it will be useful,
43 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
45 + * Lesser General Public License for more details.
47 + * You should have received a copy of the GNU Lesser General Public
48 + * License along with this library; if not, write to the Free Software
49 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
52 + ************************************************************************/
54 +#ifndef INCLUDED_COM_SUN_STAR_DEPLOYMENT_LINKEXCEPTION_IDL
55 +#define INCLUDED_COM_SUN_STAR_DEPLOYMENT_LINKEXCEPTION_IDL
57 +#include "com/sun/star/uno/Exception.idl"
59 +module com { module sun { module star { module deployment {
64 + describes the fact that deployment unit is about to be linked.
66 + <p>This exception is intended to be used with an
67 + <type scope="com::sun::star::task">XInteractionHandler</type>.</p>
71 +exception LinkException: com::sun::star::uno::Exception {
73 + represents the new deployment unit.
75 + <p>Must not be <NULL/>.</p>
85 Index: source/deployment/manager/dp_manager.cxx
86 ===================================================================
87 RCS file: /cvs/framework/desktop/source/deployment/manager/dp_manager.cxx,v
88 retrieving revision 1.26
89 diff -u -r1.26 dp_manager.cxx
90 --- desktop/source/deployment/manager/dp_manager.cxx 26 Jul 2007 08:54:34 -0000 1.26
91 +++ desktop/source/deployment/manager/dp_manager.cxx 22 Nov 2007 14:45:05 -0000
93 #include "com/sun/star/ucb/NameClash.hpp"
94 #include "com/sun/star/deployment/VersionException.hpp"
95 #include "com/sun/star/deployment/InstallException.hpp"
96 +#include "com/sun/star/deployment/LinkException.hpp"
97 #include "com/sun/star/task/XInteractionApprove.hpp"
98 #include "com/sun/star/ucb/UnsupportedCommandException.hpp"
99 #include "boost/bind.hpp"
104 +oslFileError dp_linkFile( rtl_uString* ustrFileURL, rtl_uString* ustrDestURL )
106 + oslFileError eRet = osl_File_E_invalidError;
108 + OSL_ASSERT( ustrFileURL );
109 + OSL_ASSERT( ustrDestURL );
111 + /* convert source url to system path */
112 + rtl::OUString aSrc;
113 + eRet = osl_getSystemPathFromFileURL( ustrFileURL, &aSrc.pData );
114 + if( eRet != osl_File_E_None )
116 + rtl::OString aSrcPath = rtl::OUStringToOString( aSrc, osl_getThreadTextEncoding() );
118 + /* convert destination url to system path */
119 + rtl::OUString aDest;
120 + osl_getSystemPathFromFileURL( ustrDestURL, &aDest.pData );
121 + if( eRet != osl_File_E_None )
123 + rtl::OString aDestPath = rtl::OUStringToOString( aDest, osl_getThreadTextEncoding() );
125 + rtl::OString sName = aSrcPath;
126 + sal_Int32 nEnd = sName.getLength()-1;
127 + if (sName.pData->buffer[nEnd] == '/')
129 + sal_Int32 nStart = sName.lastIndexOf( '/', nEnd );
130 + sName = sName.copy(nStart, nEnd - nStart + 1);
132 + int nRet = symlink(aSrcPath.getStr(), (aDestPath + sName).getStr());
133 + eRet = nRet != 0 ? osl_File_E_invalidError : osl_File_E_None;
138 //______________________________________________________________________________
139 OUString PackageManagerImpl::insertToActivationLayer(
140 OUString const & mediaType, ::ucbhelper::Content const & sourceContent_,
141 @@ -536,11 +571,11 @@
142 destFolder = makeURL( m_activePackages, tempEntry );
144 destFolder += OUSTR("_");
147 // prepare activation folder:
148 ::ucbhelper::Content destFolderContent;
149 create_folder( &destFolderContent, destFolder, xCmdEnv );
152 // copy content into activation temp dir:
153 if (mediaType.matchIgnoreAsciiCaseAsciiL(
154 RTL_CONSTASCII_STRINGPARAM(
155 @@ -552,19 +587,49 @@
158 ::rtl::OUStringBuffer buf;
159 - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") );
160 - buf.append( ::rtl::Uri::encode( sourceContent.getURL(),
161 + if (!sourceContent.isFolder())
163 + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") );
164 + buf.append( ::rtl::Uri::encode( sourceContent.getURL(),
165 rtl_UriCharClassRegName,
166 rtl_UriEncodeIgnoreEscapes,
167 RTL_TEXTENCODING_UTF8 ) );
170 + buf.append( sourceContent.getURL() );
172 buf.append( static_cast<sal_Unicode>('/') );
173 - sourceContent = ::ucbhelper::Content(
174 - buf.makeStringAndClear(), xCmdEnv );
175 + sourceContent = ::ucbhelper::Content( buf.makeStringAndClear(), xCmdEnv );
178 + bool bLink = false;
179 + Any request( (deployment::LinkException()) );
180 + bool approve = false, abort = false;
181 + interactContinuation( request, task::XInteractionApprove::static_type(),
182 + xCmdEnv, &approve, &abort );
184 + if (!abort && approve)
190 + (!sourceContent.isFolder()) ||
191 + (osl_File_E_None != dp_linkFile(sourceContent.getURL().pData, destFolderContent.getURL().pData))
194 + throw RuntimeException( OUSTR("dp_linkFile() failed!"), 0 );
199 + if (! destFolderContent.transferContent(
200 + sourceContent, ::ucbhelper::InsertOperation_COPY,
201 + title, NameClash::OVERWRITE ))
203 + throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
206 - if (! destFolderContent.transferContent(
207 - sourceContent, ::ucbhelper::InsertOperation_COPY,
208 - title, NameClash::OVERWRITE ))
209 - throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
212 dbData->temporaryName = tempEntry;
213 Index: source/pkgchk/unopkg/unopkg_app.cxx
214 ===================================================================
215 RCS file: /cvs/framework/desktop/source/pkgchk/unopkg/unopkg_app.cxx,v
216 retrieving revision 1.6.84.1
217 diff -u -r1.6.84.1 unopkg_app.cxx
218 --- desktop/source/pkgchk/unopkg/unopkg_app.cxx 10 Aug 2007 15:03:53 -0000 1.6.84.1
219 +++ desktop/source/pkgchk/unopkg/unopkg_app.cxx 10 Aug 2007 15:03:53 -0000 1.6.84.1
221 " -V, --version version information\n"
222 " -v, --verbose verbose output to stdout\n"
223 " -f, --force force overwriting existing extensions\n"
225 +" -l, --link attempt to link to instead of copying extensions\n"
227 " --log-file <file> custom log file; default: <cache-dir>/log.txt\n"
228 " --shared expert feature: operate on shared installation\n"
229 " deployment context;\n"
231 { RTL_CONSTASCII_STRINGPARAM("version"), 'V', false },
232 { RTL_CONSTASCII_STRINGPARAM("verbose"), 'v', false },
233 { RTL_CONSTASCII_STRINGPARAM("force"), 'f', false },
235 + { RTL_CONSTASCII_STRINGPARAM("link"), 'l', false },
237 { RTL_CONSTASCII_STRINGPARAM("log-file"), '\0', true },
238 { RTL_CONSTASCII_STRINGPARAM("shared"), '\0', false },
239 { RTL_CONSTASCII_STRINGPARAM("deployment-context"), '\0', true },
242 bool option_shared = false;
243 bool option_force = false;
244 + bool option_link = false;
245 bool option_verbose = false;
246 bool option_bundled = false;
247 bool subcmd_add = false;
248 @@ -218,11 +225,13 @@
249 OUString deploymentContext;
251 ::std::vector<OUString> cmdPackages;
254 OptionInfo const * info_shared = getOptionInfo(
255 s_option_infos, OUSTR("shared") );
256 OptionInfo const * info_force = getOptionInfo(
257 s_option_infos, OUSTR("force") );
258 + OptionInfo const * info_link = getOptionInfo(
259 + s_option_infos, OUSTR("link") );
260 OptionInfo const * info_verbose = getOptionInfo(
261 s_option_infos, OUSTR("verbose") );
262 OptionInfo const * info_log = getOptionInfo(
264 !readOption( &option_shared, info_shared, &nPos ) &&
265 !readOption( &option_force, info_force, &nPos ) &&
266 !readOption( &option_bundled, info_bundled, &nPos ) &&
267 + !readOption( &option_link, info_link, &nPos ) &&
268 !readArgument( &deploymentContext, info_context, &nPos ) &&
269 !isBootstrapVariable(&nPos))
273 Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv(
274 createCmdEnv( xComponentContext, logFile,
275 - option_force, option_verbose, option_bundled) );
276 + option_force, option_link, option_verbose, option_bundled) );
279 subCommand.equalsAsciiL(
280 +++ openoffice.org/desktop/source/pkgchk/unopkg/unopkg_app.cxx 22 Nov 2007 14:46:24 -0000
281 Index: source/pkgchk/unopkg/unopkg_cmdenv.cxx
282 ===================================================================
283 RCS file: /cvs/framework/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx,v
284 retrieving revision 1.8
285 diff -u -r1.8 unopkg_cmdenv.cxx
286 --- desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx 26 Jun 2007 11:13:26 -0000 1.8
287 +++ desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx 22 Nov 2007 14:46:24 -0000
289 #include "com/sun/star/task/XInteractionAbort.hpp"
290 #include "com/sun/star/task/XInteractionApprove.hpp"
291 #include "com/sun/star/deployment/InstallException.hpp"
292 +#include "com/sun/star/deployment/LinkException.hpp"
293 #include "com/sun/star/container/ElementExistException.hpp"
294 #include "com/sun/star/deployment/LicenseException.hpp"
295 #include "com/sun/star/deployment/VersionException.hpp"
298 sal_Int32 m_logLevel;
299 bool m_option_force_overwrite;
300 + bool m_option_link;
301 bool m_option_verbose;
302 bool m_option_bundled;
303 Reference< XComponentContext > m_xComponentContext;
305 Reference<XComponentContext> const & xComponentContext,
306 OUString const & log_file,
307 bool option_force_overwrite,
310 bool option_bundled);
312 @@ -137,10 +140,12 @@
313 Reference<XComponentContext> const & xComponentContext,
314 OUString const & log_file,
315 bool option_force_overwrite,
320 m_option_force_overwrite( option_force_overwrite ),
321 + m_option_link( option_link ),
322 m_option_verbose( option_verbose ),
323 m_option_bundled( option_bundled),
324 m_xComponentContext(xComponentContext)
326 lang::WrappedTargetException wtExc;
327 deployment::LicenseException licExc;
328 deployment::InstallException instExc;
329 + deployment::LinkException linkExc;
330 deployment::LicenseIndividualAgreementException licAgreementExc;
331 deployment::PlatformException platExc;
332 deployment::VersionException verExc;
334 bLicenseException = true;
335 printLicense(licExc.Text, approve, abort);
337 + else if (request >>= linkExc)
339 + approve = m_option_link;
341 else if (request >>= instExc)
343 //Only if the unopgk was started with gui + extension then we user is asked.
344 @@ -457,11 +467,12 @@
345 Reference< XComponentContext > const & xContext,
346 OUString const & logFile,
347 bool option_force_overwrite,
352 return new CommandEnvironmentImpl(
353 - xContext, logFile, option_force_overwrite, option_verbose, option_bundled);
354 + xContext, logFile, option_force_overwrite, option_link, option_verbose, option_bundled);
358 Index: source/pkgchk/unopkg/unopkg_shared.h
359 ===================================================================
360 RCS file: /cvs/framework/desktop/source/pkgchk/unopkg/unopkg_shared.h,v
361 retrieving revision 1.2.130.1
362 diff -u -r1.2.130.1 unopkg_shared.h
363 --- desktop/source/pkgchk/unopkg/unopkg_shared.h 10 Aug 2007 15:04:16 -0000 1.2.130.1
364 +++ desktop/source/pkgchk/unopkg/unopkg_shared.h 22 Nov 2007 14:46:24 -0000
366 css::uno::Reference<css::uno::XComponentContext> const & xContext,
367 ::rtl::OUString const & logFile,
368 bool option_force_overwrite,
371 bool option_bundled);