19.10.2014 10:13, cpu memhd пишет:
> Hello,
>
> Can someone explain when and how this function is used?
>
> I'm having troubles understanding this part:
>
> # remove local files that have not changed from
> # the installed version of this package
> rm -f $(cat $PKGDIR/$pkg.sha1 | sed '/  -/d' | \
>      sha1sum -c 2>/dev/null | grep OK | sed 's/: OK$//')
>
> for file in $(cat $TMP/$SESSIONID.changed); do
>      if [ "$2" = 1 ]; then
>          test -f $file && echo "$pkg upgrade failed - config file(s) are 
> changed, try manual upgrade" && return 1
>      fi
>                                                       
>      test -f $file && apkg.merge $PKGROOT . $file
>      test -f $file && mv $file $PKGROOT/$file
> done
>
> When $2 = 1 that means to 'freshen'. But if a local config file has changed, 
> then abort the upgrade.
>
> First of all, what is the point of this (to "freshen")? And secondly, why 
> test for "local" changes, then abort if true ("return 1") inside the for 
> loop, especially after the potential deletion of lots of--unchanged--files, 
> from the "installed version"?
>
> Seems like this has the potential to leave an LRP in a broken/inconsistent 
> state.
>
> Also note: create_sha1 $pkg is being called to create a *running* .sha1 file 
> list even when the *updated* package doesn't contain a .local file. Shouldn't 
> the running .local and .sha1 be deleted instead?
>
Freshen option was added as tiny hack to original apkg for upgrade 
automation.
It'll be good to add work with temporary dir, to ensure that nothing 
went wrong during update (for ex., ssh session not lost on merge - 
this'll cause same trouble).

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho

_______________________________________________
leaf-devel mailing list
leaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to