source: adobe-flashplugin/trunk/fuentes/update_flash.sh @ 8

Last change on this file since 8 was 8, checked in by mabarracus, 4 years ago

ported trusty code from repo to xenial repo

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2
3echo ""
4
5if [ "$1" = "" ];then
6
7
8        #echo "USAGE: update_flash adobe-flash-url.dsc"
9        #echo -e "\n\tDSC file can be found in http://archive.canonical.com/pool/partner/a/adobe-flashplugin/\n"
10        #exit 0
11
12        echo "* Scanning for newest version ..."
13
14        DSC_FILE=$(python -c "
15
16import urllib
17import os
18import tempfile
19
20URL='http://archive.canonical.com/pool/partner/a/adobe-flashplugin/'
21BASE_NAME='adobe-flashplugin_'
22DISTRO='14.04'
23
24fd,tmp_file=tempfile.mkstemp()
25os.close(fd)
26
27urllib.urlretrieve(URL,tmp_file)
28
29f=open(tmp_file)
30
31for line in f:
32        if BASE_NAME in line and DISTRO in line and \".dsc\" in line:
33                DSC_FILE=line.strip('\n').split('<a href=\"')[1].split('\">')[0]
34                print URL+DSC_FILE
35f.close()
36
37")
38       
39       
40        echo "* Using $DSC_FILE ..."
41        echo ""
42       
43       
44else
45        DSC_FILE="$1"
46       
47fi
48
49
50
51
52TMP_DIR=$(mktemp -d)
53
54echo "* Downloading to $TMP_DIR ... "
55
56cd $TMP_DIR
57dget -xu $DSC_FILE 1>/dev/null 2>/dev/null
58
59ADOBE_DIR=$(ls *.orig.tar.gz | cut -d / -f4 | sed -e "s%\.orig\.tar\.gz$%%g" | sed -e "s%_%-%g")
60ADOBE_VERSION=$(ls *.diff.gz | cut -d _ -f2 | sed -e "s%\.diff.gz%+lliurex1%g")
61
62echo "* Updating files..."
63
64cd - 1>/dev/null 2>/dev/null
65
66cp -r $TMP_DIR/$ADOBE_DIR/amd64/* amd64/
67cp -r $TMP_DIR/$ADOBE_DIR/i386/* i386/
68cp $TMP_DIR/$ADOBE_DIR/debian/changelog debian/changelog
69
70API_VERSION=$(cat i386/readme.txt | grep Version | cut -d " " -f2)
71
72echo "* Done updating Adobe-flashplugin Version $API_VERSION $ADOBE_VERSION"
73
74dch -b --release-heuristic trusty -v 1:$ADOBE_VERSION "Updating version to $ADOBE_VERSION"
75
76python -c "
77f=open('debian/adobe-flashplugin.postinst')
78lines=f.readlines()
79f.close()
80new_file=''
81oldv=''
82count=0
83for line in lines:
84
85        if 'sed -i' in line:
86                old_line=line
87                rule=line.split(' ')[2]
88                oldv=rule.split('%')[2]
89                newv='$API_VERSION'.replace('.','\.')
90                line=line.replace(oldv,newv)
91                               
92                if 'sed -i' not in lines[count+1]:
93                        rule=old_line.split(' ')[2]
94                        oldr=rule.split('%')[2]
95                        oldl=rule.split('%')[1]
96                        if oldr!=newv:
97                                new_line=old_line.replace(oldr,newv)
98                                new_line=new_line.replace(oldl,oldr)
99                                line+=new_line
100                                       
101        count+=1
102        new_file+=line
103
104f=open('debian/adobe-flashplugin.postinst','w')
105f.write(new_file)
106f.close()
107"
108
109echo ""
110svn st
111echo ""
112
Note: See TracBrowser for help on using the repository browser.