Date: Sat, 21 Nov 2015 09:02:19 +0100 From: Ben Woods <woodsb02@gmail.com> To: Dangling Pointer <danglingpointer@outlook.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: Unzip utility choice decision Message-ID: <CAOc73CAWJd05L0P833XzmgMXuUDd3hX2ypcbUmQfNxCBoS2rHA@mail.gmail.com> In-Reply-To: <BAY169-W9776556FEBDA58E22FA457A71A0@phx.gbl> References: <BAY169-W9776556FEBDA58E22FA457A71A0@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 20 November 2015, Dangling Pointer <danglingpointer@outlook.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOc73CAWJd05L0P833XzmgMXuUDd3hX2ypcbUmQfNxCBoS2rHA>