ghetto project init
[p5sagit/Distar.git] / lib / Distar.pm
index 8b8c4db..2dedc9f 100644 (file)
@@ -14,13 +14,15 @@ sub import {
 
 sub author { our $Author = shift }
 
+our $Ran_Preflight;
+
 our @Manifest = (
   'lib' => '.pm',
   't' => '.t',
   't/lib' => '.pm',
   'xt' => '.t',
   'xt/lib' => '.pm',
-  '' => '.PL',
+  '' => qr{[^/]*\.PL},
   '' => qr{Changes|MANIFEST|README|META\.yml},
   'maint' => qr{[^.].*},
 );
@@ -50,6 +52,8 @@ sub write_manifest_skip {
 }
 
 sub run_preflight {
+  $Ran_Preflight = 1;
+
   system("git fetch");
 
   for (scalar `make manifest 2>&1 >/dev/null`) {
@@ -57,6 +61,7 @@ sub run_preflight {
   }
 
   for (scalar `git status`) {
+    /^# On branch master/ || die "Not on master. EEEK";
     /Your branch is (behind|ahead of)/ && die "Not synced with upstream";
   }
 
@@ -80,9 +85,9 @@ upload: preflight $(DISTVNAME).tar$(SUFFIX)
        cpan-upload $(DISTVNAME).tar$(SUFFIX)
 release: upload
        git commit -a -m "Release commit for $(VERSION)"
-       git tag release_$(VERSION) -m "release $(VERSION)"
-       git push
+       git tag v$(VERSION) -m "release v$(VERSION)"
        git push --tags
+       git push
 distdir: readmefile
 readmefile: create_distdir
        pod2text $(VERSION_FROM) >$(DISTVNAME)/README
@@ -97,13 +102,13 @@ END
     ExtUtils::MakeMaker::WriteMakefile(
       LICENSE => 'perl',
       @_, AUTHOR => our $Author, ABSTRACT_FROM => $args{VERSION_FROM},
-      test => { TESTS => ($args{test}{TESTS}||'').' xt/*.t' },
+      test => { TESTS => ($args{test}{TESTS}||'t/*.t').' xt/*.t' },
     );
   }
 }
 
 END {
-  write_manifest_skip()
+  write_manifest_skip() unless $Ran_Preflight
 }
 
 1;