convert all existing libraries to new vipakfile format, automatically, with Shell scripts

This commit is contained in:
Antranig Vartanian 2025-10-04 13:06:42 +04:00
parent d1c3a3601f
commit 91191b6b62
No known key found for this signature in database
GPG key ID: DE3998662D59F21C
33 changed files with 750 additions and 0 deletions

42
convert_vipatsar.sh Normal file
View file

@ -0,0 +1,42 @@
#!/bin/sh
# convert_vipatsar.sh: Convert old JSON vipakfiles to new plain-text format with
# proper file naming and versioning using convert_vipakfile.sh
# Program name and version
PROGNAME=${0##*/}
VERSION="0.1.0"
# Colors for output
COLOUR_SET_R="\033[0;31m"
COLOUR_SET_G="\033[0;32m"
COLOUR_SET_B="\033[0;34m"
COLOUR_END="\033[0m"
# Error, info, and action print functions
perror() {
printf "${COLOUR_SET_R}[-] ${COLOUR_END}%s\n" "$@" >&2
exit 1
}
pinfo() {
printf "${COLOUR_SET_B}[+] ${COLOUR_END}%s\n" "$@" >&2
}
paction() {
printf "${COLOUR_SET_G}[*] ${COLOUR_END}%s\n" "$@" >&2
}
# We assume that we're running inside vipatsar tree
for dir in $(find . -not -path '*/.git/*' -not -path '.' -type d) ;
do
# The port/library name is derived from the directory
port=${dir##./}
pinfo "Working on ${port}"
cd $dir
paction "Converting ${port}.json"
../convert_vipakfile.sh -c "${port}.json"
pinfo "Conversion done"
cd - >/dev/null || return
done