Revision: 7316 http://sourceforge.net/p/ipcop/svn/7316 Author: owes Date: 2014-03-10 07:48:08 +0000 (Mon, 10 Mar 2014) Log Message: ----------- Add a script I have been using to track differences after a package update.
Added Paths: ----------- ipcop/trunk/tools/package-diff.pl Added: ipcop/trunk/tools/package-diff.pl =================================================================== --- ipcop/trunk/tools/package-diff.pl (rev 0) +++ ipcop/trunk/tools/package-diff.pl 2014-03-10 07:48:08 UTC (rev 7316) @@ -0,0 +1,92 @@ +#!/usr/bin/perl +# +# This file is part of the IPCop Firewall. +# +# IPCop is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# IPCop is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with IPCop. If not, see <http://www.gnu.org/licenses/>. +# +# (c) 2011-2014 The IPCop Team +# +# Usage: package-diff.pl <lfs-package-name> +# +# Purpose: find and list differences for package by searching in doc/diff-list.txt. +# The differences can then be more easily added to update ROOTFILE +# +# +# TODO: support for non-i486 architectures +# +# $Id$ +# + + +use strict; +use warnings; + + +my $ipcop_version = `grep "^VERSION=" make.sh | cut -d '=' -f 2`; +chomp(${ipcop_version}); +my $diff_file = "doc/IPCop-${ipcop_version}-diff-list.i486.txt"; +unless (-e $diff_file) { + die "$diff_file does not exist"; +} + +unless (defined($ARGV[0])) { + die "No package name."; +} +my $package = $ARGV[0]; +my $package_version = `grep "^VER" lfs/${package} | cut -d '=' -f 2`; +$package_version =~ s/^\s*(.*?)\s*$/$1/; +my $rootfile = ""; +my $filelist = `find files_i486 -name ${package}-${package_version}`; +chomp($filelist); + +# +# Search rootfile and filelist for differences +# +if (-f "config/rootfiles/common/${package}") { + $rootfile = "config/rootfiles/common/${package}"; +} +elsif (-f "config/rootfiles/arch_i486/${package}") { + $rootfile = "config/rootfiles/arch_i486/${package}"; +} +else { + print "No rootfile for package ${package}?\n"; +} + +if (! -f "${filelist}") { + print "Filelist for ${package} version ${package_version} not found.\n"; +} +elsif (! -f "${rootfile}") { + # Already informed +} +else { + print "## rootfile differences >>\n"; + print `diff -Nuw ${rootfile} ${filelist}`; + print "<<\n"; +} + +# +# Search diff-list.txt for matches +# +print "##\n"; +print "## ${package}-${package_version}\n"; + +open (LIST, "$diff_file") or die "Unable to open $diff_file"; +while (<LIST>) { + my @temp = split(' ',$_); + + next unless (($temp[0] eq 'DIFF') || ($temp[0] eq 'NEW')); + next unless (defined($temp[2]) && ($temp[2] eq "${package}")); + + print "$temp[1]\n"; +} Property changes on: ipcop/trunk/tools/package-diff.pl ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn