source: llx-pool-tools/trunk/fuentes/install-files/usr/share/llx-pool/actions/xenial/package-list-update-frozen.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.3 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="xenial"
14
15# Config base dir
16CONFIG_PATH="/etc/llx-pool/basic-pkg-lists/${DISTRO}/"
17
18# Package lists
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# Frozen lliurex pacakges list
25FROZEN_FILE="${CONFIG_PATH}/frozen-list"
26
27#PATHS
28CHROOT_BASE="/srv/nfs/lliurex1609/bootstraps"
29LLX_XENIAL_MIRROR="/srv/nfs/lliurex1609/xenial"
30LLX_PREXENIAL_MIRROR="/srv/nfs/lliurex1609/pre-xenial"
31UBUNTU_XENIAL_MIRROR="/srv/nfs/lliurex1609/ubuntu"
32
33AMD64_CHROOT="${CHROOT_BASE}/amd64"
34I386_CHROOT="${CHROOT_BASE}/i386"
35
36PACKAGE_LIST="PackageList.txt"
37
38EXTRA_SUPPORTED_LIST="$(cat ${SUPPORTED_FILE} | tr "\n" " ")"
39
40
41META_LIST=$(cat ${METAS_FILE} | tr "\n" " ")
42UDEB_LIST=$(cat ${UDEBS_FILE} | tr "\n" " ")
43
44
45
46
47
48# Copy sources-list files
49
50cp $CHROOT_BASE/sources.list.frozen $AMD64_CHROOT/etc/apt/sources.list
51cp $CHROOT_BASE/sources.list.frozen $I386_CHROOT/etc/apt/sources.list
52
53cp $CHROOT_BASE/debian-installer.frozen $AMD64_CHROOT/etc/apt/sources.list.d/debian-installer.list
54cp $CHROOT_BASE/debian-installer.frozen $I386_CHROOT/etc/apt/sources.list.d/debian-installer.list
55
56# Mount ubuntu-mirror
57
58mount --bind $UBUNTU_XENIAL_MIRROR $AMD64_CHROOT/srv
59mount --bind $UBUNTU_XENIAL_MIRROR $I386_CHROOT/srv
60
61
62
63for ch in $AMD64_CHROOT $I386_CHROOT; do
64
65        echo "[${ch}] Updating apt..."
66        chroot ${ch} apt-get update 2>/dev/null 1>/dev/null
67        echo "[${ch}] Installing pool data..."
68        chroot ${ch} apt-get install lliurex-pool-data -y --force-yes
69        #CDD_SUPPORTED_LIST="$(cat ${ch}/usr/share/lliurex-pool-data/lists/supported/cdd-supported | tr "\n" " ")"
70        chroot ${ch} lliurex-resolver -i ${UDEB_LIST} ${META_LIST} ${EXTRA_SUPPORTED_LIST} -d -o ${PACKAGE_LIST}
71        echo "The path of list is: "
72        echo "${ch}"/"${PACKAGE_LIST}"
73
74done
75
76# Umount ubuntu-mirror
77
78umount $AMD64_CHROOT/srv
79umount $I386_CHROOT/srv
80
81
82# Order and unique packages
83cat $AMD64_CHROOT/$PACKAGE_LIST | sort -u > /tmp/$PACKAGE_LIST
84cp /tmp/$PACKAGE_LIST $AMD64_CHROOT/$PACKAGE_LIST
85
86cat $I386_CHROOT/$PACKAGE_LIST | sort -u > /tmp/$PACKAGE_LIST
87cp /tmp/$PACKAGE_LIST $I386_CHROOT/$PACKAGE_LIST
88
89
90
91#Remove frozen apps from list from Ubuntu repos
92echo "# Frozen apps!"
93cp $AMD64_CHROOT/$PACKAGE_LIST $AMD64_CHROOT/$PACKAGE_LIST.frozen
94cp $I386_CHROOT/$PACKAGE_LIST $I386_CHROOT/$PACKAGE_LIST.frozen
95
96# Removing frozen packages
97while read line
98do
99    pkg=$line
100   echo " [ LliureX Mega Resolver ]  * Frozen :  $pkg"
101    sed -i "/^$pkg[[:blank:]]\+/d" $AMD64_CHROOT/$PACKAGE_LIST.frozen
102   sed -i "/^$pkg[[:blank:]]\+/d" $I386_CHROOT/$PACKAGE_LIST.frozen
103done < ${FROZEN_FILE}
104
105echo ""
106echo ""
107echo ""
108
109echo "****  SHOWING DIFFERENCIES (If empty, there are no changes)"
110echo "[AMD64]"
111diff -Nuar ${LLX_PREXENIAL_MIRROR}/conf/amd64.txt ${AMD64_CHROOT}/${PACKAGE_LIST}
112
113echo "[FROZEN AMD64]"
114diff -Nuar ${LLX_PREXENIAL_MIRROR}/conf/amd64-frozen.txt ${AMD64_CHROOT}/${PACKAGE_LIST}.frozen
115
116echo ""
117echo -n " * Press any key to continue... "
118read
119
120echo "[i386]"
121diff -Nuar ${LLX_PREXENIAL_MIRROR}/conf/i386.txt ${I386_CHROOT}/${PACKAGE_LIST}
122
123echo "[FROZEN i386]"
124diff -Nuar ${LLX_PREXENIAL_MIRROR}/conf/i386-frozen.txt ${I386_CHROOT}/${PACKAGE_LIST}.frozen
125
126echo ""
127echo -n " * Press any key to continue... "
128read
129echo ""
130
131echo ""
132
133echo -n "# Copy new packages list to pre-xenial? [y/n]: "
134read x
135if [ "$x" = "y" ]; then
136    cp ${I386_CHROOT}/${PACKAGE_LIST} ${LLX_PREXENIAL_MIRROR}/conf/i386.txt
137    cp ${AMD64_CHROOT}/${PACKAGE_LIST} ${LLX_PREXENIAL_MIRROR}/conf/amd64.txt
138   
139    cp ${I386_CHROOT}/${PACKAGE_LIST}.frozen ${LLX_PREXENIAL_MIRROR}/conf/i386-frozen.txt
140    cp ${AMD64_CHROOT}/${PACKAGE_LIST}.frozen ${LLX_PREXENIAL_MIRROR}/conf/amd64-frozen.txt
141   
142   
143else
144    echo "Nothing to do."
145fi
146
147echo -n "# Copy new packages list to xenial? [y/n]: "
148read x
149if [ "$x" = "y" ]; then
150   
151    cp ${I386_CHROOT}/${PACKAGE_LIST} ${LLX_XENIAL_MIRROR}/conf/i386.txt
152    cp ${AMD64_CHROOT}/${PACKAGE_LIST} ${LLX_XENIAL_MIRROR}/conf/amd64.txt
153   
154    cp ${I386_CHROOT}/${PACKAGE_LIST}.frozen ${LLX_XENIAL_MIRROR}/conf/i386-frozen.txt
155    cp ${AMD64_CHROOT}/${PACKAGE_LIST}.frozen ${LLX_XENIAL_MIRROR}/conf/amd64-frozen.txt
156   
157else
158    echo "Nothing to do."
159fi
160
161
Note: See TracBrowser for help on using the repository browser.