summaryrefslogtreecommitdiff
path: root/auto
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-03-06 00:42:57 +0000
committerdavidovski <david@davidovski.xyz>2022-03-06 00:42:57 +0000
commitce1ac2b89b42e4e05ba706b7bbdcc39cd2e64e8b (patch)
tree8eac0ab36ab35e361729635ac32eef346c93c51b /auto
parentad95cf3c8430f90225b628e072c35717ce86945c (diff)
fixed sphinx deps
Diffstat (limited to 'auto')
-rwxr-xr-xauto/pypi.sh37
1 files changed, 28 insertions, 9 deletions
diff --git a/auto/pypi.sh b/auto/pypi.sh
index 05656f7..f6c554b 100755
--- a/auto/pypi.sh
+++ b/auto/pypi.sh
@@ -1,3 +1,7 @@
+#!/bin/sh
+
+[ -f /usr/lib/colors.sh ] && . /usr/lib/colors.sh
+
if [ $# = 0 ]; then
printf "Name of package: python-"
read name
@@ -20,18 +24,33 @@ if [ ${#deps} != 0 ]; then
echo $package_deps
fi
+echo PKG_VER: $version
+echo DESC: $desc
+echo SOURCE: $url
+echo DEPS: $package_deps
+
file=repo/python/python-$name.xibuild
-cat templates/pypi.xibuild |
- sed "s@^SOURCE=.*@SOURCE=$url@g" |
- sed "s/^PKG_VER=.*/PKG_VER=$version/g" |
- sed "s/^DESC=.*/DESC=\"$desc\"/g" |
- sed "s/^DEPS=.*/DEPS=\"$package_deps\"/g" > $file
-echo written to $file
+inp=templates/pypi.xibuild
+if [ -f $file ]; then
+ inp=$file
+ echo "replacing existing"
+fi
+
+tmp=/tmp/python-$name.xibuild
+rm -f $tmp
+cat $inp > $tmp
+
+sed -i "s@^SOURCE=.*@SOURCE=$url@g" $tmp
+sed -i "s@^PKG_VER=.*@PKG_VER=$version@g" $tmp
+sed -i "s@^DESC=.*@DESC=\"$desc\"@g" $tmp
if [ ${#deps} != 0 ]; then
- for p in $deps; do
- $0 $p
- done
+ printf "${LIGHT_BLUE}Please ensure the following exist: ${BLUE}${deps}${RESET}\n"
+ sed -i "s/^DEPS=.*/DEPS=\"$package_deps\"/g" $tmp
fi
+mv $tmp $file
+
+printf "${GREEN}Written to $file${RESET}\n"
+