fix INSTALLURL detection
reported by Alexey Proschenko > There is unsafe use of "cat /etc/installurl" in PKG_PATH composition code > because of man INSTALLURL(5): > "Empty lines and lines beginning with ‘#’ in the file are ignored." the current code was looking for the first line not starting with # which was wrong in case the line was empty.
This commit is contained in:
parent
1bd66adc4a
commit
c13f3d30dc
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
INSTALLURL=$(grep -v ^# /etc/installurl | head -n 1)
|
INSTALLURL=$(awk '/^./ && ! /^#/ { print ; exit }' /etc/installurl)
|
||||||
export PKG_PATH="${INSTALLURL}/$(uname -r)/packages-stable/$(machine)/"
|
export PKG_PATH="${INSTALLURL}/$(uname -r)/packages-stable/$(machine)/"
|
||||||
|
|
||||||
CACHE_DIR=/var/cache/pkgupdate/
|
CACHE_DIR=/var/cache/pkgupdate/
|
||||||
|
|
Loading…
Reference in New Issue