LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-23-2018, 09:16 AM   #1
ivandi
Member
 
Registered: Jul 2009
Location: Québec, Canada
Distribution: CRUX, Debian
Posts: 528

Rep: Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866
Managing package priorities, menu and expert mode install


The maketag and maketag.ez files are identical with all packages selected by default. And menu and expert mode are actually the same thing (as the installer tells you).

I propose a simple way to make use of these options.
A short (manageable) ADD list and a short (manageable) OPT list.

The packages in the ADD list are tagged ADD and selected by default in expert and menu mode. They are hidden in menu mode (always installed).

The packages in OPT are tagged OPT and are not selected by default in menu and expert mode, they are installed in full mode only (or if selected from the menu).

The rest of the packages are tagged REC. They are selected by default in menu mode, but not in expert mode.

Here is a script to create tagfile maketag and maketag.ez using simple ADD and OPT files:
Code:
#!/bin/bash

LANG=C
LC_ALL=C

CWD=$(pwd)

SLACK_DIR="$CWD/slackware64-current"
SLACK_PKGS="slackware64"

SERIES="a ap d e f k kde kdei l n t tcl x xap xfce y"

PRI_ADD=$CWD/ADD
PRI_OPT=$CWD/OPT

TMP_DIR=/var/log/setup/tmp
# For testing
#TMP_DIR=/tmp

_pbase(){
    echo $(basename $1) | rev | cut -f4- -d '-' | rev
}

