On 2013-09-10 07:01, Weijun Wang wrote:
Hi Eric

The creation of the blacklisted.certs file looks like this now:

$(BLACKLISTED_CERTS_DST): $(BLACKLISTED_CERTS_SRC)
    $(MKDIR) -p $(@D)
    $(CAT) $^ | $(SED) '/^$$/d' | $(SORT) | $(UNIQ) > [email protected]
    $(GREP) -i Algorithm [email protected] > $@
    $(GREP) -iv Algorithm [email protected] >> $@

As you can see, I use 2 greps to make sure the output always starts with "Algorithm=something" and entries followed ordered. Is there a better way to do it?

I also want to add a check before the last line to make sure there is only one line of "Algorithm" in $@ since there is a possibility that the algorithm value is different in different sources. How can I do that?
Would this be considered an error or do you expect one would like to override the other? I would probably do something along the lines of:

if test `grep -i Algorithm $@ | wc | awk '{ print $1 }'` != 1; then \
  echo "Some message" && false \
fi

But there are probably simpler ways of handling it.

/Erik

Thanks
Max

Reply via email to