From owner-freebsd-questions@freebsd.org Sat Nov 21 08:02:22 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5228FA2ACD5 for ; Sat, 21 Nov 2015 08:02:22 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE1F15E7 for ; Sat, 21 Nov 2015 08:02:21 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by lfs39 with SMTP id 39so82048193lfs.3 for ; Sat, 21 Nov 2015 00:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hWBEy9iwZPggIa6kreyzXpVGgCA6/MmW6O4TtSGxreg=; b=Fjy74lep68qD8JBAocbVbwFIESSK3Xo7K/50O0xbnrn3Ajx48DOCndAVpNBnsbwF5p ucDGekz8wnz6V88OOy0KTUUsnCrBPdkrDGqeO3pZN4v0SWNWRFQdTc0VrJAG1MGOoK3u eCSY4Jb8yC9mQLmxwp6S0S4ilLknl19U0Ow3zXIAshL8CNCEB/oHqLJd/MK+tBPFKUcG 0f56ZBZtXXzIlYTVwmXS5gI+8ZJ2CUJAtq2slyAaS1CFK8s1kbL2xHS6DfBLqytkxm9S 6soS47+ywBWU+8SkW9Jq1QN6XAXOHNhLSVtQXIfBW2BHWj5cmxR5a9GMZnxdEZ3lK3z9 i7Zg== MIME-Version: 1.0 X-Received: by 10.25.170.149 with SMTP id t143mr7488816lfe.162.1448092939961; Sat, 21 Nov 2015 00:02:19 -0800 (PST) Received: by 10.25.141.129 with HTTP; Sat, 21 Nov 2015 00:02:19 -0800 (PST) In-Reply-To: References: Date: Sat, 21 Nov 2015 09:02:19 +0100 Message-ID: Subject: Re: Unzip utility choice decision From: Ben Woods To: Dangling Pointer Cc: "freebsd-questions@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2015 08:02:22 -0000 On Friday, 20 November 2015, Dangling Pointer wrote: > > > > Hi, > The unzip utility which comes OOTB is different than the one which > installs with `pkg install unzip`. The latter one is the real unzip utility > which accepts -uoq switches together. The former one complains "unzip: -n, > -o and -u are contradictory". > Without being able to -uoq causes a race with two unzips attempting to > overwrite the same file at the same time. -u prevents existing files from > being overwritten if they haven't been updated and allows us to run any > number of unzips in parallel. > After installing FreeBSD, I have to rename "/usr/bin/unzip" to > "/usr/bin/unzip2" followed by "pkg install unzip" and then "ln -s > /usr/local/bin/unzip /usr/bin/unzip". > If the licensing permits, please consider replacing the default unzip > utility with the one available in ports. This way it is convenient to write > a cross-platform build/install scripts for software without additional > checks. > Thanks. > Having just read the manpage of both the FreeBSD version and the info-zip version, it sounds to me like those -o and -u options ARE contradictory. -o tells unzip to overwrite any existing files. -u tells unzip to only overwrite any existing files if the version from the zip is newer. It doesn't make sense to me to use both of these switches. You should choose which behaviour you want and only specify one of them. Perhaps "unzip -uq FILE.zip" will suffice? Info-zip unzip(1) manpage: http://linux.die.net/man/1/unzip FreeBSD unzip(1) manpage: https://www.freebsd.org/cgi/man.cgi?unzip Regards, Ben -- -- From: Benjamin Woods woodsb02@gmail.com