source: llx-pool-tools/trunk/fuentes/install-files/usr/share/llx-pool/actions/xenial/package-list-update.sh @ 1290

Last change on this file since 1290 was 1290, checked in by hectorgh, 4 years ago

adding some xenial scripts

  • Property svn:executable set to *
File size: 4.7 KB
Line 
1#!/bin/bash
2
3# LLIUREX-POOL INFO
4
5SECTION="lists"
6WEIGHT=2
7COMMENT="Update package list using Ubuntu"
8
9
10# COMMON VALUES
11#
12
13DISTRO="xenial"
14
15# Path base de configuracion
16CONFIG_PATH="/etc/llx-pool/basic-pkg-lists/${DISTRO}/"
17
18# Listas de paquetes
19SUPPORTED_FILE="${CONFIG_PATH}/extra-pkg-list"
20METAS_FILE="${CONFIG_PATH}/llx-metas-list"
21UDEBS_FILE="${CONFIG_PATH}/udeb-list"
22UDEBS_EXTRA_FILE="${CONFIG_PATH}/udeb-list-extra"
23
24# Lista de paquetes congelados de LliureX
25FROZEN_FILE="${CONFIG_PATH}/frozen-list"
26
27#PATHS
28PATH_TO_CHROOT="/srv/nfs/lliurex1609/bootstraps"
29PATH_TO_PRO_TRUSTY="/srv/nfs/lliurex1609/trusty"
30PATH_TO_PRE_TRUSTY="/srv/nfs/lliurex1609/pre-trusty"
31
32LIST_NAME="MegaLista.txt"
33
34# Obtenemos la lista de los paquetes que estan soportados via lista-supported.txt
35LIST_OF_SUPPORTED="$(cat ${SUPPORTED_FILE} | tr "\n" " ")"
36
37# Obtenemos la lista de los metas
38LIST_OF_METAS=$(cat ${METAS_FILE} | tr "\n" " ")
39
40# Obtenemos la lista de los udebs
41LIST_OF_UDEBS=$(cat ${UDEBS_FILE} | tr "\n" " ")
42
43# Copy sources-list files
44
45cp $PATH_TO_CHROOT/sources.list.ubuntu $PATH_TO_CHROOT/trusty-chroot-amd64/etc/apt/sources.list
46cp $PATH_TO_CHROOT/sources.list.ubuntu $PATH_TO_CHROOT/trusty-chroot-i386/etc/apt/sources.list
47
48cp $PATH_TO_CHROOT/debian-installer.ubuntu $PATH_TO_CHROOT/trusty-chroot-amd64/etc/apt/sources.list.d/debian-installer.list
49cp $PATH_TO_CHROOT/debian-installer.ubuntu $PATH_TO_CHROOT/trusty-chroot-i386/etc/apt/sources.list.d/debian-installer.list
50
51
52
53for ch in ${PATH_TO_CHROOT}/amd64 ${PATH_TO_CHROOT}/i386; do
54
55        echo "Actualizando ${ch}"
56        chroot ${ch} apt-get update 2>/dev/null 1>/dev/null
57        echo "Fin de la actualizacion ${ch}"
58        chroot ${ch} apt-get install lliurex-pool-data -y --force-yes
59        LIST_OF_CDD_SUPPORTED="$(cat ${ch}/usr/share/lliurex-pool-data/lists/supported/cdd-supported | tr "\n" " ")"
60        chroot ${ch} lliurex-resolver -i ${LIST_OF_UDEBS} ${LIST_OF_METAS} ${LIST_OF_CDD_SUPPORTED} ${LIST_OF_SUPPORTED} -d -o ${LIST_NAME}
61        echo "The path of list is: "
62        echo "${ch}"/"${LIST_NAME}"
63
64done
65
66
67# Order and unique packages
68cat ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt |sort -u > /tmp/Megalista.txt
69cp /tmp/Megalista.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt
70
71cat ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt |sort -u > /tmp/Megalista.txt
72cp /tmp/Megalista.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt
73
74# Remove frozen apps from list from Ubuntu repos
75echo "# Frozen apps!"
76cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
77cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
78
79# Removing frozen packages
80while read line
81do
82    pkg=$line
83    echo " [ LliureX Mega Resolver ]  * Frozen :  $pkg"
84    sed -i "/^$pkg[[:blank:]]\+/d" ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
85    sed -i "/^$pkg[[:blank:]]\+/d" ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
86done < ${FROZEN_FILE}
87
88
89echo ""
90echo ""
91echo ""
92
93echo "****  SHOWING DIFFERENCIES (If empty, there are no changes)"
94echo "[AMD64]"
95diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/amd64.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt
96echo ""
97echo "[FROZEN AMD64]"
98diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/amd64-frozen.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
99echo ""
100echo -n " * Press any key to continue... "
101read
102
103echo "[i386]"
104diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/i386.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt
105echo ""
106echo "[FROZEN i386]"
107diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/i386-frozen.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
108echo ""
109echo -n " * Press any key to continue... "
110read
111echo ""
112
113echo ""
114
115echo -n "# Copy new packages list to pre-trusty? [y/n]: "
116read x
117if [ "$x" = "y" ]; then
118    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_PRE_TRUSTY}/conf/i386.txt
119    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_PRE_TRUSTY}/conf/amd64.txt
120    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt ${PATH_TO_PRE_TRUSTY}/conf/i386-frozen.txt
121    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt ${PATH_TO_PRE_TRUSTY}/conf/amd64-frozen.txt
122else
123    echo "Nothing to do."
124fi
125
126echo -n "# Copy new packages list to trusty? [y/n]: "
127read x
128if [ "$x" = "y" ]; then
129    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_PRO_TRUSTY}/conf/i386.txt
130    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_PRO_TRUSTY}/conf/amd64.txt
131    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt ${PATH_TO_PRO_TRUSTY}/conf/i386-frozen.txt
132    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt ${PATH_TO_PRO_TRUSTY}/conf/amd64-frozen.txt
133else
134    echo "Nothing to do."
135fi
Note: See TracBrowser for help on using the repository browser.