Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
fixed mkinitcpio.conf updating
Browse files Browse the repository at this point in the history
  • Loading branch information
parov0z committed Feb 8, 2021
1 parent 97dbbae commit 96ac359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: ANDRoid7890 <[email protected]>

pkgname=bootsplash-manager
pkgver=1.0
pkgver=1.1
pkgrel=1
pkgdesc="Simple cli bootsplash manager"
url="https://github.com/ANDRoid7890/bootsplash-manager"
Expand All @@ -16,7 +16,7 @@ source=("CMakeLists.txt"
"org.manjaro.bootsplash-manager.policy")

md5sums=('c15c5c3dbb5d60868db08caaf63ff901'
'8a8ef82d4ad27e743d38be739724a463'
'fd9706296aeb49b51d4d026d7691693d'
'bff11696553f09c850aee775a83ba4d3')

build() {
Expand Down
15 changes: 10 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,14 @@ int setTheme( QString theme ){
position = data.indexOf( QRegularExpression("^HOOKS=.*") );
hooks = data.at( position );

QStringList hooksList = hooks.replace( QRegularExpression("^HOOKS="), "" )
.replace('"', "")
.split(' ');
bool bracketsFlag = hooks.contains( QRegularExpression("^HOOKS=[(].*") );

hooks.replace( QRegularExpression("^HOOKS="), "" );
if ( bracketsFlag ) hooks.replace('(', "")
.replace(')', "");
else hooks.replace('"', "");

QStringList hooksList = hooks.split(' ');
bool hooksFlag=1;
for ( const QString& t : qAsConst(themesList) )
if ( !hooksList.contains( "bootsplash-"+t ) )
Expand All @@ -156,9 +161,9 @@ int setTheme( QString theme ){
for ( const QString& t : qAsConst(themesList) )
hooksList.append( "bootsplash-"+t );
hooks.clear();
hooks="HOOKS=\"";
hooks=bracketsFlag?"HOOKS=(":"HOOKS=\"";
for ( const QString& s : qAsConst(hooksList) ) hooks.append( s ).append( ' ' );
hooks.replace( QRegularExpression( "\\s$" ), "\"" );
hooks.replace( QRegularExpression( "\\s$" ), bracketsFlag?")":"\"" );
data.replace( position, hooks );

// write initcpio
Expand Down

0 comments on commit 96ac359

Please sign in to comment.