add portimport
portimport is used to import the directories and files of a new port to the OpenBSD ports cvs(1) repository, avoiding common mistakes. It has to be executed from within the new port's directory. please read the BUGS section in portimport(1) for details about the user login used to connect to cvs.openbsd.org !! addition suggested by and OK sthen@ no objections from jasper@ espie@ aja@ manpage nits jmc@
This commit is contained in:
parent
7616e18ac8
commit
e195d5e0df
60
infrastructure/bin/portimport
Executable file
60
infrastructure/bin/portimport
Executable file
@ -0,0 +1,60 @@
|
||||
#!/bin/ksh
|
||||
#
|
||||
# $OpenBSD: portimport,v 1.1 2013/04/09 19:51:37 rpe Exp $
|
||||
# Copyright (c) 2013 Robert Peichaer
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
# Based on Marc Espie's portimport.
|
||||
# sthen: Modified to handle imports from mystuff/ and do a dry run first.
|
||||
# rpe: rewrite based on sthen@'s version
|
||||
|
||||
set -e
|
||||
|
||||
# XXX
|
||||
# XXX CHANGE if you login to cvs.openbsd.org with different user
|
||||
# XXX
|
||||
user=$(id -un)
|
||||
|
||||
cvsroot=$user@cvs.openbsd.org:/cvs
|
||||
error=false
|
||||
fulldir=$(pwd)
|
||||
importname="ports/${fulldir##*/ports/*(mystuff/|openbsd-wip/|p5-ports-wip/)}"
|
||||
timestamp=$(date '+%Y%m%d')
|
||||
|
||||
err() { echo "$*"; error=true; }
|
||||
|
||||
[[ -f Makefile && -f distinfo && -f pkg/DESCR && -f pkg/PLIST ]] || err "No ports files?"
|
||||
find . -name .git -print|read i && err "You git!"
|
||||
find . -name .\*.swp -print|read i && err "Found vim swap file"
|
||||
find . -name \*.orig -print|read i && err "Found .orig file, ouch"
|
||||
find . -name typescript -print|read i && err "Found typescript file, ouch"
|
||||
find . -path ./w-\* -print|read i && err "Please wipe out work directory before importing"
|
||||
find . -type d -name core -print|read i && err "directory named core found, cvs will ignore it"
|
||||
find . -type f -name .todo -print|read i && err "devtodo file found"
|
||||
find . -type d -name CVS -print|read i && err "Some CVS stuff already in there, very funky"
|
||||
$error && exit 1
|
||||
|
||||
echo -n "Import would go into: "
|
||||
cvs -n -d$cvsroot import $importname $user ${user}_$timestamp 2>/dev/null | \
|
||||
grep Makefile | head -1 | awk '{print $2}' | xargs dirname
|
||||
|
||||
read ans?'Correct path? [y/n] '
|
||||
if [[ $ans == +(y|Y) ]]; then
|
||||
cvs -d$cvsroot import $importname $user ${user}_$timestamp
|
||||
cd /usr/$importname/../
|
||||
cvs -d$cvsroot update -AdP ${fulldir##*/}
|
||||
echo "Don't forget to commit the category Makefile when you're done!"
|
||||
cd /usr/$importname/../
|
||||
pwd
|
||||
fi
|
66
infrastructure/man/man1/portimport.1
Normal file
66
infrastructure/man/man1/portimport.1
Normal file
@ -0,0 +1,66 @@
|
||||
.\" $OpenBSD: portimport.1,v 1.1 2013/04/09 19:51:37 rpe Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2013 Robert Peichaer
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
.\" copyright notice and this permission notice appear in all copies.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: April 9 2013 $
|
||||
.Dt PORTIMPORT 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm portimport
|
||||
.Nd import a new port to the ports cvs repository
|
||||
.Sh SYNOPSIS
|
||||
.Nm portimport
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is used to import the directories and files of a new port to the
|
||||
.Ox
|
||||
ports
|
||||
.Xr cvs 1
|
||||
repository, avoiding common mistakes.
|
||||
It has to be executed from within the new port's directory.
|
||||
.Pp
|
||||
.Nm
|
||||
verifies that a minimal directory and file structure for a port is in
|
||||
place and that no bogus files exist.
|
||||
The import is done in two steps.
|
||||
In the first step, the
|
||||
.Fl n
|
||||
option of the cvs command is used to only check for possible problems
|
||||
without changing anything and shows the cvs path where the new port will
|
||||
be imported.
|
||||
In the second step, the current ports directory is imported to the
|
||||
.Ox
|
||||
ports cvs repository.
|
||||
After the import, the new port is checked out in the respective directory
|
||||
of the local ports tree.
|
||||
.Sh SEE ALSO
|
||||
.Xr cvs 1
|
||||
.Sh HISTORY
|
||||
This command is based on the portimport script of Marc Espie, lightly
|
||||
modified by Stuart Henderson and rewritten by Robert Peichaer.
|
||||
.Sh CAVEATS
|
||||
The
|
||||
.Ev CVSROOT
|
||||
environment variable is not used.
|
||||
.Sh BUGS
|
||||
The login name of the current user is used for the
|
||||
.Xr ssh 1
|
||||
connection to the
|
||||
.Ox
|
||||
cvs server, to compose the vendortag and the releasetag.
|
||||
The value of the
|
||||
.Va user
|
||||
variable has to be changed in the sourcecode if a different login name is
|
||||
used to connect to the cvs server.
|
Loading…
Reference in New Issue
Block a user