fence-agents: master - build: allow autoreconf from tarball release
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: d2c04e14faa0da39a8d3fe2b54fa628617b6a8c5
Parent: 3ee321509fcd71452adf29824a2d359304a7b4c5
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Nov 9 09:27:53 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Nov 9 09:27:53 2010 +0100
build: allow autoreconf from tarball release
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
Makefile.am | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6d5a879..1bd077a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
EXTRA_DIST = autogen.sh make/fencebuild.mk scripts/fenceparse \
- .version
+ .version make/release.mk \
+ make/git-version-gen make/gitlog-to-changelog
AUTOMAKE_OPTIONS = foreign
13 years, 5 months
resource-agents: master - build: allow autoreconf from tarball release
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: 7b23696f4c7d9811737c6ac80a8458c714dfc0fb
Parent: 38d2fa87df0583c4fb54e89f33668edc070fbe48
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Nov 9 09:20:45 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Nov 9 09:20:45 2010 +0100
build: allow autoreconf from tarball release
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
Makefile.am | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 700da2e..581dbc9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
-EXTRA_DIST = autogen.sh .version
+EXTRA_DIST = autogen.sh .version make/release.mk \
+ make/git-version-gen make/gitlog-to-changelog
AUTOMAKE_OPTIONS = foreign
13 years, 5 months
fence-agents: master - build: enable publishing
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 3ee321509fcd71452adf29824a2d359304a7b4c5
Parent: 6be3479c66e1bc06db29a0e53294a71620eca1af
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:58:02 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:58:02 2010 +0100
build: enable publishing
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
make/release.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/make/release.mk b/make/release.mk
index b7241e5..f3257d9 100644
--- a/make/release.mk
+++ b/make/release.mk
@@ -63,7 +63,7 @@ publish:
ifeq (,$(release))
@echo Building test release $(version), no publishing!
else
- @echo git push --tags origin
+ git push --tags origin
scp $(project)-$(version).* \
fedorahosted.org:$(project)
@echo Hey you!.. yeah you looking somewhere else!
13 years, 6 months
fence-agents: master - build: workaround python path madness
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 6be3479c66e1bc06db29a0e53294a71620eca1af
Parent: dac61807c8f9d2cc32e3a254be438144d6dc30e2
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:57:42 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:57:42 2010 +0100
build: workaround python path madness
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
make/release.mk | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/make/release.mk b/make/release.mk
index 14e8357..b7241e5 100644
--- a/make/release.mk
+++ b/make/release.mk
@@ -35,6 +35,7 @@ endif
tarballs: tag
./autogen.sh
./configure
+ make
make distcheck
sha256: tarballs $(project)-$(version).sha256
13 years, 6 months
resource-agents: master - build: enable publishing
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: 38d2fa87df0583c4fb54e89f33668edc070fbe48
Parent: 5bda8b628f638ba09e0cc440d101bfcde8234981
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:45:22 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:45:22 2010 +0100
build: enable publishing
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
make/release.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/make/release.mk b/make/release.mk
index 78abfd9..1982cb3 100644
--- a/make/release.mk
+++ b/make/release.mk
@@ -62,7 +62,7 @@ publish:
ifeq (,$(release))
@echo Building test release $(version), no publishing!
else
- @echo git push --tags origin
+ git push --tags origin
scp $(project)-$(version).* \
fedorahosted.org:$(project)
@echo Hey you!.. yeah you looking somewhere else!
13 years, 6 months
fence-agents: master - build: add automatic versioning and release script
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: dac61807c8f9d2cc32e3a254be438144d6dc30e2
Parent: 79336e5ef88fc33f40306466e48fafca9532d452
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:44:05 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:44:05 2010 +0100
build: add automatic versioning and release script
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
.gitignore | 19 ++++-
Makefile.am | 20 +++++-
configure.ac | 9 ++-
make/git-version-gen | 161 ++++++++++++++++++++++++++++++++++++++
make/gitlog-to-changelog | 191 ++++++++++++++++++++++++++++++++++++++++++++++
make/release.mk | 73 ++++++++++++++++++
6 files changed, 466 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore
index cd80ece..fe47444 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,23 +37,33 @@ fence/agents/bladecenter/fence_bladecenter
fence/agents/brocade/fence_brocade
fence/agents/bullpap/fence_bullpap
fence/agents/cisco_mds/fence_cisco_mds
+fence/agents/cisco_ucs/fence_cisco_ucs
fence/agents/cpint/fence_cpint
fence/agents/drac/fence_drac
-fence/agents/drac/fence_drac5
+fence/agents/drac5/fence_drac5
fence/agents/egenera/fence_egenera
fence/agents/eps/fence_eps
fence/agents/ibmblade/fence_ibmblade
fence/agents/ifmib/fence_ifmib
fence/agents/ilo/fence_ilo
+fence/agents/ilo_mp/fence_ilo_mp
fence/agents/intelmodular/fence_intelmodular
fence/agents/ipmilan/fence_ipmilan
fence/agents/ldom/fence_ldom
fence/agents/lib/fencing.py
fence/agents/lib/fencing_snmp.py
+fence/agents/lib/fencing.pyc
+fence/agents/lib/fencing_snmp.pyc
fence/agents/lpar/fence_lpar
+fence/agents/manual/fence_ack_manual
fence/agents/mcdata/fence_mcdata
+fence/agents/node_assassin/fence_na
+fence/agents/node_assassin/fence_na.conf
+fence/agents/node_assassin/fence_na.lib
+fence/agents/node_assassin/fence_na.pod
fence/agents/nss_wrapper/fence_nss_wrapper
fence/agents/rackswitch/fence_rackswitch
+fence/agents/rhevm/fence_rhevm
fence/agents/rsa/fence_rsa
fence/agents/rsb/fence_rsb
fence/agents/sanbox2/fence_sanbox2
@@ -65,7 +75,8 @@ fence/agents/vmware/fence_vmware
fence/agents/vmware/fence_vmware_helper
fence/agents/wti/fence_wti
fence/agents/xcat/fence_xcat
-fence/agents/xvm/fence_xvm
-fence/agents/xvm/fence_xvmd
-fence/agents/xvm/testprog
fence/agents/zvm/fence_zvm
+fence*.8
+.fence*.tmp
+fence-agents*
+.version
diff --git a/Makefile.am b/Makefile.am
index 7fb4d60..6d5a879 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
-EXTRA_DIST = autogen.sh make/fencebuild.mk scripts/fenceparse
+EXTRA_DIST = autogen.sh make/fencebuild.mk scripts/fenceparse \
+ .version
AUTOMAKE_OPTIONS = foreign
@@ -23,5 +24,22 @@ uninstall-local:
rmdir $(DESTDIR)/$(LOGDIR) || :;
rmdir $(DESTDIR)/$(CLUSTERVARRUN) || :;
+BUILT_SOURCES = .version
+.version:
+ echo $(VERSION) > $@-t && mv $@-t $@
+
+dist-hook: gen-ChangeLog
+ echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = 2000-01-01
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ if test -d .git; then \
+ $(top_srcdir)/make/gitlog-to-changelog \
+ --since=$(gen_start_date) > $(distdir)/cl-t; \
+ rm -f $(distdir)/ChangeLog; \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ fi
+
maintainer-clean-local:
rm -rf m4
diff --git a/configure.ac b/configure.ac
index 6f7c6df..fd441e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,13 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
-AC_INIT([fence-agents], [master], [linux-cluster(a)redhat.com])
-AM_INIT_AUTOMAKE([-Wno-portability])
+
+AC_INIT([fence-agents],
+ m4_esyscmd([make/git-version-gen .tarball-version]),
+ [linux-cluster(a)redhat.com])
+
+AM_INIT_AUTOMAKE([-Wno-portability dist-bzip2 dist-xz])
+
LT_PREREQ([2.2.6])
LT_INIT
diff --git a/make/git-version-gen b/make/git-version-gen
new file mode 100755
index 0000000..795a98b
--- /dev/null
+++ b/make/git-version-gen
@@ -0,0 +1,161 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2010-10-13.20; # UTC
+
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+#
+# 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/>.
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+# produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+# presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+# a checked-out repository. Created with contents that were learned at
+# the last time autoconf was run, and used by git-version-gen. Must not
+# be present in either $(srcdir) or $(builddir) for git-version-gen to
+# give accurate answers during normal development with a checked out tree,
+# but must be present in a tarball when there is no version control system.
+# Therefore, it cannot be used in any dependencies. GNUmakefile has
+# hooks to force a reconfigure at distribution time to get the value
+# correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+# tarball. Usable in dependencies, particularly for files that don't
+# want to depend on config.h but do want to track version changes.
+# Delete this file prior to any autoconf run where you want to rebuild
+# files to pick up a version string change; and leave it stale to
+# minimize rebuild time after unrelated changes to configure sources.
+#
+# It is probably wise to add these two files to .gitignore, so that you
+# don't accidentally commit either generated file.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .tarball-version will
+# exist in distribution tarballs.
+#
+# BUILT_SOURCES = $(top_srcdir)/.version
+# $(top_srcdir)/.version:
+# echo $(VERSION) > $@-t && mv $@-t $@
+# dist-hook:
+# echo $(VERSION) > $(distdir)/.tarball-version
+
+case $# in
+ 1|2) ;;
+ *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \
+ '[TAG-NORMALIZATION-SED-SCRIPT]'
+ exit 1;;
+esac
+
+tarball_version_file=$1
+tag_sed_script="${2:-s/x/x/}"
+nl='
+'
+
+# Avoid meddling by environment variable of the same name.
+v=
+
+# First see if there is a tarball-only version file.
+# then try "git describe", then default.
+if test -f $tarball_version_file
+then
+ v=`cat $tarball_version_file` || exit 1
+ case $v in
+ *$nl*) v= ;; # reject multi-line output
+ [0-9]*) ;;
+ *) v= ;;
+ esac
+ test -z "$v" \
+ && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
+fi
+
+if test -n "$v"
+then
+ : # use $v
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+ && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
+ || git describe --abbrev=4 HEAD 2>/dev/null` \
+ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
+ && case $v in
+ v[0-9]*) ;;
+ *) (exit 1) ;;
+ esac
+then
+ # Is this a new git that lists number of commits since the last
+ # tag or the previous older version that did not?
+ # Newer: v6.10-77-g0f8faeb
+ # Older: v6.10-g0f8faeb
+ case $v in
+ *-*-*) : git describe is okay three part flavor ;;
+ *-*)
+ : git describe is older two part flavor
+ # Recreate the number of commits and rewrite such that the
+ # result is the same as if we were using the newer version
+ # of git describe.
+ vtag=`echo "$v" | sed 's/-.*//'`
+ numcommits=`git rev-list "$vtag"..HEAD | wc -l`
+ v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+ ;;
+ esac
+
+ # Change the first '-' to a '.', so version-comparing tools work properly.
+ # Remove the "g" in git describe's output string, to save a byte.
+ v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+else
+ v=UNKNOWN
+fi
+
+v=`echo "$v" |sed 's/^v//'`
+
+# Don't declare a version "dirty" merely because a time stamp has changed.
+git update-index --refresh > /dev/null 2>&1
+
+dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+case "$dirty" in
+ '') ;;
+ *) # Append the suffix only if there isn't one already.
+ case $v in
+ *-dirty) ;;
+ *) v="$v-dirty" ;;
+ esac ;;
+esac
+
+# Omit the trailing newline, so that m4_esyscmd can use the result directly.
+echo "$v" | tr -d "$nl"
+
+# 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:
diff --git a/make/gitlog-to-changelog b/make/gitlog-to-changelog
new file mode 100755
index 0000000..7660af5
--- /dev/null
+++ b/make/gitlog-to-changelog
@@ -0,0 +1,191 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+ & eval 'exec perl -wS "$0" $argv:q'
+ if 0;
+# Convert git log output to ChangeLog format.
+
+my $VERSION = '2009-10-30 13:46'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+
+# 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/>.
+
+# Written by Jim Meyering
+
+use strict;
+use warnings;
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try `$ME --help' for more information.\n";
+ }
+ else
+ {
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS] [ARGS]
+
+Convert git log output to ChangeLog format. If present, any ARGS
+are passed to "git log". To avoid ARGS being parsed as options to
+$ME, they may be preceded by '--'.
+
+OPTIONS:
+
+ --since=DATE convert only the logs since DATE;
+ the default is to convert all log entries.
+ --format=FMT set format string for commit subject and body;
+ see 'man git-log' for the list of format metacharacters;
+ the default is '%s%n%b%n'
+
+ --help display this help and exit
+ --version output version information and exit
+
+EXAMPLE:
+
+ $ME --since=2008-01-01 > ChangeLog
+ $ME -- -n 5 foo > last-5-commits-to-branch-foo
+
+EOF
+ }
+ exit $exit_code;
+}
+
+# If the string $S is a well-behaved file name, simply return it.
+# If it contains white space, quotes, etc., quote it, and return the new string.
+sub shell_quote($)
+{
+ my ($s) = @_;
+ if ($s =~ m![^\w+/.,-]!)
+ {
+ # Convert each single quote to '\''
+ $s =~ s/\'/\'\\\'\'/g;
+ # Then single quote the string.
+ $s = "'$s'";
+ }
+ return $s;
+}
+
+sub quoted_cmd(@)
+{
+ return join (' ', map {shell_quote $_} @_);
+}
+
+{
+ my $since_date = '1970-01-01 UTC';
+ my $format_string = '%s%n%b%n';
+ GetOptions
+ (
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ 'since=s' => \$since_date,
+ 'format=s' => \$format_string,
+ ) or usage 1;
+
+ my @cmd = (qw (git log --log-size), "--since=$since_date",
+ '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV);
+ open PIPE, '-|', @cmd
+ or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
+ . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
+
+ my $prev_date_line = '';
+ while (1)
+ {
+ defined (my $in = <PIPE>)
+ or last;
+ $in =~ /^log size (\d+)$/
+ or die "$ME:$.: Invalid line (expected log size):\n$in";
+ my $log_nbytes = $1;
+
+ my $log;
+ my $n_read = read PIPE, $log, $log_nbytes;
+ $n_read == $log_nbytes
+ or die "$ME:$.: unexpected EOF\n";
+
+ my @line = split "\n", $log;
+ my $author_line = shift @line;
+ defined $author_line
+ or die "$ME:$.: unexpected EOF\n";
+ $author_line =~ /^(\d+) (.*>)$/
+ or die "$ME:$.: Invalid line "
+ . "(expected date/author/email):\n$author_line\n";
+
+ my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
+ # If this line would be the same as the previous date/name/email
+ # line, then arrange not to print it.
+ if ($date_line ne $prev_date_line)
+ {
+ $prev_date_line eq ''
+ or print "\n";
+ print $date_line;
+ }
+ $prev_date_line = $date_line;
+
+ # Omit "Signed-off-by..." lines.
+ @line = grep !/^Signed-off-by: .*>$/, @line;
+
+ # If there were any lines
+ if (@line == 0)
+ {
+ warn "$ME: warning: empty commit message:\n $date_line\n";
+ }
+ else
+ {
+ # Remove leading and trailing blank lines.
+ while ($line[0] =~ /^\s*$/) { shift @line; }
+ while ($line[$#line] =~ /^\s*$/) { pop @line; }
+
+ # Prefix each non-empty line with a TAB.
+ @line = map { length $_ ? "\t$_" : '' } @line;
+
+ print "\n", join ("\n", @line), "\n";
+ }
+
+ defined ($in = <PIPE>)
+ or last;
+ $in ne "\n"
+ and die "$ME:$.: unexpected line:\n$in";
+ }
+
+ close PIPE
+ or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
+ # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+}
+
+# Local Variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/make/release.mk b/make/release.mk
new file mode 100644
index 0000000..14e8357
--- /dev/null
+++ b/make/release.mk
@@ -0,0 +1,73 @@
+# to build official release tarballs, handle tagging and publish.
+
+# signing key
+gpgsignkey=0x6CE95CA7
+
+project=fence-agents
+
+all: checks setup tag tarballs sha256 sign
+
+checks:
+ifeq (,$(version))
+ @echo ERROR: need to define version=
+ @exit 1
+endif
+ @if [ ! -d .git ]; then \
+ echo This script needs to be executed from top level cluster git tree; \
+ exit 1; \
+ fi
+
+setup: checks
+ ./autogen.sh
+ ./configure
+ make maintainer-clean
+
+tag: setup ./tag-$(version)
+
+tag-$(version):
+ifeq (,$(release))
+ @echo Building test release $(version), no tagging
+else
+ git tag -a -m "v$(version) release" v$(version) HEAD
+ @touch $@
+endif
+
+tarballs: tag
+ ./autogen.sh
+ ./configure
+ make distcheck
+
+sha256: tarballs $(project)-$(version).sha256
+
+$(project)-$(version).sha256:
+ifeq (,$(release))
+ @echo Building test release $(version), no sha256
+else
+ sha256sum $(project)-$(version)*tar* | sort -k2 > $@
+endif
+
+sign: sha256 $(project)-$(version).sha256.asc
+
+$(project)-$(version).sha256.asc: $(project)-$(version).sha256
+ifeq (,$(release))
+ @echo Building test release $(version), no sign
+else
+ gpg --default-key $(gpgsignkey) \
+ --detach-sign \
+ --armor \
+ $<
+endif
+
+publish:
+ifeq (,$(release))
+ @echo Building test release $(version), no publishing!
+else
+ @echo git push --tags origin
+ scp $(project)-$(version).* \
+ fedorahosted.org:$(project)
+ @echo Hey you!.. yeah you looking somewhere else!
+ @echo remember to update the wiki and send the email to cluster-devel and linux-cluster
+endif
+
+clean:
+ rm -rf $(project)* tag-*
13 years, 6 months
resource-agents: master - build: fix script permission
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: 5bda8b628f638ba09e0cc440d101bfcde8234981
Parent: 03bc6813bff8fae2a30cc19f3405c4ce347e6e00
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:37:46 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:37:46 2010 +0100
build: fix script permission
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
0 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/make/git-version-gen b/make/git-version-gen
old mode 100644
new mode 100755
diff --git a/make/gitlog-to-changelog b/make/gitlog-to-changelog
old mode 100644
new mode 100755
13 years, 6 months
resource-agents: master - build: add automatic versioning and release script
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: 03bc6813bff8fae2a30cc19f3405c4ce347e6e00
Parent: 487517a0935e80dbf9a1c01592c63dd5220563ac
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 8 14:32:35 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 8 14:32:35 2010 +0100
build: add automatic versioning and release script
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
.gitignore | 2 +
Makefile.am | 19 +++++-
configure.ac | 8 ++-
make/git-version-gen | 161 ++++++++++++++++++++++++++++++++++++++
make/gitlog-to-changelog | 191 ++++++++++++++++++++++++++++++++++++++++++++++
make/release.mk | 73 ++++++++++++++++++
6 files changed, 451 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
index 476babe..af0ae98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,5 @@ missing
rgmanager/src/resources/fs.sh
rgmanager/src/resources/oracledb.sh
rgmanager/src/resources/utils/config-utils.sh
+resource-agents*
+.version
diff --git a/Makefile.am b/Makefile.am
index 0a878ef..700da2e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-EXTRA_DIST = autogen.sh
+EXTRA_DIST = autogen.sh .version
AUTOMAKE_OPTIONS = foreign
@@ -15,3 +15,20 @@ install-exec-local:
uninstall-local:
rmdir $(DESTDIR)/$(LOGDIR) || :;
+
+BUILT_SOURCES = .version
+.version:
+ echo $(VERSION) > $@-t && mv $@-t $@
+
+dist-hook: gen-ChangeLog
+ echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = 2000-01-01
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ if test -d .git; then \
+ $(top_srcdir)/make/gitlog-to-changelog \
+ --since=$(gen_start_date) > $(distdir)/cl-t; \
+ rm -f $(distdir)/ChangeLog; \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ fi
diff --git a/configure.ac b/configure.ac
index b863d5b..be3a9de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,12 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
-AC_INIT([resource-agents], [master], [linux-cluster(a)redhat.com])
-AM_INIT_AUTOMAKE([-Wno-portability])
+
+AC_INIT([resource-agents],
+ m4_esyscmd([make/git-version-gen .tarball-version]),
+ [linux-cluster(a)redhat.com])
+
+AM_INIT_AUTOMAKE([-Wno-portability dist-bzip2 dist-xz])
AC_CONFIG_SRCDIR([rgmanager/src/resources/ip.sh])
diff --git a/make/git-version-gen b/make/git-version-gen
new file mode 100644
index 0000000..795a98b
--- /dev/null
+++ b/make/git-version-gen
@@ -0,0 +1,161 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2010-10-13.20; # UTC
+
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+#
+# 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/>.
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+# produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+# presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+# a checked-out repository. Created with contents that were learned at
+# the last time autoconf was run, and used by git-version-gen. Must not
+# be present in either $(srcdir) or $(builddir) for git-version-gen to
+# give accurate answers during normal development with a checked out tree,
+# but must be present in a tarball when there is no version control system.
+# Therefore, it cannot be used in any dependencies. GNUmakefile has
+# hooks to force a reconfigure at distribution time to get the value
+# correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+# tarball. Usable in dependencies, particularly for files that don't
+# want to depend on config.h but do want to track version changes.
+# Delete this file prior to any autoconf run where you want to rebuild
+# files to pick up a version string change; and leave it stale to
+# minimize rebuild time after unrelated changes to configure sources.
+#
+# It is probably wise to add these two files to .gitignore, so that you
+# don't accidentally commit either generated file.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .tarball-version will
+# exist in distribution tarballs.
+#
+# BUILT_SOURCES = $(top_srcdir)/.version
+# $(top_srcdir)/.version:
+# echo $(VERSION) > $@-t && mv $@-t $@
+# dist-hook:
+# echo $(VERSION) > $(distdir)/.tarball-version
+
+case $# in
+ 1|2) ;;
+ *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \
+ '[TAG-NORMALIZATION-SED-SCRIPT]'
+ exit 1;;
+esac
+
+tarball_version_file=$1
+tag_sed_script="${2:-s/x/x/}"
+nl='
+'
+
+# Avoid meddling by environment variable of the same name.
+v=
+
+# First see if there is a tarball-only version file.
+# then try "git describe", then default.
+if test -f $tarball_version_file
+then
+ v=`cat $tarball_version_file` || exit 1
+ case $v in
+ *$nl*) v= ;; # reject multi-line output
+ [0-9]*) ;;
+ *) v= ;;
+ esac
+ test -z "$v" \
+ && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
+fi
+
+if test -n "$v"
+then
+ : # use $v
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+ && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
+ || git describe --abbrev=4 HEAD 2>/dev/null` \
+ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
+ && case $v in
+ v[0-9]*) ;;
+ *) (exit 1) ;;
+ esac
+then
+ # Is this a new git that lists number of commits since the last
+ # tag or the previous older version that did not?
+ # Newer: v6.10-77-g0f8faeb
+ # Older: v6.10-g0f8faeb
+ case $v in
+ *-*-*) : git describe is okay three part flavor ;;
+ *-*)
+ : git describe is older two part flavor
+ # Recreate the number of commits and rewrite such that the
+ # result is the same as if we were using the newer version
+ # of git describe.
+ vtag=`echo "$v" | sed 's/-.*//'`
+ numcommits=`git rev-list "$vtag"..HEAD | wc -l`
+ v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+ ;;
+ esac
+
+ # Change the first '-' to a '.', so version-comparing tools work properly.
+ # Remove the "g" in git describe's output string, to save a byte.
+ v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+else
+ v=UNKNOWN
+fi
+
+v=`echo "$v" |sed 's/^v//'`
+
+# Don't declare a version "dirty" merely because a time stamp has changed.
+git update-index --refresh > /dev/null 2>&1
+
+dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+case "$dirty" in
+ '') ;;
+ *) # Append the suffix only if there isn't one already.
+ case $v in
+ *-dirty) ;;
+ *) v="$v-dirty" ;;
+ esac ;;
+esac
+
+# Omit the trailing newline, so that m4_esyscmd can use the result directly.
+echo "$v" | tr -d "$nl"
+
+# 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:
diff --git a/make/gitlog-to-changelog b/make/gitlog-to-changelog
new file mode 100644
index 0000000..7660af5
--- /dev/null
+++ b/make/gitlog-to-changelog
@@ -0,0 +1,191 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+ & eval 'exec perl -wS "$0" $argv:q'
+ if 0;
+# Convert git log output to ChangeLog format.
+
+my $VERSION = '2009-10-30 13:46'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+
+# 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/>.
+
+# Written by Jim Meyering
+
+use strict;
+use warnings;
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try `$ME --help' for more information.\n";
+ }
+ else
+ {
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS] [ARGS]
+
+Convert git log output to ChangeLog format. If present, any ARGS
+are passed to "git log". To avoid ARGS being parsed as options to
+$ME, they may be preceded by '--'.
+
+OPTIONS:
+
+ --since=DATE convert only the logs since DATE;
+ the default is to convert all log entries.
+ --format=FMT set format string for commit subject and body;
+ see 'man git-log' for the list of format metacharacters;
+ the default is '%s%n%b%n'
+
+ --help display this help and exit
+ --version output version information and exit
+
+EXAMPLE:
+
+ $ME --since=2008-01-01 > ChangeLog
+ $ME -- -n 5 foo > last-5-commits-to-branch-foo
+
+EOF
+ }
+ exit $exit_code;
+}
+
+# If the string $S is a well-behaved file name, simply return it.
+# If it contains white space, quotes, etc., quote it, and return the new string.
+sub shell_quote($)
+{
+ my ($s) = @_;
+ if ($s =~ m![^\w+/.,-]!)
+ {
+ # Convert each single quote to '\''
+ $s =~ s/\'/\'\\\'\'/g;
+ # Then single quote the string.
+ $s = "'$s'";
+ }
+ return $s;
+}
+
+sub quoted_cmd(@)
+{
+ return join (' ', map {shell_quote $_} @_);
+}
+
+{
+ my $since_date = '1970-01-01 UTC';
+ my $format_string = '%s%n%b%n';
+ GetOptions
+ (
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ 'since=s' => \$since_date,
+ 'format=s' => \$format_string,
+ ) or usage 1;
+
+ my @cmd = (qw (git log --log-size), "--since=$since_date",
+ '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV);
+ open PIPE, '-|', @cmd
+ or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
+ . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
+
+ my $prev_date_line = '';
+ while (1)
+ {
+ defined (my $in = <PIPE>)
+ or last;
+ $in =~ /^log size (\d+)$/
+ or die "$ME:$.: Invalid line (expected log size):\n$in";
+ my $log_nbytes = $1;
+
+ my $log;
+ my $n_read = read PIPE, $log, $log_nbytes;
+ $n_read == $log_nbytes
+ or die "$ME:$.: unexpected EOF\n";
+
+ my @line = split "\n", $log;
+ my $author_line = shift @line;
+ defined $author_line
+ or die "$ME:$.: unexpected EOF\n";
+ $author_line =~ /^(\d+) (.*>)$/
+ or die "$ME:$.: Invalid line "
+ . "(expected date/author/email):\n$author_line\n";
+
+ my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
+ # If this line would be the same as the previous date/name/email
+ # line, then arrange not to print it.
+ if ($date_line ne $prev_date_line)
+ {
+ $prev_date_line eq ''
+ or print "\n";
+ print $date_line;
+ }
+ $prev_date_line = $date_line;
+
+ # Omit "Signed-off-by..." lines.
+ @line = grep !/^Signed-off-by: .*>$/, @line;
+
+ # If there were any lines
+ if (@line == 0)
+ {
+ warn "$ME: warning: empty commit message:\n $date_line\n";
+ }
+ else
+ {
+ # Remove leading and trailing blank lines.
+ while ($line[0] =~ /^\s*$/) { shift @line; }
+ while ($line[$#line] =~ /^\s*$/) { pop @line; }
+
+ # Prefix each non-empty line with a TAB.
+ @line = map { length $_ ? "\t$_" : '' } @line;
+
+ print "\n", join ("\n", @line), "\n";
+ }
+
+ defined ($in = <PIPE>)
+ or last;
+ $in ne "\n"
+ and die "$ME:$.: unexpected line:\n$in";
+ }
+
+ close PIPE
+ or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
+ # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+}
+
+# Local Variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/make/release.mk b/make/release.mk
new file mode 100644
index 0000000..78abfd9
--- /dev/null
+++ b/make/release.mk
@@ -0,0 +1,73 @@
+# to build official release tarballs, handle tagging and publish.
+
+# signing key
+gpgsignkey=0x6CE95CA7
+
+project=resource-agents
+
+all: checks setup tag tarballs sha256 sign
+
+checks:
+ifeq (,$(version))
+ @echo ERROR: need to define version=
+ @exit 1
+endif
+ @if [ ! -d .git ]; then \
+ echo This script needs to be executed from top level cluster git tree; \
+ exit 1; \
+ fi
+
+setup: checks
+ ./autogen.sh
+ ./configure
+ make maintainer-clean
+
+tag: setup ./tag-$(version)
+
+tag-$(version):
+ifeq (,$(release))
+ @echo Building test release $(version), no tagging
+else
+ git tag -a -m "v$(version) release" v$(version) HEAD
+ @touch $@
+endif
+
+tarballs: tag
+ ./autogen.sh
+ ./configure
+ make distcheck
+
+sha256: tarballs $(project)-$(version).sha256
+
+$(project)-$(version).sha256:
+ifeq (,$(release))
+ @echo Building test release $(version), no sha256
+else
+ sha256sum $(project)-$(version)*tar* | sort -k2 > $@
+endif
+
+sign: sha256 $(project)-$(version).sha256.asc
+
+$(project)-$(version).sha256.asc: $(project)-$(version).sha256
+ifeq (,$(release))
+ @echo Building test release $(version), no sign
+else
+ gpg --default-key $(gpgsignkey) \
+ --detach-sign \
+ --armor \
+ $<
+endif
+
+publish:
+ifeq (,$(release))
+ @echo Building test release $(version), no publishing!
+else
+ @echo git push --tags origin
+ scp $(project)-$(version).* \
+ fedorahosted.org:$(project)
+ @echo Hey you!.. yeah you looking somewhere else!
+ @echo remember to update the wiki and send the email to cluster-devel and linux-cluster
+endif
+
+clean:
+ rm -rf $(project)* tag-*
13 years, 6 months
cluster: RHEL56 - qdisk: mkqdisk argument positioning
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5b5c8300ef6f8c8d2105baba7379607d45ce1d84
Parent: ea929dd303acb1c99112efda799433a4d60aec36
Author: Tatsuo Kawasaki <kawasaki(a)redhat.com>
AuthorDate: Fri Feb 12 14:42:52 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Nov 5 10:54:21 2010 -0400
qdisk: mkqdisk argument positioning
mkqdisk debug option (-d) doesn't work after -L option.
This works:
mkqdisk -d -L
This should also work:
mkqdisk -L -d
This patch fixes the behavior.
Resolves: rhbz#555246
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/mkqdisk.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/cman/qdisk/mkqdisk.c b/cman/qdisk/mkqdisk.c
index 46d6b63..6afdf94 100644
--- a/cman/qdisk/mkqdisk.c
+++ b/cman/qdisk/mkqdisk.c
@@ -37,7 +37,7 @@ main(int argc, char **argv)
{
char device[128];
char *newdev = NULL, *newlabel = NULL;
- int rv, verbose_level = 1;
+ int rv, flg = 0, verbose_level = 1;
printf("mkqdisk v0.6.0\n");
@@ -48,13 +48,12 @@ main(int argc, char **argv)
break;
case 'L':
/* List */
- close(2);
- return find_partitions(NULL, NULL, 0, verbose_level);
- break;
+ flg = rv;
+ break;
case 'f':
- close(2);
- return find_partitions( optarg, device,
- sizeof(device), verbose_level);
+ flg = rv;
+ newlabel = optarg;
+ break;
case 'c':
newdev = optarg;
break;
@@ -70,6 +69,16 @@ main(int argc, char **argv)
}
}
+ /* list */
+ if (flg == 'L') {
+ close(2);
+ return find_partitions(NULL, NULL, 0, verbose_level);
+ } else if (flg == 'f') {
+ close(2);
+ return find_partitions( newlabel, device,
+ sizeof(device), verbose_level);
+ }
+
if (!newdev && !newlabel) {
printf("usage: mkqdisk -L | -f <label> | -c "
"<device> -l <label>\n");
13 years, 6 months
cluster: RHEL56 - Revert "qdisk: mkqdisk argument positioning"
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ea929dd303acb1c99112efda799433a4d60aec36
Parent: af5036d74431ea4446ed7941a58ffafd09dc1050
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Nov 5 10:51:59 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Nov 5 10:51:59 2010 -0400
Revert "qdisk: mkqdisk argument positioning"
This reverts commit c6873545f430825a0f211dd595a2248f24ab88c1.
---
cman/qdisk/mkqdisk.c | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/cman/qdisk/mkqdisk.c b/cman/qdisk/mkqdisk.c
index edccf1c..46d6b63 100644
--- a/cman/qdisk/mkqdisk.c
+++ b/cman/qdisk/mkqdisk.c
@@ -37,7 +37,7 @@ main(int argc, char **argv)
{
char device[128];
char *newdev = NULL, *newlabel = NULL;
- int rv, flg = 0, verbose_level = 1;
+ int rv, verbose_level = 1;
printf("mkqdisk v0.6.0\n");
@@ -48,12 +48,13 @@ main(int argc, char **argv)
break;
case 'L':
/* List */
- flg = rv;
- break;
- case 'f':
- flg = rv;
- newlabel = optarg;
+ close(2);
+ return find_partitions(NULL, NULL, 0, verbose_level);
break;
+ case 'f':
+ close(2);
+ return find_partitions( optarg, device,
+ sizeof(device), verbose_level);
case 'c':
newdev = optarg;
break;
@@ -69,14 +70,6 @@ main(int argc, char **argv)
}
}
- /* list */
- if (flg == 'L') {
- return find_partitions(NULL, NULL, 0, verbose_level);
- } else if (flg == 'f') {
- return find_partitions( newlabel, device,
- sizeof(device), verbose_level);
- }
-
if (!newdev && !newlabel) {
printf("usage: mkqdisk -L | -f <label> | -c "
"<device> -l <label>\n");
13 years, 6 months