Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

452 Commits   2 Branches   1 Tag
   323         kx #!/bin/sh
   323         kx 
   323         kx # Preserve new files
   323         kx install_file() {
   323         kx   NEW="$1"
   323         kx   OLD="`dirname $NEW`/`basename $NEW .new`"
   323         kx   # If there's no file by that name, mv it over:
   323         kx   if [ ! -r $OLD ]; then
   323         kx     mv $NEW $OLD
   323         kx   elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
   323         kx     rm $NEW
   323         kx   fi
   323         kx   # Otherwise, we leave the .new copy for the admin to consider...
   323         kx }
   323         kx 
   323         kx 
   323         kx # arg 1:  the new package version
   323         kx pre_install() {
   323         kx   /bin/true
   323         kx }
   323         kx 
   323         kx # arg 1:  the new package version
   323         kx post_install() {
   323         kx   # Try to run these.  If they fail, no biggie.
   323         kx   # Also we have to be sure that we are on the working system
   323         kx   # on the target hardware ("proc/sys/kernel/osrelease" - relative path).
   323         kx   if [ -r proc/sys/kernel/osrelease -a -x /usr/bin/glib-compile-schemas ] ; then
   323         kx     /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas 1> /dev/null 2> /dev/null
   323         kx   fi
   323         kx 
   323         kx   if [ -e usr/share/icons/hicolor/icon-theme.cache ] ; then
   323         kx     if [ -r proc/sys/kernel/osrelease -a -x /usr/bin/gtk-update-icon-cache ] ; then
   323         kx       /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor 1> /dev/null 2> /dev/null
   323         kx     fi
   323         kx   fi
   323         kx 
   323         kx   if [ -r proc/sys/kernel/osrelease -a -x /usr/bin/update-mime-database ] ; then
   323         kx     /usr/bin/update-mime-database usr/share/mime 1> /dev/null 2> /dev/null
   323         kx   fi
   323         kx 
   323         kx   if [ -r proc/sys/kernel/osrelease -a -x /usr/bin/update-desktop-database ] ; then
   323         kx     /usr/bin/update-desktop-database -q usr/share/applications 1> /dev/null 2> /dev/null
   323         kx   fi
   323         kx }
   323         kx 
   323         kx # arg 1:  the new package version
   323         kx # arg 2:  the old package version
   323         kx pre_update() {
   323         kx   /bin/true
   323         kx }
   323         kx 
   323         kx # arg 1:  the new package version
   323         kx # arg 2:  the old package version
   323         kx post_update() {
   323         kx   post_install
   323         kx }
   323         kx 
   323         kx # arg 1:  the old package version
   323         kx pre_remove() {
   323         kx   /bin/true
   323         kx }
   323         kx 
   323         kx # arg 1:  the old package version
   323         kx post_remove() {
   323         kx   /bin/true
   323         kx }
   323         kx 
   323         kx 
   323         kx operation=$1
   323         kx shift
   323         kx 
   323         kx $operation $*