From e1c4cbc1da6cdfceb1b0046c7f47d345aecd9539 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Sat, 2 Mar 2019 16:06:25 +0000 Subject: core scripts backup revision and added portspage patch --- core/scripts/backup-system.sh | 74 ------------------------------------------- 1 file changed, 74 deletions(-) (limited to 'core/scripts/backup-system.sh') 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} -- cgit 1.4.1-2-gfad0