SHARE
TWEET

bash koji

a guest Sep 10th, 2012 383 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WORKDIR="/tmp"
  2. SQLFILE=$1.sql
  3. cat > $WORKDIR/$SQLFILE << EOF
  4. delete from tag_listing where build_id in (select id from build where pkg_id in (select id from package where name = '$1'));
  5. delete from rpmsigs where rpm_id in (select id from rpminfo where build_id in (select id from build where pkg_id in (select id from package where name = '$1')));
  6. delete from buildroot_listing where rpm_id in (select id from rpminfo where build_id in (select id from build where pkg_id in (select id from package where name = '$1')));
  7. delete from rpminfo where build_id in (select id from build where pkg_id in (select id from package where name = '$1'));
  8. delete from build where pkg_id = (select id from package where name = '$1');
  9. delete from tag_packages where package_id = (select id from package where name = '$1');
  10. delete from package where name = '$1';
  11. EOF
  12.  
  13. su - koji -c  "psql koji < $WORKDIR/$SQLFILE"
  14.  
  15. # remove old package directory otherwise koji failed
  16. rm -rf /mnt/koji/hub/packages/$1/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top