* errno, doc/errno.1, debian/control, debian/copyright, setup.py:

- add an errno utility, LP: #61226
This commit is contained in:
Dustin Kirkland 2010-08-10 11:46:16 -04:00
parent 55cd28cb31
commit 6f4c4b031f
6 changed files with 63 additions and 0 deletions

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
ubuntu-dev-tools (0.102) UNRELEASED; urgency=low
[ Dustin Kirkland ]
* errno, doc/errno.1, debian/control, debian/copyright, setup.py:
- add an errno utility, LP: #61226
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Aug 2010 11:41:10 -0400
ubuntu-dev-tools (0.101) unstable; urgency=low
[ Andrew Starr-Bochicchio ]

1
debian/control vendored
View File

@ -51,6 +51,7 @@ Description: useful tools for Ubuntu developers
all .so files in a binary package.
- dch-repeat - used to repeat a change log into an older release.
- dgetlp - download a source package from the Launchpad library.
- errno - search POSIX error codes by error number, name, or description
- get-branches - used to branch/checkout all the bzr branches in a Launchpad
team.
- get-build-deps - install the build dependencies needed for a package

2
debian/copyright vendored
View File

@ -8,6 +8,7 @@ Upstream Authors:
Bryce Harrington <bryce@ubuntu.com>
Daniel Hahler <ubuntu@thequod.de>
Daniel Holbach <daniel.holbach@ubuntu.com>
Dustin Kirkland <kirkland@ubuntu.com>
Emmet Hikory <persia@ubuntu.com>
Iain Lane <iain@orangesquash.org.uk>
James Westby <james.westby@ubuntu.com>
@ -35,6 +36,7 @@ Copyright:
(C) 2007, Albert Damen <albrt@gmx.net>
(C) 2006-2007, Albin Tonnerre <lut1n.tne@gmail.com>
(C) 2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com>
(C) 2010, Dustin Kirkland <kirkland@ubuntu.com>
(C) 2008, Iain Lane <iain@orangesquash.org.uk>
© 2009, James Westby <james.westby@ubuntu.com>
(C) Jamin W. Collins <jcollins@asgardsrealm.net>

22
doc/errno.1 Normal file
View File

@ -0,0 +1,22 @@
.TH errno 1 "10 Aug 2010" ubuntu-dev-tools "ubuntu-dev-tools"
.SH NAME
errno \- search POSIX error codes by error number, error name, or error description
.SH DESCRIPTION
\fBerrno\fP is a simple script that interprets a POSIX error code, or finds error codes related to a search string.
.SH EXAMPLE
$ errno 36
ENAMETOOLONG 36 /* File name too long */
$ errno perm
EPERM 1 /* Operation not permitted */
EACCES 13 /* Permission denied */
.SH SEE ALSO
\fBerrno\fP(2)\fP, \fBerrno\fP(3), \fI/usr/include/asm/errno.h\fP
.SH AUTHOR
This manpage and the utility was written by Dustin Kirkland <dustin.kirkland@gmail.com> for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.

29
errno Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh -e
#
# errno - search POSIX error codes by error number, error name,
# or error description
# Copyright (C) 2010 Dustin Kirkland <kirkland@ubuntu.com>
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
# Header finding trick from Kees Cook <kees@ubuntu.com>
headers=$(echo "#include <asm/errno.h>" | gcc -E - | grep "\.h" | awk -F\" '{print $2}' | sort -u)
if echo "$code" | egrep -qs "^[0-9]+$"; then
# Input is a number, search for a particular matching code
egrep -h "^#define\s.*\s+$code\s+/" $headers | sed 's/^#define\s*//'
else
# Input is not a number, search for any matching strings
grep -hi "$code" $headers | sed 's/^#define\s*//'
fi

View File

@ -20,6 +20,7 @@ setup(name='ubuntu-dev-tools',
'dch-repeat',
'dgetlp',
'edit-patch',
'errno',
'get-branches',
'get-build-deps',
'grab-attachments',