Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 971de4f

Browse files
committed
add "system" path
1 parent f4799fc commit 971de4f

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ repkg create <package> [dependencies...]
2929
```
3030
`package` is the AUR package that should be rebuild, when one of the given `dependencies` is updated to a newer versions. You can also create rules directly by creating a rule file in `~/.config/repkg/rules`, with the package name beeing the filename (i.e. `package.rule`) and the content beeing the dependencies, space seperated.
3131

32-
When updating packages via pacman (or any frontend), rebuilds are automatically detected. You will see a message with all packages that need rebuilds at the end. You can also run
32+
For system admins, when running this command as root, the rules are instead written to `/etc/repkg/rules`. For repkg prior to version `1.3.0` this will overwrite the rules created by installed packages. But since `1.3.0` packages should place their rules in `/etc/repkg/rules/system` to prevent such conflicts.
33+
34+
When updating packages via pacman (or any frontend), rebuilds are automatically detected. You will see a message with all packages that need rebuilds at the end. You can also run
3335
```
3436
repkg list detail
3537
```
@@ -42,7 +44,7 @@ repkg
4244
This will start the frontend of your choice (e.g. yay, trizen, pacaur, yaourt, ...) and rebuild all required packages.
4345

4446
### Package Providers
45-
Simply add a rule file to your PKGBUILD, and install it to `/etc/repkg/rules`. Assuming your package is name `my-pkg` and should be rebuild when `dep-a` or `dep-b` is updated, the file must be named `my-pkg.rule` and contain:
47+
Simply add a rule file to your PKGBUILD, and install it to `/etc/repkg/rules/system` (or `/etc/repkg/rules` if you want to be compatible with versions of repkg before `1.3.0`). Assuming your package is name `my-pkg` and should be rebuild when `dep-a` or `dep-b` is updated, the file must be named `my-pkg.rule` and contain:
4648
```
4749
dep-a dep-b
4850
```

global.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ QDir global::userPath()
2727
if(dir.exists())
2828
return dir;
2929
else
30-
return QDir();
30+
return {};
3131
}
3232

3333
QDir global::rootPath()
@@ -39,5 +39,14 @@ QDir global::rootPath()
3939
if(dir.exists())
4040
return dir;
4141
else
42-
return QDir();
42+
return {};
43+
}
44+
45+
QDir global::systemPath()
46+
{
47+
QDir dir{rootPath()};
48+
if(dir.cd(QStringLiteral("system")))
49+
return dir;
50+
else
51+
return {};
4352
}

global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bool isRoot();
1111

1212
QDir userPath();
1313
QDir rootPath();
14+
QDir systemPath();
1415
}
1516

1617
#endif // GLOBAL_H

rulecontroller.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ void RuleController::readRules() const
9696
{
9797
QList<std::pair<QDir, bool>> paths {
9898
{userPath(), false},
99-
{rootPath(), true}
99+
{rootPath(), true},
100+
{systemPath(), true},
100101
};
101102

102103
_ruleInfos.clear();

0 commit comments

Comments
 (0)