Hello,

That is a nifty expandpath(). Only thing is, I think it should get rid of 
redundant slashes: //some/path//here. No need to call it expandpath2, should be 
replaced IMO.

Regarding upgrade(), I didn't know it existed until recently. Adding support 
for symlinks and empty dirs to apkg has made it even more convoluted. Notice 
package_changed_files() where I have to untar the (possible) symlinks to test 
them. But it gets the job done for now. In general, I'm just happy to be able 
to backup all changes. Though I will try 'upgrade' next time around.

Assuming no bugs, my changes should affect anything.

Regarding full (and multiple) system backups, I myself just do it the old 
fashioned way, 'cp -a' .... etc. But that is rare. And now especially since I 
use ESX server on a 1U x86 server. I can simply create a snapshot, then restore 
or delete it. My leaf router is really a virtual router, but 100% production 
with access to all five of my NICs. When I upgraded from the 2.0 kernel (old 
leaf version), I simply shutdown the old server, changed the IP address of the 
new leaf server, then booted up and mostly everything worked, all on the same 
hardware.

----- Original Message -----




From: Erich Titl <erich.t...@think.ch>
To: leaf-devel <leaf-devel@lists.sourceforge.net>
Cc: 
Sent: Saturday, November 1, 2014 3:05 AM
Subject: Re: [leaf-devel] Fwd: [leaf:bering-uclibc] [2bdcfd] - Jorge Contreras: 
Backup symlinks, empty dirs and other improvements

Hi

Am 01.11.2014 um 04:58 schrieb cpu memhd:
> The ability to backup symbolic links and empty directories was never part of 
> apkg. Therefore, one would have to create them on the fly during bootup. 
> That's how I used to do it.
> 
> The other improvements are:
> 
> a) expandpath always ended up being /// when you passed it /, and would give 
> you double slashes in other situations. Also it did not handle "" as a valid 
> path, which should be--and now is treated as ".".

This is interesting, as I was preparing a few fixes for apkg on similar
goals, especially getting rid of unnecessary constructs in that IMHO
rather messy code. I willl have to start from scratch then.

this is my proposed expandpath()

#
# expandpath2 IMHO better
#
expandpath2 () {
        case $1 in
                /*) echo $1;;
                *) echo `pwd`/`echo $1 | sed -e s/^[.][/]*//` | sed -e
s/[/]$// ;;
        esac
       }

> 
> c) upgrade() now handles symlinks and empty dirs and very importantly, now 
> commits only on confirmation at the very end.

OK

> 
> Before, because of the interactive nature of upgrade it was possible to end 
> up with a partially upgraded package because of a lost ssh session, or if you 
> messed up while merging there was no ability to back out.

I am preparing a backup scenario which will allow to have a complete
secondary boot. I was doing this manually for a number of years but got
tired of this.

I don't like upgrade as the code has very little comments and appears to
be very static. I would like a process where we would publish all
packages along with the kernel images and initrd ( one version including
initmod ) for each arch for at least the most recent version. That way
an existing installation could be tailor made upgraded without hasssle
(hopefully)

> 
> d) rundiff() now reflects symlink and empty dir changes.
> -jorge
> 
> 

Thanks for the details, does anything change for the user except for the
empty directory stuff?

cheers


Erich


------------------------------------------------------------------------------



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

------------------------------------------------------------------------------

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

Reply via email to