about summary refs log tree commit diff stats
path: root/core/scripts/backup-system.sh
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2019-03-02 16:06:25 +0000
committerSilvino Silva <silvino@bk.ru>2019-03-02 16:06:25 +0000
commite1c4cbc1da6cdfceb1b0046c7f47d345aecd9539 (patch)
tree55c74b57c0ab3c1b5bca9f5930cfdc33ea2c55fe /core/scripts/backup-system.sh
parent4d95146424bae0ddec124f5dd5d70aa7e97548ee (diff)
downloaddoc-e1c4cbc1da6cdfceb1b0046c7f47d345aecd9539.tar.gz
core scripts backup revision and added portspage patch
Diffstat (limited to 'core/scripts/backup-system.sh')
-rw-r--r--core/scripts/backup-system.sh74
1 files changed, 0 insertions, 74 deletions
diff --git a/core/scripts/backup-system.sh b/core/scripts/backup-system.sh
index 7faf676..17c8c6a 100644
--- a/core/scripts/backup-system.sh
+++ b/core/scripts/backup-system.sh
@@ -193,77 +193,3 @@ do
         *) echo "Please enter only y or n"
     esac
 done
-
-# Port System
-while true
-do
-    echo "Backup Port System ?" 
-    echo "Please confirm (y or n) :"
-    read CONFIRM
-    case $CONFIRM in
-        n|N|no|NO|No) break ;;
-        y|Y|YES|yes|Yes)
-            echo "Accept - you entered $CONFIRM"
-
-	    # archive pkgutils data
-	    tar --xattrs -zcpf $DEST_SYS/pkg-db.tar.gz \
-		/var/lib/pkg/db
-
-	    # archive ports data
-	    tar --xattrs -zcpf $DEST_SYS/etc_ports.tar.gz \
-		    --directory=/etc/ports \
-		    .	
-
-	    METADATA=${DEST_SYS}/meta-data
-	    mkdir -p $METADATA
-
-	    # must be using gwak instead of sed
- 	    prt-get listinst -v | sed 's/ /#/g' | sed 's/$/.pkg.tar.gz/g' > ${METADATA}/all-installed.pkg 
-
-	    for filename in /etc/ports/*.git; do
-	    	source $filename
-
-		# backup ports collection
-		echo "Backing up collection: $NAME"
-		tar --xattrs -zcpf $PORT_PRT/${NAME}-ports.tar.gz \
-		--directory=$ROOT_DIR/usr/ports/${NAME} \
-		--exclude=.git/ \
-		.
-
-
-		# create list of installed packages 
-		prt-get printf "%i %p %n\n" | grep "yes /usr/ports/${NAME}" | cut -d " " -f 3 > ${METADATA}/${NAME}-installed.pkg
-
-		# backup collection packages
-		while read line; do
-			echo "Backing up package: ${NAME}/${line}"
-			# get installed version not version on ports
-			PACKAGE="$(cat ${METADATA}/all-installed.pkg | grep "^${line}#")"
-			if [ ! -f /usr/ports/packages/${PACKAGE} ]; then
-				echo "Building package: ${PACKAGE};\n"
-				sudo prt-get update -fr -if -is ${line}
-				(cd /usr/ports/${NAME}/${line} \
-				       	&& sudo pkgmk -uf)
-			fi
-
-			if [ -f /usr/ports/packages/${PACKAGE} ]; then
-				echo ${PACKAGE} >> ${METADATA}/${NAME}-backup.pkg
-				#cp /usr/ports/packages/${PACKAGE} ${PORT_PKG}/${NAME}/
-				tar rvf ${PORT_PKG}/${NAME}.tar \
-					--directory=/usr/ports/packages \
-					${PACKAGE}
-			else
-				echo "Package $PORT_NAME not found: ${line}"
-				echo ${PACKAGE} >> ${METADATA}/${NAME}-notfound.pkg
-			fi
-		done < ${METADATA}/${NAME}-installed.pkg
-	    done
-            break
-            ;;
-        *) echo "Please enter only y or n"
-    esac
-done
-
-RELEASE_NAME=$(basename ${DEST_DIR})
-cd $(dirname ${DEST_DIR}) && tar -zcpf  ${RELEASE_NAME}.tar.gz ${RELEASE_NAME}/
-rm -rf ${DEST_DIR}