From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <867hajg2nz.fsf_-_@cmarib.ramside> References: <864o5ogspr.fsf@cmarib.ramside> <2a1dfb1de5e846fe21335de074595377@ladd.quanstro.net> <867hajg2nz.fsf_-_@cmarib.ramside> Date: Sun, 24 Apr 2011 14:17:26 -0300 Message-ID: From: =?UTF-8?Q?Iruat=C3=A3_Souza?= To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] contrib(1) WAS: Re: wiki... Topicbox-Message-UUID: d3689ae0-ead6-11e9-9d60-3106f5b1d025 On Sun, Apr 24, 2011 at 11:11 AM, wrote: > erik quanstrom writes: > >>> IIRC it's based on replica(1) >>> which rather requires ideal circumstances for correct behaviour. >> >> partial installs are easy to recover from. =C2=A0i just used it friday t= o sort >> out a file system that had a contrib package listed as installed, but it >> hadn't been. > > It *would* be easy if contrib(1) properly indicated the install status > of a package. =C2=A0As it is right now, contrib/install marks a package a= s > installed and THEN goes about installing it. =C2=A0If anything fails, the > install will still be marked as having been successful. =C2=A0A subsequen= t > contrib/install for the same package will snubly claim that the package > has already been installed and refuse to run. =C2=A0You have to supply th= e > '-f' switch to make the install complete. =C2=A0However, doing this requi= res > (1) knowing that the install broke, and (2) that all the packages > dependencies have been met (because -f also overrides dependency > checking). =C2=A0contrib(1) doesn't provide any way to check if a package= is > up to date, like replica/changes. =C2=A0Having a contrib(1) wrapper for > replica/changes (say, 'contrib/changes') would be very handy. =C2=A0(And > simple to write.) > > As for prematurely marking packages as successfully installed... > > This: > > =C2=A0 =C2=A0cat > $cfg < =C2=A0 =C2=A0... > =C2=A0 =C2=A0exec /bin/contrib/pull $name > > should probably be replaced with something like: > > =C2=A0 =C2=A0cat > $cfg.part < =C2=A0 =C2=A0... > =C2=A0 =C2=A0/bin/contrib/pull $name > =C2=A0 =C2=A0if(~ -$status -) mv $cfg.part $cfg > =C2=A0 =C2=A0if not { > =C2=A0 =C2=A0 =C2=A0 =C2=A0echo install failed >[1=3D2] > =C2=A0 =C2=A0 =C2=A0 =C2=A0rm $cfg.part > =C2=A0 =C2=A0 =C2=A0 =C2=A0exit 'oh, crap' > =C2=A0 =C2=A0} > > -- you've done all the research, why don't you send a patch?