Changeset 1131


Ignore:
Timestamp:
Jan 3, 2013, 12:29:25 PM (11 years ago)
Author:
joergs
Message:

cleanup

Location:
obs/obs-service-dsc_filelist/usr/lib/obs/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • obs/obs-service-dsc_filelist/usr/lib/obs/service/dsc_filelist

    r1130 r1131  
    11#!/bin/bash
    22
    3 # A simple script to update spec or dsc file
    4 # very, very simple. I am happy about patches which handles multiple files with different version numbers
     3# A simple script that adds the source file list to a dsc file.
    54#
    65# (C) 2012 by <joerg.steffens@dass-it.de>
     
    2928    *)
    3029      echo Unknown parameter $1.
    31       echo 'Usage: set_version --version $VERSION --file $FILE --basename $BASENAME --outdir $OUT'
     30      echo 'Usage: dsc_filelist --file $FILE --outdir $OUT'
    3231      exit 1
    3332    ;;
     
    4140fi
    4241
    43 
    44 write_files () {
    45   if [ -z "$FILES" ]; then
    46     FILES="*.spec *.dsc"
    47   fi
    48   if [ -z "$MYOUTDIR" ]; then
    49     echo "ERROR: no output directory is given via --outdir parameter!"
    50     exit 1
    51   fi
    52 
    53   for i in $FILES; do
    54     FILE=`ls -1 $i 2>/dev/null`
    55     [ -e "$FILE" ] || continue
    56 
    57     sed "0,/^Version:\(\s*\)[^%]*/s//Version:\1$MYVERSION/" "$FILE" > "$MYOUTDIR/$FILE" || exit 1
    58     echo "Updated first occurrence (if any) of Version in $FILE to $MYVERSION"
    59     if [ "${FILE%.spec}" != "$FILE" ]; then
    60       # set release back to zero after version upgrade, will be increased by OBS during build
    61       # also keep macros in release in case of fedora/mandriva
    62       sed -r -i "s,^Release:(\s*)[^%]*,Release:\10," "$MYOUTDIR/$FILE" || exit 1
    63    fi
    64 
    65     if [ "${FILE#_service:}" != "$FILE" ]; then
    66       # we can remove service files, no need to store them twice
    67       rm -f "$FILE"
    68     fi
    69   done
    70 }
    71 
    7242filesize()
    7343{
    74         stat  --format='%s' $*
     44    stat  --format='%s' $*
    7545}
    7646
    7747md5()
    7848{
    79         md5sum $* | cut -f 1 -d ' '
     49    md5sum $* | cut -f 1 -d ' '
    8050}
    8151
  • obs/obs-service-dsc_filelist/usr/lib/obs/service/dsc_filelist.service

    r1130 r1131  
    11<service name="dsc_filelist">
    22  <summary>DSC file: updates source files info in DSC file</summary>
    3   <description>This service updates the files info in a DSC file according to the existing files.
     3  <description>This service updates the file list in a DSC file according to the defined files.
    44Can be used after download_url or tar_scm service.
    55</description>
    6   <parameter name="file">
    7     <description>Update only the given file.</description>
     6  <param name="file">
     7    <description>only add files matching this parameter to the file list (wildcards allowed)</description>
    88    <required/>
    9   </parameter>
     9  </param>
    1010</service>
    11 
Note: See TracChangeset for help on using the changeset viewer.