Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-19 21:23:41 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-19 21:23:41 +0300
commite7bb56b084cd27b80ceec15ce71cbbd1ccfd5446 (patch)
tree943a4424ef0acc64fa24b6ca1a39bc5fc11b423a /mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package
parent8d31e86bdd82aa5f46bd24b3a6b5665e1b2796d8 (diff)
Updated to latest hakchi, latest zImage, fixes
Diffstat (limited to 'mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package')
-rw-r--r--mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package25
1 files changed, 16 insertions, 9 deletions
diff --git a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package
index 3c3894f3..7697c6c7 100644
--- a/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package
+++ b/mods/mod_hakchi/hakchi/rootfs/etc/preinit.d/b0030_package
@@ -37,17 +37,23 @@ pack_upath(){
}
pack_install(){
- echo "installing $(basename "$1" .hmod)..."
- if [ -f "$1" ]; then
+ local packFile="$(readlink -f "$1")"
+ local packName="$(basename "$1" .hmod)"
+ echo "installing $packName..."
+ if [ -f "$packFile" ]; then
local transferpath="$temppath/pack"
rm -rf "$transferpath"
mkdir -p "$transferpath"
- cd "$transferpath" && tar -xzf "$1"
+ cd "$transferpath" && tar -xzf "$packFile"
else
- local transferpath="$1"
+ local transferpath="$packFile"
fi
transfer_path "$transferpath"
- echo "creating uninstall for $(basename "$1" .hmod)..."
+ if grep -xqF "no-uninstall" "$transferpath/uninstall"; then
+ echo "package $packName installed"
+ return 0
+ fi
+ echo "creating uninstall for $packName..."
echo >> "$transferpath/uninstall"
echo "# auto-generated" >> "$transferpath/uninstall"
cd "$transferpath"
@@ -56,7 +62,7 @@ pack_install(){
find . -depth -mindepth 1 -type d -exec echo rmdir \"\$rootfs/{}\" + >> "$transferpath/uninstall"
[ $(stat -c%s "$transferpath/uninstall") -gt 8 ] || rm -f "$transferpath/uninstall"
cd /
- local unfile="$(pack_upath "$1")"
+ local unfile="$(pack_upath "$packFile")"
if [ -f "$transferpath/uninstall" ]; then
dos2unix -u "$transferpath/uninstall"
sed -i "s#rmdir #rmdir --ignore-fail-on-non-empty #" "$transferpath/uninstall"
@@ -65,7 +71,7 @@ pack_install(){
else
rm -f "$unfile"
fi
- echo "package $(basename "$1" .hmod) installed"
+ echo "package $packName installed"
}
pack_list(){
@@ -84,10 +90,11 @@ pack_uninstall(){
else
local unfile="$(pack_upath "$1")"
if [ -f "$unfile" ]; then
- echo "uninstalling $(basename "$1" .hmod)..."
+ local packName="$(basename "$1" .hmod)"
+ echo "uninstalling $packName..."
cd "$rootfs"
transfer_file "$unfile"
- echo "package $(basename "$1" .hmod) uninstalled"
+ echo "package $packName uninstalled"
fi
fi
cd /