User Tools

Site Tools


linux:lfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
linux:lfs [2017/12/18 15:51]
vamp898
linux:lfs [2017/12/18 15:54]
vamp898
Line 1: Line 1:
 ====== Package Management ====== ====== Package Management ======
 +Raw draft of install scripts, that can be used by a package management.
 +
 Everything is placed under ''/​usr/​src/​packagename/​packageversion''​ Everything is placed under ''/​usr/​src/​packagename/​packageversion''​
 ===== samples ===== ===== samples =====
 +==== install.sh ====
 +
 <code bash> <code bash>
 VER="​$( pwd | cut -d '/'​ -f 5 )" VER="​$( pwd | cut -d '/'​ -f 5 )"
Line 60: Line 64:
 cd /​usr/​src/​${PKG} cd /​usr/​src/​${PKG}
 rm -rf ${SRC} rm -rf ${SRC}
 +</​code>​
 +==== remove.sh ====
 +<code bash>
 +VER="​$( pwd | cut -d '/'​ -f 5 )"
 +PKG="​$( pwd | cut -d '/'​ -f 4-5 )"
 +PKGBASE="​$( pwd | cut -d '/'​ -f 4 )"
 +cd /​usr/​pkg/​${PKG}
 +if [ "​$?"​ != "​0"​ ]; then
 +        echo "cd failed"​
 +        exit 1
 +fi
 +
 +### REMOVE LINKS ###
 +cat .l | while read line; do
 +        unlink "​${line}"​
 +done
 +
 +### REMOVE FILES ###
 +cat .f | while read line; do
 +        rm "​${line}"​
 +done
 +
 +### REMOVE DIRECTORIES ###
 +tac .d | grep -v ^/$ | while read line; do
 +        rmdir "​${line}"​ --ignore-fail-on-non-empty
 +done
 +cd /
 +rm -rf /​usr/​pkg/​${PKG}
 +rmdir -p /​usr/​pkg/​${PKGBASE} --ignore-fail-on-non-empty
 </​code>​ </​code>​
linux/lfs.txt ยท Last modified: 2017/12/18 15:55 by vamp898