Commit 3df93860 authored by Franco Fichtner's avatar Franco Fichtner

firmware: pkg will receive a license query fix soon :)

parent 276f7bdb
......@@ -199,7 +199,7 @@ class FirmwareController extends ApiControllerBase
// sanitize package name
$filter = new \Phalcon\Filter();
$filter->add('scrub', function ($value) {
return preg_replace('/[^0-9a-zA-Z]/', '', $value);
return preg_replace('/[^0-9a-zA-Z\-]/', '', $value);
});
$package = $filter->sanitize($package, 'scrub');
$text = trim($backend->configdRun(sprintf('firmware license %s', $package)));
......
......@@ -32,6 +32,10 @@ PACKAGE=${1}
LICENSES=$(pkg query %L ${PACKAGE})
VERSION=$(pkg query %v ${PACKAGE})
if [ -f "${LICENSEDIR}/${PACKAGE}-${VERSION}/${LICENSES}" ]; then
cat "${LICENSEDIR}/${PACKAGE}-${VERSION}/${LICENSES}"
fi
IFS=', '
for LICENSE in ${LICENSES}; do
if [ -f "${LICENSEDIR}/${PACKAGE}-${VERSION}/${LICENSE}" ]; then
cat "${LICENSEDIR}/${PACKAGE}-${VERSION}/${LICENSE}"
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment