Skip to content

Commit 809bd5e

Browse files
committed
Packages must pull their own dependencies: declare util-linux, drop manual installs from the deb/rpm tests
- rpm: add Requires: util-linux - postinstall runs the upgrade tool and the server via runuser unconditionally. - test-rpm: no manual dependency installs; dnf must resolve everything from the package Requires (java-headless, util-linux, shadow-utils). - test-deb-upgrade: drop the manual JRE (the released 5.1.1 deb declares a JRE dependency itself) and procps (the process-owner check now uses /proc stat). - test-rpm-upgrade: keep only java + which, needed by the RELEASED 5.1.1 rpm which declared no dependencies at all (declarations added by OpenIdentityPlatform#677); drop them when the upgrade-source artifact link points to a release containing OpenIdentityPlatform#677.
1 parent 515fa9a commit 809bd5e

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ jobs:
524524
set -e
525525
RPM=$(ls opendj-packages/opendj-rpm/opendj-rpm-standard/target/rpm/opendj/RPMS/noarch/*.rpm | head -1)
526526
echo "Found $RPM"
527-
dnf install -y java-21-openjdk-headless util-linux initscripts >/dev/null
527+
# No manual dependencies: the package must pull everything itself (Requires).
528528
dnf install -y "$RPM"
529529
id opendj
530530
test "$(stat -c %U /opt/opendj)" = opendj
@@ -568,7 +568,7 @@ jobs:
568568
NEW=$(ls opendj-packages/opendj-deb/opendj-deb-standard/target/*.deb | head -1)
569569
echo "New deb: $NEW"
570570
apt-get update
571-
apt-get install -y default-jre-headless procps >/dev/null
571+
# No manual dependencies: even the released 5.1.1 deb declares a JRE dependency.
572572
apt-get install -y ./opendj-5.1.1.deb
573573
# 5.1.1 model: no dedicated user, root-owned tree, SysV only
574574
/opt/opendj/setup --cli --no-prompt --acceptLicense --doNotStart \
@@ -595,7 +595,7 @@ jobs:
595595
sleep 3
596596
done
597597
test "$OK" = 1
598-
test "$(ps -o user= -p "$(cat /opt/opendj/logs/server.pid)" | tr -d " ")" = opendj
598+
test "$(stat -c %U /proc/$(cat /opt/opendj/logs/server.pid))" = opendj
599599
/etc/init.d/opendj stop
600600
apt-get purge -y opendj
601601
'
@@ -618,9 +618,11 @@ jobs:
618618
set -e
619619
NEW=$(ls opendj-packages/opendj-rpm/opendj-rpm-standard/target/rpm/opendj/RPMS/noarch/*.rpm | head -1)
620620
echo "New rpm: $NEW"
621-
# "which" is required by the RELEASED 5.1.1 scripts to locate java (the new
622-
# package uses "command -v" and config/java.properties instead)
623-
dnf install -y java-21-openjdk-headless util-linux initscripts procps-ng which >/dev/null
621+
# java and "which" are needed only by the RELEASED 5.1.1 rpm, which declared no
622+
# dependencies at all (declarations added by #677; java discovery fixed by this PR).
623+
# Drop them when the upgrade-source artifact link points to a release with #677.
624+
# Everything the NEW package needs must come from its own Requires.
625+
dnf install -y java-21-openjdk-headless which >/dev/null
624626
dnf install -y ./opendj-5.1.1.rpm
625627
# 5.1.1 model: no dedicated user, root-owned tree, SysV only
626628
/opt/opendj/setup --cli --no-prompt --acceptLicense --doNotStart \
@@ -647,7 +649,7 @@ jobs:
647649
sleep 3
648650
done
649651
test "$OK" = 1
650-
test "$(ps -o user= -p "$(cat /opt/opendj/logs/server.pid)" | tr -d " ")" = opendj
652+
test "$(stat -c %U /proc/$(cat /opt/opendj/logs/server.pid))" = opendj
651653
/etc/init.d/opendj stop
652654
rpm -e opendj
653655
'

opendj-packages/opendj-rpm/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@
154154
<targetOS>linux</targetOS>
155155
<requires>
156156
<require>java-headless &gt;= 1:11</require>
157+
<!-- postinstall runs the upgrade tool and the server via runuser. -->
158+
<require>util-linux</require>
157159
</requires>
158160
<requiresPre>
159161
<require>shadow-utils</require>

0 commit comments

Comments
 (0)