Skip to content

Commit

Permalink
[merge] from unstable into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
OneCDOnly committed Apr 30, 2024
2 parents d2d598b + 4ec040a commit 2cb9ea1
Show file tree
Hide file tree
Showing 31 changed files with 406 additions and 382 deletions.
2 changes: 1 addition & 1 deletion docs/QNAP-forum-announcement.bbcode
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ If 'sudo' is unavailable in your version of QTS, [url=https://www.qnap.com/en/ho

If you have suggestions, advice, comments or concerns, please either create a new [url=https://github.com/OneCDOnly/sherpa/issues/new]issue[/url], or you are most welcome to start a new [url=https://github.com/OneCDOnly/sherpa/discussions/new/choose]discussion[/url] topic.

This project is a community effort, and has been built with the combined feedback of many community members on the [url=https://forum.qnap.com/viewtopic.php?f=320&t=132373]QNAP[/url] community forum. Thank you to everyone who has contributed. 🤓
This project is a community effort, and was built with combined feedback from many members of the [url=https://forum.qnap.com/viewtopic.php?f=320&t=132373]QNAP[/url] community forum. Thank you to everyone who has contributed. 🤓

Checkout the wiki for more information: https://github.com/OneCDOnly/sherpa/wiki
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ sudo sherpa

If you have suggestions, advice, comments or concerns, please either create a new [issue](https://github.com/OneCDOnly/sherpa/issues/new), or you are most welcome to start a new [discussion](https://github.com/OneCDOnly/sherpa/discussions/new/choose) topic.

This project is a community effort, and has been built with the combined feedback of many community members on the [QNAP](https://forum.qnap.com/viewtopic.php?f=320&t=132373) community forum. Thank you to everyone who has contributed. 🤓
This project is a community effort, and was built with combined feedback from many members of the [QNAP](https://forum.qnap.com/viewtopic.php?f=320&t=132373) community forum. Thank you to everyone who has contributed. 🤓

Checkout the wiki for more information: [https://github.com/OneCDOnly/sherpa/wiki](https://github.com/OneCDOnly/sherpa/wiki)
Binary file modified objects.tar.gz
Binary file not shown.
Binary file modified packages.tar.gz
Binary file not shown.
Binary file modified sherpa-manager.tar.gz
Binary file not shown.
16 changes: 7 additions & 9 deletions support/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

. vars.source || exit

declare -a source_pathfiles
declare -i index=0
declare -a a
declare -i i=0

source_pathfiles+=("$source_path/$objects_file")
source_pathfiles+=("$source_path/$packages_file")
source_pathfiles+=("$source_path/$management_file")
a+=("$support_path/$objects_file")
a+=("$support_path/$packages_file")
a+=("$support_path/$management_file")

for index in "${!source_pathfiles[@]}"; do
[[ -e ${source_pathfiles[index]} ]] && rm -f "${source_pathfiles[index]}"
for i in "${!a[@]}"; do
[[ -e ${a[i]} ]] && rm -f "${a[i]}"
done

./build-qpkgs.sh sherpa || exit
Expand All @@ -19,5 +19,3 @@ done
./build-wiki-package-abbreviations.sh || exit
./build-manager.sh || exit
./build-archives.sh || exit

exit 0
23 changes: 0 additions & 23 deletions support/build-archive.sh

This file was deleted.

24 changes: 24 additions & 0 deletions support/build-archive.sh_(obsolete)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# compiler for sherpa archives.

. vars.source || exit

echo -n 'building archive ... '

a=$target_path/$management_archive_file

[[ -e $a ]] && rm -f "$a"

tar --create --gzip --numeric-owner --file="$a" --directory="$support_path" "$objects_file" "$packages_file" "$management_file"

if [[ ! -s $a ]]; then
ColourTextBrightRed "'$a' was not written"; echo
exit 1
fi

rm -f "$objects_file" "$packages_file" "$management_file"
chmod 444 "$a"

ShowDone
exit 0
36 changes: 18 additions & 18 deletions support/build-archives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@

echo -n 'building archives ... '

declare -a source_pathfiles
declare -a target_pathfiles
declare -i index=0
declare -a a
declare -a b
declare -i i=0

source_pathfiles+=("$source_path/$objects_file")
target_pathfiles+=("$target_path/$objects_archive_file")
a+=("$support_path/$objects_file")
b+=("$target_path/$objects_archive_file")

source_pathfiles+=("$source_path/$packages_file")
target_pathfiles+=("$target_path/$packages_archive_file")
a+=("$support_path/$packages_file")
b+=("$target_path/$packages_archive_file")

source_pathfiles+=("$source_path/$management_file")
target_pathfiles+=("$target_path/$management_archive_file")
a+=("$support_path/$management_file")
b+=("$target_path/$management_archive_file")

for index in "${!source_pathfiles[@]}"; do
[[ -e ${target_pathfiles[index]} ]] && rm -f "${target_pathfiles[index]}"
for i in "${!a[@]}"; do
[[ -e ${b[i]} ]] && rm -f "${b[i]}"

if [[ ! -e ${source_pathfiles[index]} ]]; then
ColourTextBrightRed "'${source_pathfiles[index]}' not found, "
if [[ ! -e ${a[i]} ]]; then
ColourTextBrightRed "'${a[i]}' not found, "
continue
fi

tar --create --gzip --numeric-owner --file="${target_pathfiles[index]}" --directory="$source_path" "$(basename "${source_pathfiles[index]}")"
tar --create --gzip --numeric-owner --file="${b[i]}" --directory="$support_path" "$(basename "${a[i]}")"

if [[ ! -s ${target_pathfiles[index]} ]]; then
ColourTextBrightRed "'${target_pathfiles[index]}' was not written"; echo
if [[ ! -s ${b[i]} ]]; then
ColourTextBrightRed "'${b[i]}' was not written"; echo
exit 1
fi

[[ -e ${source_pathfiles[index]} ]] && rm -f "${source_pathfiles[index]}"
chmod 444 "${target_pathfiles[index]}"
[[ -e ${a[i]} ]] && rm -f "${a[i]}"
chmod 444 "${b[i]}"
done

ShowDone
Expand Down
10 changes: 5 additions & 5 deletions support/build-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

. vars.source || exit

source_pathfile=$source_path/$management_source_file
target_pathfile=$source_path/$management_file
a=$support_path/$management_source_file
b=$support_path/$management_file

SwapTags "$source_pathfile" "$target_pathfile"
Squeeze "$target_pathfile" "$target_pathfile"
SwapTags "$a" "$b"
Squeeze "$b" "$b"

[[ -e $target_pathfile ]] && chmod 554 "$target_pathfile"
[[ -e $b ]] && chmod 554 "$b"

exit 0
22 changes: 11 additions & 11 deletions support/build-objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

echo -n "building 'objects' file ... "

target_pathfile="$source_path/$objects_file"
target=$support_path/$objects_file

# These are used internally by sherpa. Must maintain separate lists for sherpa internal-use, and what user has requested.
# ordered
Expand Down Expand Up @@ -65,7 +65,7 @@ echo $public_function_name':Init()
'$public_function_name':NoLogMods()
{ '$_placeholder_log_changes_flag_'=false ;}
'$public_function_name':Init' >> "$target_pathfile"
'$public_function_name':Init' >> "$target"

return 0

Expand Down Expand Up @@ -127,15 +127,15 @@ echo $public_function_name':Add()
{ if [[ -n ${1:-} && ${1:-} = "=" ]]; then '$_placeholder_size_'=$2; else echo -n "$'$_placeholder_size_'"
fi ;}
'$public_function_name':Init' >> "$target_pathfile"
'$public_function_name':Init' >> "$target"

return 0

}

[[ -e $target_pathfile ]] && rm -f "$target_pathfile"
echo "OBJECTS_VER='<?build_date?>'" > "$target_pathfile"
echo "#* <?dont_edit?>" >> "$target_pathfile"
[[ -e $target ]] && rm -f "$target"
echo "OBJECTS_VER='<?build_date?>'" > "$target"
echo "#* <?dont_edit?>" >> "$target"

# package action flag objects.

Expand Down Expand Up @@ -197,16 +197,16 @@ for action in "${PIP_ACTIONS[@]}"; do
done
done

if [[ ! -e $target_pathfile ]]; then
ColourTextBrightRed "'$target_pathfile' was not written to disk"; echo
if [[ ! -e $target ]]; then
ColourTextBrightRed "'$target' was not written to disk"; echo
exit 1
else
ShowDone
fi

SwapTags "$target_pathfile" "$target_pathfile"
Squeeze "$target_pathfile" "$target_pathfile"
SwapTags "$target" "$target"
Squeeze "$target" "$target"

[[ -f $target_pathfile ]] && chmod 444 "$target_pathfile"
[[ -f $target ]] && chmod 444 "$target"

exit 0
42 changes: 21 additions & 21 deletions support/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

. vars.source || exit

source_pathfile=$source_path/$packages_source_file
target_pathfile=$source_path/$packages_file
source=$support_path/$packages_source_file
target=$support_path/$packages_file

buffer=$(<"$source_pathfile")
buffer=$(<"$source")

checksum_pathfilename=''
checksum_filename=''
Expand Down Expand Up @@ -55,10 +55,10 @@ TranslateQPKGArch()
StripComments()
{

# input:
# Input:
# $1 = string to strip comment lines, empty lines, and so-on.

# output:
# Output:
# stdout = stripped string.

[[ -n $1 ]] || return
Expand Down Expand Up @@ -127,7 +127,7 @@ ShowDone

echo -n 'loading IPK essentials ... '

a=$source_path/ipk-essential.txt
a=$support_path/ipk-essential.txt

if [[ -e $a ]]; then
essential_ipks=$(/bin/tr '\n' ' ' <<< "$(StripComments "$(<"$a")")")
Expand All @@ -139,7 +139,7 @@ ShowDone

echo -n 'loading PIP essentials ... '

a=$source_path/pip-essential.txt
a=$support_path/pip-essential.txt

if [[ -e $a ]]; then
essential_pips=$(/bin/tr '\n' ' ' <<< "$(StripComments "$(<"$a")")")
Expand All @@ -151,7 +151,7 @@ ShowDone

echo -n 'loading PIP exclusions ... '

a=$source_path/pip-exclusions.txt
a=$support_path/pip-exclusions.txt

if [[ -e $a ]]; then
exclusion_pips=$(/bin/tr '\n' ' ' <<< "$(StripComments "$(<"$a")")")
Expand All @@ -161,17 +161,17 @@ echo -n 'loading PIP exclusions ... '

ShowDone

[[ -e $target_pathfile ]] && chmod +w "$target_pathfile"
echo "$buffer" > "$target_pathfile"
SwapTags "$source_pathfile" "$target_pathfile"
buffer=$(<"$target_pathfile")
[[ -e $target ]] && chmod +w "$target"
echo "$buffer" > "$target"
SwapTags "$source" "$target"
buffer=$(<"$target")

echo -n 'updating QPKG fields ... '

buffer=$(sed "s|<?cdn_nzbget_dev_packages_url?>|$cdn_nzbget_dev_packages_url|g" <<< "$buffer")
buffer=$(sed "s|<?cdn_other_packages_url?>|$cdn_other_packages_url|g" <<< "$buffer")
buffer=$(sed "s|<?cdn_qnap_dev_packages_url?>|$cdn_qnap_dev_packages_url|g" <<< "$buffer")
buffer=$(sed "s|<?cdn_sherpa_packages_url?>|$cdn_sherpa_packages_url|g" <<< "$buffer")
# buffer=$(sed "s|<?cdn_nzbget_dev_packages_url?>|$cdn_nzbget_dev_packages_url|g" <<< "$buffer")
# buffer=$(sed "s|<?cdn_other_packages_url?>|$cdn_other_packages_url|g" <<< "$buffer")
# buffer=$(sed "s|<?cdn_qnap_dev_packages_url?>|$cdn_qnap_dev_packages_url|g" <<< "$buffer")
# buffer=$(sed "s|<?cdn_sherpa_packages_url?>|$cdn_sherpa_packages_url|g" <<< "$buffer")

while read -r checksum_filename qpkg_filename package_name version arch hash; do
for property in version package_name qpkg_filename hash; do
Expand All @@ -194,17 +194,17 @@ ShowDone

echo -n "building 'packages' file ... "

echo "$buffer" > "$target_pathfile"
echo "$buffer" > "$target"

if [[ ! -e $target_pathfile ]]; then
ColourTextBrightRed "'$target_pathfile' was not written to disk"; echo
if [[ ! -e $target ]]; then
ColourTextBrightRed "'$target' was not written to disk"; echo
exit 1
else
ShowDone
fi

Squeeze "$target_pathfile" "$target_pathfile"
[[ -f $target_pathfile ]] && chmod 444 "$target_pathfile"
Squeeze "$target" "$target"
[[ -f $target ]] && chmod 444 "$target"

# Sort and add header line for easier viewing.

Expand Down
Loading

0 comments on commit 2cb9ea1

Please sign in to comment.