Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chown to use primary group of user for group name #3577

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Fix chown to use primary group of user for group name
  • Loading branch information
kmcfate committed Sep 9, 2022
commit 0da8ac5253f47b2c1265202af10d9fd9bd39bb50
2 changes: 1 addition & 1 deletion scriptmodules/admin/apidocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function build_apidocs() {

function install_apidocs() {
rsync -a --delete "$md_build/html/" "$__tmpdir/apidocs/"
chown -R $user:$user "$__tmpdir/apidocs"
chown -R $user: "$__tmpdir/apidocs"
}

function upload_apidocs() {
Expand Down
6 changes: 3 additions & 3 deletions scriptmodules/admin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function _setup_gzip_log() {
function rps_logInit() {
if [[ ! -d "$__logdir" ]]; then
if mkdir -p "$__logdir"; then
chown $user:$user "$__logdir"
chown $user: "$__logdir"
else
fatalError "Couldn't make directory $__logdir"
fi
Expand All @@ -32,7 +32,7 @@ function rps_logInit() {
local now=$(date +'%Y-%m-%d_%H%M%S')
logfilename="$__logdir/rps_$now.log.gz"
touch "$logfilename"
chown $user:$user "$logfilename"
chown $user: "$logfilename"
time_start=$(date +"%s")
}

Expand Down Expand Up @@ -111,7 +111,7 @@ function depends_setup() {
function updatescript_setup()
{
clear
chown -R $user:$user "$scriptdir"
chown -R $user: "$scriptdir"
printHeading "Fetching latest version of the RetroPie Setup Script."
pushd "$scriptdir" >/dev/null
if [[ ! -d ".git" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/admin/stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function build_stats() {

cp -rv "$md_data/licences" "$dest/"
cp -rv "$md_data/pkgflags" "$dest/"
chown -R $user:$user "$dest"
chown -R $user: "$dest"
}

function upload_stats() {
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/admin/wikidocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function build_wikidocs() {

function install_wikidocs() {
rsync -a --delete "$md_build/site/" "$__tmpdir/wikidocs/"
chown -R $user:$user "$__tmpdir/wikidocs"
chown -R $user: "$__tmpdir/wikidocs"
}

function upload_wikidocs() {
Expand Down
6 changes: 3 additions & 3 deletions scriptmodules/emulators/amiberry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function configure_amiberry() {
moveConfigFile "$md_inst/data/cd32.nvr" "$md_conf_root/amiga/amiberry/cd32.nvr"

moveConfigDir "$md_inst/kickstarts" "$biosdir/amiga"
chown -R $user:$user "$biosdir/amiga"
chown -R $user: "$biosdir/amiga"

# symlink the retroarch config / autoconfigs for amiberry to use
ln -sf "$configdir/all/retroarch/autoconfig" "$md_inst/controllers"
Expand All @@ -127,7 +127,7 @@ function configure_amiberry() {
# copy game-data, save-data folders, boot-data.zip and WHDLoad
cp -R "$md_inst/whdboot-dist/"{game-data,save-data,boot-data.zip,WHDLoad} "$config_dir/whdboot/"

chown -R $user:$user "$config_dir/whdboot"
chown -R $user: "$config_dir/whdboot"

# copy shared uae4arm/amiberry launch script while setting is_amiberry=1
sed "s/is_amiberry=0/is_amiberry=1/" "$md_data/../uae4arm/uae4arm.sh" >"$md_inst/amiberry.sh"
Expand All @@ -139,5 +139,5 @@ function configure_amiberry() {
"$md_inst/amiberry.sh"
_EOF_
chmod a+x "$romdir/amiga/$script"
chown $user:$user "$romdir/amiga/$script"
chown $user: "$romdir/amiga/$script"
}
4 changes: 2 additions & 2 deletions scriptmodules/emulators/daphne.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fi
_EOF_
chmod +x "$md_inst/daphne.sh"

chown -R $user:$user "$md_inst"
chown -R $user:$user "$md_conf_root/daphne/dapinput.ini"
chown -R $user: "$md_inst"
chown -R $user: "$md_conf_root/daphne/dapinput.ini"

}
2 changes: 1 addition & 1 deletion scriptmodules/emulators/dgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function configure_dgen() {

if [[ ! -f "$md_conf_root/megadrive/dgenrc" ]]; then
cp "sample.dgenrc" "$md_conf_root/megadrive/dgenrc"
chown $user:$user "$md_conf_root/megadrive/dgenrc"
chown $user: "$md_conf_root/megadrive/dgenrc"
fi

iniConfig " = " "" "$md_conf_root/megadrive/dgenrc"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/dolphin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function configure_dolphin() {
FullscreenResolution = Auto
Fullscreen = True
_EOF_
chown -R $user:$user "$md_conf_root/gc/Config"
chown -R $user: "$md_conf_root/gc/Config"
fi

addEmulator 1 "$md_id" "gc" "$md_inst/bin/dolphin-emu-nogui -e %ROM%"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/dosbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ midi_synth start
midi_synth stop
_EOF_
chmod +x "$romdir/pc/$launcher_name"
chown $user:$user "$romdir/pc/$launcher_name"
chown $user: "$romdir/pc/$launcher_name"

if [[ "$md_id" == "dosbox" || "$md_id" == "dosbox-sdl2" ]]; then
local config_path=$(su "$user" -c "\"$md_inst/bin/dosbox\" -printconf")
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/frotz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function game_data_frotz() {
rm -rf "$temp"
done
rm -rf "$temp"
chown -R $user:$user "$romdir/zmachine"
chown -R $user: "$romdir/zmachine"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/fuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function configure_fuse() {
#!/bin/bash
$md_inst/bin/fuse --machine 128 --full-screen
_EOF_
chown $user:$user "$script"
chown $user: "$script"
chmod +x "$script"
}

Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/gngeopi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function configure_gngeopi() {
p1control A=K122,B=K120,C=K97,D=K115,START=K49,COIN=K51,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K27
p2control A=K108,B=K59,C=K111,D=K112,START=K50,COIN=K52,UP=K264,DOWN=K261,LEFT=K260,RIGHT=K262,MENU=K27
_EOF_
chown -R $user:$user "$md_conf_root/neogeo/gngeorc"
chown -R $user: "$md_conf_root/neogeo/gngeorc"
fi

addEmulator 0 "$md_id" "arcade" "$md_inst/bin/gngeo -i $romdir/neogeo -B $md_inst/neogeobios %ROM%"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/gpsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function install_gpsp() {

function configure_gpsp() {
mkRomDir "gba"
chown $user:$user -R "$md_inst"
chown $user: -R "$md_inst"

mkUserDir "$md_conf_root/gba"

Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/mame4all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function configure_mame4all() {
copyDefaultConfig "$config" "$md_conf_root/$system/mame.cfg"
rm "$config"

chown -R $user:$user "$md_conf_root/$system"
chown -R $user: "$md_conf_root/$system"
fi

addEmulator 0 "$md_id" "arcade" "$md_inst/mame %BASENAME%"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/mupen64plus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,5 @@ function configure_mupen64plus() {
addAutoConf mupen64plus_hotkeys 1
addAutoConf mupen64plus_texture_packs 1

chown -R $user:$user "$md_conf_root/n64"
chown -R $user: "$md_conf_root/n64"
}
2 changes: 1 addition & 1 deletion scriptmodules/emulators/openmsx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function configure_openmsx() {

# Add an autostart script, used for joypad configuration
cp "$md_data/retropie-init.tcl" "$home/.openMSX/share/scripts"
chown -R "$user:$user" "$home/.openMSX/share/scripts"
chown -R "$user:" "$home/.openMSX/share/scripts"
}

function _default_settings_openmsx() {
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/oricutron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function game_data_oricutron() {
if [[ -d "$md_inst/disks" && ! -f "$romdir/oric/barbitoric.dsk" ]]; then
# copy demo disks
cp -v "$md_inst/disks/"* "$romdir/oric/"
chown -R $user:$user "$romdir/oric"
chown -R $user: "$romdir/oric"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/pcsx2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function depends_pcsx2() {
iniGet "own_sdl2"
if [[ "$ini_value" != "0" ]]; then
if dialog --yesno "PCSX2 cannot be installed on a 64bit system with the RetroPie custom version of SDL2 installed due to version conflicts with the multiarch i386 version of SDL2.\n\nDo you want to downgrade to your OS version of SDL2 and continue to install PCSX2?" 22 76 2>&1 >/dev/tty; then
chown $user:$user "$configdir/all/retropie.cfg"
chown $user: "$configdir/all/retropie.cfg"
if rp_callModule sdl2 revert; then
iniSet "own_sdl2" "0"
else
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/redream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function configure_redream() {

[[ "$md_mode" == "remove" ]] && return

chown -R $user:$user "$md_inst"
chown -R $user: "$md_inst"

local dest="$md_conf_root/dreamcast/redream"
mkUserDir "$dest"
Expand Down
6 changes: 3 additions & 3 deletions scriptmodules/emulators/reicast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ function configure_reicast() {
# copy default mappings
cp "$md_inst/share/reicast/mappings/"*.cfg "$md_conf_root/dreamcast/mappings/"

chown -R $user:$user "$md_conf_root/dreamcast"
chown -R $user: "$md_conf_root/dreamcast"

if [[ "$md_mode" == "install" ]]; then
cat > "$romdir/dreamcast/+Start Reicast.sh" << _EOF_
#!/bin/bash
$md_inst/bin/reicast.sh
_EOF_
chmod a+x "$romdir/dreamcast/+Start Reicast.sh"
chown $user:$user "$romdir/dreamcast/+Start Reicast.sh"
chown $user: "$romdir/dreamcast/+Start Reicast.sh"
else
rm "$romdir/dreamcast/+Start Reicast.sh"
fi
Expand Down Expand Up @@ -155,7 +155,7 @@ function input_reicast() {
iniGet "mapping_name"
local mapping_file="$configdir/dreamcast/mappings/evdev_${ini_value//[:><?\"]/-}.cfg"
mv "$temp_file" "$mapping_file"
chown $user:$user "$mapping_file"
chown $user: "$mapping_file"
}

function gui_reicast() {
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/residualvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ while read id desc; do
done < <($md_inst/bin/residualvm --list-targets | tail -n +3)
popd >/dev/null
_EOF_
chown $user:$user "$romdir/residualvm/+Start ResidualVM.sh"
chown $user: "$romdir/residualvm/+Start ResidualVM.sh"
chmod u+x "$romdir/residualvm/+Start ResidualVM.sh"

addEmulator 0 "$md_id" "residualvm" "bash $romdir/residualvm/+Start\ ResidualVM.sh opengl_shaders %BASENAME%"
Expand Down
10 changes: 5 additions & 5 deletions scriptmodules/emulators/retroarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ function update_shaders_retroarch() {
# remove if not git repository for fresh checkout
[[ ! -d "$dir/.git" ]] && rm -rf "$dir"
gitPullOrClone "$dir" https://github.com/RetroPie/common-shaders.git "$branch"
chown -R $user:$user "$dir"
chown -R $user: "$dir"
}

function update_overlays_retroarch() {
local dir="$configdir/all/retroarch/overlay"
# remove if not a git repository for fresh checkout
[[ ! -d "$dir/.git" ]] && rm -rf "$dir"
gitPullOrClone "$dir" https://github.com/libretro/common-overlays.git
chown -R $user:$user "$dir"
chown -R $user: "$dir"
}

function update_joypad_autoconfigs_retroarch() {
Expand All @@ -102,7 +102,7 @@ function update_assets_retroarch() {
# remove if not a git repository for fresh checkout
[[ ! -d "$dir/.git" ]] && rm -rf "$dir"
gitPullOrClone "$dir" https://github.com/libretro/retroarch-assets.git
chown -R $user:$user "$dir"
chown -R $user: "$dir"
}

function update_core_info_retroarch() {
Expand All @@ -112,15 +112,15 @@ function update_core_info_retroarch() {
gitPullOrClone "$configdir/all/retroarch/cores" https://github.com/libretro/libretro-core-info.git
# Add the info files for cores/configurations not available upstream
cp -f "$md_data/"*.info "$configdir/all/retroarch/cores"
chown -R $user:$user "$dir"
chown -R $user: "$dir"
}

function install_minimal_assets_retroarch() {
local dir="$configdir/all/retroarch/assets"
[[ -d "$dir/.git" ]] && return
[[ ! -d "$dir" ]] && mkUserDir "$dir"
downloadAndExtract "$__binary_base_url/retroarch-minimal-assets.tar.gz" "$dir"
chown -R $user:$user "$dir"
chown -R $user: "$dir"
}

function _package_minimal_assets_retroarch() {
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/rpix86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fi
popd
_EOF_
chmod +x "$romdir/pc/+Start rpix86.sh"
chown $user:$user "$romdir/pc/+Start rpix86.sh"
chown $user: "$romdir/pc/+Start rpix86.sh"
ln -sfn "$romdir/pc" games

addEmulator 0 "$md_id" "pc" "bash $romdir/pc/+Start\ rpix86.sh %ROM%"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/scummvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ while read id desc; do
done < <($md_inst/bin/scummvm --list-targets | tail -n +3)
popd >/dev/null
_EOF_
chown $user:$user "$romdir/scummvm/+Start $name.sh"
chown $user: "$romdir/scummvm/+Start $name.sh"
chmod u+x "$romdir/scummvm/+Start $name.sh"

addEmulator 1 "$md_id" "scummvm" "bash $romdir/scummvm/+Start\ $name.sh %BASENAME%"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/uae4all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pushd "$md_inst"
popd
_EOF_
chmod a+x "$romdir/amiga/+Start UAE4All.sh"
chown $user:$user "$romdir/amiga/+Start UAE4All.sh"
chown $user: "$romdir/amiga/+Start UAE4All.sh"

isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"
else
Expand Down
4 changes: 2 additions & 2 deletions scriptmodules/emulators/uae4arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function configure_uae4arm() {
done

moveConfigDir "$md_inst/kickstarts" "$biosdir/amiga"
chown -R $user:$user "$biosdir/amiga"
chown -R $user: "$biosdir/amiga"

local conf="$(mktemp)"
iniConfig "=" "" "$conf"
Expand Down Expand Up @@ -98,5 +98,5 @@ function configure_uae4arm() {
"$md_inst/uae4arm.sh"
_EOF_
chmod a+x "$romdir/amiga/$script"
chown $user:$user "$romdir/amiga/$script"
chown $user: "$romdir/amiga/$script"
}
2 changes: 1 addition & 1 deletion scriptmodules/emulators/zesarux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function configure_zesarux() {
"$md_inst/bin/zesarux" "\$@"
_EOF_
chmod +x "$romdir/zxspectrum/+Start ZEsarUX.sh"
chown $user:$user "$romdir/zxspectrum/+Start ZEsarUX.sh"
chown $user: "$romdir/zxspectrum/+Start ZEsarUX.sh"

moveConfigFile "$home/.zesaruxrc" "$md_conf_root/zxspectrum/.zesaruxrc"

Expand Down