From 8f3178dccd00b6fd8cdb10030fccff8535993c2f Mon Sep 17 00:00:00 2001 From: Jai-JAP <78354625+Jai-JAP@users.noreply.github.com> Date: Tue, 18 May 2021 19:30:15 +0530 Subject: [PATCH] Add support for alternate package names Add support for alternate package names if primary package name is not available in repos --- pkg-install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg-install b/pkg-install index 521374b..9e087f2 100755 --- a/pkg-install +++ b/pkg-install @@ -13,6 +13,7 @@ error() { #$1 is a quotation-marked, space-seperated list of package names. #$2 is the path to the program folder being installed. +#"package0 package1 | package2" represents "package0 & package1" or "package0 & package2" (whichever is available) in $2 #Example usage: ~/pi-apps/pkg-install "gparted buffer expect" ~/pi-apps/apps/Arduino PKG_LIST="$1" #quotation-marked, space-seperated list of package names to install @@ -144,7 +145,7 @@ Version: 1.0 Architecture: all Priority: optional Section: custom -Depends: $(echo "$PKG_LIST" | tr -d ',' | sed 's/ /, /g') +Depends: $(echo "$PKG_LIST" | tr -d ',' | sed 's/ /, /g' | sed 's/, |/ |/g' | sed 's/|, /| /g') Package: pi-apps-$appnamehash" > ~/pi-apps-$appnamehash/DEBIAN/control dpkg-deb --build ~/pi-apps-$appnamehash || error "pkg-install: failed to create dummy deb pi-apps-$appnamehash"