From 0d1d564592bc83718c49dab11d9b1cb6c9ceec9f Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 7 Dec 2022 16:45:30 -0500
Subject: linhes-dev: mp.py: add ability to run mp_preflight

add a mp_preflight file to the PKGBUILD directory and mp.py will execute the cmds in the file that need to be run before running makepkg. See linhes-templates for example
---
 linhes/linhes-dev/PKGBUILD |  4 ++--
 linhes/linhes-dev/mp.py    | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/linhes/linhes-dev/PKGBUILD b/linhes/linhes-dev/PKGBUILD
index 88d34b9..dc95d74 100644
--- a/linhes/linhes-dev/PKGBUILD
+++ b/linhes/linhes-dev/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=linhes-dev
 pkgver=9.0.0
-pkgrel=10
+pkgrel=11
 pkgdesc="Scripts to develop LinHES"
 arch=('x86_64')
 license=('GPL2')
@@ -10,7 +10,7 @@ url="http://linhes.org/"
 source=('lh_sync.sh' 'chk_aur_pkg.py' 'mp.py' 'lh_setup_dev.sh' 'lh_update_db_repo.sh')
 sha256sums=('3a64b4125b56c6f95cc9dc85ce58ebd1c0612b22fb27c3e76d4d9a5570f2d61e'
             '864192e9fe627c5a85d4c33ba30df7c870783a450f5fea7c550dd9490d48f2ab'
-            'ae515d0ef707daf5565b828b5e16e3812bcbe5060754ad06f783173b3fa1dedd'
+            '7a6686291bd0e3f4da7d7fbe4dda2022004f5275aebec173eabd97fccff2275c'
             '24310eb2e957d2ac56739ca8286fcf8bd87776f0daa1f7e7bc67d7e39018e8db'
             '86c9ebe77228f7e3cc07cb05f480e5584e0e3cad1b889b63a50821f7323bf449')
 
diff --git a/linhes/linhes-dev/mp.py b/linhes/linhes-dev/mp.py
index f415b29..f8d660b 100755
--- a/linhes/linhes-dev/mp.py
+++ b/linhes/linhes-dev/mp.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
-# Version 3.0.2
+# Version 3.0.3
 import os
+import stat
 import sys
 import re
 import subprocess
@@ -304,6 +305,15 @@ class Packagefile(object):
         self.set_srcpkg()
         self.pkgrel_incremented = True
 
+    def runPreFlight(self):
+        if os.path.isfile("mp_preflight"):
+            print("-  Running PreFlight...")
+            os.chmod("mp_preflight", 0o755)
+            retcode = subprocess.call(["./mp_preflight"])
+            if retcode != 0:
+                print("    ERROR: PreFlight Error")
+            print("")
+
     def updateSUMS(self):
         print("-  Updating checksums...")
         retcode = subprocess.call(["updpkgsums"])
@@ -520,6 +530,7 @@ def main():
 
     packagefile.find_repo()
     packagefile.increase_pkgrel()
+    packagefile.runPreFlight()
     packagefile.print_vars()
     packagefile.updateSUMS()
     if packagefile.make_package():
-- 
cgit v0.12

