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

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

adding project files

  • Property svn:executable set to *
File size: 5.0 KB
Line 
1#!/bin/bash
2
3# LLIUREX-POOL INFO
4
5SECTION="lists"
6WEIGHT=1
7COMMENT="Update package list using our frozen Ubuntu mirror"
8
9
10# COMMON VALUES
11#
12
13DISTRO="trusty"
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/lliurex1505/bootstraps"
29PATH_TO_PRO_TRUSTY="/srv/nfs/lliurex1505/trusty"
30PATH_TO_PRE_TRUSTY="/srv/nfs/lliurex1505/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.frozen $PATH_TO_CHROOT/trusty-chroot-amd64/etc/apt/sources.list
46cp $PATH_TO_CHROOT/sources.list.frozen $PATH_TO_CHROOT/trusty-chroot-i386/etc/apt/sources.list
47
48cp $PATH_TO_CHROOT/debian-installer.frozen $PATH_TO_CHROOT/trusty-chroot-amd64/etc/apt/sources.list.d/debian-installer.list
49cp $PATH_TO_CHROOT/debian-installer.frozen $PATH_TO_CHROOT/trusty-chroot-i386/etc/apt/sources.list.d/debian-installer.list
50
51# Mount ubuntu-mirror
52
53mount --bind /srv/nfs/lliurex1505/ubuntu-mirror/ $PATH_TO_CHROOT/trusty-chroot-amd64/srv
54mount --bind /srv/nfs/lliurex1505/ubuntu-mirror/ $PATH_TO_CHROOT/trusty-chroot-i386/srv
55
56
57
58for ch in ${PATH_TO_CHROOT}/trusty-chroot-amd64 ${PATH_TO_CHROOT}/trusty-chroot-i386; do
59
60        echo "Actualizando ${ch}"
61        chroot ${ch} apt-get update 2>/dev/null 1>/dev/null
62        echo "Fin de la actualizacion ${ch}"
63        chroot ${ch} apt-get install lliurex-pool-data -y --force-yes
64        LIST_OF_CDD_SUPPORTED="$(cat ${ch}/usr/share/lliurex-pool-data/lists/supported/cdd-supported | tr "\n" " ")"
65        chroot ${ch} lliurex-resolver -i ${LIST_OF_UDEBS} ${LIST_OF_METAS} ${LIST_OF_CDD_SUPPORTED} ${LIST_OF_SUPPORTED} -d -o ${LIST_NAME}
66        echo "The path of list is: "
67        echo "${ch}"/"${LIST_NAME}"
68
69done
70
71# Umount ubuntu-mirror
72
73umount $PATH_TO_CHROOT/trusty-chroot-amd64/srv
74umount $PATH_TO_CHROOT/trusty-chroot-i386/srv
75
76
77
78# Order and unique packages
79cat ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt |sort -u > /tmp/Megalista.txt
80cp /tmp/Megalista.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt
81
82cat ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt |sort -u > /tmp/Megalista.txt
83cp /tmp/Megalista.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt
84
85# Remove frozen apps from list from Ubuntu repos
86echo "# Frozen apps!"
87cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
88cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
89
90# Removing frozen packages
91while read line
92do
93    pkg=$line
94    echo " [ LliureX Mega Resolver ]  * Frozen :  $pkg"
95    sed -i "/^$pkg[[:blank:]]\+/d" ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
96    sed -i "/^$pkg[[:blank:]]\+/d" ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
97done < ${FROZEN_FILE}
98
99echo ""
100echo ""
101echo ""
102
103echo "****  SHOWING DIFFERENCIES (If empty, there are no changes)"
104echo "[AMD64]"
105diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/amd64.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt
106echo "[FROZEN AMD64]"
107diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/amd64-frozen.txt ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt
108echo ""
109echo -n " * Press any key to continue... "
110read
111
112echo "[i386]"
113diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/i386.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt
114echo "[FROZEN i386]"
115diff -Nuar ${PATH_TO_PRE_TRUSTY}/conf/i386-frozen.txt ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt
116echo ""
117echo -n " * Press any key to continue... "
118read
119echo ""
120
121echo ""
122
123echo -n "# Copy new packages list to pre-trusty? [y/n]: "
124read x
125if [ "$x" = "y" ]; then
126    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_PRE_TRUSTY}/conf/i386.txt
127    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_PRE_TRUSTY}/conf/amd64.txt
128    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt ${PATH_TO_PRE_TRUSTY}/conf/i386-frozen.txt
129    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt ${PATH_TO_PRE_TRUSTY}/conf/amd64-frozen.txt
130else
131    echo "Nothing to do."
132fi
133
134echo -n "# Copy new packages list to trusty? [y/n]: "
135read x
136if [ "$x" = "y" ]; then
137    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista.txt ${PATH_TO_PRO_TRUSTY}/conf/i386.txt
138    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista.txt ${PATH_TO_PRO_TRUSTY}/conf/amd64.txt
139    cp ${PATH_TO_CHROOT}/trusty-chroot-i386/MegaLista-Frozen.txt ${PATH_TO_PRO_TRUSTY}/conf/i386-frozen.txt
140    cp ${PATH_TO_CHROOT}/trusty-chroot-amd64/MegaLista-Frozen.txt ${PATH_TO_PRO_TRUSTY}/conf/amd64-frozen.txt
141else
142    echo "Nothing to do."
143fi
144
Note: See TracBrowser for help on using the repository browser.