Discussion:
[Sqlgrey-users] update_sqlgrey_config on FreeBSD
Edgar Pettijohn
2014-07-19 02:17:46 UTC
Permalink
Hello list,

I'm trying to get update_sqlgrey_config to work on FreeBSD 10.
Following is a diff of changes I've made compared to the stock version.
It still doesn't appear to be working correctly. I'm going to add some
echo's and see if I can't pinpoint the issue, but hopefully someone out
there has the answer already.

Thanks

1c1
< #!/usr/local/bin/bash
---
#!/bin/bash
4c4
< MD5SUM=`which md5 2>/dev/null`
---
MD5SUM=`which md5sum 2>/dev/null`
7c7
< echo "md5 not found in PATH, can't continue"
---
echo "md5sum not found in PATH, can't continue"
27c27
< MYDIR=/usr/local/etc/sqlgrey
---
MYDIR=/etc/sqlgrey
51c51
< cd /usr/local/etc/sqlgrey
---
cd ~sqlgrey
56c56
<
---
62c62
< TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1`
---
-f1`
88c88
< md5 -c MD5SUMS >/dev/null 2>/dev/null
---
md5sum -c MD5SUMS >/dev/null 2>/dev/null
Edgar Pettijohn
2014-07-19 16:53:29 UTC
Permalink
Well I've definantly narrowed it down. This line seems to be the culprit:


TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1

When I change TOUPDATE=clients_fqdn_whitlist (the file locally changed
to test script) it runs without error and updates the file. Playing
around with this I had to change cut -d: -f1 to cut -d " " -f3 to have
the same result as a linux machine. However, that alone has not fixed
the problem. I'm not sure that md5 -c and md5sum -c have the same
effect. The wording in the man pages are definantly different, but to
me it seems the intent is the same. Any help is appreciated.

Thanks
Post by Edgar Pettijohn
Hello list,
I'm trying to get update_sqlgrey_config to work on FreeBSD 10.
Following is a diff of changes I've made compared to the stock
version. It still doesn't appear to be working correctly. I'm going
to add some echo's and see if I can't pinpoint the issue, but
hopefully someone out there has the answer already.
Thanks
1c1
< #!/usr/local/bin/bash
---
#!/bin/bash
4c4
< MD5SUM=`which md5 2>/dev/null`
---
MD5SUM=`which md5sum 2>/dev/null`
7c7
< echo "md5 not found in PATH, can't continue"
---
echo "md5sum not found in PATH, can't continue"
27c27
< MYDIR=/usr/local/etc/sqlgrey
---
MYDIR=/etc/sqlgrey
51c51
< cd /usr/local/etc/sqlgrey
---
cd ~sqlgrey
56c56
<
---
62c62
< TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1`
---
TOUPDATE=`md5sum -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut
-d: -f1`
88c88
< md5 -c MD5SUMS >/dev/null 2>/dev/null
---
md5sum -c MD5SUMS >/dev/null 2>/dev/null
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
Edgar Pettijohn
2014-07-19 22:00:57 UTC
Permalink
Just realized what the goal of `md5sums -c $MYTMP/MD5SUMS 2>/dev/null |
grep FAILED | cut -d: -f1` was. Unfortunantly md5 doesn't give the same
error message, so the grep and cut don't do what they are intended to
do. Sorry for the noise thus far.
Post by Edgar Pettijohn
TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1
When I change TOUPDATE=clients_fqdn_whitlist (the file locally changed
to test script) it runs without error and updates the file. Playing
around with this I had to change cut -d: -f1 to cut -d " " -f3 to have
the same result as a linux machine. However, that alone has not fixed
the problem. I'm not sure that md5 -c and md5sum -c have the same
effect. The wording in the man pages are definantly different, but to
me it seems the intent is the same. Any help is appreciated.
Thanks
Post by Edgar Pettijohn
Hello list,
I'm trying to get update_sqlgrey_config to work on FreeBSD 10.
Following is a diff of changes I've made compared to the stock
version. It still doesn't appear to be working correctly. I'm going
to add some echo's and see if I can't pinpoint the issue, but
hopefully someone out there has the answer already.
Thanks
1c1
< #!/usr/local/bin/bash
---
#!/bin/bash
4c4
< MD5SUM=`which md5 2>/dev/null`
---
MD5SUM=`which md5sum 2>/dev/null`
7c7
< echo "md5 not found in PATH, can't continue"
---
echo "md5sum not found in PATH, can't continue"
27c27
< MYDIR=/usr/local/etc/sqlgrey
---
MYDIR=/etc/sqlgrey
51c51
< cd /usr/local/etc/sqlgrey
---
cd ~sqlgrey
56c56
<
---
62c62
< TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1`
---
TOUPDATE=`md5sum -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut
-d: -f1`
88c88
< md5 -c MD5SUMS >/dev/null 2>/dev/null
---
md5sum -c MD5SUMS >/dev/null 2>/dev/null
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
Edgar Pettijohn
2014-07-20 00:24:37 UTC
Permalink
Not sure why it took so long to come up with the solution, but here is
the final diff for bin/update_sqlgrey_config after installing gnu coreutils:

< #!/usr/local/bin/bash
---
#!/bin/bash
4c4
< MD5SUM=`which gmd5sum 2>/dev/null`
---
MD5SUM=`which md5sum 2>/dev/null`
27c27
< MYDIR=/usr/local/etc/sqlgrey
---
MYDIR=/etc/sqlgrey
51c51
< cd $MYDIR
---
cd ~sqlgrey
62c62
< TOUPDATE=`gmd5sum -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut
-d: -f1`
---
-f1`
88c88
< gmd5sum -c MD5SUMS >/dev/null 2>/dev/null
---
md5sum -c MD5SUMS >/dev/null 2>/dev/null
Just realized what the goal of `md5sums -c $MYTMP/MD5SUMS 2>/dev/null
| grep FAILED | cut -d: -f1` was. Unfortunantly md5 doesn't give the
same error message, so the grep and cut don't do what they are
intended to do. Sorry for the noise thus far.
Post by Edgar Pettijohn
TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1
When I change TOUPDATE=clients_fqdn_whitlist (the file locally
changed to test script) it runs without error and updates the file.
Playing around with this I had to change cut -d: -f1 to cut -d " "
-f3 to have the same result as a linux machine. However, that alone
has not fixed the problem. I'm not sure that md5 -c and md5sum -c
have the same effect. The wording in the man pages are definantly
different, but to me it seems the intent is the same. Any help is
appreciated.
Thanks
Post by Edgar Pettijohn
Hello list,
I'm trying to get update_sqlgrey_config to work on FreeBSD 10.
Following is a diff of changes I've made compared to the stock
version. It still doesn't appear to be working correctly. I'm
going to add some echo's and see if I can't pinpoint the issue, but
hopefully someone out there has the answer already.
Thanks
1c1
< #!/usr/local/bin/bash
---
#!/bin/bash
4c4
< MD5SUM=`which md5 2>/dev/null`
---
MD5SUM=`which md5sum 2>/dev/null`
7c7
< echo "md5 not found in PATH, can't continue"
---
echo "md5sum not found in PATH, can't continue"
27c27
< MYDIR=/usr/local/etc/sqlgrey
---
MYDIR=/etc/sqlgrey
51c51
< cd /usr/local/etc/sqlgrey
---
cd ~sqlgrey
56c56
<
---
62c62
< TOUPDATE=`md5 -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut -d: -f1`
---
TOUPDATE=`md5sum -c $MYTMP/MD5SUMS 2>/dev/null | grep FAILED | cut
-d: -f1`
88c88
< md5 -c MD5SUMS >/dev/null 2>/dev/null
---
md5sum -c MD5SUMS >/dev/null 2>/dev/null
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sqlgrey-users mailing list
https://lists.sourceforge.net/lists/listinfo/sqlgrey-users
Loading...