Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.8
obs-service-download_files
_service:gitpkg:0005-Stricter-change-filename-c...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:gitpkg:0005-Stricter-change-filename-check.patch of Package obs-service-download_files
From 1acae964cd57b0a3d84633c35c0725c6603096ff Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" <bwiedemann@suse.de> Date: Mon, 15 Jun 2015 09:48:41 +0200 Subject: [PATCH] Stricter change filename check This fixes a problem when there's a filename which contains one of the matchers in it's name (i.e. 'changes_foo_bar). Be more strict now and check that the file at least ends with the match. This is the actual fix that PR #3 intended --- download_files | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/download_files b/download_files index dce099c..f18884a 100755 --- a/download_files +++ b/download_files @@ -88,6 +88,12 @@ function uncompress_file() { echo $basename } +function changes_filename() +{ + # Check old tarball if there are any changes files present, take the first one (if any) + tar -tf "$@" 2>/dev/null | grep -iE "/changelog|/news|/changes" | head -n1 +} + function write_changes() { spec_file_name=$1 @@ -161,9 +167,7 @@ for i in *.spec PKGBUILD; do if [ "$CHANGES_GENERATE" == "enable" ]; then - # Check old tarball if there are any changes files present, take the first one (if any) - #changes_filename=$(tar -tf $BN* 2>/dev/null | sed -e "s|[^/]*/||" | grep -iE 'changelog$|news$|changes$' | head -n1) - OLD_CHANGES_FILENAME=$(tar -tf $BN* 2>/dev/null | grep -iE "/changelog|news|changes" | head -n1) + OLD_CHANGES_FILENAME=$(changes_filename $BN*) if [ -n "$OLD_CHANGES_FILENAME" ] ; then OLD_CHANGES_FILE=$(tar -xvf $BN* $OLD_CHANGES_FILENAME) OLD_CHANGES_BASEDIR=$(echo $OLD_CHANGES_FILE | sed -e "s|/.*||") @@ -216,7 +220,7 @@ for i in *.spec PKGBUILD; do if [ "$CHANGES_GENERATE" == "enable" -a -n "$OLD_CHANGES_FILE" ]; then # Try to find the same changes file in the new tarball - CHANGES_FILENAME=$(tar -tf $BN* 2>/dev/null | grep -iE "/changelog|news|changes" | head -n1) + CHANGES_FILENAME=$(changes_filename $BN*) if [ -n "$CHANGES_FILENAME" ] ; then CHANGES_FILE=$(tar -xvf $BN* $CHANGES_FILENAME) CHANGES_BASEDIR=$(echo $CHANGES_FILE | sed -e "s|/.*||") -- 2.9.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor