Skip to content

Commit

Permalink
AUR publish.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
es20490446e committed Sep 22, 2024
1 parent 97e6cde commit 01d8f0b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions package/optimus-manager-git
Submodule optimus-manager-git added at 88d0a3
43 changes: 38 additions & 5 deletions package/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 6,37 @@ files=("optimus-manager.install" "PKGBUILD")


mainFunction () {
checkUncommittedChanges
#checkUncommittedChanges
cloneAurRepo
syncFiles
updateSrcinfo
uploadChanges
removeAurRepoClone
checkFilesHaveBeenChanged
#syncFiles
#updateSrcinfo
#uploadChanges
#removeAurRepoClone
}


checkFilesHaveBeenChanged () {
local aurSum
local changed=false
local file
local index=0
local repoSum

while [[ "${index}" -lt "${#files[@]}" ]] && ! "${changed}"; do
repoSum="$(fileSum "${here}/${files[$index]}")"
aurSum="$(fileSum "${here}/optimus-manager-git/${files[$index]}")"

if [[ "${repoSum}" != "${aurSum}" ]]; then
changed=true
else
index="$((index 1))"
fi
done

if ! "${changed}"; then
exit 0
fi
}


Expand Down Expand Up @@ -49,6 74,14 @@ fileModificationEpoch () {
}


fileSum () {
local file="${1}"

sha1sum "${file}" |
cut --delimiter=' ' --fields=1
}


lastUpdatedFile () {
local epoch=0
local file
Expand Down

0 comments on commit 01d8f0b

Please sign in to comment.