Unzip utility choice decision

Dangling Pointer danglingpointer at outlook.com
Wed Dec 23 05:57:37 UTC 2015


Those options are not contradictory with `pkg install unzip` version. That -uoq combination is an advance usage which save us from a race condition.
What I am really saying is:
There is a universally known unzip utility which offers many options and then there is FreeBSD version of unzip with less options. That makes no sense to me. Why would you want to have a separate unzip utility?

> Date: Sat, 21 Nov 2015 09:02:19 +0100
> Subject: Re: Unzip utility choice decision
> From: woodsb02 at gmail.com
> To: danglingpointer at outlook.com
> CC: freebsd-questions at freebsd.org
> 
> On Friday, 20 November 2015, Dangling Pointer <danglingpointer at 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 at gmail.com
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
 		 	   		  


More information about the freebsd-questions mailing list