On Sat, 4 Sep 2010, Laurent Guignard wrote: > Hello,
Laurent, > First of all i apologie for my poor english. No problem, my french is miserable :) > I have a question about your sourceable function. > > On Sun, 20 Jun 2010 23:23:57 +0200, Cristian Ionescu-Idbohrn wrote: > > ... > > > > +sourceable() { > > + # Care just about readable, non-backup, files > > + [ -r $1 ] || return 1 > > + case $1 in > > + *\~) > > + return 1 > > + ;; > > + esac > > +} > > + > > > > ... > > I don't understand the goal of your switch instruction. Could you > explain me the goal and what is it doing exactly ? Right. It is common editors leave backup files behind when editing files in place. These files are suffixed with a '~'. Example: -rw-r--r-- 1 root root 759 May 18 18:58 /etc/default/locale -rw-r--r-- 1 root root 726 Nov 24 2008 /etc/default/locale~ /etc/default/locale~ is such a file. Obviously, one does not want to source such files. The 'case' statement above is there to skip such files. Other examples of files one wants to avoid are the ones with 'dpkg-dist' or 'dpkg-old' extensions. Cheers, -- Cristian -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org