lib/d3/client/receipt.rb in depot3-3.0.8 vs lib/d3/client/receipt.rb in depot3-3.0.9

- old
+ new

@@ -20,10 +20,13 @@ ### KIND, either express or implied. See the Apache License for the specific ### language governing permissions and limitations under the Apache License. ### ### + + +### module D3 class Client < JSS::Client ### ### Receipt - a d3 package that is currently installed on this machine. @@ -286,12 +289,13 @@ if @@installed_rcpts.member? receipt.basename raise JSS::AlreadyExistsError, "There's already a receipt on this machine for basemame '#{receipt.basename}'" end # if end # unless replace + replacing = @@installed_rcpts[receipt.basename] ? true : false @@installed_rcpts[receipt.basename] = receipt self.save_receipts - D3.log "#{replace ? "Replaced" : "Added"} receipt for #{receipt.edition}", :info + D3.log "#{replacing ? "Replaced" : "Added"} receipt for #{receipt.edition}", :info ensure # always release the rw lock even after an error self.release_datastore_lock end # begin