Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jul 16, 2024
1 parent 621662f commit 390897b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: centos:7
image: centos:latest
options: --user root
steps:
- name: Checkout
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/packaging/rpm/spec
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
Name: linupdate
Version: __VERSION__
Release: stable
Summary: Linupdate package updater - Repomanager client side agent
Summary: Linupdate 3 (python version) - Packages updater and Repomanager client side agent

BuildArch: noarch
License: GPL-3.0
URL: https://github.com/lbr38/linupdate

Requires: curl
Requires: git
Requires: mutt
Requires: ngrep
Requires: inotify-tools
Requires: jq
Requires: virt-what
Requires: net-tools
Requires: bind-utils
Requires: yum-utils
Requires: python3-tabulate
Requires: python3-colorama
Requires: python3-dateutil
Requires: python3-yaml
Requires: python3-dateutil
Requires: python3-simplejson
Requires: python3-distro

%description
Linupdate package updater - Repomanager client side agent
Linupdate 3 (python version) - Packages updater and Repomanager client side agent

%prep
# Save current configuration file if exists
if [ -f "/etc/linupdate/linupdate.conf" ];then
cp /etc/linupdate/linupdate.conf /tmp/linupdate.conf.rpmsave
if [ -f "/etc/linupdate/linupdate.yml" ];then
cp /etc/linupdate/linupdate.yml /tmp/linupdate.yml.rpmsave
fi

# Only if systemd is installed (not the case on github runners)
Expand All @@ -49,18 +51,13 @@ DATA_DIR="/opt/linupdate"
SERVICE="$DATA_DIR/service/linupdate-agent"

# Restore configuration file if exists
if [ -f "/tmp/linupdate.conf.rpmsave" ];then
rm -f /etc/linupdate/linupdate.conf
mv /tmp/linupdate.conf.rpmsave /etc/linupdate/linupdate.conf
fi

# Delete old 'functions' directory if exists
if [ -d "$DATA_DIR/functions" ];then
rm -rf "$DATA_DIR/functions"
if [ -f "/tmp/linupdate.yml.rpmsave" ];then
rm -f /etc/linupdate/linupdate.yml
mv /tmp/linupdate.yml.rpmsave /etc/linupdate/linupdate.yml
fi

# Create a symlink to main script
ln -sf /opt/linupdate/linupdate /usr/bin/linupdate
ln -sf /opt/linupdate/linupdate.py /usr/bin/linupdate

# Set permissions
chmod 750 /etc/linupdate
Expand Down

0 comments on commit 390897b

Please sign in to comment.