public function putPackageAction($vendor, $package, Request $request)
    {
        $packageName = $vendor . '/' . $package;
        $info        = new JsonArray($request->getContent());
        $name        = $info->get('name');

        if (!($info->has('name') && $info->has('locked') && $info->has('constraint'))) {
            throw new NotAcceptableHttpException('Invalid package information.');
        }

        if ($name !== $packageName) {
            throw new NotAcceptableHttpException('Package name mismatch ' . $packageName . ' vs. ' . $name . '.');
        }

        $composer = $this->getComposer();
        $json     = $this->get('tenside.composer_json');

        $package = $this->findPackage($name, $composer->getRepositoryManager()->getLocalRepository());

        if (null === $package) {
            throw new NotFoundHttpException('Package ' . $packageName . ' not found.');
        }

        $json->setLock($package, $info->get('locked'));
        return $this->forward('TensideCoreBundle:Package:getPackage');
    }