bryan 2 лет назад
Родитель
Сommit
2aa5fe56f4
1 измененных файлов с 11 добавлено и 8 удалено
  1. 11 8
      installJRMC

+ 11 - 8
installJRMC

@@ -128,7 +128,7 @@ parseInput() {
     declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH
     declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH
     declare -g USER_VERSION_SWITCH
-    declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE
+    declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE USER_ARCH
     declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT
     declare -ga SERVICES CONTAINERS
     declare long_opts short_opts input
@@ -180,7 +180,7 @@ parseInput() {
                     ;;
                 --arch)
                     shift
-                    ARCH="$1"
+                    USER_ARCH="$1"
                     ;;
                 --restorefile)
                     shift && RESTOREFILE="$1"
@@ -579,7 +579,10 @@ installMCFromRepo() {
 acquireDeb() {
     debug "Running: ${FUNCNAME[0]}"
 
-    declare -g MCDEB="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-$ARCH.deb"
+
+
+
+    declare -g MCDEB="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb"
 
     # If necessary, create SOURCES dir
     [[ -d "$OUTPUTDIR/SOURCES" ]] || execute "mkdir -p $OUTPUTDIR/SOURCES"
@@ -592,13 +595,13 @@ acquireDeb() {
 
     if [[ -v BETAPASS ]] && 
         echo "Checking beta repo for DEB package" && wget -q -O "$MCDEB" \
-            "https://files.jriver.com/mediacenter/channels/v$MVERSION/beta/$BETAPASS/MediaCenter-$MCVERSION-$ARCH.deb"; then
+            "https://files.jriver.com/mediacenter/channels/v$MVERSION/beta/$BETAPASS/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb"; then
                 echo "Found!"
     elif echo "Checking latest repo for DEB package" && wget -q -O "$MCDEB" \
-            "https://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-$ARCH.deb"; then
+            "https://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb"; then
                 echo "Found!"
     elif echo "Checking test repo for DEB package" && wget -q -O "$MCDEB" \
-            "https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-$ARCH.deb"; then
+            "https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb"; then
                 echo "Found!"
     else
         err "Cannot find DEB file"
@@ -727,7 +730,7 @@ buildRPM() {
 		Release: 1
 		Summary: JRiver Media Center
 		Group:   Applications/Media
-		Source0: http://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-$ARCH.deb
+		Source0: http://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb
 		BuildArch: x86_64
 		%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm
 
@@ -892,7 +895,7 @@ installMCARCH() {
 			'vorbis-tools: ogg vorbis support' 
 			'musepack-tools: musepack support'
 		)
-		source=("http://files.jriver.com/mediacenter/channels/v30/latest/MediaCenter-$MCVERSION-$ARCH.deb")
+		source=("http://files.jriver.com/mediacenter/channels/v30/latest/MediaCenter-$MCVERSION-${USER_ARCH:-$ARCH}.deb")
 
 		package() {
 			cd "\$srcdir"