_tagfiles(){
    echo "Generating tagfile files:"
    cd $SLACK_DIR/$SLACK_PKGS || exit 1
    for d in $SERIES ; do
        echo "  $d"
        (
            for p in ./$d/*.t?z ; do
                PBASE=$(_pbase $p)
                if grep -q "^$PBASE$" $PRI_ADD 2>/dev/null ; then
                    echo $PBASE:ADD
                elif grep -q "^$PBASE$" $PRI_OPT 2>/dev/null ; then
                    echo $PBASE:OPT
                else
                    echo $PBASE:REC
                fi
            done
        ) > $d/tagfile
    done
    cd - >/dev/null
}

_maketag(){
    MTMODE="$1"
    if [ "$MTMODE" == "normal" ] ; then
        echo "Generating maketag.ez files:"
        MAKETAG="maketag.ez"
    elif [ "$MTMODE" == "expert" ] ; then
        echo "Generating maketag files:"
        MAKETAG="maketag"
    else
        echo "Invalid maketag mode."
        exit 1
    fi

    cd $SLACK_DIR/$SLACK_PKGS || exit 1
    for d in $SERIES ; do
        echo "  $d"
        (
            case $d in
                a)    DESC="BASE LINUX SYSTEM" ;;
                ap)   DESC="APPLICATIONS" ;;
                d)    DESC="PROGRAM DEVELOPMENT" ;;
                e)    DESC="GNU EMACS" ;;
                f)    DESC="FAQS/DOCS" ;;
                k)    DESC="KERNEL SOURCE" ;;
                kde)  DESC="PLASMA DESKTOP" ;;
                kdei) DESC="KDE LANG SUPPORT" ;;
                l)    DESC="LIBRARIES" ;;
                n)    DESC="NETWORK" ;;
                t)    DESC="TeX" ;;
                tcl)  DESC="Tcl/Tk" ;;
                x)    DESC="X WINDOW SYSTEM" ;;
                xap)  DESC="X APPLICATIONS" ;;
                xfce) DESC="XFCE DESKTOP" ;;
                y)    DESC="GAMES" ;;
                *)    DESC="UNKNOWN" ;;
            esac

            echo "#!/bin/sh"
            echo ""
            echo "TMP=$TMP_DIR"
            echo "if [ ! -d \$TMP ]; then"
            echo "  mkdir -p \$TMP"
            echo "fi"
            echo "cat /dev/null > \$TMP/SeTnewtag"
            echo "dialog --title \"SELECTING PACKAGES FROM SERIES $(echo $d | tr a-z A-Z) ($DESC)\" \\"
            echo "       --checklist \"Please confirm the packages you wish to install \\"
            echo "from series $(echo $d | tr a-z A-Z).  Use the UP/DOWN keys to scroll through the list, and \\"
            echo "the SPACE key to deselect any items you don't want to install.  \\"
            echo "Press ENTER when you are \\"
            echo "done.\" 22 72 12 \\"

            PKGS=""
            for p in ./$d/*.t?z ; do
                PBASE=$(_pbase $p)
                PKGS="$PKGS $PBASE"
                if [ "$MTMODE" == "normal" ] ; then
                    grep "^$PBASE:" ./$d/tagfile | cut -f2 -d ':' | grep -qw ADD && continue
                fi
                echo -n "\"$PBASE\" "
                echo -n "\"$( head -1 ${p%.t[xg]z}.txt | cut -f2- -d ':' | sed 's/^ *//' | cut -b1-60 )\" "
                if [ "$MTMODE"  == "expert" ] ; then
                    if grep "^$PBASE:" ./$d/tagfile | cut -f2 -d ':' | grep -qw ADD ; then
                        echo "\"on\" \\"
                    else
                        echo "\"off\" \\"
                    fi
                else
                    if grep "^$PBASE:" ./$d/tagfile | cut -f2 -d ':' | grep -qw OPT ; then
                        echo "\"off\" \\"
                    else
                        echo "\"on\" \\"
                    fi
                fi
            done

            echo "2> \$TMP/SeTpkgs"
            echo "if [ $? = 1 -o $? = 255 ]; then"
            echo " rm -f \$TMP/SeTpkgs"
            echo " > \$TMP/SeTnewtag"
            echo " for pkg in \\"
            echo "$PKGS \\"
            echo "  ; do"
            echo "  echo "\$pkg:SKP" >> \$TMP/SeTnewtag"
            echo " done"
            echo " exit"
            echo "fi"
            echo "cat /dev/null > \$TMP/SeTnewtag"
            echo "for PACKAGE in \\"
            echo "$PKGS \\"
            echo " ; do"
            echo " if grep \"\(^\| \)\$PACKAGE\( \|$\)\" \$TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then"
            echo "  echo \"\$PACKAGE:ADD\" >> \$TMP/SeTnewtag"
            echo " else"
            echo "  echo \"\$PACKAGE:SKP\" >> \$TMP/SeTnewtag"
            echo " fi"
            echo "done"
            echo "rm -f \$TMP/SeTpkgs"
        ) > $d/$MAKETAG
    done
    cd - >/dev/null
}

_tagfiles
_maketag normal
_maketag expert

# Test
#find $SLACK_DIR/$SLACK_PKGS -name maketag | sort | xargs -n1 sh
#find $SLACK_DIR/$SLACK_PKGS -name maketag.ez | sort | xargs -n1 sh
ADD:
Code:
# A
aaa_base
aaa_elflibs
aaa_terminfo
acl
acpid
attr
bash
bin
btrfs-progs
bzip2
coreutils
cpio
cpufrequtils
cryptsetup
dbus
dcron
devs
dialog
dosfstools
e2fsprogs
ed
efibootmgr
elilo
elvis
etc
eudev
file
findutils
gawk
gettext
glibc-solibs
glibc-zoneinfo
gpm
gptfdisk
grep
grub
gzip
hdparm
hostname
hwdata
inotify-tools
jfsutils
kbd
kernel-firmware
kernel-generic
kernel-huge
kernel-modules
kmod
less
libcgroup
libgudev
lilo
logrotate
lvm2
mdadm
mkinitrd
mlocate
ncompress
ntfs-3g
openssl-solibs
os-prober
patch
pciutils
pkgtools
procps-ng
quota
reiserfsprogs
sdparm
sed
shadow
sharutils
smartmontools
sysfsutils
sysklogd
syslinux
sysvinit
sysvinit-scripts
tar
tcsh
time
tree
usbutils
utempter
util-linux
which
xfsprogs
xz
OPT:
Code:
# A
lha
unarj
zoo

# AP
jed
joe
jove
ksh
sc
workbone
zsh

# D
ccache
clisp
cvs
distcc
gcc-gfortran
gcc-gnat
gcc-go
gcc-objc
gnucobol
mercurial
p2c
pmake
rcs
rust

# E
emacs

# F
linux-faqs
linux-howtos

# K
kernel-source

# T
texlive
transfig
xfig

# Y
bsd-games

Cheers
 
Old 01-28-2018, 08:08 AM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks for the tagfile script generator script, ivandi !

I've saved a copy of the script in my ~/dld/ivandi/ directory and I'll take the tagfile lists for a spin in a VM RSN ( I want to blow away my old, Current VM and reinstall with the new GCC 7.3 and kernel ).

One Q: What did you name your script so I can properly reference it if I have any Qs or Cs ?

Thanks again.

-- kjh( another fan of script generator scripts )
 
Old 01-28-2018, 09:57 AM   #3
ivandi
Member
 
Registered: Jul 2009
Location: Québec, Canada
Distribution: CRUX, Debian
Posts: 528

Original Poster
Rep: Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866
Quote:
Originally Posted by kjhambrick View Post
One Q: What did you name your script so I can properly reference it if I have any Qs or Cs ?
maketags.sh


Here is an ADD list with mc network ssh and slackpkg. It relies on aaa_elflibs for gcc runtime only:
Code:
aaa_base
aaa_elflibs
aaa_terminfo
acl
acpid
attr
bash
bin
btrfs-progs
bzip2
coreutils
cpio
cryptsetup
curl
cyrus-sasl
dcron
devs
dhcpcd
dialog
diffutils
dmidecode
dosfstools
e2fsprogs
ed
efibootmgr
elfutils
elilo
elvis
etc
eudev
file
findutils
fuse
gawk
gdbm
gettext
glib2
glibc
glibc-solibs
glibc-zoneinfo
gmp
gnupg
gpm
gptfdisk
grep
groff
grub
gzip
hdparm
hostname
hwdata
inotify-tools
iproute2
iputils
jfsutils
kbd
kernel-firmware
kernel-generic
kernel-huge
kernel-modules
kmod
less
libcap
libcap-ng
libcgroup
libgcrypt
libgpg-error
libidn2
libmnl
libpng
libsigsegv
libssh2
libunistring
libusb
libusb-compat
lilo
logrotate
lvm2
lzo
man-db
mc
mdadm
minicom
mkinitrd
mlocate
mpfr
ncompress
ncurses
net-tools
network-scripts
ntfs-3g
openldap-client
openssh
openssl
openssl-solibs
os-prober
pciutils
pcre
pkgtools
popt
procps-ng
readline
reiserfsprogs
screen
sdparm
sed
sg3_utils
shadow
sharutils
slackpkg
slang
smartmontools
sysfsutils
sysklogd
syslinux
sysvinit
sysvinit-scripts
tar
tcsh
time
traceroute
tree
usbutils
utempter
util-linux
wget
which
xfsprogs
xz
zlib

Cheers
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Managing priorities in Pthread and 2 Linux Processes program YehudaSinger Linux - Kernel 1 03-22-2015 04:40 PM
LXer: Managing Swap in Linux: Devices, Files, and Swap Priorities LXer Syndicated Linux News 0 01-15-2014 05:31 PM
How to install a rpm package in recovery mode? cojones Linux - Software 6 08-05-2009 09:12 AM
Lilo install failing in expert mode ? Vilius Slackware 10 01-21-2009 10:58 AM
LXer: Creating and managing filesystems with Expert Partitioner LXer Syndicated Linux News 0 01-19-2006 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration