Some useful ~/bin scripts: new-cygport

rurban on 2007-07-02T20:47:50

Not perl per se, but used to release updated cygwin packages, like perl, perl-libwin32, perl-Win32-GUI, ...

#!/bin/sh
# new-cygport  
# Sample: new-cygport perl-Win32-GUI-1.0-2 perl-Win32-GUI-1.0.2-1

cp $1.cygport $2.cygport cp $1.cygwin.patch $2.cygwin.patch cp $1.src.patch $2.src.patch PKG=`echo $1 | sed -e 's/\-[^\-]*\-[^\-]*$//'` VER=`echo $1 | sed -e "s/${PKG}\-//" -e 's/\-[^\-]*$//'` OLDBASE=${PKG}-${VER} PKG=`echo $2 | sed -e 's/\-[^\-]*\-[^\-]*$//'` VER=`echo $2 | sed -e "s/${PKG}\-//" -e 's/\-[^\-]*$//'` NEWBASE=${PKG}-${VER}

sed -e "s,^--- origsrc/${OLDBASE},--- origsrc/${NEWBASE}," \ -e "s,^+++ src/${OLDBASE},+++ src/${NEWBASE}," < $1.src.patch > $2.src.patch sed -e "s,^--- origsrc/${OLDBASE},--- origsrc/${NEWBASE}," \ -e "s,^+++ src/${OLDBASE},+++ src/${NEWBASE}," < $1.cygwin.patch > $2.cygwin.patch

echo cygport $2.cygport get prep make echo nano $2/CYGWIN-PATCHES/README echo cygport $2.cygport mkpatch install check pkg