| 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 |
--- openoffice.org.orig/offapi/com/sun/star/deployment/makefile.mk 6 Jul 2007 14:32:11 -0000 1.15
|
| 7 |
+++ openoffice.org/offapi/com/sun/star/deployment/makefile.mk 22 Nov 2007 14:43:47 -0000
|
| 8 |
@@ -55,6 +55,7 @@
|
| 9 |
LicenseException.idl \
|
| 10 |
VersionException.idl \
|
| 11 |
InstallException.idl \
|
| 12 |
+ LinkException.idl \
|
| 13 |
UpdateInformationEntry.idl \
|
| 14 |
XUpdateInformationProvider.idl \
|
| 15 |
UpdateInformationProvider.idl \
|
| 16 |
--- /dev/null 2007-10-09 17:51:18.611015998 +0100
|
| 17 |
+++ openoffice.org.orig/offapi/com/sun/star/deployment/LinkException.idl 2007-11-22 13:45:04.000000000 +0000
|
| 18 |
@@ -0,0 +1,66 @@
|
| 19 |
+/*************************************************************************
|
| 20 |
+ *
|
| 21 |
+ * OpenOffice.org - a multi-platform office productivity suite
|
| 22 |
+ *
|
| 23 |
+ * $RCSfile$
|
| 24 |
+ *
|
| 25 |
+ * $Revision$
|
| 26 |
+ *
|
| 27 |
+ * last change: $Author$ $Date$
|
| 28 |
+ *
|
| 29 |
+ * The Contents of this file are made available subject to
|
| 30 |
+ * the terms of GNU Lesser General Public License Version 2.1.
|
| 31 |
+ *
|
| 32 |
+ *
|
| 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
|
| 37 |
+ *
|
| 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.
|
| 41 |
+ *
|
| 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.
|
| 46 |
+ *
|
| 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,
|
| 50 |
+ * MA 02111-1307 USA
|
| 51 |
+ *
|
| 52 |
+ ************************************************************************/
|
| 53 |
+
|
| 54 |
+#ifndef INCLUDED_COM_SUN_STAR_DEPLOYMENT_LINKEXCEPTION_IDL
|
| 55 |
+#define INCLUDED_COM_SUN_STAR_DEPLOYMENT_LINKEXCEPTION_IDL
|
| 56 |
+
|
| 57 |
+#include "com/sun/star/uno/Exception.idl"
|
| 58 |
+
|
| 59 |
+module com { module sun { module star { module deployment {
|
| 60 |
+
|
| 61 |
+interface XPackage;
|
| 62 |
+
|
| 63 |
+/**
|
| 64 |
+ describes the fact that deployment unit is about to be linked.
|
| 65 |
+
|
| 66 |
+ <p>This exception is intended to be used with an
|
| 67 |
+ <type scope="com::sun::star::task">XInteractionHandler</type>.</p>
|
| 68 |
+
|
| 69 |
+ @since OOo 2.4
|
| 70 |
+*/
|
| 71 |
+exception LinkException: com::sun::star::uno::Exception {
|
| 72 |
+ /**
|
| 73 |
+ represents the new deployment unit.
|
| 74 |
+
|
| 75 |
+ <p>Must not be <NULL/>.</p>
|
| 76 |
+ */
|
| 77 |
+ XPackage New;
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+};
|
| 81 |
+
|
| 82 |
+}; }; }; };
|
| 83 |
+
|
| 84 |
+#endif
|
| 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 |
--- openoffice.org.orig/desktop/source/deployment/manager/dp_manager.cxx 26 Jul 2007 08:54:34 -0000 1.26
|
| 91 |
+++ openoffice.org/desktop/source/deployment/manager/dp_manager.cxx 22 Nov 2007 14:45:05 -0000
|
| 92 |
@@ -64,6 +64,7 @@
|
| 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"
|
| 100 |
@@ -512,6 +513,40 @@
|
| 101 |
return mediaType;
|
| 102 |
}
|
| 103 |
|
| 104 |
+oslFileError dp_linkFile( rtl_uString* ustrFileURL, rtl_uString* ustrDestURL )
|
| 105 |
+{
|
| 106 |
+ oslFileError eRet = osl_File_E_invalidError;
|
| 107 |
+#ifdef UNX
|
| 108 |
+ OSL_ASSERT( ustrFileURL );
|
| 109 |
+ OSL_ASSERT( ustrDestURL );
|
| 110 |
+
|
| 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 )
|
| 115 |
+ return eRet;
|
| 116 |
+ rtl::OString aSrcPath = rtl::OUStringToOString( aSrc, osl_getThreadTextEncoding() );
|
| 117 |
+
|
| 118 |
+ /* convert destination url to system path */
|
| 119 |
+ rtl::OUString aDest;
|
| 120 |
+ osl_getSystemPathFromFileURL( ustrDestURL, &aDest.pData );
|
| 121 |
+ if( eRet != osl_File_E_None )
|
| 122 |
+ return eRet;
|
| 123 |
+ rtl::OString aDestPath = rtl::OUStringToOString( aDest, osl_getThreadTextEncoding() );
|
| 124 |
+
|
| 125 |
+ rtl::OString sName = aSrcPath;
|
| 126 |
+ sal_Int32 nEnd = sName.getLength()-1;
|
| 127 |
+ if (sName.pData->buffer[nEnd] == '/')
|
| 128 |
+ --nEnd;
|
| 129 |
+ sal_Int32 nStart = sName.lastIndexOf( '/', nEnd );
|
| 130 |
+ sName = sName.copy(nStart, nEnd - nStart + 1);
|
| 131 |
+
|
| 132 |
+ int nRet = symlink(aSrcPath.getStr(), (aDestPath + sName).getStr());
|
| 133 |
+ eRet = nRet != 0 ? osl_File_E_invalidError : osl_File_E_None;
|
| 134 |
+#endif
|
| 135 |
+ return eRet;
|
| 136 |
+}
|
| 137 |
+
|
| 138 |
//______________________________________________________________________________
|
| 139 |
OUString PackageManagerImpl::insertToActivationLayer(
|
| 140 |
OUString const & mediaType, ::ucbhelper::Content const & sourceContent_,
|
| 141 |
@@ -536,11 +571,11 @@
|
| 142 |
destFolder = makeURL( m_activePackages, tempEntry );
|
| 143 |
}
|
| 144 |
destFolder += OUSTR("_");
|
| 145 |
-
|
| 146 |
+
|
| 147 |
// prepare activation folder:
|
| 148 |
::ucbhelper::Content destFolderContent;
|
| 149 |
create_folder( &destFolderContent, destFolder, xCmdEnv );
|
| 150 |
-
|
| 151 |
+
|
| 152 |
// copy content into activation temp dir:
|
| 153 |
if (mediaType.matchIgnoreAsciiCaseAsciiL(
|
| 154 |
RTL_CONSTASCII_STRINGPARAM(
|
| 155 |
@@ -552,19 +587,49 @@
|
| 156 |
{
|
| 157 |
// inflate content:
|
| 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())
|
| 162 |
+ {
|
| 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 ) );
|
| 168 |
+ }
|
| 169 |
+ else
|
| 170 |
+ buf.append( sourceContent.getURL() );
|
| 171 |
+
|
| 172 |
buf.append( static_cast<sal_Unicode>('/') );
|
| 173 |
- sourceContent = ::ucbhelper::Content(
|
| 174 |
- buf.makeStringAndClear(), xCmdEnv );
|
| 175 |
+ sourceContent = ::ucbhelper::Content( buf.makeStringAndClear(), xCmdEnv );
|
| 176 |
+ }
|
| 177 |
+
|
| 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 );
|
| 183 |
+
|
| 184 |
+ if (!abort && approve)
|
| 185 |
+ bLink = true;
|
| 186 |
+
|
| 187 |
+ if (bLink)
|
| 188 |
+ {
|
| 189 |
+ if (
|
| 190 |
+ (!sourceContent.isFolder()) ||
|
| 191 |
+ (osl_File_E_None != dp_linkFile(sourceContent.getURL().pData, destFolderContent.getURL().pData))
|
| 192 |
+ )
|
| 193 |
+ {
|
| 194 |
+ throw RuntimeException( OUSTR("dp_linkFile() failed!"), 0 );
|
| 195 |
+ }
|
| 196 |
+ }
|
| 197 |
+ else
|
| 198 |
+ {
|
| 199 |
+ if (! destFolderContent.transferContent(
|
| 200 |
+ sourceContent, ::ucbhelper::InsertOperation_COPY,
|
| 201 |
+ title, NameClash::OVERWRITE ))
|
| 202 |
+ {
|
| 203 |
+ throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
|
| 204 |
+ }
|
| 205 |
}
|
| 206 |
- if (! destFolderContent.transferContent(
|
| 207 |
- sourceContent, ::ucbhelper::InsertOperation_COPY,
|
| 208 |
- title, NameClash::OVERWRITE ))
|
| 209 |
- throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
|
| 210 |
|
| 211 |
// write to DB:
|
| 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 |
--- openoffice.org.orig/desktop/source/pkgchk/unopkg/unopkg_app.cxx 10 Aug 2007 15:03:53 -0000 1.6.84.1
|
| 219 |
+++ openoffice.org:desktop/source/pkgchk/unopkg/unopkg_app.cxx 10 Aug 2007 15:03:53 -0000 1.6.84.1
|
| 220 |
@@ -86,6 +86,9 @@
|
| 221 |
" -V, --version version information\n"
|
| 222 |
" -v, --verbose verbose output to stdout\n"
|
| 223 |
" -f, --force force overwriting existing extensions\n"
|
| 224 |
+#ifdef UNX
|
| 225 |
+" -l, --link attempt to link to instead of copying extensions\n"
|
| 226 |
+#endif
|
| 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"
|
| 230 |
@@ -103,6 +106,9 @@
|
| 231 |
{ RTL_CONSTASCII_STRINGPARAM("version"), 'V', false },
|
| 232 |
{ RTL_CONSTASCII_STRINGPARAM("verbose"), 'v', false },
|
| 233 |
{ RTL_CONSTASCII_STRINGPARAM("force"), 'f', false },
|
| 234 |
+#ifdef UNX
|
| 235 |
+ { RTL_CONSTASCII_STRINGPARAM("link"), 'l', false },
|
| 236 |
+#endif
|
| 237 |
{ RTL_CONSTASCII_STRINGPARAM("log-file"), '\0', true },
|
| 238 |
{ RTL_CONSTASCII_STRINGPARAM("shared"), '\0', false },
|
| 239 |
{ RTL_CONSTASCII_STRINGPARAM("deployment-context"), '\0', true },
|
| 240 |
@@ -210,6 +216,7 @@
|
| 241 |
OUString subCommand;
|
| 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;
|
| 250 |
OUString cmdArg;
|
| 251 |
::std::vector<OUString> cmdPackages;
|
| 252 |
-
|
| 253 |
+
|
| 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(
|
| 263 |
@@ -276,6 +285,7 @@
|
| 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))
|
| 270 |
{
|
| 271 |
@@ -346,7 +356,7 @@
|
| 272 |
|
| 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) );
|
| 277 |
|
| 278 |
if (subcmd_add ||
|
| 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 |
--- openoffice.org.orig/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx 26 Jun 2007 11:13:26 -0000 1.8
|
| 287 |
+++ openoffice.org/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx 22 Nov 2007 14:46:24 -0000
|
| 288 |
@@ -46,6 +46,7 @@
|
| 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"
|
| 296 |
@@ -98,6 +99,7 @@
|
| 297 |
{
|
| 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;
|
| 304 |
@@ -112,6 +114,7 @@
|
| 305 |
Reference<XComponentContext> const & xComponentContext,
|
| 306 |
OUString const & log_file,
|
| 307 |
bool option_force_overwrite,
|
| 308 |
+ bool option_link,
|
| 309 |
bool option_verbose,
|
| 310 |
bool option_bundled);
|
| 311 |
|
| 312 |
@@ -137,10 +140,12 @@
|
| 313 |
Reference<XComponentContext> const & xComponentContext,
|
| 314 |
OUString const & log_file,
|
| 315 |
bool option_force_overwrite,
|
| 316 |
+ bool option_link,
|
| 317 |
bool option_verbose,
|
| 318 |
bool option_bundled)
|
| 319 |
: m_logLevel(0),
|
| 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)
|
| 325 |
@@ -270,6 +275,7 @@
|
| 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;
|
| 333 |
@@ -318,6 +324,10 @@
|
| 334 |
bLicenseException = true;
|
| 335 |
printLicense(licExc.Text, approve, abort);
|
| 336 |
}
|
| 337 |
+ else if (request >>= linkExc)
|
| 338 |
+ {
|
| 339 |
+ approve = m_option_link;
|
| 340 |
+ }
|
| 341 |
else if (request >>= instExc)
|
| 342 |
{
|
| 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,
|
| 348 |
+ bool option_link,
|
| 349 |
bool option_verbose,
|
| 350 |
bool option_bundled)
|
| 351 |
{
|
| 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);
|
| 355 |
}
|
| 356 |
|
| 357 |
} // unopkg
|
| 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 |
--- openoffice.org.orig/desktop/source/pkgchk/unopkg/unopkg_shared.h 10 Aug 2007 15:04:16 -0000 1.2.130.1
|
| 364 |
+++ openoffice.org/desktop/source/pkgchk/unopkg/unopkg_shared.h 22 Nov 2007 14:46:24 -0000
|
| 365 |
@@ -131,6 +131,7 @@
|
| 366 |
css::uno::Reference<css::uno::XComponentContext> const & xContext,
|
| 367 |
::rtl::OUString const & logFile,
|
| 368 |
bool option_force_overwrite,
|
| 369 |
+ bool option_link,
|
| 370 |
bool option_verbose,
|
| 371 |
bool option_bundled);
|
| 372 |
|