3 # Debian-specific script to insert a new skill into the SF database
9 use vars qw/$dbh @reqlist $skill/ ;
11 use vars qw/@skills/ ;
15 require ("/usr/share/gforge/lib/include.pl") ; # Include all the predefined functions
20 debug "Usage: sf-add-skill <skill>..." ;
26 $dbh->{AutoCommit} = 0;
27 $dbh->{RaiseError} = 1;
29 my ($query, $sth, @array, $version, $action, $skill) ;
31 foreach $skill (@skills) {
32 debug "Inserting skill <$skill>." ;
33 $skill = $dbh->quote ($skill) ;
35 $query = "INSERT INTO people_skill (name) VALUES ($skill)" ;
39 $sth = $dbh->prepare ($query) ;
44 # debug "Committing." ;
47 # There should be a commit at the end of every block above.
48 # If there is not, then it might be symptomatic of a problem.
49 # For safety, we roll back.
54 warn "Transaction aborted because $@" ;
55 debug "Transaction aborted because $@" ;
57 debug "Please report this bug on the Debian bug-tracking system." ;
58 debug "Please include the previous messages as well to help debugging." ;
59 debug "You should not worry too much about this," ;
60 debug "your DB is still in a consistent state and should be usable." ;