initial commit
This commit is contained in:
parent
78c5e79e70
commit
6ad574f515
48
Makefile.am
48
Makefile.am
@ -1,14 +1,40 @@
|
|||||||
dist_bin_SCRIPTS = sunrise-commit
|
EXTRA_DIST = README LICENSES AUTHORS
|
||||||
dist_man1_MANS = sunrise-commit.1
|
|
||||||
|
|
||||||
EXTRA_DIST = sunrise-commit.in sunrise-commit.1.in
|
bin_SCRIPTS = go-commit go-series2epatch go-patch go-checkPatch go-distclean go-redigest go-oneelf go-checkdeps
|
||||||
|
pkglib_SCRIPTS= go-pkgutil.rb
|
||||||
|
man1_MANS = go-commit.1
|
||||||
|
|
||||||
$(dist_bin_SCRIPTS) $(dist_man1_MANS): configure.ac
|
|
||||||
rm -f $@ $@.tmp
|
|
||||||
sed -e "s|@PACKAGE_STRING[@]|@PACKAGE_STRING@|" ${srcdir}/$@.in > $@.tmp
|
|
||||||
! [ -x $@ ] || chmod +x $@.tmp
|
|
||||||
chmod a-w $@.tmp
|
|
||||||
mv $@.tmp $@
|
|
||||||
|
|
||||||
sunrise-commit: sunrise-commit.in
|
go-commit:
|
||||||
sunrise-commit.1: sunrise-commit.1.in
|
$(CP) sunrise-commit go-commit
|
||||||
|
|
||||||
|
go-commit.1:
|
||||||
|
$(CP) sunrise-commit.1 go-commit.1
|
||||||
|
|
||||||
|
go-series2epatch:
|
||||||
|
$(CP) series2epatch go-series2epatch
|
||||||
|
|
||||||
|
go-patch:
|
||||||
|
$(CP) lfspatch go-patch
|
||||||
|
|
||||||
|
go-checkPatch:
|
||||||
|
$(CP) checkPatch go-checkPatch
|
||||||
|
|
||||||
|
go-distclean:
|
||||||
|
$(CP) distclean-0.3.py go-distclean
|
||||||
|
|
||||||
|
go-redigest:
|
||||||
|
$(CP) redigest go-redigest
|
||||||
|
|
||||||
|
go-oneelf:
|
||||||
|
$(CP) oneelf.rb go-oneelf
|
||||||
|
|
||||||
|
go-checkdeps:
|
||||||
|
$(CP) checkdeps.rb go-checkdeps
|
||||||
|
|
||||||
|
go-pkgutil.rb:
|
||||||
|
$(CP) pkgutil.rb go-pkgutil.rb
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
$(RM) -rf $(bin_SCRIPTS) $(pkglib_SCRIPTS) $(man1_MANS) go-utils-*
|
||||||
|
|
||||||
|
1578
autogen.sh
Executable file
1578
autogen.sh
Executable file
File diff suppressed because it is too large
Load Diff
75
checkPatch.in
Normal file
75
checkPatch.in
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Script to verify that the patch contains all neccessary headers
|
||||||
|
# [Created by Tushar Teredesai]
|
||||||
|
# [License: GPL]
|
||||||
|
#
|
||||||
|
# Script to verify that the patch meets the basic formatting standards.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$DEBUG" = "yes" ]
|
||||||
|
then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "" ]
|
||||||
|
then
|
||||||
|
echo "Info: @PACKAGE_STRING@"
|
||||||
|
echo "ERROR: Patch File not specified."
|
||||||
|
echo "Usage: `basename $0` file.patch"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PATCH_FILE="$1"
|
||||||
|
if [ ! -f "$PATCH_FILE" ]
|
||||||
|
then
|
||||||
|
echo "ERROR: Patch File not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
err_val=0
|
||||||
|
|
||||||
|
SUBMITTED_BY=`echo \`grep "^Submitted By:" $PATCH_FILE | cut -f2 -d:\``
|
||||||
|
DATE=`echo \`grep -h "^Date:" $PATCH_FILE | cut -f2 -d:\``
|
||||||
|
INITIAL_PACKAGE_VERSION=`echo \`grep -h "^Initial Package Version:" $PATCH_FILE | cut -f2 -d:\``
|
||||||
|
ORIGIN=`echo \`grep -h "^Origin:" $PATCH_FILE | cut -f2 -d:\``
|
||||||
|
DESCRIPTION=`grep -h "^Description:" $PATCH_FILE`
|
||||||
|
UPSTREAM_STATUS=`echo \`grep "^Upstream Status:" $PATCH_FILE | cut -f2 -d:\``
|
||||||
|
if [ -z "$SUBMITTED_BY" ]
|
||||||
|
then
|
||||||
|
echo "Annonymous Submitter!"
|
||||||
|
err_val=1
|
||||||
|
else
|
||||||
|
echo "Submitted By: $SUBMITTED_BY"
|
||||||
|
fi
|
||||||
|
if [ -z "$DATE" ]
|
||||||
|
then
|
||||||
|
echo "Date not specified!"
|
||||||
|
err_val=1
|
||||||
|
else
|
||||||
|
echo "Date: $DATE"
|
||||||
|
fi
|
||||||
|
if [ -z "$INITIAL_PACKAGE_VERSION" ]
|
||||||
|
then
|
||||||
|
echo "No Package Version specified!"
|
||||||
|
err_val=1
|
||||||
|
else
|
||||||
|
echo "Initial Package Version: $INITIAL_PACKAGE_VERSION"
|
||||||
|
fi
|
||||||
|
if [ -z "$UPSTREAM_STATUS" ]
|
||||||
|
then
|
||||||
|
echo "Upstream status not included!"
|
||||||
|
err_val=1
|
||||||
|
else
|
||||||
|
echo "Upstream Status: $UPSTREAM_STATUS"
|
||||||
|
fi
|
||||||
|
if [ -z "$ORIGIN" ]
|
||||||
|
then
|
||||||
|
echo "Origin of patch not mentioned!"
|
||||||
|
err_val=1
|
||||||
|
fi
|
||||||
|
if [ -z "$DESCRIPTION" ]
|
||||||
|
then
|
||||||
|
echo "Description missing!"
|
||||||
|
err_val=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $err_val
|
128
checkdeps.rb.in
Normal file
128
checkdeps.rb.in
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
#!/usr/bin/ruby -w
|
||||||
|
|
||||||
|
# Licensed under GPL-2 or later
|
||||||
|
# Author: Petteri Räty <betelgeuse@gentoo.org>
|
||||||
|
|
||||||
|
$: << File.dirname(__FILE__)
|
||||||
|
require "@LIBDIR@/@PACKAGE@/go-pkgutil.rb"
|
||||||
|
|
||||||
|
$verbose = false
|
||||||
|
$quiet = false
|
||||||
|
|
||||||
|
pkgs_to_check=[]
|
||||||
|
|
||||||
|
def print_help(exit_value)
|
||||||
|
puts 'Info: @PACKAGE_STRING@'
|
||||||
|
puts 'Usage: go-checkdeps opts|pkgs'
|
||||||
|
puts
|
||||||
|
puts 'Options:'
|
||||||
|
puts '-q, --quiet'
|
||||||
|
puts '-v, --verbose'
|
||||||
|
puts '-h, --help'
|
||||||
|
puts '-d, --debug'
|
||||||
|
puts
|
||||||
|
puts 'Everything else is passed to qfile as it is'
|
||||||
|
exit(exit_value)
|
||||||
|
end
|
||||||
|
|
||||||
|
ARGV.each do | arg |
|
||||||
|
if arg =~ /^(-v|--verbose)$/
|
||||||
|
$verbose = true
|
||||||
|
elsif arg =~ /^(-h|--help)$/
|
||||||
|
print_help(0)
|
||||||
|
elsif arg =~ /^(-q|--quiet)$/
|
||||||
|
$quiet = true
|
||||||
|
elsif arg =~ /^(-d|--debug)$/
|
||||||
|
$DEBUG = true
|
||||||
|
$verbose = true
|
||||||
|
else
|
||||||
|
pkgs_to_check << arg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
pkgs_to_check.length == 0 && print_help(1)
|
||||||
|
|
||||||
|
class ElfObj
|
||||||
|
attr_reader :path, :pkgs
|
||||||
|
|
||||||
|
def initialize(path)
|
||||||
|
@path = path
|
||||||
|
@pkgs = []
|
||||||
|
end
|
||||||
|
|
||||||
|
def <<(pkg)
|
||||||
|
if ! @pkgs.index(pkg)
|
||||||
|
@pkgs << pkg
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def <=>(r)
|
||||||
|
return @path <=> r.path
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_s()
|
||||||
|
puts 'ElfObj to_s:' if $DEBUG
|
||||||
|
s = "\t" + @path
|
||||||
|
s+="\t" + @path + "\n\t\t" + @pkgs.sort.join("\n\t\t") if $DEBUG
|
||||||
|
s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def handle_new_lib(obj,lib)
|
||||||
|
puts 'library: ' + lib if $DEBUG
|
||||||
|
$lib_hash[lib]=nil
|
||||||
|
pkg = get_pkg_of_lib(lib)
|
||||||
|
|
||||||
|
if ! pkg
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if obj_table = $pkg_hash[pkg]
|
||||||
|
obj_table << obj
|
||||||
|
else
|
||||||
|
$pkg_hash[pkg]=[obj]
|
||||||
|
obj << pkg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
$lib_hash ={}
|
||||||
|
$pkg_hash ={}
|
||||||
|
|
||||||
|
qlist = IO.popen("qlist #{pkgs_to_check.join(' ')}")
|
||||||
|
|
||||||
|
scan_elf = ScanElf.instance
|
||||||
|
|
||||||
|
while obj = qlist.gets
|
||||||
|
obj.rstrip!
|
||||||
|
if is_elf(obj)
|
||||||
|
puts 'obj: ' + obj if $DEBUG
|
||||||
|
elf_obj = ElfObj.new(obj)
|
||||||
|
scan_elf.each(obj) do | lib |
|
||||||
|
handle_new_lib(elf_obj,lib) unless $lib_hash.key?(lib)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "#{file} is not executable or a normal file" if $verbose
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
qlist.close
|
||||||
|
|
||||||
|
if $? != 0
|
||||||
|
$stderr.puts('qlist did not run succesfully.')
|
||||||
|
$stderr.puts('Please emerge portage-utils if you don\'t already have it.')
|
||||||
|
end
|
||||||
|
|
||||||
|
$pkg_hash.sort.each do | pair |
|
||||||
|
puts 'Key: ' if $DEBUG
|
||||||
|
puts pair[0]
|
||||||
|
puts 'Value: ' if $DEBUG
|
||||||
|
puts pair[1].uniq.sort unless $quiet
|
||||||
|
puts 'end Hash.' if $DEBUG
|
||||||
|
end
|
||||||
|
|
||||||
|
if $verbose
|
||||||
|
puts $lib_hash.keys
|
||||||
|
end
|
29
configure.ac
29
configure.ac
@ -1,7 +1,32 @@
|
|||||||
AC_PREREQ([2.59])
|
AC_PREREQ([2.59])
|
||||||
AC_INIT([sunrise-commit], [0.3])
|
AC_INIT([go-utils], [0.3])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 no-dependencies])
|
AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 no-dependencies])
|
||||||
|
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
AC_DEFINE_DIR(DATADIR, datadir)
|
||||||
|
AC_DEFINE_DIR(LIBDIR, libdir)
|
||||||
|
AC_DEFINE_DIR(LOCALSTATEDIR, localstatedir)
|
||||||
|
|
||||||
|
# Check common programs
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_PROG_LN_S
|
||||||
|
AC_CHECK_PROG([RM], rm, rm, [], [$PATH])
|
||||||
|
AC_CHECK_PROG([CP], cp, cp, [], [$PATH])
|
||||||
|
AC_CHECK_PROG([CHMOD], chmod, chmod, [], [$PATH])
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
AC_CONFIG_FILES([checkPatch], [chmod +x checkPatch])
|
||||||
|
AC_CONFIG_FILES([checkdeps.rb], [chmod +x checkdeps.rb])
|
||||||
|
AC_CONFIG_FILES([oneelf.rb], [chmod +x oneelf.rb])
|
||||||
|
AC_CONFIG_FILES([pkgutil.rb], [chmod +x pkgutil.rb])
|
||||||
|
AC_CONFIG_FILES([distclean-0.3.py], [chmod +x distclean-0.3.py])
|
||||||
|
AC_CONFIG_FILES([lfspatch], [chmod +x lfspatch])
|
||||||
|
AC_CONFIG_FILES([redigest], [chmod +x redigest])
|
||||||
|
AC_CONFIG_FILES([series2epatch], [chmod +x series2epatch])
|
||||||
|
AC_CONFIG_FILES([sunrise-commit.1], [chmod +x sunrise-commit.1])
|
||||||
|
AC_CONFIG_FILES([sunrise-commit], [chmod +x sunrise-commit])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
90
distclean-0.3.py.in
Normal file
90
distclean-0.3.py.in
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
## distclean.py version 0.3 (4 Jan 2009)
|
||||||
|
##
|
||||||
|
## Removes source files for Gentoo
|
||||||
|
## packages that are no longer installed
|
||||||
|
## Use with '-p' (pretend) flag to just get a list of files
|
||||||
|
## that would be removed
|
||||||
|
##
|
||||||
|
## 0.1: Aug 20, 2003 - first version with version number
|
||||||
|
## 0.2: Jan 11, 2005 - fixes by Emil Beinroth
|
||||||
|
## 0.3: Jan 04, 2009 - portage API changed, fixed by Jan Narovec
|
||||||
|
##
|
||||||
|
## Copyright (c) 2003, Fredrik Arnerup (e97_far@e.kth.se)
|
||||||
|
## All rights reserved.
|
||||||
|
##
|
||||||
|
## Redistribution and use in source and binary forms, with or without
|
||||||
|
## modification, are permitted provided that the following conditions are met:
|
||||||
|
##
|
||||||
|
## * Redistributions of source code must retain the above copyright notice,
|
||||||
|
## this list of conditions and the following disclaimer.
|
||||||
|
##
|
||||||
|
## * Redistributions in binary form must reproduce the above copyright
|
||||||
|
## notice, this list of conditions and the following disclaimer in the
|
||||||
|
## documentation and/or other materials provided with the distribution.
|
||||||
|
##
|
||||||
|
## THIS SOFTWARE IS PROVIDED BY FREDRIK ARNERUP "AS IS" AND ANY
|
||||||
|
## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
## DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||||
|
## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
## CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
## DAMAGE.
|
||||||
|
|
||||||
|
import sys, os, os.path, getopt, portage
|
||||||
|
|
||||||
|
opt_p = 0
|
||||||
|
try:
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
opt_p = getopt.getopt(sys.argv[1:], 'p')[0][0][0] == '-p'
|
||||||
|
except getopt.GetoptError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
distdir = portage.settings['DISTDIR']
|
||||||
|
print 'DISTDIR =', distdir
|
||||||
|
|
||||||
|
vartree = portage.db['/']['vartree']
|
||||||
|
packages = []
|
||||||
|
for name in vartree.getallnodes():
|
||||||
|
packages.extend(vartree.dep_match(name))
|
||||||
|
|
||||||
|
files = {}
|
||||||
|
for package in packages:
|
||||||
|
try:
|
||||||
|
package_files = portage.portdb.getFetchMap(package).keys()
|
||||||
|
for filename in package_files:
|
||||||
|
files[filename] = 1
|
||||||
|
except:
|
||||||
|
print 'Failed to get file list for', package
|
||||||
|
|
||||||
|
if not files:
|
||||||
|
sys.exit("No package files found. This can't be right.\n")
|
||||||
|
|
||||||
|
try:
|
||||||
|
list = portage.listdir(distdir)
|
||||||
|
except os.OSError:
|
||||||
|
sys.exit('Failed to read ' + distdir)
|
||||||
|
|
||||||
|
size = 0; count = 0
|
||||||
|
for file in list:
|
||||||
|
abs_file = distdir + '/' + file
|
||||||
|
if (os.path.isfile(abs_file) and (not os.path.islink(abs_file))
|
||||||
|
and (not file in files)):
|
||||||
|
size += os.stat(abs_file).st_size
|
||||||
|
count += 1
|
||||||
|
if opt_p:
|
||||||
|
print 'Would remove', abs_file
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
os.remove(abs_file)
|
||||||
|
print 'Removed', abs_file
|
||||||
|
except OSError:
|
||||||
|
print 'Failed to remove', abs_file
|
||||||
|
|
||||||
|
|
||||||
|
size /= 1048576 ## MB
|
||||||
|
print '%i files, total size: %i MB' % (count, size)
|
520
install-sh
Executable file
520
install-sh
Executable file
@ -0,0 +1,520 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit=${DOITPROG-}
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
chgrpprog=${CHGRPPROG-chgrp}
|
||||||
|
chmodprog=${CHMODPROG-chmod}
|
||||||
|
chownprog=${CHOWNPROG-chown}
|
||||||
|
cmpprog=${CMPPROG-cmp}
|
||||||
|
cpprog=${CPPROG-cp}
|
||||||
|
mkdirprog=${MKDIRPROG-mkdir}
|
||||||
|
mvprog=${MVPROG-mv}
|
||||||
|
rmprog=${RMPROG-rm}
|
||||||
|
stripprog=${STRIPPROG-strip}
|
||||||
|
|
||||||
|
posix_glob='?'
|
||||||
|
initialize_posix_glob='
|
||||||
|
test "$posix_glob" != "?" || {
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=
|
||||||
|
else
|
||||||
|
posix_glob=:
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chgrpcmd=
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
mvcmd=$mvprog
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
stripcmd=
|
||||||
|
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dst_arg=
|
||||||
|
|
||||||
|
copy_on_change=false
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="\
|
||||||
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
-c (ignored)
|
||||||
|
-C install only if different (preserve the last data modification time)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||||
|
RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) ;;
|
||||||
|
|
||||||
|
-C) copy_on_change=true;;
|
||||||
|
|
||||||
|
-d) dir_arg=true;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog;;
|
||||||
|
|
||||||
|
-t) dst_arg=$2
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dst_arg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dst_arg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dst_arg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dst_arg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dst_arg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dst_arg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix='/';;
|
||||||
|
-*) prefix='./';;
|
||||||
|
*) prefix='';;
|
||||||
|
esac
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob"
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# If -C, don't bother to copy if it wouldn't change the file.
|
||||||
|
if $copy_on_change &&
|
||||||
|
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||||
|
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob" &&
|
||||||
|
$posix_glob set -f &&
|
||||||
|
set X $old && old=:$2:$4:$5:$6 &&
|
||||||
|
set X $new && new=:$2:$4:$5:$6 &&
|
||||||
|
$posix_glob set +f &&
|
||||||
|
|
||||||
|
test "$old" = "$new" &&
|
||||||
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
rm -f "$dsttmp"
|
||||||
|
else
|
||||||
|
# Rename the file to the real destination.
|
||||||
|
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||||
|
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
{
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
test ! -f "$dst" ||
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||||
|
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||||
|
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||||
|
} ||
|
||||||
|
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
fi || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
200
lfspatch.in
Normal file
200
lfspatch.in
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script will generate a patch with the appropriate LFS header
|
||||||
|
#
|
||||||
|
# Asumptions
|
||||||
|
#
|
||||||
|
# * The script assumes that you have two directories
|
||||||
|
# One for the unmodified and one modified
|
||||||
|
# Examples: zoo-2.10 and zoo-2.10.orig
|
||||||
|
# The .orig is unmodified
|
||||||
|
#
|
||||||
|
# or
|
||||||
|
# The script assums that you have two files
|
||||||
|
# One for the umodified and one modified
|
||||||
|
# Examples: config.h and config.h.orig
|
||||||
|
# The .orig is unmodified
|
||||||
|
#
|
||||||
|
# * It assumes that this is a first release patch and
|
||||||
|
# adds -1 to end of the patch. Unless you specify the
|
||||||
|
# third option
|
||||||
|
#
|
||||||
|
# Script depends on the following programs that are not standard with
|
||||||
|
# LFS (See BLFS for installation)
|
||||||
|
# * nail
|
||||||
|
# * which
|
||||||
|
#
|
||||||
|
# This script also create a blank header that will need to be edited
|
||||||
|
# with the Initial Package Version:, Origin: , and Description: of
|
||||||
|
# the patch
|
||||||
|
#
|
||||||
|
# See ChangeLog at the end for credits.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Input Check
|
||||||
|
#
|
||||||
|
dir="$1"
|
||||||
|
type="$2"
|
||||||
|
version="$3"
|
||||||
|
|
||||||
|
if [ "$dir" == "" ] || [ "$type" == "" ]
|
||||||
|
then
|
||||||
|
echo "Info: @PACKAGE_STRING@"
|
||||||
|
echo ""
|
||||||
|
echo "The command below will create a patch."
|
||||||
|
echo "$0 directory description version"
|
||||||
|
echo "or"
|
||||||
|
echo "The command below will allow you to submit the patch."
|
||||||
|
echo "$0 submit"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$version" == "" ]
|
||||||
|
then
|
||||||
|
version="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/patch.mail /tmp/file.list /tmp/file.list.new
|
||||||
|
|
||||||
|
date="`date +%F`"
|
||||||
|
|
||||||
|
if [ -e ~/.go-patch ]
|
||||||
|
then
|
||||||
|
. ~/.go-patch
|
||||||
|
else
|
||||||
|
cat <<EOF > ~/.go-patch
|
||||||
|
# Variables
|
||||||
|
#
|
||||||
|
submitter="Your Name"
|
||||||
|
email="your@email.address"
|
||||||
|
patches="patches@disconnected-by-peer.at"
|
||||||
|
|
||||||
|
|
||||||
|
# If you want the script to submit your patches
|
||||||
|
# You will need to specify the mailer program
|
||||||
|
#
|
||||||
|
# Currently the script only works with nail and mail
|
||||||
|
#
|
||||||
|
SUBMIT_PATCH="disabled"
|
||||||
|
|
||||||
|
# Enter name of Mail Program
|
||||||
|
mailprog="mail"
|
||||||
|
|
||||||
|
# Enter name of Editor
|
||||||
|
editorprog="mcedit"
|
||||||
|
|
||||||
|
# If you want the script to be compressed
|
||||||
|
#
|
||||||
|
COMPRESS="disabled"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
echo "Please modifiy the config ~/.go-patch file to your needs"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enter name of compressing program
|
||||||
|
compressprog="bzip2"
|
||||||
|
compressext="bz2"
|
||||||
|
|
||||||
|
# Do not edit this
|
||||||
|
mailbin="`which $mailprog`"
|
||||||
|
editorbin="`which $editorprog`"
|
||||||
|
compressbin="`which $compressprog`"
|
||||||
|
|
||||||
|
# Subroutines
|
||||||
|
#
|
||||||
|
YESNO ()
|
||||||
|
{
|
||||||
|
INPUT="$1"
|
||||||
|
echo -n "$INPUT -=>"
|
||||||
|
RETURN="0"
|
||||||
|
read input
|
||||||
|
if [ "$input" == "YES" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "y" ]
|
||||||
|
then
|
||||||
|
OK="YES"
|
||||||
|
RETURN="1"
|
||||||
|
fi
|
||||||
|
if [ "$input" == "NO" ] || [ "$input" == "no" ] || [ "$input" == "N" ] || [ "$input" == "n" ]
|
||||||
|
then
|
||||||
|
OK="NO"
|
||||||
|
RETURN="1"
|
||||||
|
fi
|
||||||
|
if [ "$RETURN" == "0" ]
|
||||||
|
then
|
||||||
|
YESNO "$INPUT"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse Email
|
||||||
|
#
|
||||||
|
emailobfuscated="`echo $email|sed -e s%'@'%' at '% -e s%'\.'%' dot '%g`"
|
||||||
|
|
||||||
|
# Create Patch Header
|
||||||
|
#
|
||||||
|
echo "Submitted By: $submitter ($emailobfuscated)" > $dir-$type-$version.patch
|
||||||
|
echo "Date: $date" >> $dir-$type-$version.patch
|
||||||
|
echo "Initial Package Version: " >> $dir-$type-$version.patch
|
||||||
|
echo "Origin: " >> $dir-$type-$version.patch
|
||||||
|
echo "Upstream Status: " >> $dir-$type-$version.patch
|
||||||
|
echo "Description: " >> $dir-$type-$version.patch
|
||||||
|
echo " " >> $dir-$type-$version.patch
|
||||||
|
|
||||||
|
# Lets edit the patch Header
|
||||||
|
#
|
||||||
|
$editorbin $dir-$type-$version.patch
|
||||||
|
|
||||||
|
# Copy the patch header for email text
|
||||||
|
#
|
||||||
|
cp $dir-$type-$version.patch /tmp/patch.mail
|
||||||
|
|
||||||
|
# Check for directory.orig first if not there check all files in the current directory
|
||||||
|
#
|
||||||
|
if [ -e $dir.orig ]
|
||||||
|
then
|
||||||
|
# Create Patch from directory.orig directory
|
||||||
|
#
|
||||||
|
echo "Creating patch from directory $dir.."
|
||||||
|
LC_ALL=C TZ=UTC0 diff -Naur $dir.orig $dir >> $dir-$type-$version.patch
|
||||||
|
else
|
||||||
|
# Create Patch from file.orig file
|
||||||
|
#
|
||||||
|
find $dir/ -type f > /tmp/file.list
|
||||||
|
cat /tmp/file.list | grep ".orig" > /tmp/file.list.new
|
||||||
|
sed -e 's|.orig| |g' /tmp/file.list.new > /tmp/file.list
|
||||||
|
file_list="`cat /tmp/file.list`"
|
||||||
|
for file in $file_list
|
||||||
|
do
|
||||||
|
echo "Creating patch from file $file.."
|
||||||
|
LC_ALL=C TZ=UTC0 diff -Naur $file.orig $file >> $dir-$type-$version.patch
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/file.list /tmp/file.list.new
|
||||||
|
|
||||||
|
if [ "$SUBMIT_PATCH" == "enabled" ] && [ "$mailbin" != "" ] && [ "$email" != "" ]
|
||||||
|
then
|
||||||
|
YESNO "Are you sure you want to send $dir-$type-$version to $patches (yes/no)"
|
||||||
|
if [ "$OK" == "YES" ]
|
||||||
|
then
|
||||||
|
if [ "$COMPRESS" == "enabled" ]
|
||||||
|
then
|
||||||
|
echo "Compressing $dir-$type-$version.patch..."
|
||||||
|
$compressbin $dir-$type-$version.patch
|
||||||
|
attachment="$dir-$type-$version.patch.$compressext"
|
||||||
|
else
|
||||||
|
attachment="$dir-$type-$version.patch"
|
||||||
|
fi
|
||||||
|
echo "Sending email to $patches..."
|
||||||
|
$mailbin -B -s "Patch Submission for $dir" -a $attachment -r $email $patches < /tmp/patch.mail
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rm -f /tmp/patch.mail $dir-$type-$version.patch.$compressext /tmp/file.list /tmp/file.list.new
|
||||||
|
|
||||||
|
# ChangeLog:
|
||||||
|
# [2003-10-06]
|
||||||
|
# * Initial Version (Jim Gifford)
|
||||||
|
# [2003-10-16]
|
||||||
|
# * Fixed typo in submission e-mail address (Ronald Hummelink)
|
||||||
|
# * Fixed e-mail obfuscation to handle more than one "." (Ronald Hummelink)
|
||||||
|
# [2004-05-04]
|
||||||
|
# * Added Upstream Status Header (Jim Gifford)
|
14
m4/definedir.m4
Normal file
14
m4/definedir.m4
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
dnl Available from the GNU Autoconf Macro Archive at:
|
||||||
|
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_define_dir.html
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([AC_DEFINE_DIR], [
|
||||||
|
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||||
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||||
|
ac_define_dir=`eval echo [$]$2`
|
||||||
|
ac_define_dir=`eval echo [$]ac_define_dir`
|
||||||
|
$1="$ac_define_dir"
|
||||||
|
AC_SUBST($1)
|
||||||
|
ifelse($3, ,
|
||||||
|
AC_DEFINE_UNQUOTED($1, "$ac_define_dir"),
|
||||||
|
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3))
|
||||||
|
])
|
376
missing
Executable file
376
missing
Executable file
@ -0,0 +1,376 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
|
||||||
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
|
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||||
|
# 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
|
# 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 2, 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/>.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
run=:
|
||||||
|
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||||
|
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||||
|
|
||||||
|
# In the cases where this matters, `missing' is being run in the
|
||||||
|
# srcdir already.
|
||||||
|
if test -f configure.ac; then
|
||||||
|
configure_ac=configure.ac
|
||||||
|
else
|
||||||
|
configure_ac=configure.in
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg="missing on your system"
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--run)
|
||||||
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
|
run=
|
||||||
|
shift
|
||||||
|
"$@" && exit 0
|
||||||
|
# Exit code 63 means version mismatch. This often happens
|
||||||
|
# when the user try to use an ancient version of a tool on
|
||||||
|
# a file that requires a minimum version. In this case we
|
||||||
|
# we should proceed has if the program had been absent, or
|
||||||
|
# if --run hadn't been passed.
|
||||||
|
if test $? = 63; then
|
||||||
|
run=:
|
||||||
|
msg="probably too old"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
-h|--h|--he|--hel|--help)
|
||||||
|
echo "\
|
||||||
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help display this help and exit
|
||||||
|
-v, --version output version information and exit
|
||||||
|
--run try to run the given command, and emulate it if it fails
|
||||||
|
|
||||||
|
Supported PROGRAM values:
|
||||||
|
aclocal touch file \`aclocal.m4'
|
||||||
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
autom4te touch the output file, or create a stub one
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
help2man touch the output file
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
|
||||||
|
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||||
|
\`g' are ignored when checking the name.
|
||||||
|
|
||||||
|
Send bug reports to <bug-automake@gnu.org>."
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||||
|
echo "missing $scriptversion (GNU Automake)"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# normalize program name to check for.
|
||||||
|
program=`echo "$1" | sed '
|
||||||
|
s/^gnu-//; t
|
||||||
|
s/^gnu//; t
|
||||||
|
s/^g//; t'`
|
||||||
|
|
||||||
|
# Now exit if we have it, but it failed. Also exit now if we
|
||||||
|
# don't have it and --version was passed (most likely to detect
|
||||||
|
# the program). This is about non-GNU programs, so use $1 not
|
||||||
|
# $program.
|
||||||
|
case $1 in
|
||||||
|
lex*|yacc*)
|
||||||
|
# Not GNU programs, they don't have --version.
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar*)
|
||||||
|
if test -n "$run"; then
|
||||||
|
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
|
# We have it, but it failed.
|
||||||
|
exit 1
|
||||||
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
|
# Could not run --version or --help. This is probably someone
|
||||||
|
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||||
|
# $TOOL exists and not knowing $TOOL uses missing.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If it does not exist, or fails to run (possibly an outdated version),
|
||||||
|
# try to emulate it.
|
||||||
|
case $program in
|
||||||
|
aclocal*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`${configure_ac}'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case $f in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
autom4te*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, but is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them.
|
||||||
|
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||||
|
archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo "#! /bin/sh"
|
||||||
|
echo "# Created by GNU Automake missing as a replacement of"
|
||||||
|
echo "# $ $@"
|
||||||
|
echo "exit 0"
|
||||||
|
chmod +x $file
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison*|yacc*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' $msg. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.h; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.c; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
lex*|flex*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f lex.yy.c; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
help2man*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a dependency of a manual page. You may need the
|
||||||
|
\`Help2man' package in order for those modifications to take
|
||||||
|
effect. You can get \`Help2man' from any GNU archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo ".ab help2man is required to generate this page"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
# The file to touch is that specified with -o ...
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -z "$file"; then
|
||||||
|
# ... or it is the one specified with @setfilename ...
|
||||||
|
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '
|
||||||
|
/^@setfilename/{
|
||||||
|
s/.* \([^ ]*\) *$/\1/
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}' $infile`
|
||||||
|
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||||
|
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||||
|
fi
|
||||||
|
# If the file does not exist, the user really needs makeinfo;
|
||||||
|
# let's fail without touching anything.
|
||||||
|
test -f $file || exit 1
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar*)
|
||||||
|
shift
|
||||||
|
|
||||||
|
# We have already tried tar in the generic part.
|
||||||
|
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||||
|
# messages.
|
||||||
|
if (gnutar --version > /dev/null 2>&1); then
|
||||||
|
gnutar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
if (gtar --version > /dev/null 2>&1); then
|
||||||
|
gtar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
firstarg="$1"
|
||||||
|
if shift; then
|
||||||
|
case $firstarg in
|
||||||
|
*o*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/o//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case $firstarg in
|
||||||
|
*h*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/h//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||||
|
You may want to install GNU tar or Free paxutils, or check the
|
||||||
|
command line arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequisites for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
19
oneelf.rb.in
Normal file
19
oneelf.rb.in
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/ruby -w
|
||||||
|
|
||||||
|
# Licensed under GPL-2 or later
|
||||||
|
# Author: Petteri Räty <betelgeuse@gentoo.org>
|
||||||
|
|
||||||
|
$: << File.dirname(__FILE__)
|
||||||
|
require "@LIBDIR@/@PACKAGE@/go-pkgutil.rb"
|
||||||
|
|
||||||
|
elf = ARGV[0]
|
||||||
|
|
||||||
|
if ! elf || ! is_elf(elf)
|
||||||
|
$stderr.puts 'This program takes one arguments that should be an elf file.'
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
run_scanelf(elf) do | lib |
|
||||||
|
puts lib
|
||||||
|
puts "\t" + get_pkg_of_lib(lib)
|
||||||
|
end
|
60
pkgutil.rb.in
Normal file
60
pkgutil.rb.in
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# Licensed under GPL-2 or later
|
||||||
|
# Author: Petteri Räty <betelgeuse@gentoo.org>
|
||||||
|
|
||||||
|
MAGIC="\x7FELF"
|
||||||
|
def is_elf(file)
|
||||||
|
File.executable?(file) && File.file?(file) && File.read(file, 4) == MAGIC
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_pkg_of_lib(lib)
|
||||||
|
command='qfile -qC ' + lib
|
||||||
|
output = `#{command}`.split("\n")
|
||||||
|
output.uniq!
|
||||||
|
output.join(' || ')
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle_extra_output(prog)
|
||||||
|
$stderr.puts 'This program expects only one line'
|
||||||
|
$stderr.puts 'of output from scanelf. Extra lines:'
|
||||||
|
while line = scanelf.gets
|
||||||
|
$stderr.puts line
|
||||||
|
end
|
||||||
|
exit 2
|
||||||
|
end
|
||||||
|
|
||||||
|
def run_scanelf(elf)
|
||||||
|
scanelf = IO.popen("scanelf -q -F '%n#F' #{elf}")
|
||||||
|
first_line = scanelf.gets
|
||||||
|
handle_extra_output(scanelf) if not scanelf.eof?
|
||||||
|
scanelf.close
|
||||||
|
|
||||||
|
libs = first_line.split(',')
|
||||||
|
for lib in libs
|
||||||
|
yield lib
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class ScanElf
|
||||||
|
private_class_method :new
|
||||||
|
@@instance = nil
|
||||||
|
|
||||||
|
def ScanElf.instance
|
||||||
|
@@instance = new unless @@instance
|
||||||
|
@@instance
|
||||||
|
end
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
@process = IO.popen('scanelf -q -F "%n#F" -f /dev/stdin','r+')
|
||||||
|
end
|
||||||
|
|
||||||
|
def each(elf)
|
||||||
|
@process.puts(elf)
|
||||||
|
result = @process.gets
|
||||||
|
|
||||||
|
libs = result.split(',')
|
||||||
|
for lib in libs
|
||||||
|
yield lib
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
7
redigest.in
Normal file
7
redigest.in
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
EBUILD=`find ${PWD} -type f -name '*.ebuild'`
|
||||||
|
|
||||||
|
for J in $EBUILD ; do
|
||||||
|
ebuild $J digest
|
||||||
|
done
|
64
series2epatch.in
Normal file
64
series2epatch.in
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Library General Public License as published
|
||||||
|
# by the Free Software Foundation; either version 2, 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 Library General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
# USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
case "$0" in
|
||||||
|
series2epatch | */series2epatch | *\\series2epatch)
|
||||||
|
progname=$0
|
||||||
|
package=series2epatch
|
||||||
|
version=@VERSION@
|
||||||
|
# func_usage
|
||||||
|
# outputs to stdout the --help usage message.
|
||||||
|
func_usage ()
|
||||||
|
{
|
||||||
|
echo "series2epatch shell script version $version"
|
||||||
|
echo "Usage: . series2epatch <start number> <source dir> <destination dir>"
|
||||||
|
}
|
||||||
|
# func_version
|
||||||
|
# outputs to stdout the --version message.
|
||||||
|
func_version ()
|
||||||
|
{
|
||||||
|
echo "$progname (GNU $package) $version"
|
||||||
|
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
|
||||||
|
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
|
||||||
|
This is free software: you are free to change and redistribute it.
|
||||||
|
There is NO WARRANTY, to the extent permitted by law."
|
||||||
|
echo "Written by" "Mario Fetka"
|
||||||
|
}
|
||||||
|
if test $# = 1; then
|
||||||
|
case "$1" in
|
||||||
|
--help | --hel | --he | --h )
|
||||||
|
func_usage; exit 0 ;;
|
||||||
|
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||||
|
func_version; exit 0 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
func_usage 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
sed -e '/^#/d' -i $2/series
|
||||||
|
|
||||||
|
cnt=$1
|
||||||
|
for f in $(<$2/series) ; do
|
||||||
|
cp $2/${f} $3/${cnt}_${f}
|
||||||
|
((cnt++))
|
||||||
|
done
|
||||||
|
|
@ -1,19 +1,19 @@
|
|||||||
.TH SUNRISE-COMMIT 1 "13 Jul 2010" "@PACKAGE_STRING@" "User Commands"
|
.TH GO-COMMIT 1 "13 Jul 2010" "@PACKAGE_STRING@" "User Commands"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
sunrise-commit \- a Gentoo repository commit helper.
|
go-commit \- a Gentoo repository commit helper.
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
||||||
.B sunrise-commit
|
.B go-commit
|
||||||
[options]
|
[options]
|
||||||
[--]
|
[--]
|
||||||
.I <commit-message>
|
.I <commit-message>
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
|
||||||
.B sunrise-commit
|
.B go-commit
|
||||||
is a helper script for Gentoo repository commiters. Apart from
|
is a helper script for Gentoo repository commiters. Apart from
|
||||||
performing the actual commit, it performs the following tasks:
|
performing the actual commit, it performs the following tasks:
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ Print the version string and exit.
|
|||||||
.IP ECHANGELOG_USER
|
.IP ECHANGELOG_USER
|
||||||
|
|
||||||
the committer name and e-mail as it would appear in ChangeLog.
|
the committer name and e-mail as it would appear in ChangeLog.
|
||||||
The sunrise-suggested format is:
|
The go-suggested format is:
|
||||||
|
|
||||||
.IR "Real Name" " (" nickname ") <" e-mail >
|
.IR "Real Name" " (" nickname ") <" e-mail >
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ The sunrise-suggested format is:
|
|||||||
|
|
||||||
.IP "Adding and Updating Packages"
|
.IP "Adding and Updating Packages"
|
||||||
|
|
||||||
The primary use of \fBsunrise-commit\fP is to add packages to a Gentoo
|
The primary use of \fBgo-commit\fP is to add packages to a Gentoo
|
||||||
repository or update existing packages. In order to use it this way,
|
repository or update existing packages. In order to use it this way,
|
||||||
you are expected to run it from within the package's directory,
|
you are expected to run it from within the package's directory,
|
||||||
providing an appropriate changelog message. (The package's directory
|
providing an appropriate changelog message. (The package's directory
|
||||||
@ -113,9 +113,9 @@ is the directory holding its ebuilds).
|
|||||||
|
|
||||||
If your package requires an additional file to be committed outside
|
If your package requires an additional file to be committed outside
|
||||||
the package directory (e.g. an eclass, a license), then you need to
|
the package directory (e.g. an eclass, a license), then you need to
|
||||||
commit that file manually \fBbefore\fP using \fBsunrise-commit\fP.
|
commit that file manually \fBbefore\fP using \fBgo-commit\fP.
|
||||||
|
|
||||||
\fBsunrise-commit\fP will update the ChangeLog entry and call
|
\fBgo-commit\fP will update the ChangeLog entry and call
|
||||||
.BR repoman (1)
|
.BR repoman (1)
|
||||||
to do the actual commit for you. If the package's ChangeLog should
|
to do the actual commit for you. If the package's ChangeLog should
|
||||||
\fBnot\fP be updated for a particular commit, use \fB--trivial\fP.
|
\fBnot\fP be updated for a particular commit, use \fB--trivial\fP.
|
||||||
@ -124,17 +124,17 @@ If you are adding a new package and using subversion or a similar VCS,
|
|||||||
you may get a warning that your VCS's update command failed. For
|
you may get a warning that your VCS's update command failed. For
|
||||||
example, subversion's update command fails when run from a newly added,
|
example, subversion's update command fails when run from a newly added,
|
||||||
but not yet committed, directory. To avoid this warning, you may use
|
but not yet committed, directory. To avoid this warning, you may use
|
||||||
\fB--noupdate\fP. This option prevents \fBsunrise-commit\fP from calling the
|
\fB--noupdate\fP. This option prevents \fBgo-commit\fP from calling the
|
||||||
VCS's update command (which only happens if you are not using DVCS).
|
VCS's update command (which only happens if you are not using DVCS).
|
||||||
|
|
||||||
.IP "Removing Packages"
|
.IP "Removing Packages"
|
||||||
|
|
||||||
\fBsunrise-commit\fP can be used to remove a set of packages too. In order to
|
\fBgo-commit\fP can be used to remove a set of packages too. In order to
|
||||||
do so, first mark all the expected packages as removed using your VCS.
|
do so, first mark all the expected packages as removed using your VCS.
|
||||||
Next, perform the necessary \fBpackage.mask\fP changes and remove
|
Next, perform the necessary \fBpackage.mask\fP changes and remove
|
||||||
licenses no longer in use.
|
licenses no longer in use.
|
||||||
|
|
||||||
Afterwards, call \fBsunrise-commit\fP from within your repository's root
|
Afterwards, call \fBgo-commit\fP from within your repository's root
|
||||||
directory, passing the removal reason as an argument. The script will
|
directory, passing the removal reason as an argument. The script will
|
||||||
prepend your commit message with the complete removed package list.
|
prepend your commit message with the complete removed package list.
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ atomic package removal commit, where \fBpackage.mask\fP entries and
|
|||||||
files used only by the removed packages are removed. However, this can
|
files used only by the removed packages are removed. However, this can
|
||||||
cause trouble if the working copy is dirty.
|
cause trouble if the working copy is dirty.
|
||||||
|
|
||||||
\fBsunrise-commit\fP will check whether any removed package is still
|
\fBgo-commit\fP will check whether any removed package is still
|
||||||
referenced by any of the other packages by default. If it finds an
|
referenced by any of the other packages by default. If it finds an
|
||||||
internal package reference, it will give an error message. This is in
|
internal package reference, it will give an error message. This is in
|
||||||
order to ensure that no package will be left with unsatisfied
|
order to ensure that no package will be left with unsatisfied
|
||||||
@ -165,7 +165,7 @@ $ svn mkdir app-foo/bar
|
|||||||
$ cd app-foo/bar
|
$ cd app-foo/bar
|
||||||
[...]
|
[...]
|
||||||
$ svn add bar-1.ebuild
|
$ svn add bar-1.ebuild
|
||||||
$ sunrise-commit 'New ebuild for bug #nnnnnn.'
|
$ go-commit 'New ebuild for bug #nnnnnn.'
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.I "2. Performing a version bump:"
|
.I "2. Performing a version bump:"
|
||||||
@ -174,23 +174,23 @@ $ sunrise-commit 'New ebuild for bug #nnnnnn.'
|
|||||||
$ cd app-foo/bar
|
$ cd app-foo/bar
|
||||||
$ svn mv bar-1.ebuild bar-2.ebuild
|
$ svn mv bar-1.ebuild bar-2.ebuild
|
||||||
[...]
|
[...]
|
||||||
$ sunrise-commit 'Version bump.'
|
$ go-commit 'Version bump.'
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.I "3. Fixing a broken Manifest:"
|
.I "3. Fixing a broken Manifest:"
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
$ cd app-foo/bar
|
$ cd app-foo/bar
|
||||||
$ sunrise-commit -t 'Fixing a broken Manifest.'
|
$ go-commit -t 'Fixing a broken Manifest.'
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
(\fBsunrise-commit\fP always updates the Manifest)
|
(\fBgo-commit\fP always updates the Manifest)
|
||||||
|
|
||||||
.I "4. Removing a package which was added to gx86:"
|
.I "4. Removing a package which was added to gx86:"
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
$ svn rm app-foo/bar
|
$ svn rm app-foo/bar
|
||||||
$ sunrise-commit -f 'in gx86.'
|
$ go-commit -f 'in gx86.'
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.SH "REPORTING BUGS"
|
.SH "REPORTING BUGS"
|
||||||
|
8
sunrise-commit.in
Executable file → Normal file
8
sunrise-commit.in
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# sunrise-commit -- a Gentoo repository commit helper
|
# go-commit -- a Gentoo repository commit helper
|
||||||
# (c) 2010 Michał Górny <gentoo@mgorny.alt.pl>
|
# (c) 2010 Michał Górny <gentoo@mgorny.alt.pl>
|
||||||
# Released under the terms of the 3-clause BSD license.
|
# Released under the terms of the 3-clause BSD license.
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ vcs_update() {
|
|||||||
print_help() {
|
print_help() {
|
||||||
cat <<_EOH_
|
cat <<_EOH_
|
||||||
Synopsis:
|
Synopsis:
|
||||||
sunrise-commit [options] [--] <commit message>
|
go-commit [options] [--] <commit message>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-?, -h, --help print this message,
|
-?, -h, --help print this message,
|
||||||
@ -423,8 +423,8 @@ main() {
|
|||||||
if [ ! -f ChangeLog ]; then
|
if [ ! -f ChangeLog ]; then
|
||||||
[ -n "${trivial}" ] && die "Trivial change for an initial commit? You're joking, right?"
|
[ -n "${trivial}" ] && die "Trivial change for an initial commit? You're joking, right?"
|
||||||
|
|
||||||
# Sunrise-specific checks.
|
# Geos_One-specific checks.
|
||||||
if [ "$(cat ../../profiles/repo_name 2>/dev/null)" = "sunrise" ]; then
|
if [ "$(cat ../../profiles/repo_name 2>/dev/null)" = "go" ]; then
|
||||||
[ -z "${bns}" ] && die 'Please supply the bug number in the initial commit message!'
|
[ -z "${bns}" ] && die 'Please supply the bug number in the initial commit message!'
|
||||||
if [ ! -f metadata.xml ]; then
|
if [ ! -f metadata.xml ]; then
|
||||||
req cp ../../skel.metadata.xml metadata.xml
|
req cp ../../skel.metadata.xml metadata.xml
|
||||||
|
Loading…
Reference in New Issue
Block a user