[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][master] 3 commits: update-db: do not just ignore other exceptions



Title: GitLab

Ansgar pushed to branch master at Debian FTP Team / dak

Commits:

3 changed files:

Changes:

  • dak/dakdb/update124.py
    ... ... @@ -109,9 +109,9 @@ def do_update(self):
    109 109
             """)
    
    110 110
     
    
    111 111
             for section in sections:
    
    112
    -            c.execute("UPDATE section SET description='{1}', longdesc='' WHERE section='{0}'".format(section, sections[section]["desc"], sections[section]["longdesc"]))
    
    113
    -            c.execute("UPDATE section SET description='{1}', longdesc='' WHERE section='contrib/{0}'".format(section, sections[section]["desc"], sections[section]["longdesc"]))
    
    114
    -            c.execute("UPDATE section SET description='{1}', longdesc='' WHERE section='non-free/{0}'".format(section, sections[section]["desc"], sections[section]["longdesc"]))
    
    112
    +            c.execute("UPDATE section SET description=%s, longdesc="" WHERE section=%s", (section, sections[section]["desc"], sections[section]["longdesc"]))
    
    113
    +            c.execute("UPDATE section SET description=%s, longdesc="" WHERE section=CONCAT('contrib/', %s)", (section, sections[section]["desc"], sections[section]["longdesc"]))
    
    114
    +            c.execute("UPDATE section SET description=%s, longdesc="" WHERE section=CONCAT('non-free/', %s)", (section, sections[section]["desc"], sections[section]["longdesc"]))
    
    115 115
     
    
    116 116
             c.execute("UPDATE config SET value = '124' WHERE name = 'db_revision'")
    
    117 117
             self.db.commit()
    

  • dak/update_db.py
    ... ... @@ -234,6 +234,8 @@ Updates dak's database schema to the lastest version. You should disable crontab
    234 234
             except IOError as e:
    
    235 235
                 if e.errno in (errno.EACCES, errno.EAGAIN):
    
    236 236
                     utils.fubar("Couldn't obtain lock, looks like archive is doing something, try again later.")
    
    237
    +            else:
    
    238
    +                raise
    
    237 239
     
    
    238 240
             self.update_db()
    
    239 241
     
    

  • setup/dak-setup.sh
    ... ... @@ -17,6 +17,9 @@
    17 17
     # You should have received a copy of the GNU General Public License
    
    18 18
     # along with this program.  If not, see <https://www.gnu.org/licenses/>.
    
    19 19
     
    
    20
    +set -e
    
    21
    +set -u
    
    22
    +set -o pipefail
    
    20 23
     
    
    21 24
     dak-setup() {
    
    22 25
       # Get the parent directory of the current script
    


  • Reply to: