source: lliurex-up/trunk/fuentes/LliurexUpForPool.sh @ 2932

Last change on this file since 2932 was 2932, checked in by kbut, 4 years ago

add script to generate changelogs in pool

File size: 801 bytes
Line 
1#!/bin/bash
2POOLPATH=$1
3CHANGELOGSFOLDER="changelogs"
4DEBSPATH="${POOLPATH}/pool"
5TEMPFOLDERDEB=$(mktemp)
6UNCOMPRESSEDDEB="${TEMPFOLDERDEB}/deb/"
7for x in $(find $DEBSPATH -type f); do
8        FOLDERDEB=$(echo $x | sed -E -e "s/_all.deb$|_i386.deb$|_amd64.deb$//g")
9        if [ ! -e "${POOLPATH}/${CHANGELOGSFOLDER}" ] ; then
10                ###############################################
11                #   Falta un if para comprobar que es un DEB  #
12                ##############################################
13                mkdir "${UNCOMPRESSEDDEB}"
14                dpkg -x "${x}" "${UNCOMPRESSEDDEB}"
15                CHANGELOGFILE=$(find ${UNCOMPRESSEDDEB} -name changelog.gz)
16                if [ -e ${CHANGELOGSFOLDER} ]; then
17                        AUX="${POOLPATH}/${CHANGELOGSFOLDER}/"
18                        mkdir -p "${AUX}"
19                        gunzip "${CHANGELOGFILE}"
20                        cp "${CHANGELOGFILE%*.gz}" "${AUX}"
21                fi
22                rm -r ${UNCOMPRESSEDDEB}
23        fi
24done
Note: See TracBrowser for help on using the repository browser.