Fix requirements_style_check on BSD platforms

On Linux, the sort command implicitly ignore non-alphanumeric characters
when sorting.  Since the '>' character has an ASCII value greater than
the '-' character, the following list will be sorted on Linux, but not
on a Mac:

SQLAlchemy>=0.7.8,<=0.9.99
sqlalchemy-migrate>=0.9.1

This makes sort explicitly ignore such characters and will keep the
tests consistent across different environments.

Closes-Bug: #1324945
Change-Id: I559ae4b4c3e2a7d190af9d4b1517dfaf23d114b1
This commit is contained in:
Anderson Mesquita 2014-05-30 10:01:59 -04:00
parent 2d37843d13
commit 797dcc8dc1

View File

@ -12,7 +12,7 @@ function check_file() {
# We don't care about comment lines.
grep -v '^#' $f > ${f}.unsorted
sort -i -f ${f}.unsorted > ${f}.sorted
sort -d -i -f ${f}.unsorted > ${f}.sorted
diff -c ${f}.unsorted ${f}.sorted
rc=$?
rm -f ${f}.sorted ${f}.unsorted