~sircmpwn/gddo

34e9f6dfc70d68b4cc257c9898deb75fedaf8a37 — Adnan Maolood 16 days ago 7629bbe master
contrib/delete-package: New script

Useful for deleting a broken module when you only know the package
import path.
1 files changed, 15 insertions(+), 0 deletions(-)

A contrib/delete-package
A contrib/delete-package => contrib/delete-package +15 -0
@@ 0,0 1,15 @@
#!/bin/sh

if [ $# -eq 0 ]; then
	echo "Usage: $0 <path>"
	exit 1
fi

echo "
BEGIN;
DELETE FROM modules USING packages
WHERE modules.module_path = packages.module_path
AND packages.import_path = :'path'
RETURNING modules.module_path;
COMMIT;
" | psql -At -v path=$1