Changeset 561 for adobe-flashplugin


Ignore:
Timestamp:
Feb 11, 2016, 10:23:34 AM (4 years ago)
Author:
mabarracus
Message:

Fix update script:

  • allow one or two filters
  • if there is more than one result, gets the newer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • adobe-flashplugin/trunk/fuentes/update_flash.sh

    r552 r561  
    1818import tempfile
    1919
     20# Base url to get package list
    2021URL='http://archive.canonical.com/pool/partner/a/adobe-flashplugin/'
     22
     23# First filter
    2124BASE_NAME='adobe-flashplugin_'
    22 DISTRO='15.10'
     25
     26# Second filter (can be innactive or empty)
     27#DISTRO='15.10'
    2328
    2429fd,tmp_file=tempfile.mkstemp()
     
    2934f=open(tmp_file)
    3035
     36# Filter the results
    3137item_dsc=[]
    3238for line in f:
    33         if BASE_NAME in line and DISTRO in line and \".dsc\" in line:
    34                 DSC_FILE=line.strip('\n').split('<a href=\"')[1].split('\">')[0]
    35                 item_dsc.append(URL+DSC_FILE)
     39        if BASE_NAME in line and \".dsc\" in line:
     40            try:
     41                DISTRO
     42                if DISTRO=='':
     43                    DISTRO=None
     44            except NameError:
     45                DISTRO=None
     46            if DISTRO != None:
     47                if DISTRO in line:
     48                    DSC_FILE=line.strip('\n').split('<a href=\"')[1].split('\">')[0]
     49                    item_dsc.append(URL+DSC_FILE)
     50            else:
     51                DSC_FILE=line.strip('\n').split('<a href=\"')[1].split('\">')[0]
     52                item_dsc.append(URL+DSC_FILE)
     53               
    3654f.close()
    3755
     56# Always select the newer that meets the criteria
     57item_dsc.sort()
     58
     59# The last is the newer
    3860if len(item_dsc) > 1:
    3961    print item_dsc[-1]
     62else:
     63    print item_dsc[0]
    4064")
    4165       
     
    5579
    5680echo "* Downloading to $TMP_DIR ... "
    57 
     81exit
    5882cd $TMP_DIR
    5983dget -xu $DSC_FILE 1>/dev/null 2>/dev/null
Note: See TracChangeset for help on using the changeset viewer.