```ruby
template "/opt/local/etc/pkgin/repositories.conf" do
  source "repositories.conf.erb"
  mode 0755
  action :nothing
end.run_action(:create)

execute "update pkgsrc database" do
  command "pkgin -y -f update"
  action :nothing
end.run_action(:run)
```

Update pkgsrc db via pkgin list, not update (so it's one-time-only).
user
```ruby
template "/opt/local/etc/pkgin/repositories.conf" do
  source "repositories.conf.erb"
  mode 0755
  action :nothing
end.run_action(:create)

# This will update the pkgsrc database if it has not already
# been done
execute "update pkgsrc database" do
  command "pkgin -y list"
  action :nothing
end.run_action(:run)
```
assistant