Handling existing patches
This commit is contained in:
parent
ccd4472ac0
commit
d93127cff9
|
@ -196,36 +196,32 @@ EOF
|
||||||
#Makefile
|
#Makefile
|
||||||
_info "Creating $pkgname/Makefile..."
|
_info "Creating $pkgname/Makefile..."
|
||||||
_pkgsrc_makefile > "$pkgname/Makefile"
|
_pkgsrc_makefile > "$pkgname/Makefile"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
$RM -r -- "$pkgname"
|
||||||
|
_error "Could not create $pkgname/Makefile"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
#PLIST
|
#PLIST
|
||||||
_info "Creating $pkgname/PLIST..."
|
_info "Creating $pkgname/PLIST..."
|
||||||
tmpdir="$PWD/$pkgname/destdir"
|
tmpdir="$PWD/$pkgname/destdir"
|
||||||
$MAKE DESTDIR="$tmpdir" PREFIX="/usr/local" install
|
$MAKE DESTDIR="$tmpdir" PREFIX="/usr/local" install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
$RM -r -- "$tmpdir"
|
$RM -r -- "$pkgname"
|
||||||
_error "Could not install files in staging directory"
|
_error "Could not install files in staging directory"
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
cat > "$pkgname/PLIST" << EOF
|
echo "@comment \$NetBSD\$" > "$pkgname/PLIST"
|
||||||
@comment \$NetBSD\$
|
|
||||||
EOF
|
|
||||||
(cd "$tmpdir/usr/local" && $FIND . -type f | $CUT -c 3-) >> "$pkgname/PLIST"
|
(cd "$tmpdir/usr/local" && $FIND . -type f | $CUT -c 3-) >> "$pkgname/PLIST"
|
||||||
$RM -r -- "$tmpdir"
|
$RM -r -- "$tmpdir"
|
||||||
|
|
||||||
#distinfo
|
#distinfo
|
||||||
_info "Creating $pkgname/distinfo..."
|
_info "Creating $pkgname/distinfo..."
|
||||||
#FIXME really implement
|
_pkgsrc_distinfo > "$pkgname/distinfo"
|
||||||
cat > "$pkgname/distinfo" << EOF
|
|
||||||
\$NetBSD\$
|
|
||||||
|
|
||||||
EOF
|
|
||||||
($SHA1 -- "$PACKAGE-$VERSION.tar.gz" &&
|
|
||||||
$RMD160 -- "$PACKAGE-$VERSION.tar.gz" &&
|
|
||||||
$SIZE -- "$PACKAGE-$VERSION.tar.gz") >> "$pkgname/distinfo"
|
|
||||||
#FIXME also handle existing patches
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
$RM -- "$pkgname/distinfo"
|
$RM -r -- "$pkgname"
|
||||||
_error "Could not create $pkgname/distinfo"
|
_error "Could not create $pkgname/distinfo"
|
||||||
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_info "The package is complete"
|
_info "The package is complete"
|
||||||
|
@ -237,6 +233,29 @@ EOF
|
||||||
#- commit
|
#- commit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pkgsrc_distinfo()
|
||||||
|
{
|
||||||
|
cat << EOF
|
||||||
|
\$NetBSD\$
|
||||||
|
|
||||||
|
EOF
|
||||||
|
$SHA1 -- "$PACKAGE-$VERSION.tar.gz"
|
||||||
|
$RMD160 -- "$PACKAGE-$VERSION.tar.gz"
|
||||||
|
$SIZE -- "$PACKAGE-$VERSION.tar.gz"
|
||||||
|
#additional patches
|
||||||
|
for i in "$PKGSRC_ROOT/wip/$pkgname/patches/patch-"*; do
|
||||||
|
[ ! -f "$i" ] && continue
|
||||||
|
case "$i" in
|
||||||
|
*.orig)
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
i="${i##*/}"
|
||||||
|
(cd "$PKGSRC_ROOT/wip/$pkgname/patches" && $SHA1 -- "$i") ||
|
||||||
|
return 2
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
_pkgsrc_makefile()
|
_pkgsrc_makefile()
|
||||||
{
|
{
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
Loading…
Reference in New Issue
Block a user