Message ID | 1385627172-6556-1-git-send-email-dore@madsdore.dk |
---|---|
State | Superseded |
Delegated to: | Esben Haabendal |
Headers | show |
Mads Doré Hansen <dore@madsdore.dk> writes: > --- > classes/image_crontab.oeclass | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/classes/image_crontab.oeclass b/classes/image_crontab.oeclass > index 32899a5..a2c09a5 100644 > --- a/classes/image_crontab.oeclass > +++ b/classes/image_crontab.oeclass > @@ -6,8 +6,10 @@ image_preprocess_crontab () { > cwd=`pwd` > test -d $cwd/${crontabdir} || return 0 > for f in $cwd/${crontabdir}/*.* ; do > - user=`basename $f | cut -d. -f1` > - cat $f >> $cwd${crontabdir}/$user > - rm $f > + user=`basename $f | cut -d. -f1` > + if [[ $user != "*" ]] ; then No reason to make it more complicated than needed. Why not just if [ "$f" != "$cwd/${crontabdir}/*.*" ] ; then Saving calls to both basename and cut. > + cat $f >> $cwd${crontabdir}/$user > + rm $f > + fi > done > }
diff --git a/classes/image_crontab.oeclass b/classes/image_crontab.oeclass index 32899a5..a2c09a5 100644 --- a/classes/image_crontab.oeclass +++ b/classes/image_crontab.oeclass @@ -6,8 +6,10 @@ image_preprocess_crontab () { cwd=`pwd` test -d $cwd/${crontabdir} || return 0 for f in $cwd/${crontabdir}/*.* ; do - user=`basename $f | cut -d. -f1` - cat $f >> $cwd${crontabdir}/$user - rm $f + user=`basename $f | cut -d. -f1` + if [[ $user != "*" ]] ; then + cat $f >> $cwd${crontabdir}/$user + rm $f + fi done }