[eos-hooks] preliminary preparations for overriding packages filesystem and lsb-release

This commit is contained in:
manuel
2025-11-20 22:59:05 +02:00
parent 8759db1724
commit 78c68fcd1b
2 changed files with 29 additions and 4 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
# Maintainer: EndeavourOS-Team <info@endeavouros.com>
pkgname=eos-hooks
pkgver=1.16.1
pkgver=1.16.2
pkgrel=1
pkgdesc='EndeavourOS pacman hooks'
arch=('any')
@@ -21,7 +21,7 @@ source=(
sha512sums=('d315c86c3f18278883161798b1f8ec891d20efb0bf2ada4dbf406a30767506807c494256e872cacd3c5ebe08d4f73bc96517c52d227808c5bcfbf89284094c72'
'20568a779c4ec34e9a79559a125efb1a85aacde8474df4ab9c5f766b6eb7a6b5848c049387f78306ad844e7571cf8a22afc89e6aab18c47b5be419e3d0e4e2e7'
'11940266adb37425e9b89b448a005a99dfc978ec0c91555cfa78f2e955a35bcd175374b775d7d31a395ce135587be106cbc8ad55eef1a9c933cea1806bf4dcfc'
'87ffb0a69c78db08d87c39a80709c8acb09d502397f88151d63a61d68ceb5d906d0db633e4857cf658cfe1a42859856c96e4d356710019001656a8c7733456dc')
'49b50615ee1d86e4e56aefd4fa2024c880e2d4ea104b87b2c80ea86e33b436bb1d8516602e2ccc5a6317f752255843dfa1d8e27c9fb506b7a287c7e1e6b17882')
package() {
local item
+27 -2
View File
@@ -5,6 +5,8 @@
Lsb_release() {
local file=/etc/lsb-release
[ $in_current_folder = yes ] && SkipPath file
if [ -z "$(grep "^DISTRIB_CODENAME=" $file)" ] ; then
# add missing DISTRIB_CODENAME=
echo "DISTRIB_CODENAME=${quote}rolling${quote}" >> $file
@@ -20,6 +22,11 @@ Os_release() {
local file=/usr/lib/os-release
local eosfile=/usr/lib/endeavouros-release
if [ $in_current_folder = yes ] ; then
SkipPath file
SkipPath eosfile
fi
# Get URLs from the EndeavourOS web site!
local home=https://endeavouros.com
local doc=https://discovery.endeavouros.com
@@ -52,18 +59,36 @@ Os_release() {
}
Issues() {
sed -i 's|Arch|EndeavourOS|g' /etc/issue /usr/share/factory/etc/issue
local file1=/etc/issue
local file2=/usr/share/factory/etc/issue
if [ $in_current_folder = yes ] ; then
SkipPath file1
SkipPath file2
fi
sed -i 's|Arch|EndeavourOS|g' $file1 $file2
}
SkipPath() {
local -n _filepath="$1"
_filepath="${_filepath##*/}"
}
Main()
{
local hookname="$1"
local hookname="$1" # "os-release", "lsb-release", "issue", ""
local in_current_folder="$2" # optional, "yes" or "no" (default: no)
local quote="'"
quote='\"'
case "$in_current_folder" in
yes) ;; # change branding for files in current folder
*) in_current_folder=no ;; # change branding for files in system folders
esac
case "$hookname" in
os-release) Os_release ;;
lsb-release) Lsb_release ;;
issue) Issues ;;
"") Os_release
Lsb_release
Issues