summaryrefslogtreecommitdiff
path: root/Debian/Dgit.pm
Commit message (Collapse)AuthorAge
* Dgit: break must_getcwd out into Dgit.pmIan Jackson2017-08-02
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: in_workarea: Use changedirIan Jackson2017-07-19
| | | | | | This produces better debug output. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: changedir: Break out from dgitIan Jackson2017-07-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit: Introduce in_workarea and fresh_workareaIan Jackson2017-07-19
| | | | | | No callers yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: git_slurp_config_src: Break out from dgitIan Jackson2017-07-19
| | | | | | | | | | We are going to want this so we can provide better subtree setup functions in Dgit.pm, including the config transfer. No functional change, except that we now run just "git" from the path, rather than honouring dgit's @git (which is not available in Dgit.pm). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: workarea_setup: Break out from dgitIan Jackson2017-07-18
| | | | | | | | | | | This subroutine needs a hash of the main tree's git config, so that some of the config settings which affect the object store can be properly honoured. Purely code motion, except for the changed reference to $gitcfgs. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: $negate_harmful_gitattrs: Break out from dgitIan Jackson2017-07-18
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: runcmd: Break out from dgitIan Jackson2017-07-18
| | | | | | | | | | | | Move runcmd into Dgit.pm. We need to change dgit-repos-server too, but luckily its definition is essentially equivalent. No functional change to dgit. dgit-repos-server now prints somewhat better error messages when subprocesses fail. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Regularise patch filenames, and defend against funny commit subjectsIan Jackson2017-07-09
| | | | | | | * Do not specified patch names which look like series filenames * When we invent a filename based on a commit message, add ".patch". Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: Call `confess' when shellquote gets an undef argIan Jackson2017-01-18
| | | | | | | | This can happen if a command (eg passed to debugcmd) has an undef argument. This turns an undefined warning into an explicit internal error. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit: forkcheck_*: break out from setup_sigwarnIan Jackson2017-01-12
| | | | | | Other places are going to want this too, notably END blocks. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: git_cat_file: clarify scalar context semanticsIan Jackson2017-01-08
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: dsc Dgit field handling: Parse additional dataIan Jackson2017-01-08
| | | | | | | So far we don't do much with it, so this akes no change except to messages. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Enforce a syntax for nominal distrosIan Jackson2017-01-08
| | | | | | | | These appear in various interchange output like tags. They should be sane. They're going to appear in Dgit: too where people will need to use them. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: Provide git_cat_fileIan Jackson2017-01-06
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit-repos-server: Defend against bad commits (from eg #849041).Ian Jackson2017-01-05
| | | | | | | Right now, this causes the test `debpolicy-quilt-gbp' to fail, because in this branch #849041 is unfixed. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* If we cannot hardlink origs into our extraction area, use symlinks instead.Ian Jackson2016-12-19
| | | | | | Closes:#844570. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Version tags mangling: Protect dots, as per proposed update to DEP-14.Ian Jackson2016-12-19
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Introduce dep14_version_quoteIan Jackson2016-12-19
| | | | | | | Removes three identical copies of this y/// rune. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: Break out failedcmd_waitstatusIan Jackson2016-10-24
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: failedcmd_report_cmd: Break out of failedcmdIan Jackson2016-10-23
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Copyright: Add notices to some more of the (larger) filesIan Jackson2016-10-11
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: fail: Strip any trailing newlineIan Jackson2016-09-25
| | | | | | This makes it sensible to call fail() with a here doc. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Tag change: Provide debiantags in Dgit.pmIan Jackson2016-07-31
| | | | | | No callers yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Tag change: Make git_for_each_ref support multiple patternsIan Jackson2016-07-31
| | | | | | | By passing $patterns= [ ... ]. No functional change yet as no call site does this. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Tag change: Declare intent in docs etc.Ian Jackson2016-07-31
| | | | | | | Provide debiantag_new as well as debiantag_old. Change the docs and an important comment. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Tag change: Rename debiantag to debiantag_oldIan Jackson2016-07-31
| | | | | | | | | | | | | | | | | We are going to change the tag name of the main signed tag used by dgit to signal the user's intent to the archive server. Prepare for this by changing debiantag to debiantag_old and changing all call sites outside dgit itself. dgit will want to be able to generate either, depending on whether it's cooperating in an rpush with a new or old dgit so reintroduce a wrapper called debiantag there. This will also allow us to have dgit generate old tags for testing. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Dgit.pm: cmdoutput: Handle undef in arg crash betterIan Jackson2016-07-31
| | | | | | | | | | Use `confess' which produces a stack trace. And don't forget to use Data::Dumper; Bug introduced in e6ce71a87a1c "Move various useful functions into Dgit.pm [...]". Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Subprocess error handling: Initialise $? to -1Ian Jackson2016-07-17
| | | | | | | | | | | | | | | When system(3perl) fails due to syscall error, it sets only $!. When it succeeds it sets only $? and sometimes trashes $!. Conversely, close of a popened filehandle always sets both in all cases. Document this in a comment. So when using system and relying on $?/$! (rather than looking at system's return value), such as when about to use failedcmd, it's necessary to initialise $? to -1. Fix the three call sites where system might be followed by failedcmd but this wasn't done.
* Dgit.pm: Provide hashfile()Ian Jackson2016-07-16
| | | | Call site(s) will come later.
* If a .orig in .. is a symlink, hardlink the link target into our private ↵Ian Jackson2015-08-16
| | | | unpack directory, rather than the link itself (since latter won't work if the symlink is relative).
* When exec fails, always print the program name in the error message.Ian Jackson2015-07-27
|
* Dgit.pm: Provide executable_on_path (avoids loading File::Which which is ↵Ian Jackson2015-07-27
| | | | rather more heavyweight) (no callers yet)
* Do not quote `:' in shellquote.Ian Jackson2015-07-26
|
* Dgit.pm: Provide messagequoteIan Jackson2015-07-26
|
* Work around #793471 (madness with $SIG{__WARN__} and Perl's system builtin): ↵Ian Jackson2015-07-25
| | | | | | | move $SIG{} setting into setup_sigwarn in Dgit.pm, and check getppid. We also need to fix up the expectation for an error message in one of the tests, where the message changes as a side effect.
* Do some quoting on debug output (needed if the server might not be ↵Ian Jackson2015-07-19
| | | | trustworthy and might send us bad stuff).
* For non-Debian distros, debiantag() uses distro name a la DEP-14.Ian Jackson2015-07-04
|
* Avoid use of "my $_", which is not portableIan Jackson2015-06-22
|
* Dgit.pm: git_for_each_ref: Provide optional $git_dir argumentIan Jackson2015-05-31
|
* git_get_ref: Move to Dgit.pm and reimplementIan Jackson2015-05-31
| | | | | | | | | | | | | Use git for-each-ref --format=%(objectname) [r]efs/whatever This pattern won't match literally as a prefix because a ref name cannot contain [, so it must match according to fnmatch. whatever cannot contain fnmatch metacharacters because they're not valid in ref names. This is a better idiom because it might directly look up the ref in question (although currently it probably doesn't).
* Dgit.pm: git_for_each_ref: do not insist that first component after refs/ ↵Ian Jackson2015-05-31
| | | | matches \w+
* Break out ensuredir and make mkrepotmp use itIan Jackson2015-05-31
|
* Dgit.pm: git_for_each_tag_referring provides referred-to object id tooIan Jackson2015-05-31
|
* Move is_fast_fwd into Dgit.pmIan Jackson2015-05-31
|
* Move git_rev_parse into Dgit.pm (renaming it from rev_parseIan Jackson2015-05-31
|
* Move various useful functions into Dgit.pm. Necessitates some slightly ↵Ian Jackson2015-05-31
| | | | fancy footwork with $::us
* Dgit.pm: Move debugging earlier in file (pure code motion)Ian Jackson2015-05-31
|
* Dgit.pm: Fix next's in git_for_each_tag_referring which should be returnsIan Jackson2015-05-31
|
* Dgit.pm: Add debugging to git_for_each_...Ian Jackson2015-05-31
|