1*b1cdbd2cSJim Jagielski/************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim JagielskiThere are three extensions in various versions: 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski1 version_XXX/plain.oxt has no dependencies and no license. 25*b1cdbd2cSJim Jagielski2a version_XXX/dependency.oxt has an unsatisfied dependency and no license. 26*b1cdbd2cSJim Jagielski2b version_nodependencies_XXX/dependency.oxt is identical to 2a but without the 27*b1cdbd2cSJim Jagielski dependency. 28*b1cdbd2cSJim Jagielski3 version_XXX/license.oxt has no dependencies and a license. 29*b1cdbd2cSJim Jagielski 30*b1cdbd2cSJim JagielskiThe different versions are: 31*b1cdbd2cSJim Jagielski 32*b1cdbd2cSJim JagielskiA version_none contains no version element (treated as version "0"). 33*b1cdbd2cSJim JagielskiB version_badelement contains a bad <version val="1"/> (not allowed by the 34*b1cdbd2cSJim Jagielski specification, but treated by the current implementation as version "0"). 35*b1cdbd2cSJim JagielskiC version_badvalue contains a bad <version value="1.a"/> (not allowed by the 36*b1cdbd2cSJim Jagielski specification, but treated by the current implementation as version "1"). 37*b1cdbd2cSJim JagielskiD version_0.0 contains <version value="0.0"/> (same as version "0"). 38*b1cdbd2cSJim JagielskiE version_1.2.3 contains <version value="1.2.3"/>. 39*b1cdbd2cSJim JagielskiF version_1.2.4.7 contains <version value="1.2.4.7"/>. 40*b1cdbd2cSJim JagielskiG version_1.02.4.7.0 contains <version value="1.02.4.7.0"/> (same as version 41*b1cdbd2cSJim Jagielski "1.2.4.7"). 42*b1cdbd2cSJim JagielskiH version_1.2.15.3 contains <version value="1.2.15.3"/>. 43*b1cdbd2cSJim Jagielski 44*b1cdbd2cSJim JagielskiThe total order among the various versions is thus 45*b1cdbd2cSJim Jagielski 46*b1cdbd2cSJim Jagielski A = B = D < C < E < F = G < H. 47*b1cdbd2cSJim Jagielski 48*b1cdbd2cSJim JagielskiThings to watch for: 49*b1cdbd2cSJim Jagielski 50*b1cdbd2cSJim Jagielski- If version y of extension e is to be installed and version x < y of 51*b1cdbd2cSJim Jagielski extension e is already installed, then 52*b1cdbd2cSJim Jagielski unopkg add e 53*b1cdbd2cSJim Jagielski will replace x with y. 54*b1cdbd2cSJim Jagielski 55*b1cdbd2cSJim Jagielski- If version y of extension e is to be installed and version x >= y of 56*b1cdbd2cSJim Jagielski extension e is already installed, then 57*b1cdbd2cSJim Jagielski unopkg add e 58*b1cdbd2cSJim Jagielski will fail with an error message. 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski- If version y of extension e is to be installed and any version x of 61*b1cdbd2cSJim Jagielski extension e is already installed, then 62*b1cdbd2cSJim Jagielski unopkg add -f e 63*b1cdbd2cSJim Jagielski will replace x with y. 64*b1cdbd2cSJim Jagielski 65*b1cdbd2cSJim Jagielski- If version y of extension e is to be installed and any version x of 66*b1cdbd2cSJim Jagielski extension e is already installed, then 67*b1cdbd2cSJim Jagielski unopkg gui "Add..." 68*b1cdbd2cSJim Jagielski and 69*b1cdbd2cSJim Jagielski soffice "Tools - Package Manager... - Add..." 70*b1cdbd2cSJim Jagielski will query with a dialog whether to replace x with y. The dialog will have 71*b1cdbd2cSJim Jagielski "OK" (replace) preselected if x < y, and "Cancel" otherwise. 72*b1cdbd2cSJim Jagielski 73*b1cdbd2cSJim Jagielski- If replacing an installed version x of an extension e with a version y fails 74*b1cdbd2cSJim Jagielski because y has unsatisfied dependencies, or because y has a license to wich the 75*b1cdbd2cSJim Jagielski user does not agree, version x is left installed afterwards. 76*b1cdbd2cSJim Jagielski 77*b1cdbd2cSJim Jagielski- Checking for already installed versions of an extension is only done within a 78*b1cdbd2cSJim Jagielski single layer (unopkg versus unopkg --shared; "My Packages" versus 79*b1cdbd2cSJim Jagielski "OpenOffice Packages" in unopkg gui/soffice), not across layers. 80