Changeset 1131
- Timestamp:
- Jan 3, 2013, 12:29:25 PM (12 years ago)
- 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 1 1 #!/bin/bash 2 2 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. 5 4 # 6 5 # (C) 2012 by <joerg.steffens@dass-it.de> … … 29 28 *) 30 29 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' 32 31 exit 1 33 32 ;; … … 41 40 fi 42 41 43 44 write_files () {45 if [ -z "$FILES" ]; then46 FILES="*.spec *.dsc"47 fi48 if [ -z "$MYOUTDIR" ]; then49 echo "ERROR: no output directory is given via --outdir parameter!"50 exit 151 fi52 53 for i in $FILES; do54 FILE=`ls -1 $i 2>/dev/null`55 [ -e "$FILE" ] || continue56 57 sed "0,/^Version:\(\s*\)[^%]*/s//Version:\1$MYVERSION/" "$FILE" > "$MYOUTDIR/$FILE" || exit 158 echo "Updated first occurrence (if any) of Version in $FILE to $MYVERSION"59 if [ "${FILE%.spec}" != "$FILE" ]; then60 # set release back to zero after version upgrade, will be increased by OBS during build61 # also keep macros in release in case of fedora/mandriva62 sed -r -i "s,^Release:(\s*)[^%]*,Release:\10," "$MYOUTDIR/$FILE" || exit 163 fi64 65 if [ "${FILE#_service:}" != "$FILE" ]; then66 # we can remove service files, no need to store them twice67 rm -f "$FILE"68 fi69 done70 }71 72 42 filesize() 73 43 { 74 44 stat --format='%s' $* 75 45 } 76 46 77 47 md5() 78 48 { 79 49 md5sum $* | cut -f 1 -d ' ' 80 50 } 81 51 -
obs/obs-service-dsc_filelist/usr/lib/obs/service/dsc_filelist.service
r1130 r1131 1 1 <service name="dsc_filelist"> 2 2 <summary>DSC file: updates source files info in DSC file</summary> 3 <description>This service updates the file s info in a DSC file according to the existingfiles.3 <description>This service updates the file list in a DSC file according to the defined files. 4 4 Can be used after download_url or tar_scm service. 5 5 </description> 6 <param etername="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> 8 8 <required/> 9 </param eter>9 </param> 10 10 </service> 11
Note:
See TracChangeset
for help on using the changeset viewer.